FluidInitialCondition#

class FluidInitialCondition[source]#

Bases: ExpressionInitialConditionBase

FluidInitialCondition class for specifying the Fluid.initial_condition: the initial state of every equation solved on the fluid.

Note

The result of the expressions will be treated as non-dimensional values. Please refer to the Units Introduction for more details.

Example

>>> fl.FluidInitialCondition(
...     rho = "(x <= 0) ? (1.0) : (0.125)",
...     u = "0",
...     v = "0",
...     w = "0",
...     p = "(x <= 0) ? (1 / 1.4) : (0.1 / 1.4)"
... )

Attributes

constants: dict[str, str], optional#

Named constants or reusable sub-expressions that the initial condition expressions may reference. Like the expressions themselves, these carry no units and are nondimensional.

Default:

None

rho: str#

Density

Default:

'rho'

u: str#

X-direction velocity

Default:

'u'

v: str#

Y-direction velocity

Default:

'v'

w: str#

Z-direction velocity

Default:

'w'

p: str#

Pressure

Default:

'p'

species_mass_fractions: dict[str, str], optional#

Optional initial mass-fraction expressions of (x, y, z), keyed by species name; an expression is required for every declared species and zero values are legal. Values are projected onto the simplex (clamped non-negative and normalized to sum to one) at each node. When omitted, the initial composition is the uniform reference mixture. Requires a SpeciesTransportSolver and a Gas with two or more species.

Default:

None