transiflow.CylindricalDiscretization
- class CylindricalDiscretization(parameters, nr, ntheta, nz, dim=None, dof=None, r=None, theta=None, z=None, boundary_conditions=None)
Bases:
DiscretizationFinite volume discretization of the incompressible Navier-Stokes equations on a (possibly non-uniform) Arakawa C-grid in a cylindrical coordinate system. For details on the implementation and the ordering of the variables, see the transiflow.Discretization class.
- get_coordinate_vector(start, end, nx)
Get a coordinate vector according to the set parameters.
- Parameters:
- startfloat
Start of the domain
- endfloat
End of the domain
- nxint
Amount of steps
- get_parameter(name, default=0)
Get a parameter from
self.parameters.- Parameters:
- namestr
Name of the parameter
- defaultAny, optional
Default return value if the parameter is not found in
self.parameters. The default value is 0.
- Returns:
- The value of the parameter
- jacobian(state)
Compute the Jacobian matrix $J(u, p)$ of the right-hand side of the DAE. That is the Jacobian matrix of $F(u, p)$ in
\[M(p) \frac{\d u}{\d t} = F(u, p)\]- Parameters:
- statearray_like
State $u$ at which to evaluate $J(u, p)$
- Returns:
- jacCrsMatrix
The matrix $J(u, p)$ in CSR format
- mass_matrix()
Compute the mass matrix of the DAE. That is the mass matrix $M(p)$ in
\[M(p) \frac{\d u}{\d t} = F(u, p)\]- Returns:
- massCrsMatrix
The matrix $M(p)$ in CSR format
- rhs(state)
Compute the right-hand side of the DAE. That is the right-hand side $F(u, p)$ in
\[M(p) \frac{\d u}{\d t} = F(u, p)\]- Parameters:
- statearray_like
State $u$ at which to evaluate $F(u, p)$
- Returns:
- rhsarray_like
The value of $F(u, p)$
- set_parameter(name, value)
Set a parameter in
self.parameters. Changing a value inself.parameterswill make us recompute the linear part of the equation.- Parameters:
- namestr
Name of the parameter
- valueAny
Value of the parameter. Generally a floating point value