24#ifndef DUMUX_POROELASTIC_VOLUME_VARIABLES_HH
25#define DUMUX_POROELASTIC_VOLUME_VARIABLES_HH
42 using Scalar =
typename Traits::PrimaryVariables::value_type;
43 using ModelTraits =
typename Traits::ModelTraits;
51 using Indices =
typename ModelTraits::Indices;
66 template<
class ElemSol,
class Problem,
class Element,
class Scv>
68 const Problem& problem,
69 const Element& element,
72 priVars_ = elemSol[scv.localDofIndex()];
73 extrusionFactor_ = Deprecated::extrusionFactor(problem, element, scv, elemSol);
76 updateSolidVolumeFractions_(elemSol, problem, element, scv);
78 setSolidTemperature_(problem, element, scv, elemSol);
85 {
return solidState_.density(); }
89 {
return solidState_.porosity(); }
93 {
return priVars_[ Indices::momentum(dir) ]; }
99 for (
int dir = 0; dir < d.size(); ++dir)
106 {
return priVars_[pvIdx]; }
118 template<
class ElemSol,
class Problem,
class Element,
class Scv>
119 void updateSolidVolumeFractions_(
const ElemSol& elemSol,
120 const Problem& problem,
121 const Element& element,
124 static constexpr int numSolidComp = SolidState::numComponents;
125 static constexpr int numInertComp = SolidState::numInertComponents;
128 const auto& sp = problem.spatialParams();
129 for (
int sCompIdx = numSolidComp-numInertComp; sCompIdx < numSolidComp; ++sCompIdx)
130 solidState_.setVolumeFraction(sCompIdx,
131 sp.template inertVolumeFraction<SolidSystem>(element, scv, elemSol, sCompIdx));
137 if (!(SolidState::isInert()))
138 for (
int sCompIdx = 0; sCompIdx < numSolidComp-numInertComp; ++sCompIdx)
139 solidState_.setVolumeFraction(sCompIdx,
140 sp.template reactiveVolumeFraction<SolidSystem>(element, scv, elemSol, sCompIdx));
144 static constexpr bool enableEnergyBalance = ModelTraits::enableEnergyBalance();
145 template<
class Problem,
class Element,
class Scv,
class ElemSol,
146 bool enableEB = enableEnergyBalance,
typename std::enable_if_t<enableEB, bool> = 0 >
147 void setSolidTemperature_(
const Problem& problem,
const Element& element,
const Scv& scv,
const ElemSol& elemSol)
148 { DUNE_THROW(Dune::NotImplemented,
"Non-isothermal poroelastic model."); }
151 template<
class Problem,
class Element,
class Scv,
class ElemSol,
152 bool enableEB = enableEnergyBalance,
typename std::enable_if_t<!enableEB, bool> = 0 >
153 void setSolidTemperature_(
const Problem& problem,
const Element& element,
const Scv& scv,
const ElemSol& elemSol)
157 Scalar extrusionFactor_;
free functions for the evaluation of primary variable gradients inside elements.
std::string temperature() noexcept
I/O name of temperature for equilibrium models.
Definition: name.hh:51
std::string density(int phaseIdx) noexcept
I/O name of density for multiphase systems.
Definition: name.hh:65
Contains the quantities which are constant within a finite volume in the poroelastic model.
Definition: geomechanics/poroelastic/volumevariables.hh:41
typename ModelTraits::Indices Indices
export the type encapsulating primary variable indices
Definition: geomechanics/poroelastic/volumevariables.hh:51
typename Traits::SolidSystem SolidSystem
export the solid system used
Definition: geomechanics/poroelastic/volumevariables.hh:55
Scalar priVar(const int pvIdx) const
Return a component of primary variable vector for a given index.
Definition: geomechanics/poroelastic/volumevariables.hh:105
Scalar solidDensity() const
Return the average porosity within the scv.
Definition: geomechanics/poroelastic/volumevariables.hh:84
typename Traits::SolidState SolidState
export type of solid state
Definition: geomechanics/poroelastic/volumevariables.hh:53
const PrimaryVariables & priVars() const
Return the vector of primary variables.
Definition: geomechanics/poroelastic/volumevariables.hh:109
Scalar displacement(unsigned int dir) const
Returns the permeability within the scv in .
Definition: geomechanics/poroelastic/volumevariables.hh:92
Scalar porosity() const
Return the average porosity within the scv.
Definition: geomechanics/poroelastic/volumevariables.hh:88
typename Traits::DisplacementVector DisplacementVector
export the type used for displacement vectors
Definition: geomechanics/poroelastic/volumevariables.hh:49
DisplacementVector displacement() const
Returns the displacement vector within the scv in .
Definition: geomechanics/poroelastic/volumevariables.hh:96
typename Traits::PrimaryVariables PrimaryVariables
export the type used for the primary variables
Definition: geomechanics/poroelastic/volumevariables.hh:47
static constexpr Scalar extrusionFactor()
TODO We don't know yet how to interpret extrusion for mechanics.
Definition: geomechanics/poroelastic/volumevariables.hh:113
void update(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv)
Update all quantities for a given control volume.
Definition: geomechanics/poroelastic/volumevariables.hh:67