pyoomph.equations.ALE module
- class pyoomph.equations.ALE.BaseMovingMeshEquations(coordinate_space=None, constrain_bulk_to_C1=False, coordsys=None)[source]
Bases:
EquationsDefines the base class for moving mesh equations. This class should be inherited by all moving mesh equations.
- Parameters:
coordinate_space (Optional[str]) – The coordinate space. Default is None.
constrain_bulk_to_C1 (bool) – If True, the bulk position space is constrained to C1, except on boundaries. Currently not working. Default is False.
coordsys (Optional[BaseCoordinateSystem]) – The coordinate system. Default is None.
- class pyoomph.equations.ALE.ConnectMeshAtInterface(lagr_mult_prefix='_lagr_conn_', use_highest_space=False)[source]
Bases:
InterfaceEquationsConnects the mesh at the interface by enforcing the equality of the nodal coordinates at the interface.
- Parameters:
lagr_mult_prefix (str) – The prefix for the Lagrange multipliers. Default is “_lagr_conn_”.
use_highest_space (bool) – If True, the highest space used in other elements is used for the Lagrange Multipliers. Default is False.
- class pyoomph.equations.ALE.EnforceVolumeByPressure(volume, *, ode_storage_domain=None, only_for_stationary_solve=False, set_zero_on_normal_mode_eigensolve=True, scaling_factor=None)[source]
Bases:
IntegralConstraintEnforces a volume of an ALE mesh with a (Navier-)Stokes equation by adjusting the pressure until the volume is correct. Usually, you need a free surface for this as well which can deform to grow or shrink until the desired volume is reached by adjusting the pressure.
- Parameters:
volume (
Union[Expression,int,float]) – The desired volume to be enforced. This can be a constant or any expression, e.g. a global parameter or a function of time.
- class pyoomph.equations.ALE.EnforcedInterfacialLaplaceSmoothing(*args: Any, **kwargs: Any)[source]
Bases:
InterfaceEquationsThis class can be attached to interfaces of a moving mesh. It ensures that the nodes along this boundary will be placed equidistantly along the interface line with respect to the initial configuration. This can be helpful if you e.g. add a mesh deformation at a single point, e.g. a contact line, which will deform the bulk elements quite dramatically. If the interfaces are associated with this class, the interfaces will move nicely along, keeping the bulk elements in better shape. In order to use it, add it to the interface and use the with_corners method to specify the corners of the interface. So if e.g. a line “substrate” of a domain “droplet” starts at a corner with the boundary “axis” and ends at a corner at the boundary “liquid_gas”, just add
EnforcedInterfacialLaplaceSmoothing().with_corners(“axis”,”liquid_gas”)@”substrate”
to the droplet domain. The same should be done with
EnforcedInterfacialLaplaceSmoothing().with_corners(“axis”,”substrate”)@”liquid_gas”
So that a motion of the contact line will be smooth.
- required_parent_type
alias of
BaseMovingMeshEquations
- class pyoomph.equations.ALE.EnforcedInterfacialLaplaceSmoothingCorner(*args: Any, **kwargs: Any)[source]
Bases:
InterfaceEquationsHelper class to pin the arclength and deactivate the tangential shift at a corner of an interface. This is used in EnforcedInterfacialLaplaceSmoothing.with_corners
- required_parent_type
alias of
EnforcedInterfacialLaplaceSmoothing
- class pyoomph.equations.ALE.HyperelasticSmoothedMesh(mu=1, kappa=1, coordinate_space=None, constrain_bulk_to_C1=False, coordsys=<pyoomph.expressions.coordsys.CartesianCoordinateSystem object>, use_subexpressions=False)[source]
Bases:
BaseMovingMeshEquationsHyperelastic mesh smoothing. The mesh is smoothed by minimizing the energy functional:
W = integral( mu/2*(I1-d)+kappa/2*(J-1)**2 dOmega )
where I1 is the first invariant of the right Cauchy-Green deformation tensor, J is the determinant of the deformation gradient, mu is the shear modulus, and kappa is the bulk modulus. d is the dimension of the mesh.
- Parameters:
mu (float) – The shear modulus. Default is 1.
kappa (float) – The bulk modulus. Default is 1.
coordinate_space (Optional[str]) – The coordinate space. Default is None.
constrain_bulk_to_C1 (bool) – If True, the bulk position space is constrained to C1. Default is False.
coordsys (Optional[BaseCoordinateSystem]) – The coordinate system. Default is cartesian.
- class pyoomph.equations.ALE.LaplaceSmoothedMesh(factor=scale(spatial, < code=0, tags=>)**2, constrain_bulk_to_C1=False, coordinate_space=None, coordsys=<pyoomph.expressions.coordsys.CartesianCoordinateSystem object>, symmetrize=False)[source]
Bases:
BaseMovingMeshEquationsRepresents a Laplace smoothed mesh. The Laplace smoothed mesh is defined by the kinematic boundary condition:
laplace(x - X) = 0
where x is the unknown Eulerian coordinate, X is the is the Lagrangian coordinate and lapalce represents the Laplacian operator.
This class is a subclass of BaseMovingMeshEquations and inherits all its arguments.
- Parameters:
factor (ExpressionOrNum) – The factor. Default is scale_factor(“spatial”)**2.
constrain_bulk_to_C1 (bool) – If True, the bulk position space is constrained to C1. Default is False.
- class pyoomph.equations.ALE.PseudoElasticMesh(E=scale(spatial, < code=0, tags=>)**2, nu=3/10, spatial_error_factor=None, coordinate_space=None, constrain_bulk_to_C1=False, coordsys=<pyoomph.expressions.coordsys.CartesianCoordinateSystem object>)[source]
Bases:
BaseMovingMeshEquationsRepresents a deformable solid mesh defined by the a kinematic boundary condition:
lambda = 2 * E / 2 / (1 + nu) * (E * nu / (1 + nu) / (1 - 2 * nu)) / (nu / (1 + nu) / (1 - 2 * nu) + 2 * E / 2 / (1 + nu)) sigma = lambda * tr(sym(grad(x - X))) * I + 2 * mu * sym(grad((x - X))) div(sigma) = 0
where x is the unknown Eulerian coordinate, X is the is the Lagrangian coordinate, E is the Young’s modulus, nu is the Poisson’s ratio, lambda is the Lamé parameter, sigma is the stress tensor, tr is the trace operator, sym(grad()) is the symmetric gradient operator, div is the divergence operator, f is the bulk force, and I is the identity matrix.
This class is a subclass of BaseMovingMeshEquations and inherits all its arguments.
- Parameters:
E (ExpressionOrNum) – The Young’s modulus. Default is 1*scale_factor(“spatial”)**2.
nu (ExpressionOrNum) – The Poisson’s ratio. Default is rational_num(3,10).
spatial_error_factor (Optional[float]) – The spatial error factor. Default is None.
coordinate_space (Optional[str]) – The coordinate space. Default is None.
constrain_bulk_to_C1 (bool) – If True, the bulk position space is constrained to C1. Default is False.
coordsys (Optional[BaseCoordinateSystem]) – The coordinate system. Default is cartesian.
- class pyoomph.equations.ALE.SetLagrangianToEulerianAfterSolve(*args: Any, **kwargs: Any)[source]
Bases:
EquationsSets the Lagrangian nodal coordinates to the Eulerian nodal coordinates after the Newton solve.
- class pyoomph.equations.ALE.StabilizeElementSizeAtMovingInterface(factor)[source]
Bases:
InterfaceEquationsEnsures that the size of the interface elements remains the same.
This class requires the parent equations to be of type BaseMovingMeshEquations, meaning that if BaseMovingMeshEquations (or subclasses) are not defined in the parent domain, an error will be raised.
- Parameters:
factor (float) – Multiplicative stabilization factor. Default is 1.
- required_parent_type
alias of
BaseMovingMeshEquations
- class pyoomph.equations.ALE.VolumeEnforceStorage(volume, scale='auto')[source]
Bases:
ODEEquationsStores the volume that should be enforced.
- Parameters:
volume (ExpressionOrNum) – The volume that should be enforced.
scale (Union[Literal["auto"],ExpressionOrNum]) – The scale factor. Default is “auto”.
- class pyoomph.equations.ALE.VolumeEnforcingBoundary(storage_var)[source]
Bases:
EquationsAdd these to the boundaries of a volume that should be enforced and pass the var(“volume_enforcing”,domain=”<ode domain>”) as arg. The volume is enforced by the weak form of the volume constraint:
V=(1,vltest)=(div(x)/NORM,vltest)=-1/NORM*<x*n,vltest>
- Parameters:
storage_var (Expression) – The storage variable that contains the volume that should be enforced.
- class pyoomph.equations.ALE.YeohSmoothedMesh(kappa=1, C1=1, C2=10, C3=0, coordinate_space=None, constrain_bulk_to_C1=False, coordsys=<pyoomph.expressions.coordsys.CartesianCoordinateSystem object>, use_subexpressions=False)[source]
Bases:
BaseMovingMeshEquationsYeoh mesh smoothing. The mesh is smoothed by minimizing the energy functional:
W = integral( 1/2 * (C1*I1min+C2*I1min**2+C3*I1min**3+kappa*(J-1)**2 ) * dOmega )
where I1min=I1-d is the first invariant of the right Cauchy-Green deformation tensor minus the dimension d of the mesh, J is the determinant of the deformation gradient, C1, C2, and C3 are the Yeoh constants, and kappa is the bulk modulus.
- Parameters:
kappa (float) – The bulk modulus. Default is 1.
C1 (float) – The Yeoh constant C1. Default is 1.
C2 (float) – The Yeoh constant C2. Default is 10.
C3 (float) – The Yeoh constant C3. Default is 0.
coordinate_space (Optional[str]) – The coordinate space. Default is None.
constrain_bulk_to_C1 (bool) – If True, the bulk position space is constrained to C1. Default is False.
coordsys (Optional[BaseCoordinateSystem]) – The coordinate system. Default is cartesian