porepy.models.poromechanics module
Coupling of mass and momentum balance to obtain poromechanics equations.
The module only contains what is needed for the coupling, the two individual subproblems are defined elsewhere.
The main changes to the equations are achieved by changing the constitutive laws for porosity and stress. The former aquires a pressure dependency and an additional \(lpha\) ablacdotmathbf{u} term, while the latter is modified to include a isotropic pressure term \(lpha p \mathbf{I}\).
- Suggested references (TODO: add more, e.g. Inga’s in prep):
Coussy, 2004, https://doi.org/10.1002/0470092718.
Garipov and Hui, 2019, https://doi.org/10.1016/j.ijrmms.2019.104075.
- class BoundaryConditionsMechanicsTimeDependent[source]
Bases:
BoundaryConditionsMomentumBalance
- bc_values_mechanics(subdomains)[source]
Boundary values for mechanics.
- Parameters
subdomains (list[porepy.grids.grid.Grid]) – List of subdomains on which to define boundary conditions.
- Returns
Array of boundary values.
- Return type
- time_dependent_bc_values_mechanics(subdomains)[source]
Boundary values for mechanics.
- Parameters
subdomains (list[porepy.grids.grid.Grid]) – List of subdomains on which to define boundary conditions.
- Returns
Array of boundary values.
- Return type
- class BoundaryConditionsPoromechanics[source]
Bases:
BoundaryConditionsSinglePhaseFlow
,BoundaryConditionsMechanicsTimeDependent
Combines mass and momentum balance boundary conditions.
Note
The mechanical boundary conditions are differentiated wrt time in the div_u term. Thus, time dependent values must be defined using
TimeDependentArray
.To modify the values of the mechanical boundary conditions, the user must redefine the method
time_dependent_bc_values_mechanics()
, which is called by the methodsinitial_condition()
andbefore_nonlinear_loop()
to update the boundary conditions in data[pp.STATE] and data[pp.STATE][pp.ITERATE].- domain_boundary_sides: Callable[[Grid], tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray, numpy.ndarray, numpy.ndarray, numpy.ndarray, numpy.ndarray]]
Boundary sides of the domain. Normally defined in a mixin instance of
ModelGeometry
.
- fluid: FluidConstants
Fluid constant object that takes care of scaling of fluid-related quantities. Normally, this is set by a mixin of instance
SolutionStrategy
.
- class ConstitutiveLawsPoromechanics[source]
Bases:
DisplacementJumpAperture
,BiotCoefficient
,PressureStress
,PoroMechanicsPorosity
,DarcysLaw
,DimensionReduction
,AdvectiveFlux
,FluidMobility
,ConstantPermeability
,FluidDensityFromPressure
,ConstantViscosity
,LinearElasticSolid
,FracturedSolid
,FrictionBound
Class for the coupling of mass and momentum balance to obtain poromechanics equations.
- stress(subdomains)[source]
Stress operator.
- Parameters
subdomains (list[porepy.grids.grid.Grid]) – List of subdomains where the stress is defined.
- Returns
Operator for the stress.
- Return type
- displacement_jump: Callable[[list[pp.Grid]], pp.ad.Operator]
Operator giving the displacement jump on fracture grids. Normally defined in a mixin instance of
ModelGeometry
.
- equation_system: pp.ad.EquationSystem
EquationSystem object for the current model. Normally defined in a mixin class defining the solution strategy.
- interfaces_to_subdomains: Callable[[list[pp.MortarGrid]], list[pp.Grid]]
Map from interfaces to the adjacent subdomains. Normally defined in a mixin instance of
ModelGeometry
.
- mdg: pp.MixedDimensionalGrid
Mixed dimensional grid for the current model. Normally defined in a mixin instance of
ModelGeometry
.
- nd: int
Ambient dimension of the problem. Normally set by a mixin instance of
porepy.models.geometry.ModelGeometry
.
- normal_component: Callable[[list[pp.Grid]], pp.ad.Matrix]
Operator giving the normal component of vectors. Normally defined in a mixin instance of
ModelGeometry
.
- solid: pp.SolidConstants
Solid constant object that takes care of scaling of solid-related quantities. Normally, this is set by a mixin of instance
SolutionStrategy
.
- class EquationsPoromechanics[source]
Bases:
MassBalanceEquations
,MomentumBalanceEquations
Combines mass and momentum balance equations.
- set_equations()[source]
Set the equations for the poromechanics problem.
Call both parent classes’ set_equations methods.
- advective_flux: Callable[[list[pp.Grid], pp.ad.Operator, pp.ad.UpwindAd, pp.ad.Operator, Callable[[list[pp.MortarGrid]], pp.ad.Operator]], pp.ad.Operator]
Ad operator representing the advective flux. Normally provided by a mixin instance of
AdvectiveFlux
.
- basis: Callable[[Sequence[pp.GridLike], int], list[pp.ad.Matrix]]
Basis for the local coordinate system. Normally set by a mixin instance of
porepy.models.geometry.ModelGeometry
.
- bc_values_mobrho: Callable[[list[pp.Grid]], pp.ad.Array]
Mobility times density boundary conditions. Normally defined in a mixin instance of
BoundaryConditionsSinglePhaseFlow
.
- equation_system: pp.ad.EquationSystem
EquationSystem object for the current model. Normally defined in a mixin class defining the solution strategy.
- fluid_density: Callable[[list[pp.Grid]], pp.ad.Operator]
Fluid density. Defined in a mixin class with a suitable constitutive relation.
- interface_advective_flux: Callable[[list[pp.MortarGrid], pp.ad.Operator, pp.ad.UpwindCouplingAd], pp.ad.Operator]
Ad operator representing the advective flux on internal boundaries. Normally provided by a mixin instance of
AdvectiveFlux
.
- interface_darcy_flux: Callable[[list[pp.MortarGrid]], pp.ad.MixedDimensionalVariable]
Darcy flux variable on interfaces. Normally defined in a mixin instance of
VariablesSinglePhaseFlow
.
- interface_darcy_flux_equation: Callable[[list[pp.MortarGrid]], pp.ad.Operator]
Interface Darcy flux equation. Normally provided by a mixin instance of
DarcysLaw
.
- interface_mobility_discretization: Callable[[list[pp.MortarGrid]], pp.ad.UpwindCouplingAd]
Discretization of the fluid mobility on internal boundaries. Normally provided by a mixin instance of
FluidMobility
.
- interfaces_to_subdomains: Callable[[list[pp.MortarGrid]], list[pp.Grid]]
Map from interfaces to the adjacent subdomains. Normally defined in a mixin instance of
ModelGeometry
.
- mdg: pp.MixedDimensionalGrid
Mixed dimensional grid for the current model. Normally defined in a mixin instance of
ModelGeometry
.
- mobility: Callable[[list[pp.Grid]], pp.ad.Operator]
Fluid mobility. Normally provided by a mixin instance of
FluidMobility
.
- mobility_discretization: Callable[[list[pp.Grid]], pp.ad.UpwindAd]
Discretization of the fluid mobility. Normally provided by a mixin instance of
FluidMobility
.
- nd: int
Ambient dimension of the problem. Normally set by a mixin instance of
porepy.models.geometry.ModelGeometry
.
- porosity: Callable[[list[pp.Grid]], pp.ad.Operator]
Porosity of the rock. Normally provided by a mixin instance of
ConstantPorosity
or a subclass thereof.
- specific_volume: Callable[[list[pp.Grid]], pp.ad.Operator]
Function that returns the specific volume of a subdomain. Normally provided by a mixin of instance
DimensionReduction
.
- subdomains_to_interfaces: Callable[[list[pp.Grid], list[int]], list[pp.MortarGrid]]
Map from subdomains to the adjacent interfaces. Normally defined in a mixin instance of
ModelGeometry
.
- time_manager: pp.TimeManager
Time manager. Normally set by a mixin instance of
porepy.models.solution_strategy.SolutionStrategy
.
- wrap_grid_attribute: Callable[[Sequence[pp.GridLike], str, int, bool], pp.ad.Matrix]
Wrap grid attributes as Ad operators. Normally set by a mixin instance of
porepy.models.geometry.ModelGeometry
.
- class Poromechanics(params=None)[source]
Bases:
EquationsPoromechanics
,VariablesPoromechanics
,ConstitutiveLawsPoromechanics
,BoundaryConditionsPoromechanics
,SolutionStrategyPoromechanics
,ModelGeometry
,DataSavingMixin
Class for the coupling of mass and momentum balance in a mixed-dimensional porous medium.
- Parameters
params (Optional[dict]) –
- equation_system: pp.ad.EquationSystem
EquationSystem object for the current model. Normally defined in a mixin class defining the solution strategy.
- mdg: pp.MixedDimensionalGrid
Mixed dimensional grid for the current model. Normally defined in a mixin instance of
ModelGeometry
.
- nd: int
Ambient dimension of the problem. Normally set by a mixin instance of
porepy.models.geometry.ModelGeometry
.
- time_manager: pp.TimeManager
Time manager. Normally set by a mixin instance of
porepy.models.solution_strategy.SolutionStrategy
.
- class SolutionStrategyPoromechanics(params=None)[source]
Bases:
SolutionStrategyTimeDependentBCs
,SolutionStrategySinglePhaseFlow
,SolutionStrategyMomentumBalance
Combines mass and momentum balance solution strategies.
This class has a diamond structure inheritance. The user should be aware of this and take method resolution order into account when defining new methods.
TODO: More targeted (re-)discretization.
- Parameters
params (Optional[dict]) –
- set_discretization_parameters()[source]
Set parameters for the subproblems and the combined problem.
- Return type
None
- mdg: pp.MixedDimensionalGrid
Mixed dimensional grid.
- class SolutionStrategyTimeDependentBCs(params=None)[source]
Bases:
SolutionStrategy
- Parameters
params (Optional[dict]) –
- initial_condition()[source]
Set initial condition for the coupled problem.
The initial condition for the coupled problem is the initial condition for the subproblems.
- Return type
None
- update_time_dependent_ad_arrays(initial)[source]
Update the time dependent arrays for the mechanics boundary conditions.
- Parameters
initial (bool) – If True, the array generating method is called for both state and iterate. If False, the array generating method is called only for the iterate, and the state is updated by copying the iterate.
- Return type
None
- class VariablesPoromechanics[source]
Bases:
VariablesSinglePhaseFlow
,VariablesMomentumBalance
Combines mass and momentum balance variables.
- create_variables()[source]
Set the variables for the poromechanics problem.
Call both parent classes’ set_variables methods.
- equation_system: EquationSystem
EquationSystem object for the current model. Normally defined in a mixin class defining the solution strategy.
- fluid: FluidConstants
Fluid constant object that takes care of scaling of fluid-related quantities. Normally, this is set by a mixin of instance
SolutionStrategy
.
- interface_darcy_flux_variable: str
Name of the primary variable representing the Darcy flux across an interface. Normally defined in a mixin of instance
SolutionStrategySinglePhaseFlow
.
- mdg: MixedDimensionalGrid
Mixed dimensional grid for the current model. Normally defined in a mixin instance of
ModelGeometry
.
- pressure_variable: str
Name of the primary variable representing the pressure. Normally defined in a mixin of instance
SolutionStrategySinglePhaseFlow
.