porepy.models.thermoporomechanics module
Coupling of energy, mass and momentum balance to obtain thermoporomechanics equations.
The module only contains what is needed for the coupling, the three 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 and temperature dependency and an additional \(lpha abla\cdot\mathbf{u}\) term, while the stress is modified to include isotropic pressure and temperature terms \(lpha p \mathbf{I}+ eta T \mathbf{I}\).
- Suggested references (TODO: add more, e.g. Inga’s in prep, ppV2):
Coussy, 2004, https://doi.org/10.1002/0470092718.
Garipov and Hui, 2019, https://doi.org/10.1016/j.ijrmms.2019.104075.
Stefansson et al, 2021, https://doi.org/10.1016/j.cma.2021.114122
- class BoundaryConditionsThermoporomechanics[source]
Bases:
BoundaryConditionsEnergyBalance
,BoundaryConditionsSinglePhaseFlow
,BoundaryConditionsMechanicsTimeDependent
Combines energy, 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 :class:pp.ad.TimeDependentArray. This is as of yet untested.
- domain_boundary_sides: Callable[[pp.Grid], tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray]]
Boundary sides of the domain. Normally defined in a mixin instance of
ModelGeometry
.
- class ConstitutiveLawsThermoporomechanics[source]
Bases:
DisplacementJumpAperture
,BiotCoefficient
,ThermalExpansion
,ThermoPressureStress
,ThermoPoroMechanicsPorosity
,FluidDensityFromPressureAndTemperature
,EnthalpyFromTemperature
,FouriersLaw
,ThermalConductivityLTE
,DarcysLaw
,DimensionReduction
,AdvectiveFlux
,FluidMobility
,ConstantPermeability
,ConstantViscosity
,LinearElasticSolid
,FracturedSolid
,FrictionBound
Class for the coupling of energy, mass and momentum balance to obtain thermoporomechanics equations.
- stress(subdomains)[source]
Thermo-poromechanical 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 EquationsThermoporomechanics[source]
Bases:
EnergyBalanceEquations
,MassBalanceEquations
,MomentumBalanceEquations
Combines energy, mass and momentum balance equations.
- set_equations()[source]
Set the equations for the poromechanics problem.
Call all 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_enthalpy_flux: Callable[[list[pp.Grid]], pp.ad.Array]
Boundary condition for enthalpy flux. Normally defined in a mixin instance of
BoundaryConditionsEnergyBalance
.
- enthalpy_keyword: str
Keyword used to identify the enthalpy flux discretization. Normally set by a mixin instance of
SolutionStrategyEnergyBalance
.
- 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.
- fluid_enthalpy: Callable[[list[pp.Grid]], pp.ad.Operator]
Fluid enthalpy. Defined in a mixin class with a suitable constitutive relation.
- fourier_flux: Callable[[list[pp.Grid]], pp.ad.Operator]
Fourier flux. Normally provided by a mixin instance of
FouriersLaw
.
- 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_enthalpy_flux: Callable[[list[pp.MortarGrid]], pp.ad.MixedDimensionalVariable]
Variable for interface enthalpy flux. Normally provided by a mixin instance of
VariablesEnergyBalance
.
- interface_fourier_flux: Callable[[list[pp.MortarGrid]], pp.ad.MixedDimensionalVariable]
Fourier flux variable on interfaces. Normally defined in a mixin instance of
VariablesEnergyBalance
.
- 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
.
- 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.
- pressure: Callable[[list[pp.Grid]], pp.ad.MixedDimensionalVariable]
Pressure variable. Normally defined in a mixin instance of
VariablesSinglePhaseFlow
.
- solid_density: Callable[[list[pp.Grid]], pp.ad.Scalar]
Solid density. Defined in a mixin class with a suitable constitutive relation.
- solid_enthalpy: Callable[[list[pp.Grid]], pp.ad.Operator]
Solid enthalpy. Defined in a mixin class with a suitable constitutive relation.
- 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 SolutionStrategyThermoporomechanics(params=None)[source]
Bases:
SolutionStrategyTimeDependentBCs
,SolutionStrategyEnergyBalance
,SolutionStrategySinglePhaseFlow
,SolutionStrategyMomentumBalance
Combines mass and momentum balance solution strategies.
This class has an extended diamond structure inheritance, i.e., all parent classes inherit from
SolutionStrategy
. The user should be aware of this and take method resolution order into account when defining new methods.TODO: More targeted (re-)discretization. See parent classes and other combined models.
- Parameters
params (Optional[dict]) –
- set_discretization_parameters()[source]
Set parameters for the subproblems and the combined problem.
- Return type
None
- create_variables: Callable[[], None]
Create variables. Normally provided by a mixin instance of a Variable class relevant to the model.
- domain_bounds: dict
Bounding box of the domain. Will normally be set by 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.
- exporter: pp.Exporter
Exporter for visualization.
- finalize_data_saving: Callable[[], None]
Finalize data saving. Normally provided by a mixin instance of
DataSavingMixin
.
- fluid: pp.FluidConstants
Fluid constants. See also
set_materials()
.
- initialize_data_saving: Callable[[], None]
Initialize data saving. Normally provided by a mixin instance of
DataSavingMixin
.
- linear_system: tuple[sps.spmatrix, np.ndarray]
The linear system to be solved in each iteration of the non-linear solver. The tuple contains the sparse matrix and the right hand side residual vector.
- mdg: pp.MixedDimensionalGrid
Mixed-dimensional grid. Will normally be set by a mixin instance of
ModelGeometry
.
- nd: int
Ambient dimension of the problem. Normally set by a mixin instance of
porepy.models.geometry.ModelGeometry
.
- save_data_time_step: Callable[[], None]
Save data at a time step. Normally provided by a mixin instance of
DataSavingMixin
.
- set_equations: Callable[[], None]
Set the governing equations of the model. Normally provided by the solution strategy of a specific model (i.e. a subclass of this class).
- set_geometry: Callable[[], None]
Set the geometry of the model. Normally provided by 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
.
- time_dependent_bc_values_mechanics: Callable[[list[pp.Grid]], np.ndarray]
Method for time dependent boundary conditions for mechanics.
- units: pp.Units
Units of the model. See also
set_units()
.
- class Thermoporomechanics(params=None)[source]
Bases:
SolutionStrategyThermoporomechanics
,EquationsThermoporomechanics
,VariablesThermoporomechanics
,BoundaryConditionsThermoporomechanics
,ConstitutiveLawsThermoporomechanics
,ModelGeometry
,DataSavingMixin
Class for the coupling of energy, mass and momentum balance in a mixed-dimensional porous medium.
- Parameters
params (Optional[dict]) –
- darcy_keyword: str
Keyword for Darcy flux term.
Used to access discretization parameters and store discretization matrices.
- domain_bounds: dict
Bounding box of the domain. Will normally be set by a mixin instance of
ModelGeometry
.
- enthalpy_keyword: str
Keyword for enthalpy flux term.
Used to access discretization parameters and store discretization matrices.
- equation_system: pp.ad.EquationSystem
EquationSystem object for the current model. Normally defined in a mixin class defining the solution strategy.
- exporter: pp.Exporter
Exporter for visualization.
- fluid: pp.FluidConstants
Fluid constants. See also
set_materials()
.
- fourier_keyword: str
Keyword for Fourier flux term.
Used to access discretization parameters and store discretization matrices.
- interface_darcy_flux_variable: str
Name of the primary variable representing the Darcy flux on the interface.
- interface_displacement_variable: str
Name of the displacement variable on fracture-matrix interfaces.
- interface_enthalpy_flux_variable: str
Name of the primary variable representing the enthalpy flux on the interface.
- interface_fourier_flux_variable: str
Name of the primary variable representing the Fourier flux on the interface.
- linear_system: tuple[sps.spmatrix, np.ndarray]
The linear system to be solved in each iteration of the non-linear solver. The tuple contains the sparse matrix and the right hand side residual vector.
- mdg: pp.MixedDimensionalGrid
Mixed-dimensional grid. Will normally be set by a mixin instance of
ModelGeometry
.
- mobility_keyword: str
Keyword for mobility factor.
Used to access discretization parameters and store discretization matrices.
- nd: int
Ambient dimension of the problem. Normally set by a mixin instance of
porepy.models.geometry.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
.
- stress_keyword: str
Keyword for stress term.
Used to access discretization parameters and store discretization matrices.
- units: pp.Units
Units of the model. See also
set_units()
.
- class VariablesThermoporomechanics[source]
Bases:
VariablesEnergyBalance
,VariablesSinglePhaseFlow
,VariablesMomentumBalance
Combines mass and momentum balance variables.
- create_variables()[source]
Set the variables for the poromechanics problem.
Call all parent classes’ set_variables methods.
- equation_system: pp.ad.EquationSystem
EquationSystem object for the current model. Normally defined in a mixin class defining the solution strategy.
- fluid: pp.FluidConstants
Fluid constant object that takes care of scaling of fluid-related quantities. Normally, this is set by a mixin of instance
SolutionStrategy
.
- interface_enthalpy_flux_variable: str
Name of the primary variable representing the enthalpy flux across an interface. Normally defined in a mixin of instance
SolutionStrategyEnergyBalance
.
- interface_fourier_flux_variable: str
Name of the primary variable representing the Fourier flux across an interface. Normally defined in a mixin of instance
SolutionStrategyEnergyBalance
.
- mdg: pp.MixedDimensionalGrid
Mixed dimensional grid for the current model. 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
.
- temperature_variable: str
Name of the primary variable representing the temperature. Normally defined in a mixin of instance
SolutionStrategyEnergyBalance
.