config

Definitions of boundary/domain conditions for compressible flow

class AdiabaticWall

Adiabatic wall condition for compressible flow.

The adiabatic wall condition sets zero heat flux \(\vec{q} \cdot \vec{n}$\) and no-slip conditions at the wall boundaries.

class CBC(fields: flowfields | None = None, target: str = 'farfield', relaxation_factor: float = 0.28, tangential_relaxation: float = 0.0, is_viscous_fluxes: bool = False)
property fields: flowfields

Returns the fields of the farfield condition

property target: str

Returns the type of target state

property relaxation_factor: dict[str, float]

Returns the relaxation factors for the different fields

property tangential_relaxation: float

Returns the tangential relaxation factor

property is_viscous_fluxes: bool

Returns the viscous fluxes flag

class CompressibleFiniteElementMethod(mesh, root=None, **default)
get_domain_boundary_mask() GridFunction

Returns a Gridfunction that is 0 on the domain boundaries and 1 on the domain interior.

set_boundary_conditions() None

Boundary conditions for compressible flows are set weakly. Therefore we do nothing here.

class ConservativeFiniteElementMethod(mesh, root=None, **default)
class Dirichlet(fields: flowfields)

Dirichlet boundary condition for compressible flow.

The Dirichlet condition is used to set the conservative variables \(\vec{U} = (\rho, \rho \vec{u}, \rho E)\) at the boundary. It is mainly used for testing purposes.

class FarField(fields: flowfields | None = None, use_identity_jacobian: bool = True)

Farfield condition for compressible flow.

The farfield condition is used to set the subsonic and supersonic inflow/outflow conditions for compressible flows in a characteristic way. It acts partially non-reflecting for acoustic waves on both inflow and outflow boundaries.

Parameters:
  • fields (flowfields) – Dictionary of flow quantities \(\vec{U}_\infty\) to be set at the farfield boundaries.

  • use_identity_jacobian (bool) – Flag to use the identity jacobian for the farfield condition.

Note:

See add_farfield_formulation() for the implementation of the farfield condition in the HDG formulation.

property fields: flowfields

Returns the fields of the farfield condition

property use_identity_jacobian: bool

Returns the identity jacobian flag

class Force(continuum: float | None = None, momentum: float | None = None, energy: float | None = None, flux: CoefficientFunction | None = None, order: int = 0, is_constant: bool = True)
class GRCBC(fields: flowfields | None = None, target: str = 'farfield', relaxation_factor: float = 0.28, tangential_relaxation: float = 0.0, is_viscous_fluxes: bool = False)

Generalized Relaxation Condition Boundary Condition

The GRCBC is a generalized relaxation condition for compressible flows. It is used to relax the conservative variables at the boundary towards a given target state \(\vec{U}^-\). The relaxation is done by a CFL-like diagonal matrix. Additionally, tangential relaxation and viscous fluxes can improve the non-reflecting behavior on planar boundaries [P1].

Note:

Currently, only supported with implicit time schemes.

class Inflow(density: float, velocity: float)

Inflow condition for subsonic compressible flow.

The inflow condition is used to set the subsonic inflow conditions for compressible flows by setting the static variables: density and velocity, \(rho_\infty, u_\infty, v_\infty\) at the inflow boundaries. By the hard imposition of these variables, the inflow condition acts reflecting for acoustic waves. Also, this can become too constricting/unstable for internal flows, due to choking.

class InterfaceBC(fields: flowfields | None = None)
class InviscidWall

Inviscid wall condition for compressible flow.

The inviscid wall condition is used to set the no-penetration condition i.e. \(\vec{u} \cdot \vec{n} = 0\) for compressible flows.

class IsothermalWall(temperature: float | flowfields | None = None)

Isothermal wall condition for compressible flow.

The isothermal wall condition sets the temperature \(T_w\) and no-slip conditions at the wall boundaries.

property fields: flowfields

Returns the set temperature

class NSCBC(fields=None, target='farfield', relaxation_factor=0.28, tangential_relaxation=0.0, is_viscous_fluxes=False, length: float = 1.0)
property length: float

Returns the length scale

class Outflow(pressure: float | flowfields | None = None)

Outflow condition for subsonic compressible flow.

The outflow condition is used to set the subsonic outflow conditions for compressible flows by setting the static pressure \(p_\infty\) at the outflow boundaries. By the hard imposition of the pressure, the outflow condition acts reflecting for acoustic waves.

property fields: flowfields

Returns the set pressure

class PML
class Symmetry

Symmetry condition for compressible flow.

The symmetry condition imposes \(\vec{u} \cdot \vec{n} = 0\) on a symmetry plane.

class dimensionalfields(rho_inf: float, u_inf: float, T_inf: float, L: float = 1.0, mu_inf: float = 1.7894e-05, k_inf: float = 0.02587, c_p: float = 1004.5, **kwargs)

Mutable mapping for scalar dimensionalisation fields.

c

speed_of_sound \(c \, [\mathrm{m/s}]\)

t

time scale \(t \, [\mathrm{s}]\)

rho

density \(\rho \, [\mathrm{kg/m^3}]\)

u

velocity \(\bm{u} \, [\mathrm{m/s}]\)

T

temperature \(T \, [\mathrm{K}]\)

L

length scale \(L \, [\mathrm{m}]\)

mu

viscosity \(\mu \, [\mathrm{kg/(m \cdot s)}]\)

k

thermal_conductivity \(k \, [\mathrm{W/(m \cdot K)}]\)

c_p

specific_heat_capacity_p \(c_p \, [\mathrm{J/(kg \cdot K)}]\)

class flowfields(other: ngsdict = None, **kwargs)

Mutable mapping for flow quantities.

Literal mathematical symbols as key names are converted to their respective quantities, if predefined. Values are converted to NGSolve CoefficientFunctions.

>>> fields = flowfields(rho=1.0, velocity=(1.0, 0.0))
>>> fields
{'density': CoefficientFunction((1.0)), 'velocity': CoefficientFunction((1.0, 0.0))}
>>> fields['density'] = 5.0
{'density': CoefficientFunction((5.0)), 'velocity': CoefficientFunction((1.0, 0.0))}
rho

density \(\rho\)

u

velocity \(\bm{u}\)

rho_u

momentum \(\rho \bm{u}\)

p

pressure \(p\)

T

temperature \(T\)

rho_E

energy \(\rho E\)

E

specific_energy \(E\)

rho_Ei

inner_energy \(\rho E_i\)

Ei

specific_inner_energy \(E_i\)

rho_Ek

kinetic_energy \(\rho E_k\)

Ek

specific_kinetic_energy \(E_k\)

rho_H

enthalpy \(\rho H\)

H

specific_enthalpy \(H\)

c

speed_of_sound \(c\)

grad_rho

density_gradient \(\nabla \rho\)

grad_u

velocity_gradient \(\nabla \bm{u}\)

grad_rho_u

momentum_gradient \(\nabla (\rho \bm{u})\)

grad_p

pressure_gradient \(\nabla p\)

grad_T

temperature_gradient \(\nabla T\)

grad_rho_E

energy_gradient \(\nabla (\rho E)\)

eps

strain_rate_tensor \(\bm{\varepsilon}\)

omega

vorticity \(\bm{\omega}\)