24#ifndef DUMUX_POROELASTIC_VOLUME_VARIABLES_HH
25#define DUMUX_POROELASTIC_VOLUME_VARIABLES_HH
41 using Scalar =
typename Traits::PrimaryVariables::value_type;
42 using ModelTraits =
typename Traits::ModelTraits;
50 using Indices =
typename ModelTraits::Indices;
65 template<
class ElemSol,
class Problem,
class Element,
class Scv>
67 const Problem& problem,
68 const Element& element,
71 priVars_ = elemSol[scv.localDofIndex()];
72 extrusionFactor_ = problem.extrusionFactor(element, scv, elemSol);
75 updateSolidVolumeFractions_(elemSol, problem, element, scv);
77 setSolidTemperature_(problem, elemSol);
84 {
return solidState_.density(); }
88 {
return solidState_.porosity(); }
92 {
return priVars_[ Indices::momentum(dir) ]; }
98 for (
int dir = 0; dir < d.size(); ++dir)
105 {
return priVars_[pvIdx]; }
117 template<
class ElemSol,
class Problem,
class Element,
class Scv>
118 void updateSolidVolumeFractions_(
const ElemSol& elemSol,
119 const Problem& problem,
120 const Element& element,
123 static constexpr int numSolidComp = SolidState::numComponents;
124 static constexpr int numInertComp = SolidState::numInertComponents;
127 const auto& sp = problem.spatialParams();
128 for (
int sCompIdx = numSolidComp-numInertComp; sCompIdx < numSolidComp; ++sCompIdx)
129 solidState_.setVolumeFraction(sCompIdx,
130 sp.template inertVolumeFraction<SolidSystem>(element, scv, elemSol, sCompIdx));
133 if (!(SolidState::isInert()))
134 for (
int sCompIdx = 0; sCompIdx < numSolidComp-numInertComp; ++sCompIdx)
135 solidState_.setVolumeFraction(sCompIdx,
136 sp.template reactiveVolumeFraction<SolidSystem>(element, scv, elemSol, sCompIdx));
140 static constexpr bool enableEnergyBalance = ModelTraits::enableEnergyBalance();
141 template<
class Problem,
class ElemSol,
142 bool enableEB = enableEnergyBalance,
typename std::enable_if_t<enableEB, bool> = 0 >
143 void setSolidTemperature_(
const Problem& problem,
const ElemSol& elemSol)
144 { DUNE_THROW(Dune::InvalidStateException,
"Non-isothermal elastic model."); }
147 template<
class Problem,
class ElemSol,
148 bool enableEB = enableEnergyBalance,
typename std::enable_if_t<!enableEB, bool> = 0 >
149 void setSolidTemperature_(
const Problem& problem,
const ElemSol& elemSol)
150 { solidState_.setTemperature(problem.temperature()); }
153 Scalar extrusionFactor_;
free functions for the evaluation of primary variable gradients inside elements.
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:40
typename ModelTraits::Indices Indices
export the type encapsulating primary variable indices
Definition: geomechanics/poroelastic/volumevariables.hh:50
typename Traits::SolidSystem SolidSystem
export the solid system used
Definition: geomechanics/poroelastic/volumevariables.hh:54
Scalar priVar(const int pvIdx) const
Return a component of primary variable vector for a given index.
Definition: geomechanics/poroelastic/volumevariables.hh:104
Scalar solidDensity() const
Return the average porosity within the scv.
Definition: geomechanics/poroelastic/volumevariables.hh:83
typename Traits::SolidState SolidState
export type of solid state
Definition: geomechanics/poroelastic/volumevariables.hh:52
const PrimaryVariables & priVars() const
Return the vector of primary variables.
Definition: geomechanics/poroelastic/volumevariables.hh:108
Scalar displacement(unsigned int dir) const
Returns the permeability within the scv in .
Definition: geomechanics/poroelastic/volumevariables.hh:91
Scalar porosity() const
Return the average porosity within the scv.
Definition: geomechanics/poroelastic/volumevariables.hh:87
typename Traits::DisplacementVector DisplacementVector
export the type used for displacement vectors
Definition: geomechanics/poroelastic/volumevariables.hh:48
DisplacementVector displacement() const
Returns the displacement vector within the scv in .
Definition: geomechanics/poroelastic/volumevariables.hh:95
typename Traits::PrimaryVariables PrimaryVariables
export the type used for the primary variables
Definition: geomechanics/poroelastic/volumevariables.hh:46
static constexpr Scalar extrusionFactor()
TODO We don't know yet how to interpret extrusion for mechanics.
Definition: geomechanics/poroelastic/volumevariables.hh:112
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:66