pyoomph.equations.multi_component module
- class pyoomph.equations.multi_component.BalanceGravityAtFarField(gravity_vector, reference_point=[[0], [0], [0]])[source]
Bases:
InterfaceEquationsWhen flow of e.g. the gas domain of an evaporating droplet with gravity is considered, the boundary conditions at the far field may not be traction-free. Otherwise, the hydrostatic pressure will lead to unphysical in/outflow at the far boundaries from the top to the bottom. We can add this to balance for the gravity term at the far field.
This class requires the parent equations to be of type NavierStokesEquation, meaning that if NavierStokesEquation (or subclasses) are not defined in the parent domain, an error will be raised.
- Parameters:
gravity_vector (ExpressionOrNum) – The gravity vector.
reference_point (ExpressionOrNum) – The reference point. Default is vector(0).
- required_parent_type
alias of
NavierStokesEquations
- class pyoomph.equations.multi_component.CompositionAdvectionDiffusionEquations(fluid_props, *, space='C2', wind=field(velocity, < code=0, tags=>), dt_factor=1, boussinesq=False, useSUPG=False, integrate_advection_by_parts=False, wrap_params_in_subexpressions=True)[source]
Bases:
EquationsRepresents the advection-diffusion equation for a single component in a multi-component system. The equation is given by:
partial_t(massfrac) + div(velocity*massfrac) = div(D*grad(massfrac)) + reaction_rate
where massfrac is the mass fraction of the component, velocity is the velocity field, D is the diffusion coefficient, and reaction_rate is the reaction rate.
- Parameters:
fluid_props (AnyFluidProperties) – The fluid properties. Default is None.
space (FiniteElementSpaceEnum) – The finite element space. Default is “C2”, i.e. second order continuous Lagrangian elements.
wind (ExpressionOrNum) – The wind field. Default is 0.
dt_factor (ExpressionOrNum) – The temporal factor. Default is 1.
boussinesq (bool) – Whether to consider the Boussinesq approximation. Default is False.
useSUPG (bool) – Whether to use the SUPG method. Default is False.
integrate_advection_by_parts (bool) – Whether to integrate the advection term by parts. Default is False.
wrap_params_in_subexpressions (bool) – Whether to wrap the parameters in subexpressions using GiNaC. Default is True.
- class pyoomph.equations.multi_component.CompositionAdvectionDiffusionFluxEquations(**kwargs)[source]
Bases:
InterfaceEquationsRepresents the flux through the interface that naturally arises from the integration by parts of the diffusion term in the advection-diffusion equation.
- Parameters:
**kwargs (ExpressionOrNum) – The fluxes. The keys are the names of the components and the values are the mass fluxes.
- pyoomph.equations.multi_component.CompositionDiffusionEquations(fluid_props, space='C2', dt_factor=1, with_IC=True, spatial_errors=None, isothermal=True, initial_temperature=None)[source]
Adds diffusion equations for the mass fractions of the components in a multi-component system, but without any Navier-Stokes equations. Can be used e.g. for diffusion-limited species transport in a gas phase.
- Parameters:
fluid_props (
Union[PureLiquidProperties,PureGasProperties,MixtureLiquidProperties,MixtureGasProperties]) – The fluid properties.space (
Literal['C1','C1TB','C2','C2TB','D1','D1TB','D2','D2TB','DL','D0']) – The space for the mass fraction fields.dt_factor (
Union[Expression,int,float]) – Factor for the time derivative in the mass fraction fields.with_IC (
bool) – Include an initial condition for the initial composition.spatial_errors (
Optional[float]) – Add spatial error estimators automatically.isothermal (
bool) – If set toFalse, a temperature equation is included.initial_temperature (
Union[Expression,int,float,None]) – Initial condition for the temperature.
- Return type:
- Returns:
A coupled set of equations for the mass fractions for the diffusive transport of the components in the mixture.
- class pyoomph.equations.multi_component.CompositionDiffusionInfinityEquations(origin=[[0], [0], [0]], **infinity_values)[source]
Bases:
InterfaceEquationsRepresents the condition at infinity for the advection-diffusion equation, using the assumption that in the far field the mass fraction behaves as:
w(r->infty) = w_infty + R/r(w_R-w_infty) for some large R and r>>R
Hence, works only correctly in axisymmetric or 3d.
We furthermore only assume diagonal diffusion here
Additionally, advection in normal (radial) direction should be considered i.e. using:
u_r(r->infty)=u_R*(R/r)**2
- Parameters:
origin (ExpressionOrNum) – The origin of the system. Default is vector([0]).
**infinity_values (ExpressionOrNum) – The values at infinity. The keys are the names of the components and the values are the mass fractions.
- pyoomph.equations.multi_component.CompositionFlowEquations(fluid_props, compo_space='C1', compo_dt_factor=1, ns_mode='TH', boussinesq=False, gravity=None, bulkforce=None, ns_dt_factor=1, ns_nl_factor=None, with_IC=True, hele_shaw_thickness=None, spatial_errors=None, useCompoSUPG=False, isothermal=True, initial_temperature=None, additional_advection=0, momentum_scheme='BDF2', continuity_scheme='BDF2', wrong_strain=False, integrate_advection_by_parts=False, PFEM=False, wrap_params_in_subexpressions=True, thermal_dt_factor=1, thermal_adv_factor=1)[source]
Assembles a system for multi-component flow with advection-diffusion equations for mass fraction fields of the mixture composition and the Navier-Stokes equations. Potentially, also a temperature field is included.
- Parameters:
fluid_props (
Union[PureLiquidProperties,PureGasProperties,MixtureLiquidProperties,MixtureGasProperties]) – The fluid properties.compo_space (
Literal['C1','C1TB','C2','C2TB','D1','D1TB','D2','D2TB','DL','D0']) – Space for the mass fraction fieldscompo_dt_factor (
Union[Expression,int,float]) – Factor for the time derivative of the mass fraction fieldsns_mode (
Literal['TH','CR']) – Which Navier-Stokes discretization to use, Taylor-Hood ("TH") or Crouzeix-Raviart ("CR").boussinesq (
bool) – Use Boussinesq approximationgravity (
Union[Expression,int,float,None]) – Gravity vector [in m/s^2].bulkforce (
Union[Expression,int,float,None]) – Additional bulk force term.ns_dt_factor (
Union[Expression,int,float]) – Factor for the time derivative of the Navier-Stokes equations.ns_nl_factor (
Union[Expression,int,float,None]) – Factor for the non-linear term in the Navier-Stokes equations.with_IC (
bool) – Include the initial mixture composition (and temperature) as initial condition.hele_shaw_thickness (
Union[Expression,int,float,None]) – If set, we consider a Hele-Shaw flow with the given thickness. This modifies a few terms in the Navier-Stokes equations.spatial_errors (
Optional[float]) – Add spatial error estimators automatically.useCompoSUPG (
bool) – Use SUPG for the composition advection.isothermal (
bool) – If set to false, a temperature field is included.initial_temperature (
Union[Expression,int,float,None]) – Temperature initial condition.additional_advection (
Union[Expression,int,float]) – Adds an additional advection term.momentum_scheme (
Literal['BDF1','BDF2','Newmark2','TPZ','MPT','Simpson','Boole','trapezoidal','Kepler','Milne','midpoint']) – Selects the time stepping scheme for the momentum equation.continuity_scheme (
Literal['BDF1','BDF2','Newmark2','TPZ','MPT','Simpson','Boole','trapezoidal','Kepler','Milne','midpoint']) – Selects the time stepping scheme for the continuity equation.wrong_strain (
bool) – Simplifies the strain by a simple Laplacian. Do not use when you e.g. imposed tractions, e.g. Marangoni forces.integrate_advection_by_parts (
bool) – Integrate the advection terms of the composition equations by parts.PFEM (
Union[PFEMOptions,bool]) – Options for the experimental Particle-Finite-Element-Method approach.wrap_params_in_subexpressions – If True, all material properties in the equations are wrapped in subexpressions.
thermal_dt_factor (
Union[Expression,int,float]) – Factor for the time derivative of the temperature field.thermal_adv_factor (
Union[Expression,int,float]) – Factor for the advection term of the temperature field.
- Return type:
- Returns:
A coupled set of equations describing the multi-component flow of the mixture
Bases:
InterfaceEquationsRepresents a multi-component free surface interface between two fluids with multiple components. It considers mass transfer by a mass transfer model and automatically connects the velocity if necessary.
- Parameters:
interface_props (AnyFluidFluidInterface) – The interface properties (e.g. surface tension).
kinbc_name (str) – The name of the kinematic boundary condition multiplier. Default is “_kin_bc”.
velo_connect_prefix (str) – The prefix for the velocity connection fields. Default is “_lagr_conn_”.
masstransfer_model (Union[MassTransferModelBase,Literal[False]]) – The mass transfer model (e.g. UNIFAC). Default is None.
static (Union[Literal["auto"],bool]) – Whether the interface is static. Default is “auto”.
surface_tension_theta (float) – The theta method to consider the surface tension (0: explicit, i.e. from last step, 1: fully implicit). Default is 1.
total_mass_loss_factor_inside (ExpressionOrNum) – Multiplicative factor for the total mass loss inside the domain. Default is 1.
total_mass_loss_factor_outside (ExpressionOrNum) – Multiplicative factor for the total mass loss outside the domain. Default is 1.
surface_tension_projection_space (Optional[FiniteElementSpaceEnum]) – The finite element space for the surface tension projection. Default is None.
additional_normal_traction (ExpressionOrNum) – Additional normal traction. Default is 0.
surface_tension_gradient_directly (bool) – Whether to consider the surface tension gradient directly. Default is False.
use_highest_space_for_velo_connection (bool) – Whether to use the highest space for the velocity connection. Default is False.
kinematic_bc_coordinate_sys (Optional[BaseCoordinateSystem]) – The coordinate system for the kinematic boundary condition. Default is None.
additional_masstransfer_scale (ExpressionOrNum) – Additional mass transfer scale. Default is 1.
additional_kin_bc_test_scale (ExpressionOrNum) – Additional kinematic boundary condition test scale. Default is 1.
static_normal_interface_motion (ExpressionOrNum) – If solved on a static mesh, we can mimic the interface motion by moving it in normal direction with this rate. Default is 0.
static_interface_motion_testfunction (ExpressionNumOrNone) – If set, we solve that the total outflux is zero by adjusting this.
project_interface_flux (bool) – If set to True, the interface flux (kinematic BC) is projected and used for the kinematic BC. Default is False.
surface_tension_factor (ExpressionOrNum) – The surface tension factor. Multiplicative factor for the imposition of the surface tension. Default is 1.
Bases:
objectBase class for mass transfer models
- class pyoomph.equations.multi_component.SurfactantsAtSolidInterface(ls_properties, out_surface_tension=True)[source]
Bases:
InterfaceEquationsRepresents the handling of surfactants at the solid-liquid-gas interface.
This class requires the parent equations to be of type CompositionAdvectionDiffusionEquations, meaning that if CompositionAdvectionDiffusionEquations (or subclasses) are not defined in the parent domain, an error will be raised.
- Parameters:
ls_properties (LiquidSolidInterfaceProperties) – The liquid-solid interface properties.
out_surface_tension (bool) – Whether to output the surface tension as a local expression. Default is True.
- required_parent_type
- class pyoomph.equations.multi_component.TemperatureAdvectionConductionEquation(material, space='C2', wind=field(velocity, < code=0, tags=>), rho_override=None, cp_override=None, lambda_override=None, dt_factor=1, adv_factor=1)[source]
Bases:
TemperatureConductionEquationRepresents the temperature advection-conduction equation of the form:
rho * cp * (partial_t(T) + u * grad(T)) = div(k * grad(T))
where rho is the mass density, cp is the specific heat capacity, u is the velocity, and k is the thermal conductivity. grad and div represent the gradient and divergence operators, respectively.
- Parameters:
material (AnyMaterialProperties) – The material properties.
space (FiniteElementSpaceEnum) – The finite element space. Default is “C2”, i.e. quadratic continuous Lagrangian elements.
wind (ExpressionOrNum) – The velocity. Default is var(“velocity”).
rho_override (ExpressionNumOrNone) – The mass density. Default is None.
cp_override (ExpressionNumOrNone) – The specific heat capacity. Default is None.
lambda_override (ExpressionNumOrNone) – The thermal conductivity. Default is None.
dt_factor (ExpressionOrNum) – Multiplicative factor for the time derivative. Default is 1.
adv_factor (ExpressionOrNum) – Multiplicative factor for the advection term. Default is 1.
- class pyoomph.equations.multi_component.TemperatureConductionEquation(material, space='C2', rho_override=None, cp_override=None, lambda_override=None, dt_factor=1)[source]
Bases:
EquationsRepresents the temperature conduction equation of the form:
rho * cp * partial_t(T) = div(k * grad(T))
- Parameters:
material (AnyMaterialProperties) – The material properties.
space (FiniteElementSpaceEnum) – The finite element space. Default is “C2”, i.e. quadratic continuous Lagrangian elements.
rho_override (ExpressionNumOrNone) – The mass density. Default is None.
cp_override (ExpressionNumOrNone) – The specific heat capacity. Default is None.
lambda_override (ExpressionNumOrNone) – The thermal conductivity. Default is None.
dt_factor (ExpressionOrNum) – The factor for the time derivative. Default is 1.
- class pyoomph.equations.multi_component.TemperatureHeatFlux(q)[source]
Bases:
InterfaceEquationsRepresents the heat flux through the interface.
This class requires the parent equations to be of type TemperatureConductionEquation, meaning that if TemperatureConductionEquation (or subclasses) are not defined in the parent domain, an error will be raised.
- Parameters:
q (ExpressionOrNum) – The heat flux.
- required_parent_type
alias of
TemperatureConductionEquation
- class pyoomph.equations.multi_component.TemperatureInfinityEquations(far_temperature, origin=[[0], [0], [0]])[source]
Bases:
InterfaceEquationsRepresents the condition at infinity for the temperature conduction equation, using the assumption that in the far field the temperature behaves as:
T(r->infty) = T_infty + R/r(T_R-T_infty) for some large R and r>>R
Hence, works only correctly in axisymmetric or 3d.
- Parameters:
far_temperature (ExpressionOrNum) – The temperature at infinity.
origin (ExpressionOrNum) – The origin of the system. Default is vector([0]).
- class pyoomph.equations.multi_component.ThinLayerThermalConductionEquation(material, thickness, *, ALE='auto', outside_temperature=None)[source]
Bases:
InterfaceEquationsConsiders a thin plate (not resolved in depth direction) of some material in between. Can be added in between two domains with temperature equations. If there is no domain at the opposite side, the outside_temperature must be set manually
- Parameters:
material (AnyMaterialProperties) – The material properties.
thickness (ExpressionOrNum) – The thickness of the layer.
ALE (Union[Literal["auto"],bool]) – Whether to use the Arbitrary Lagrangian-Eulerian (ALE) formulation. Default is “auto”.
outside_temperature (ExpressionNumOrNone) – The temperature at the outside of the layer. Default is None.