solver

Compressible flow solver configuration

class CompressibleFlowSolver(mesh: Mesh, **default)
property fem: ConservativeHDG | ConservativeDG | ConservativeDG_HDG

Sets the finite element for the compressible flow solver.

Getter:

Returns the finite element

Setter:

Sets the finite element, defaults to ConservativeFiniteElement

property mach_number: Parameter

Sets the ratio of the farfield flow velocity to the farfield speed of sound.

\[\Ma_\infty = \frac{|\overline{\vec{u}}_\infty|}{\overline{c}_\infty}\]
Getter:

Returns the Mach number

Setter:

Sets the Mach number, defaults to 0.3

property reynolds_number: Parameter

Sets the ratio of inertial to viscous forces.

\[\Re_\infty = \frac{\overline{\rho}_\infty |\overline{\vec{u}}_\infty| \overline{L}}{\overline{\mu}_\infty}\]
Getter:

Returns the Reynolds number

Setter:

Sets the Reynolds number, defaults to 150

property prandtl_number: Parameter

Sets the ratio of momentum diffusivity to thermal diffusivity.

\[\Pr_\infty = \frac{\overline{c}_p \overline{\mu}_\infty}{\overline{k}_\infty}\]
Getter:

Returns the Prandtl number

Setter:

Sets the Prandtl number, defaults to 0.72

property equation_of_state: IdealGas

Sets the equation of state for the compressible flow solver.

Getter:

Returns the equation of state

Setter:

Sets the equation of state, defaults to IdealGas

property dynamic_viscosity: Inviscid | Constant | Sutherland

Sets the dynamic viscosity for the compressible flow solver.

Getter:

Returns the dynamic viscosity

Setter:

Sets the dynamic viscosity, defaults to Inviscid

property scaling: Aerodynamic | Acoustic | Aeroacoustic

Sets the dimensional scaling for the compressible flow solver.

Getter:

Returns the scaling

Setter:

Sets the scaling, defaults to Aerodynamic

property riemann_solver: LaxFriedrich | Roe | HLL | HLLEM | Upwind

Sets the Riemann solver for the compressible flow solver.

Getter:

Returns the Riemann solver

Setter:

Sets the Riemann solver, defaults to LaxFriedrich

get_solution_fields(*fields: str, default_fields: bool = True) flowfields

Returns the solution fields depending on the underlying finite element method.

Parameters:
  • fields (str) – A list of fields as strings to be returned

  • default_fields (bool) – If True, the default fields ‘density’, ‘velocity’, ‘pressure’ are included in the returned fields

get_farfield_fields(direction: tuple[float, ...]) flowfields

Returns the dimensionless farfield fields \(\vec{U}_\infty\) depending on the scaling in use and the flow direction.

Parameters:

direction (tuple[float, ...]) – A container containing the flow direction

Note:

See scaling for the different scalings.

get_convective_flux(U: flowfields) CoefficientFunction

Returns the conservative convective flux from given fields.

\[\begin{split}\bm{F} = \begin{pmatrix} \rho \bm{u} \\ \rho \bm{u} \otimes \bm{u} + p \bm{I} \\ \rho H \bm{u} \end{pmatrix}\end{split}\]
Parameters:

U (flowfields) – A dictionary containing the flow quantities

get_diffusive_flux(U: flowfields, dU: flowfields) CoefficientFunction

Returns the conservative diffusive flux from given states.

\[\begin{split}\bm{G} = \begin{pmatrix} \bm{0} \\ \bm{\tau} \\ \left( \bm{\tau} \bm{u} - \bm{q}\right) \end{pmatrix}\end{split}\]
Parameters:
  • U (flowfields) – A dictionary containing the flow quantities

  • dU (flowfields) – A dictionary containing the gradients of the flow quantities

get_local_mach_number(U: flowfields)

Returns the local Mach number from given fields.

\[\Ma = \frac{| \bm{u} |}{c}\]
Parameters:

U (flowfields) – A dictionary containing the flow quantities

get_local_reynolds_number(U: flowfields)

Returns the local Reynolds number from given fields.

\[\Re = \frac{\rho | \bm{u} |}{\mu}\]
Parameters:

U (flowfields) – A dictionary containing the flow quantities

deviatoric_stress_tensor(U: flowfields, dU: flowfields)

Returns the deviatoric stress tensor from the given states.

\[\bm{\tau} = \frac{2\mu}{\Re_r} \bm{\varepsilon}\]
Parameters:
  • U (flowfields) – A dictionary containing the flow quantities

  • dU (flowfields) – A dictionary containing the gradients of the flow quantities

drag_coefficient(U: flowfields, dU: flowfields, Uinf: flowfields, drag_direction: tuple[float, ...] = (1, 0), aera: float = 1.0) float
Returns the definition of the drag coefficient.

Needs to be integrated over a surface, due to the inclusion of the boundary normal vector \(\bm{n}_{bnd}\).

\[C_d = \frac{1}{\frac{1}{2} \rho_\infty |\bm{u}_\infty|^2 A} \bm{n}_{drag} \left(\mat{\tau} - p \mat{\I} \right) \bm{n}_{bnd}\]
Parameters:
  • U (flowfields) – A dictionary containing the flow quantities

  • dU (flowfields) – A dictionary containing the gradients of the flow quantities for the evaluation of the viscous stress tensor

  • Uinf (flowfields) – A dictionary containing the reference flow quantities

  • drag_direction (tuple[float, ...]) – A container containing the drag direction \(\bm{n}_{drag}\)

  • aera (float) – The reference area \(A\)

Returns:

The drag coefficient

Return type:

float

lift_coefficient(U: flowfields, dU: flowfields, Uinf: flowfields, lift_direction: tuple[float, ...] = (0, 1), aera: float = 1.0) float
Returns the definition of the lift coefficient.

Needs to be integrated over a surface, due to the inclusion of the boundary normal vector \(\bm{n}_{bnd}\).

\[C_l = \frac{1}{\frac{1}{2} \rho_\infty |\bm{u}_\infty|^2 A} \bm{n}_{lift} \left(\mat{\tau} - p \mat{\I} \right) \bm{n}_{bnd} \]
Parameters:
  • U (flowfields) – A dictionary containing the flow quantities

  • dU (flowfields) – A dictionary containing the gradients of the flow quantities for the evaluation of the viscous stress tensor

  • Uinf (flowfields) – A dictionary containing the reference flow quantities

  • lift_direction (tuple[float, ...]) – A container containing the lift direction \(\bm{n}_{lift}\)

  • aera (float) – The reference area \(A\)

Returns:

The drag coefficient

Return type:

float