pyoomph.equations.advection_diffusion module
- class pyoomph.equations.advection_diffusion.AdvectionDiffusionEquations(fieldnames='advdiffu', *, diffusivity=1, space='C2', consider_scaling=True, fluid_props=None, wind=field(velocity, < code=0, tags=>), dt_factor=1, time_scheme=None, source={}, advection_by_parts=False, velocity_name_for_scaling='velocity')[source]
Bases:
EquationsRepresents the advection-diffusion equation in the form:
\[\partial_t u + \mathbf{b} \cdot \nabla u - \nabla \cdot (D \nabla u) = f\]where \(u\) is the dependent scalar variable, \(D\) is the diffusion coefficient, \(\mathbf{b}\) is the advection velocity, and \(f\) is the source term.
In the weak form, the equation reads:
\[(\partial_t u, v) + (\mathbf{b} \cdot \nabla u, v) + (D \nabla u, \nabla v) - \langle \nabla u \cdot \mathbf{n} , v \rangle = (f, v)\]- Parameters:
fieldnames (Union[str,List[str]]) – The name(s) of the dependent variable(s). Default is “advdiffu”.
diffusivity (ExpressionOrNum) – The diffusion coefficient. Default is 1.
space (FiniteElementSpaceEnum) – The finite element space. Default is “C2”, i.e. second order continuous Lagrangian elements.
consider_scaling (bool) – Whether to consider scaling. Default is True.
fluid_props (Optional[Union[MixtureLiquidProperties,MixtureGasProperties]]) – The fluid properties. Default is None.
wind (ExpressionOrNum) – The advection velocity. Default is var(“velocity”).
dt_factor (ExpressionOrNum) – Multiplicative time step factor. Default is 1.
time_scheme (Optional[TimeSteppingScheme]) – The time stepping scheme. Default is None.
source (Union[ExpressionOrNum,Dict[str,ExpressionOrNum]]) – The source term. Default is {}.
advection_by_parts (Union[bool,Literal["skew"]]) – Whether to integrate by partsthe weak form of the advective term. Default is False.
velocity_name_for_scaling (str) – The name of the velocity for scaling. Default is “velocity”.
- class pyoomph.equations.advection_diffusion.AdvectionDiffusionFluxInterface(**kwargs)[source]
Bases:
EquationsRepresents the flux through the interface that naturally arises from the integration by parts of the diffusion term in the advection-diffusion equation.
- Parameters:
**kwargs (
Union[Expression,int,float]) – name of the flux and its value.
- class pyoomph.equations.advection_diffusion.AdvectionDiffusionInfinity(**kwargs)[source]
Bases:
InterfaceEquationsRepresents the condition at infinity for the advection-diffusion equation in the form:
\[u + R \dfrac{\partial u}{\partial r} = u_{\infty}\]where \(u\) is the dependent variable, \(u_{\infty}\) is the value at infinity, and \(R\) is the distance from the origin and \(r\) is the radial coordinate.
This class requires the parent equations to be of type AdvectionDiffusionEquations, meaning that if AdvectionDiffusionEquations (or subclasses) are not defined in the parent domain, an error will be raised.
- Parameters:
**kwargs (
Union[Expression,int,float]) – name of the field and its value.
- required_parent_type
alias of
AdvectionDiffusionEquations