Coupling manager for porous medium flow problems coupled to a poro-mechanical problem. More...
#include <dumux/geomechanics/poroelastic/couplingmanager.hh>
Coupling manager for porous medium flow problems coupled to a poro-mechanical problem.
Coupling manager for porous medium flow problems coupled to a poro-mechanical problem both defined on the same grid. Coupling occurs via the change of porosity and permeability due to mechanical deformations and the influence of the pore pressure on the effective stresses acting on the porous medium.
PMFlowId | The porous medium flow domain id |
PoroMechId | The poro-mechanical domain id |
Public Types | |
template<std::size_t i, std::size_t j = (i == PMFlowId) ? PoroMechId : PMFlowId> | |
using | CouplingStencilType = typename std::conditional< i==PMFlowId, std::vector< CouplingIndexType< i > >, std::array< CouplingIndexType< i >, 1 > >::type |
The types used for coupling stencils. An element of the poro-mechanical domain always only couples to the single dof (because we use a cell-centered scheme in the porous medium flow domain) of this same element. More... | |
using | SolutionVector = typename MDTraits::SolutionVector |
the type of the solution vector More... | |
Public Member Functions | |
void | init (std::shared_ptr< Problem< PMFlowId > > pmFlowProblem, std::shared_ptr< Problem< PoroMechId > > poroMechanicalProblem, const SolutionVector &curSol) |
Initialize the coupling manager. More... | |
const CouplingStencilType< PMFlowId > & | couplingStencil (Dune::index_constant< PMFlowId > pmFlowDomainId, const Element< PMFlowId > &element, Dune::index_constant< PoroMechId > poroMechDomainId) const |
Return the coupling stencil for a given porous medium flow domain element. More... | |
const CouplingStencilType< PoroMechId > | couplingStencil (Dune::index_constant< PoroMechId > poroMechDomainId, const Element< PoroMechId > &element, Dune::index_constant< PMFlowId > pmFlowDomainId) const |
Return the coupling element stencil for a given poro-mechanical domain element. More... | |
template<class Assembler > | |
void | bindCouplingContext (Dune::index_constant< PoroMechId > poroMechDomainId, const Element< PoroMechId > &element, const Assembler &assembler) |
For the assembly of the element residual of an element of the poro-mechanics domain, we have to prepare the element variables of the porous medium flow domain. More... | |
template<class PoroMechLocalAssembler > | |
void | updateCouplingContext (Dune::index_constant< PoroMechId > poroMechDomainId, const PoroMechLocalAssembler &poroMechLocalAssembler, Dune::index_constant< PMFlowId > pmFlowDomainId, GridIndexType< PMFlowId > dofIdxGlobalJ, const PrimaryVariables< PMFlowId > &priVarsJ, unsigned int pvIdxJ) |
After deflection of the solution in the porous medium flow domain during element residual assembly in the poromechanics domain, we have to update the porous medium flow element variables of the coupling context. More... | |
template<class PoroMechLocalAssembler > | |
void | updateCouplingContext (Dune::index_constant< PoroMechId > poroMechDomainIdI, const PoroMechLocalAssembler &poroMechLocalAssembler, Dune::index_constant< PoroMechId > poroMechDomainIdJ, GridIndexType< PoroMechId > dofIdxGlobalJ, const PrimaryVariables< PoroMechId > &priVarsJ, unsigned int pvIdxJ) |
After deflection of the solution in the poromechanics domain during element residual assembly in that same domain, we have to update the porous medium flow element variables of the coupling context because the porosity/permeability might depend on the mechanical deformation. More... | |
template<std::size_t j, class PMFlowLocalAssembler > | |
void | updateCouplingContext (Dune::index_constant< PMFlowId > pmFlowDomainId, const PMFlowLocalAssembler &pmFlowLocalAssembler, Dune::index_constant< j > domainIdJ, GridIndexType< j > dofIdxGlobalJ, const PrimaryVariables< j > &priVarsJ, unsigned int pvIdxJ) |
We need this overload to avoid ambiguity. However, for the porous medium flow domain weonly have to update the solution, which is done in the parent class. More... | |
template<class PMFlowLocalAssembler , class UpdatableFluxVarCache > | |
void | updateCoupledVariables (Dune::index_constant< PMFlowId > pmFlowDomainId, const PMFlowLocalAssembler &pmFlowLocalAssembler, ElementVolumeVariables< PMFlowId > &elemVolVars, UpdatableFluxVarCache &elemFluxVarsCache) |
Update the porous medium flow domain volume variables and flux variables cache after the coupling context has been updated. This has to be done because the mechanical deformation enters the porosity/permeability relationships. More... | |
template<class PoroMechLocalAssembler , class UpdatableFluxVarCache > | |
void | updateCoupledVariables (Dune::index_constant< PoroMechId > poroMechDomainId, const PoroMechLocalAssembler &poroMechLocalAssembler, ElementVolumeVariables< PoroMechId > &elemVolVars, UpdatableFluxVarCache &elemFluxVarsCache) |
Update the poro-mechanics volume variables after the coupling context has been updated. This is necessary because the fluid density is stored in them and which potentially is solution-dependent. More... | |
template<class PMFlowLocalAssembler > | |
LocalResidual< PMFlowId >::ElementResidualVector | evalCouplingResidual (Dune::index_constant< PMFlowId > pmFlowDomainId, const PMFlowLocalAssembler &pmFlowLocalAssembler, Dune::index_constant< PoroMechId > poroMechDomainId, GridIndexType< PoroMechId > dofIdxGlobalJ) |
Evaluates the coupling element residual of the porous medium flow domain with respect to the poro-mechanical domain. The deformation might has an effect on both the permeability as well as the porosity. Thus, we need to compute fluxes and the storage term here. More... | |
template<class PoroMechLocalAssembler > | |
LocalResidual< PoroMechId >::ElementResidualVector | evalCouplingResidual (Dune::index_constant< PoroMechId > poroMechDomainId, const PoroMechLocalAssembler &poroMechLocalAssembler, Dune::index_constant< PMFlowId > pmFlowDomainId, GridIndexType< PMFlowId > dofIdxGlobalJ) |
Evaluates the coupling element residual of the poromechanical domain with respect to the porous medium flow domain. The pressure has an effect on the mechanical stresses as well as the body forces. Thus, we have to compute the fluxes as well as the source term here. More... | |
const VolumeVariables< PMFlowId > & | getPMFlowVolVars (const Element< PoroMechId > &element) const |
Return the porous medium flow variables an element/scv of the poromech domain couples to. More... | |
template<std::size_t i> | |
const auto & | curSol (Dune::index_constant< i > domainIdx) const |
the solution vector of the subproblem More... | |
member functions concerning the coupling stencils | |
const CouplingStencilType< i, j > & | couplingStencil (Dune::index_constant< i > domainI, const Element< i > &elementI, Dune::index_constant< j > domainJ) const |
returns an iterable container of all indices of degrees of freedom of domain j that couple with / influence the element residual of the given element of domain i More... | |
void | extendJacobianPattern (Dune::index_constant< id > domainI, JacobianPattern &pattern) const |
extend the jacobian pattern of the diagonal block of domain i by those entries that are not already in the uncoupled pattern More... | |
Static Public Attributes | |
static constexpr auto | pmFlowId = Dune::index_constant<PMFlowId>() |
static constexpr auto | poroMechId = Dune::index_constant<PoroMechId>() |
Protected Types | |
using | SolutionVectorStorage = typename Traits::template TupleOfSharedPtr< SubSolutionVector > |
the type in which the solution vector is stored in the manager More... | |
member functions concerning variable caching for element residual evaluations | |
void | bindCouplingContext (Dune::index_constant< i > domainI, const Element< i > &elementI, const Assembler &assembler) |
prepares all data and variables that are necessary to evaluate the residual of the element of domain i More... | |
void | updateCouplingContext (Dune::index_constant< i > domainI, const LocalAssemblerI &localAssemblerI, Dune::index_constant< j > domainJ, std::size_t dofIdxGlobalJ, const PrimaryVariables< j > &priVarsJ, int pvIdxJ) |
updates all data and variables that are necessary to evaluate the residual of the element of domain i this is called whenever one of the primary variables that the element residual depends on changes in domain j More... | |
void | updateCoupledVariables (Dune::index_constant< i > domainI, const LocalAssemblerI &localAssemblerI, UpdatableElementVolVars &elemVolVars, UpdatableFluxVarCache &elemFluxVarsCache) |
update variables of domain i that depend on variables in domain j after the coupling context has been updated More... | |
void | updateSolution (const SolutionVector &curSol) |
Updates the entire solution vector, e.g. before assembly or after grid adaption Overload might want to overload function if the solution vector is stored outside this class to make sure updates don't happen more than once. More... | |
decltype(auto) | evalCouplingResidual (Dune::index_constant< i > domainI, const LocalAssemblerI &localAssemblerI, Dune::index_constant< j > domainJ, std::size_t dofIdxGlobalJ) const |
evaluates the element residual of a coupled element of domain i which depends on the variables at the degree of freedom with index dofIdxGlobalJ of domain j More... | |
void | evalAdditionalDomainDerivatives (Dune::index_constant< i > domainI, const LocalAssemblerI &localAssemblerI, const typename LocalAssemblerI::LocalResidual::ElementResidualVector &origResiduals, JacobianMatrixDiagBlock &A, GridVariables &gridVariables) |
evaluate additional derivatives of the element residual of a domain with respect to dofs in the same domain that are not in the regular stencil (see CouplingManager::extendJacobianPattern) More... | |
decltype(auto) | numericEpsilon (Dune::index_constant< i >, const std::string ¶mGroup) const |
return the numeric epsilon used for deflecting primary variables of coupled domain i More... | |
void | setSubProblems (const std::tuple< std::shared_ptr< SubProblems >... > &problems) |
set the pointers to the sub problems More... | |
void | setSubProblem (std::shared_ptr< SubProblem > problem, Dune::index_constant< i > domainIdx) |
set a pointer to one of the sub problems More... | |
const Problem< i > & | problem (Dune::index_constant< i > domainIdx) const |
Return a reference to the sub problem. More... | |
void | attachSolution (SolutionVectorStorage &curSol) |
Attach a solution vector stored outside of this class. More... | |
SubSolutionVector< i > & | curSol (Dune::index_constant< i > domainIdx) |
the solution vector of the subproblem More... | |
using Dumux::PoroMechanicsCouplingManager< MDTraits, PMFlowId, PoroMechId >::CouplingStencilType = typename std::conditional< i == PMFlowId, std::vector< CouplingIndexType<i> >, std::array< CouplingIndexType<i>, 1> >::type |
The types used for coupling stencils. An element of the poro-mechanical domain always only couples to the single dof (because we use a cell-centered scheme in the porous medium flow domain) of this same element.
using Dumux::PoroMechanicsCouplingManager< MDTraits, PMFlowId, PoroMechId >::SolutionVector = typename MDTraits::SolutionVector |
the type of the solution vector
|
protectedinherited |
the type in which the solution vector is stored in the manager
|
inlineprotectedinherited |
Attach a solution vector stored outside of this class.
|
inlineinherited |
prepares all data and variables that are necessary to evaluate the residual of the element of domain i
domainI | the domain index of domain i |
elementI | the element whose residual we are assemling next |
assembler | the multidomain assembler for access to all data necessary for the assembly of all domains |
|
inline |
For the assembly of the element residual of an element of the poro-mechanics domain, we have to prepare the element variables of the porous medium flow domain.
|
inlineinherited |
returns an iterable container of all indices of degrees of freedom of domain j that couple with / influence the element residual of the given element of domain i
domainI | the domain index of domain i |
elementI | the coupled element of domain í |
domainJ | the domain index of domain j |
|
inline |
Return the coupling stencil for a given porous medium flow domain element.
|
inline |
Return the coupling element stencil for a given poro-mechanical domain element.
|
inlineprotectedinherited |
the solution vector of the subproblem
domainIdx | The domain index |
|
inline |
the solution vector of the subproblem
domainIdx | The domain index |
|
inlineinherited |
evaluate additional derivatives of the element residual of a domain with respect to dofs in the same domain that are not in the regular stencil (see CouplingManager::extendJacobianPattern)
|
inlineinherited |
evaluates the element residual of a coupled element of domain i which depends on the variables at the degree of freedom with index dofIdxGlobalJ of domain j
domainI | the domain index of domain i |
localAssemblerI | the local assembler assembling the element residual of an element of domain i |
domainJ | the domain index of domain j |
dofIdxGlobalJ | the index of the degree of freedom of domain j which has an influence on the element residual of domain i |
|
inline |
Evaluates the coupling element residual of the porous medium flow domain with respect to the poro-mechanical domain. The deformation might has an effect on both the permeability as well as the porosity. Thus, we need to compute fluxes and the storage term here.
|
inline |
Evaluates the coupling element residual of the poromechanical domain with respect to the porous medium flow domain. The pressure has an effect on the mechanical stresses as well as the body forces. Thus, we have to compute the fluxes as well as the source term here.
|
inlineinherited |
extend the jacobian pattern of the diagonal block of domain i by those entries that are not already in the uncoupled pattern
|
inline |
Return the porous medium flow variables an element/scv of the poromech domain couples to.
If we do not yet have the queried object, build it first
|
inline |
Initialize the coupling manager.
pmFlowProblem | The porous medium flow problem |
poroMechanicalProblem | The poro-mechanical problem |
curSol | The current solution |
|
inlineinherited |
return the numeric epsilon used for deflecting primary variables of coupled domain i
|
inlineinherited |
Return a reference to the sub problem.
domainIdx | The domain index We avoid exception handling here because the performance of this function is critical |
|
inlineinherited |
set a pointer to one of the sub problems
problem | a pointer to the sub problem |
domainIdx | the domain index of the sub problem |
|
inlineinherited |
set the pointers to the sub problems
problems | A tuple of shared pointers to the sub problems |
|
inlineinherited |
update variables of domain i that depend on variables in domain j after the coupling context has been updated
domainI | the index of domain i |
localAssemblerI | the local assembler assembling the element residual of an element of domain i |
elemVolVars | the element volume variables (all volume variables in the element local stencil) to be updated |
elemFluxVarsCache | the element flux variable cache (all flux variables in the element local stencil) to be updated |
|
inline |
Update the porous medium flow domain volume variables and flux variables cache after the coupling context has been updated. This has to be done because the mechanical deformation enters the porosity/permeability relationships.
|
inline |
Update the poro-mechanics volume variables after the coupling context has been updated. This is necessary because the fluid density is stored in them and which potentially is solution-dependent.
|
inlineinherited |
updates all data and variables that are necessary to evaluate the residual of the element of domain i this is called whenever one of the primary variables that the element residual depends on changes in domain j
domainI | the domain index of domain i |
localAssemblerI | the local assembler assembling the element residual of an element of domain i |
domainJ | the domain index of domain j |
dofIdxGlobalJ | the index of the degree of freedom of domain j whose solution changed |
priVarsJ | the new solution at the degree of freedom of domain j with index dofIdxGlobalJ |
pvIdxJ | the index of the primary variable of domain j which has been updated |
|
inline |
We need this overload to avoid ambiguity. However, for the porous medium flow domain weonly have to update the solution, which is done in the parent class.
|
inline |
After deflection of the solution in the porous medium flow domain during element residual assembly in the poromechanics domain, we have to update the porous medium flow element variables of the coupling context.
|
inline |
After deflection of the solution in the poromechanics domain during element residual assembly in that same domain, we have to update the porous medium flow element variables of the coupling context because the porosity/permeability might depend on the mechanical deformation.
|
inlineinherited |
Updates the entire solution vector, e.g. before assembly or after grid adaption Overload might want to overload function if the solution vector is stored outside this class to make sure updates don't happen more than once.
|
staticconstexpr |
|
staticconstexpr |