12#ifndef DUMUX_POROELASTIC_VOLUME_VARIABLES_HH
13#define DUMUX_POROELASTIC_VOLUME_VARIABLES_HH
15#include <dune/common/exceptions.hh>
30 using Scalar =
typename Traits::PrimaryVariables::value_type;
31 using ModelTraits =
typename Traits::ModelTraits;
39 using Indices =
typename ModelTraits::Indices;
54 template<
class ElemSol,
class Problem,
class Element,
class Scv>
56 const Problem& problem,
57 const Element& element,
60 priVars_ = elemSol[scv.localDofIndex()];
61 extrusionFactor_ = problem.spatialParams().extrusionFactor(element, scv, elemSol);
64 updateSolidVolumeFractions_(elemSol, problem, element, scv);
66 setSolidTemperature_(problem, element, scv, elemSol);
73 {
return solidState_.density(); }
77 {
return solidState_.porosity(); }
81 {
return priVars_[ Indices::momentum(dir) ]; }
87 for (
int dir = 0; dir < d.size(); ++dir)
94 {
return priVars_[pvIdx]; }
106 template<
class ElemSol,
class Problem,
class Element,
class Scv>
107 void updateSolidVolumeFractions_(
const ElemSol& elemSol,
108 const Problem& problem,
109 const Element& element,
112 static constexpr int numSolidComp = SolidState::numComponents;
113 static constexpr int numInertComp = SolidState::numInertComponents;
116 const auto& sp = problem.spatialParams();
117 for (
int sCompIdx = numSolidComp-numInertComp; sCompIdx < numSolidComp; ++sCompIdx)
118 solidState_.setVolumeFraction(sCompIdx,
119 sp.template inertVolumeFraction<SolidSystem>(element, scv, elemSol, sCompIdx));
125 if (!(SolidState::isInert()))
126 for (
int sCompIdx = 0; sCompIdx < numSolidComp-numInertComp; ++sCompIdx)
127 solidState_.setVolumeFraction(sCompIdx,
128 sp.template reactiveVolumeFraction<SolidSystem>(element, scv, elemSol, sCompIdx));
132 static constexpr bool enableEnergyBalance = ModelTraits::enableEnergyBalance();
133 template<
class Problem,
class Element,
class Scv,
class ElemSol,
134 bool enableEB = enableEnergyBalance,
typename std::enable_if_t<enableEB, bool> = 0 >
135 void setSolidTemperature_(
const Problem& problem,
const Element& element,
const Scv& scv,
const ElemSol& elemSol)
136 { DUNE_THROW(Dune::NotImplemented,
"Non-isothermal poroelastic model."); }
139 template<
class Problem,
class Element,
class Scv,
class ElemSol,
140 bool enableEB = enableEnergyBalance,
typename std::enable_if_t<!enableEB, bool> = 0 >
141 void setSolidTemperature_(
const Problem& problem,
const Element& element,
const Scv& scv,
const ElemSol& elemSol)
142 { solidState_.setTemperature(problem.spatialParams().temperature(element, scv, elemSol)); }
145 Scalar extrusionFactor_;
Contains the quantities which are constant within a finite volume in the poroelastic model.
Definition: geomechanics/poroelastic/volumevariables.hh:29
typename ModelTraits::Indices Indices
export the type encapsulating primary variable indices
Definition: geomechanics/poroelastic/volumevariables.hh:39
typename Traits::SolidSystem SolidSystem
export the solid system used
Definition: geomechanics/poroelastic/volumevariables.hh:43
Scalar priVar(const int pvIdx) const
Return a component of primary variable vector for a given index.
Definition: geomechanics/poroelastic/volumevariables.hh:93
Scalar solidDensity() const
Return the average porosity within the scv.
Definition: geomechanics/poroelastic/volumevariables.hh:72
typename Traits::SolidState SolidState
export type of solid state
Definition: geomechanics/poroelastic/volumevariables.hh:41
const PrimaryVariables & priVars() const
Return the vector of primary variables.
Definition: geomechanics/poroelastic/volumevariables.hh:97
Scalar displacement(unsigned int dir) const
Returns the permeability within the scv in .
Definition: geomechanics/poroelastic/volumevariables.hh:80
Scalar porosity() const
Return the average porosity within the scv.
Definition: geomechanics/poroelastic/volumevariables.hh:76
typename Traits::DisplacementVector DisplacementVector
export the type used for displacement vectors
Definition: geomechanics/poroelastic/volumevariables.hh:37
DisplacementVector displacement() const
Returns the displacement vector within the scv in .
Definition: geomechanics/poroelastic/volumevariables.hh:84
typename Traits::PrimaryVariables PrimaryVariables
export the type used for the primary variables
Definition: geomechanics/poroelastic/volumevariables.hh:35
static constexpr Scalar extrusionFactor()
TODO We don't know yet how to interpret extrusion for mechanics.
Definition: geomechanics/poroelastic/volumevariables.hh:101
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:55
std::string density(int phaseIdx) noexcept
I/O name of density for multiphase systems.
Definition: name.hh:53