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 (
Expression|GiNaC_GlobalParam|int|float) – The gravity vector.reference_point (
Expression|GiNaC_GlobalParam|int|float) – 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, integrate_advection_by_parts=False, wrap_params_in_subexpressions=True, GCL=False, scheme='BDF2', stabilization=None)[source]
Bases:
ScalarTransportEquationsRepresents 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 (
PureLiquidProperties|PureGasProperties|MixtureLiquidProperties|MixtureGasProperties) – The fluid properties. Default is None.space (
Literal['C1','C1TB','C2','C2TB','D1','D1TB','D2','D2TB','DL','D0']) – The finite element space. Default is “C2”, i.e. second order continuous Lagrangian elements.wind (
Expression|GiNaC_GlobalParam|int|float) – The wind field. Default is 0.dt_factor (
Expression|GiNaC_GlobalParam|int|float) – The temporal factor. Default is 1.boussinesq (
bool) – Whether to consider the Boussinesq approximation. 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.GCL (
bool) – Whether to consider the Generalized Continuity Equation. Default is False.scheme (
Literal['BDF1','BDF2','Newmark2','TPZ','MPT','Simpson','Boole','trapezoidal','Kepler','Milne','midpoint']) – The time stepping scheme. Default is “BDF2”.stabilization (
str|Iterable[str] |ScalarTransportStabilization|None) – Optional residual-based stabilization (SUPG etc.) of the mass fraction transport, seeScalarTransportStabilization.None(the default) adds nothing at all.
Note
Scaling to set on problem level. The residual is a mass balance, so each mass fraction is tested with
scale_factor("temporal")/scale_factor("mass_density").mass_densityis no field of the system and must be set byproblem.set_scaling(mass_density=...).
- 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 (
Expression|GiNaC_GlobalParam|int|float) – 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, compo_stabilization=None, thermal_stabilization=None, salts='auto')[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 (
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 (
Expression|GiNaC_GlobalParam|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 (
float|None) – Add spatial error estimators automatically.isothermal (
bool) – If set toFalse, a temperature equation is included.initial_temperature (
Expression|GiNaC_GlobalParam|int|float|None) – Initial condition for the temperature.compo_stabilization (
str|Iterable[str] |ScalarTransportStabilization|None) – Optional residual-based stabilization of the mass fraction transport. Without a wind there is nothing for SUPG to act on unless the mesh moves, so this is mainly of interest on an ALE mesh.thermal_stabilization (
str|Iterable[str] |ScalarTransportStabilization|None) – The same for the temperature.salts (
Union[Literal['auto'],bool]) – Whether to transport the salts dissolved influid_props, seeCompositionFlowEquations().
- 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]], farfield_length=None, **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 \dfrac{\partial w}{\partial r} = w_{\infty}\]Hence, works only correctly in axisymmetric or 3D. For 2D, we use:
\[w + \dfrac{R}{\log(R/L)} \dfrac{\partial w}{\partial r} = w_{\infty}\]Due to the logarithmic solution behavior in 2D, the farfield length L must be provided here.
We furthermore only assume diagonal diffusion here
Additionally, advection in normal (radial) direction should be considered i.e. using:
\[u_r(r \to \infty) = u_R \left(\frac{R}{r}\right)^2\]- Parameters:
origin (
Expression|GiNaC_GlobalParam|int|float) – The origin of the system. Default is vector([0]).farfield_length (
Expression|GiNaC_GlobalParam|int|float|None) – The farfield length (only required for 2D). Default is None.**infinity_values (
Expression|GiNaC_GlobalParam|int|float) – 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, isothermal=True, initial_temperature=None, additional_advection=0, momentum_scheme='BDF2', continuity_scheme='BDF2', compo_scheme='BDF2', integrate_advection_by_parts=False, wrap_params_in_subexpressions=True, thermal_dt_factor=1, thermal_adv_factor=1, GCL=False, ns_stabilization=None, ns_stabilization_options=None, compo_stabilization=None, thermal_stabilization=None, salts='auto', salt_space=None, salt_stabilization=None, salt_treatment='dilute')[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 (
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 (
Expression|GiNaC_GlobalParam|int|float) – Factor for the time derivative of the mass fraction fieldsns_mode (
Literal['TH','CR','mini','C1','C2','C2C1','C1C1','C2C2']) – Which Navier-Stokes discretization to use, Taylor-Hood ("TH") or Crouzeix-Raviart ("CR") or MINI Elements ("mini").boussinesq (
bool) – Use Boussinesq approximationgravity (
Expression|GiNaC_GlobalParam|int|float|None) – Gravity vector [in m/s^2].bulkforce (
Expression|GiNaC_GlobalParam|int|float|None) – Additional bulk force term.ns_dt_factor (
Expression|GiNaC_GlobalParam|int|float) – Factor for the time derivative of the Navier-Stokes equations.ns_nl_factor (
Expression|GiNaC_GlobalParam|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 (
Expression|GiNaC_GlobalParam|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 (
float|None) – Add spatial error estimators automatically.isothermal (
bool) – If set to false, a temperature field is included.initial_temperature (
Expression|GiNaC_GlobalParam|int|float|None) – Temperature initial condition.additional_advection (
Expression|GiNaC_GlobalParam|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.compo_scheme (
Literal['BDF1','BDF2','Newmark2','TPZ','MPT','Simpson','Boole','trapezoidal','Kepler','Milne','midpoint']) – Selects the time stepping scheme for the composition equations.integrate_advection_by_parts (
bool) – Integrate the advection terms of the composition equations by parts.wrap_params_in_subexpressions – If True, all material properties in the equations are wrapped in subexpressions.
thermal_dt_factor (
Expression|GiNaC_GlobalParam|int|float) – Factor for the time derivative of the temperature field.thermal_adv_factor (
Expression|GiNaC_GlobalParam|int|float) – Factor for the advection term of the temperature field.GCL (
bool) – If True, the Geometric Conservation Law is enforced in the ALE formulation of the Navier-Stokes equations and the composition equations.salts (
Union[Literal['auto'],bool]) – Whether to transport the salts dissolved influid_props, seeSaltTransportEquations."auto"(the default) does it whenever the material carries any, which is what makeswater.add_salt("NaCl", 1*milli*molar)actually mean something here. PassFalsefor the electrohydrodynamic route, wherePoissonNernstPlanck()solves for the ions and the potential instead – the two must not both define the ion concentrations.salt_space (
Optional[Literal['C1','C1TB','C2','C2TB','D1','D1TB','D2','D2TB','DL','D0']]) – Space of the salt fields. Defaults tocompo_space.salt_stabilization (
str|Iterable[str] |ScalarTransportStabilization|None) – The same ascompo_stabilization, for the salt transport.salt_treatment (
Literal['dilute','component']) –"dilute"(the default) transports a dissolved salt as a concentration that takes no part in the mass fractions – right to a few percent up to about half molar."component"upgrades the material in place so that the salt is an ordinary component with a mass fraction, a mole fraction and a share of the volume; the composition equations then transport it, and the evaporation interface condition it needs is the one they already write for any non-volatile component. Seetreat_salts_as_components().ns_stabilization (
str|Iterable[str] |None) – Residual-based stabilization of the flow, e.g."SUPG+PSPG". Anything butNoneswitches the flow equations toStabilizedNavierStokes. This is what makes the inf-sup unstable equal-order pairsns_mode="C1C1"/"C2C2"usable.ns_stabilization_options (
dict[str,Any] |None) – Further arguments ofStabilizedNavierStokes, e.g.{"tau_formula":"codina","C_I":36}.compo_stabilization (
str|Iterable[str] |ScalarTransportStabilization|None) – Residual-based stabilization of the mass fraction transport, seeScalarTransportStabilization.thermal_stabilization (
str|Iterable[str] |ScalarTransportStabilization|None) – The same for the temperature transport.
The three stabilization switches are independent and all default to off, i.e. to exactly the system that was assembled before they existed. None of them perturbs the interface physics: every added term is an element-interior integral written against the test function of the stabilized field only, so the Marangoni stress, the kinematic boundary condition, mass transfer, latent heat, surfactant transport and the contact-angle conditions – which test against
velocity,meshand the interface fields – are structurally untouched and see the stabilized fields only through their values. The one exception is the discontinuity capturing term"DC", which is diffusion-like and therefore does change the natural boundary condition of the transported field; it is off by default and its footprint is exposed asget_stabilization_flux.- 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 (
LiquidGasInterfaceProperties|LiquidLiquidInterfaceProperties) – 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],None]) – 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 (
Expression|GiNaC_GlobalParam|int|float) – Multiplicative factor for the total mass loss inside the domain. Default is 1.total_mass_loss_factor_outside (
Expression|GiNaC_GlobalParam|int|float) – Multiplicative factor for the total mass loss outside the domain. Default is 1.surface_tension_projection_space (
Optional[Literal['C1','C1TB','C2','C2TB','D1','D1TB','D2','D2TB','DL','D0']]) – The finite element space for the surface tension projection. Default is None.additional_normal_traction (
Expression|GiNaC_GlobalParam|int|float) – 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_coordsys (
BaseCoordinateSystem|None) – The coordinate system for the kinematic boundary condition. Default is None.kinematic_bc_space (
Optional[Literal['C1','C1TB','C2','C2TB','D1','D1TB','D2','D2TB','DL','D0']]) – The finite element space for the kinematic boundary condition. Default is None, means auto-select.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 (
Expression|GiNaC_GlobalParam|int|float) – 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 (
Expression|GiNaC_GlobalParam|int|float|None) – 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 (
Expression|GiNaC_GlobalParam|int|float) – The surface tension factor. Multiplicative factor for the imposition of the surface tension. Default is 1.surfactant_transport (
Union[SurfactantTransportEquations,Literal[False],None]) – How the surfactants registered on the interface properties are transported.None(the default) usesSurfactantTransportEquationsin its conservative form, which keeps the total amount of an insoluble surfactant exact rather than to the order of the time stepping. Pass a configured instance to change the form, the variable or the stabilization –SurfactantTransportEquations(form="legacy")reproduces the pre-2026 behaviour bit for bit.Falseswitches the surfactant equations off entirely, e.g. to supply your own.
Note
Scaling to set on problem level. The mass transfer rate is scaled with
scale_factor("velocity")*scale_factor("mass_density"), i.e. besides the velocity alsomass_density– no field of the system – has to be set byproblem.set_scaling(mass_density=...).The
SurfactantTransportEquationsin use, if any.- Return type:
SurfactantTransportEquations|None
Deprecated alias of
kinematic_bc_coordsys.
Whether the projected advection velocity field
_uinterf_projexists.It only does in the legacy transport form. The conservative form integrates the advection by parts, so its natural end condition is already zero flux and there is nothing for the contact line to constrain - see the module docstring of
surfactants.- Return type:
bool
Adds the
MultiComponentNavierStokesInterfaceBalancedEndequations to the given boundaries of the interface. Thereby, the Neumann force is balanced at the specified end points. Use this when you neither want to fix the position nor the contact angle at specific end points
Bases:
InterfaceEquationsThe
MultiComponentNavierStokesInterfacewithoutsurface_tension_gradient_directlyuses the surface divergence theorem to integrate the surface tension term by parts. This results in a Neumann term at the end points of the interface, which is not balanced by default. This Neumann term can be used e.g. for contact angles, but if you do not want to impose any, you can cancel out the Neumann term by adding this equation to the end points of the interface. This will balance the surface tension at the end points, resulting in a free contact angle.alias of
MultiComponentNavierStokesInterface
- 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, GCL=False, gcl_scheme='BDF2_degr', stabilization=None)[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 (
MaterialProperties|BaseLiquidProperties|BaseGasProperties|BaseSolidProperties|PureSolidProperties|PureLiquidProperties|PureGasProperties|MixtureLiquidProperties|MixtureGasProperties) – The material properties.space (
Literal['C1','C1TB','C2','C2TB','D1','D1TB','D2','D2TB','DL','D0']) – The finite element space. Default is “C2”, i.e. quadratic continuous Lagrangian elements.wind (
Expression|GiNaC_GlobalParam|int|float) – The velocity. Default is var(“velocity”).rho_override (
Expression|GiNaC_GlobalParam|int|float|None) – The mass density. Default is None.cp_override (
Expression|GiNaC_GlobalParam|int|float|None) – The specific heat capacity. Default is None.lambda_override (
Expression|GiNaC_GlobalParam|int|float|None) – The thermal conductivity. Default is None.dt_factor (
Expression|GiNaC_GlobalParam|int|float) – Multiplicative factor for the time derivative. Default is 1.adv_factor (
Expression|GiNaC_GlobalParam|int|float) – Multiplicative factor for the advection term. Default is 1.stabilization (
str|Iterable[str] |ScalarTransportStabilization|None) – Optional residual-based stabilization (SUPG etc.), seeScalarTransportStabilization.None(the default) adds nothing at all.
Note
Scaling to set on problem level. As for
TemperatureConductionEquation, the test scaling requires the non-field scalerho_cp, i.e.problem.set_scaling(rho_cp=...).
- class pyoomph.equations.multi_component.TemperatureConductionEquation(material, space='C2', rho_override=None, cp_override=None, lambda_override=None, dt_factor=1, GCL=False, gcl_scheme='BDF2_degr', stabilization=None)[source]
Bases:
ScalarTransportEquationsRepresents the temperature conduction equation of the form:
rho * cp * partial_t(T) = div(k * grad(T))
- Parameters:
material (
MaterialProperties|BaseLiquidProperties|BaseGasProperties|BaseSolidProperties|PureSolidProperties|PureLiquidProperties|PureGasProperties|MixtureLiquidProperties|MixtureGasProperties) – The material properties.space (
Literal['C1','C1TB','C2','C2TB','D1','D1TB','D2','D2TB','DL','D0']) – The finite element space. Default is “C2”, i.e. quadratic continuous Lagrangian elements.rho_override (
Expression|GiNaC_GlobalParam|int|float|None) – The mass density. Default is None.cp_override (
Expression|GiNaC_GlobalParam|int|float|None) – The specific heat capacity. Default is None.lambda_override (
Expression|GiNaC_GlobalParam|int|float|None) – The thermal conductivity. Default is None.dt_factor (
Expression|GiNaC_GlobalParam|int|float) – The factor for the time derivative. Default is 1.GCL (
bool) – Write the transient term as the derivative of the whole integral ofrho*cp*T, and (in the advective subclass) advect with the velocity relative to the mesh: the conservative ALE form. On a mesh that follows a moving or evaporating boundary the enthalpy is then conserved to machine precision instead of to the order of the time stepping. If rho or cp depend on the temperature this is a different model, not merely a different discretization: the GCL form differentiates the productrho*cp*Tin time, where the standard form multipliesrho*cpontopartial_t(T). Identical for constant properties. Default is False.gcl_scheme (
Literal['BDF1','BDF2','Newmark2','BDF2_degr','Newmark2_degr']) – Time stepping scheme of theGCLtransient, from the set a derivative of an integral understands. The default"BDF2_degr"degrades to first order in the first step, where an initial condition has no history.stabilization (
str|Iterable[str] |ScalarTransportStabilization|None) – Optional residual-based stabilization (SUPG etc.), seeScalarTransportStabilization.None(the default) adds nothing at all. Without a wind there is nothing to stabilize on a static mesh, but on a moving (ALE) mesh the transport by the mesh motion is stabilized.
Note
Scaling to set on problem level. The temperature equation is tested with
scale_factor("temporal")/(scale_factor("temperature")*scale_factor("rho_cp")). Besides thetemperaturefield scale, the volumetric heat capacityrho_cpis therefore required, i.e.problem.set_scaling(rho_cp=...), and it is no field of the system.- define_galerkin_residuals()[source]
The Galerkin part alone. Subclasses extend this, not
define_residuals, so that the stabilization stays the last thing added and is added exactly once.
- get_rho_cp_k()[source]
The three material coefficients, honouring the
*_overridearguments. Resolved in one place so that the strong residual cannot drift away from the Galerkin one.- Return type:
tuple[Expression|GiNaC_GlobalParam|int|float,Expression|GiNaC_GlobalParam|int|float,Expression|GiNaC_GlobalParam|int|float]
- 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 (
Expression|GiNaC_GlobalParam|int|float) – 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 (
Expression|GiNaC_GlobalParam|int|float) – The temperature at infinity.origin (
Expression|GiNaC_GlobalParam|int|float) – 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 (
MaterialProperties|BaseLiquidProperties|BaseGasProperties|BaseSolidProperties|PureSolidProperties|PureLiquidProperties|PureGasProperties|MixtureLiquidProperties|MixtureGasProperties) – The material properties.thickness (
Expression|GiNaC_GlobalParam|int|float) – The thickness of the layer.ALE (
Union[Literal['auto'],bool]) – Whether to use the Arbitrary Lagrangian-Eulerian (ALE) formulation. Default is “auto”.outside_temperature (
Expression|GiNaC_GlobalParam|int|float|None) – The temperature at the outside of the layer. Default is None.