pyoomph.equations.poisson module
- class pyoomph.equations.poisson.DiffusionEquation(*, name='u', space='C2', source=None, diffusivity=1, temporal_factor=1)[source]
Bases:
PoissonEquationRepresents the diffusion equation in the form:
partial_t(u) - div(coeff*grad(u)) = f
where u is the dependent variable, coeff is the diffusivity, and f is the source term.
This class is a subclass of PoissonEquation and inherits all its arguments.
- Parameters:
name (str) – The name of the dependent variable. Default is “u”.
space (FiniteElementSpaceEnum) – The finite element space. Default is “C2”, i.e. second order continuous Lagrangian elements.
source (ExpressionNumOrNone) – The source term. Default is None.
diffusivity (ExpressionOrNum) – The diffusivity. Default is 1.
temporal_factor (ExpressionOrNum) – The temporal factor. Default is 1.
- class pyoomph.equations.poisson.PoissonEquation(name='u', *, space='C2', source=None, coefficient=1, DG_alpha=1)[source]
Bases:
EquationsRepresents the Poisson equation in the form:
-div(coeff*grad(u)) = f
where u is the dependent variable, coeff is the coefficient, and f is the source term.
- Parameters:
name (str) – The name of the dependent variable. Default is “u”.
space (FiniteElementSpaceEnum) – The finite element space. Default is “C2”, i.e. second order continuous Lagrangian elements.
source (ExpressionNumOrNone) – The source term. Default is None.
coefficient (ExpressionOrNum) – The coefficient. Default is 1.
DG_alpha (ExpressionOrNum) – The penalty parameter for the interior facet terms in case of use of Discontinuous Galerkin discretisation. Default is 1.
- class pyoomph.equations.poisson.PoissonFarFieldMonopoleCondition(far_value=0, name=None, coefficient=None, origin=[[0], [0], [0]], farfield_length=None)[source]
Bases:
InterfaceEquationsRepresents a far-field condition for the Poisson equation in the form:
\[u + R \dfrac{\partial u}{\partial r} = u_{\infty}\]where u is the dependent variable, far_value is the value at infinity, and R is the distance from the origin and r is the radial coordinate. Hence, works only correctly in radialsymmetry, axisymmetric or 3D Cartesian. Also, it is only valid if the source vanishes sufficiently fast towards the far field. For 2D, we use:
\[u + R \dfrac{\partial u}{\partial r} / \log(R / L) = u_{\infty}\]Due to the logarithmic solution behavior in 2D, the farfield length L must be provided here.
This class requires the parent equations to be of type PoissonEquation, meaning that if PoissonEquation (or subclasses) are not defined in the parent domain, an error will be raised.
- Parameters:
far_value (ExpressionOrNum) – The value at infinity. Default is 0.
name (str) – The name of the dependent variable. Default is None, meaning that the name of the parent Poisson equation is used.
coefficient (ExpressionOrNum) – The coefficient. Default is None, meaning that the coefficient of the parent Poisson equation is used.
origin (ExpressionOrNum) – The origin of the far-field condition. Default is (0,0,0).
farfield_length (ExpressionNumOrNone) – The far-field length scale L used in the 2D case. Default is None, meaning that no length scale is used and the condition is applied as in 3D.
- required_parent_type
alias of
PoissonEquation