26#ifndef DUMUX_1PNC_VOLUME_VARIABLES_HH
27#define DUMUX_1PNC_VOLUME_VARIABLES_HH
29#include <dune/common/fvector.hh>
46template <
class Traits>
53 using Scalar =
typename Traits::PrimaryVariables::value_type;
54 using PermeabilityType =
typename Traits::PermeabilityType;
55 using EffDiffModel =
typename Traits::EffectiveDiffusivityModel;
56 using Idx =
typename Traits::ModelTraits::Indices;
58 using DiffusionCoefficients =
typename Traits::DiffusionType::DiffusionCoefficientsContainer;
63 pressureIdx = Idx::pressureIdx
72 using Indices =
typename Traits::ModelTraits::Indices;
79 static constexpr bool useMoles() {
return Traits::ModelTraits::useMoles(); }
90 template<
class ElemSol,
class Problem,
class Element,
class Scv>
92 const Problem &problem,
93 const Element &element,
102 EnergyVolVars::updateSolidEnergyParams(elemSol, problem, element, scv,
solidState_);
103 permeability_ = problem.spatialParams().permeability(element, scv, elemSol);
104 EnergyVolVars::updateEffectiveThermalConductivity();
106 auto getEffectiveDiffusionCoefficient = [&](
int phaseIdx,
int compIIdx,
int compJIdx)
108 return EffDiffModel::effectiveDiffusionCoefficient(*
this, phaseIdx, compIIdx, compJIdx);
111 effectiveDiffCoeff_.update(getEffectiveDiffusionCoefficient);
125 template<
class ElemSol,
class Problem,
class Element,
class Scv>
127 const Problem& problem,
128 const Element& element,
136 const auto&
priVars = elemSol[scv.localDofIndex()];
142 Scalar sumMoleFracNotMainComp = 0;
143 for (
int compIdx = 1; compIdx < numFluidComps; ++compIdx)
146 sumMoleFracNotMainComp +=
priVars[compIdx];
148 fluidState.setMoleFraction(0, 0, 1.0 - sumMoleFracNotMainComp);
154 for (
int compIdx = 1; compIdx < numFluidComps; ++compIdx)
158 typename FluidSystem::ParameterCache paramCache;
170 Scalar h = EnergyVolVars::enthalpy(
fluidState, paramCache, 0);
238 assert(compIdx < numFluidComps);
254 assert(compIdx < numFluidComps);
317 [[deprecated(
"Will be removed after release 3.2. Use diffusionCoefficient(phaseIdx, compIIdx, compJIdx)!")]]
326 typename FluidSystem::ParameterCache paramCache;
328 return FluidSystem::binaryDiffusionCoefficient(
fluidState_, paramCache, phaseIdx, compIIdx, compJIdx);
335 {
return effectiveDiffCoeff_(phaseIdx, compIIdx, compJIdx); }
344 assert(compIdx < numFluidComps);
355 assert(compIdx < numFluidComps);
363 {
return permeability_; }
370 PermeabilityType permeability_;
373 DiffusionCoefficients effectiveDiffCoeff_;
Update the solid volume fractions (inert and reacitve) and set them in the solidstate.
void updateSolidVolumeFractions(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv, SolidState &solidState, const int solidVolFracOffset)
update the solid volume fractions (inert and reacitve) and set them in the solidstate
Definition: updatesolidvolumefractions.hh:36
std::string viscosity(int phaseIdx) noexcept
I/O name of viscosity for multiphase systems.
Definition: name.hh:74
std::string molarDensity(int phaseIdx) noexcept
I/O name of molar density for multiphase systems.
Definition: name.hh:83
std::string density(int phaseIdx) noexcept
I/O name of density for multiphase systems.
Definition: name.hh:65
Contains the quantities which are are constant within a finite volume in the one-phase,...
Definition: porousmediumflow/1pnc/volumevariables.hh:50
Scalar saturation(int phaseIdx=0) const
Returns the saturation.
Definition: porousmediumflow/1pnc/volumevariables.hh:223
FluidState fluidState_
Definition: porousmediumflow/1pnc/volumevariables.hh:366
Scalar massFraction(int phaseIdx, int compIdx) const
Returns the mass fraction of a component in the phase.
Definition: porousmediumflow/1pnc/volumevariables.hh:251
void update(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv)
Updates all quantities for a given control volume.
Definition: porousmediumflow/1pnc/volumevariables.hh:91
Scalar viscosity(int phaseIdx=0) const
Returns the dynamic viscosity of the fluid within the control volume.
Definition: porousmediumflow/1pnc/volumevariables.hh:303
SolidState solidState_
Definition: porousmediumflow/1pnc/volumevariables.hh:367
Scalar diffusionCoefficient(int phaseIdx, int compIdx) const
Returns the binary diffusion coefficients for a phase in .
Definition: porousmediumflow/1pnc/volumevariables.hh:318
static constexpr bool useMoles()
Returns whether moles or masses are balanced.
Definition: porousmediumflow/1pnc/volumevariables.hh:79
Scalar density(int phaseIdx=0) const
Returns density the of the fluid phase.
Definition: porousmediumflow/1pnc/volumevariables.hh:201
Scalar mobility(int phaseIdx=0) const
Returns the mobility .
Definition: porousmediumflow/1pnc/volumevariables.hh:291
Scalar massFraction(int compIdx) const
Returns the mass fraction of a component in the phase.
Definition: porousmediumflow/1pnc/volumevariables.hh:353
typename Traits::ModelTraits::Indices Indices
Export indices.
Definition: porousmediumflow/1pnc/volumevariables.hh:72
Scalar molarDensity(int phaseIdx=0) const
Returns molar density the of the fluid phase.
Definition: porousmediumflow/1pnc/volumevariables.hh:212
Scalar porosity() const
Returns the average porosity within the control volume.
Definition: porousmediumflow/1pnc/volumevariables.hh:311
typename Traits::SolidSystem SolidSystem
Export type of solid system.
Definition: porousmediumflow/1pnc/volumevariables.hh:76
Scalar pressure(int phaseIdx=0) const
Returns the effective pressure of a given phase within the control volume.
Definition: porousmediumflow/1pnc/volumevariables.hh:267
const PermeabilityType & permeability() const
Returns the permeability within the control volume in .
Definition: porousmediumflow/1pnc/volumevariables.hh:362
Scalar molarity(int compIdx) const
Returns the molarity of a component in the phase.
Definition: porousmediumflow/1pnc/volumevariables.hh:342
Scalar averageMolarMass(int phaseIdx=0) const
Returns the average molar mass of the fluid phase.
Definition: porousmediumflow/1pnc/volumevariables.hh:192
Scalar moleFraction(int phaseIdx, int compIdx) const
Returns the mole fraction of a component in the phase.
Definition: porousmediumflow/1pnc/volumevariables.hh:235
typename Traits::FluidState FluidState
Export fluid state type.
Definition: porousmediumflow/1pnc/volumevariables.hh:68
const SolidState & solidState() const
Returns the phase state for the control volume.
Definition: porousmediumflow/1pnc/volumevariables.hh:184
typename Traits::FluidSystem FluidSystem
Export fluid system type.
Definition: porousmediumflow/1pnc/volumevariables.hh:70
const FluidState & fluidState() const
Returns the fluid configuration at the given primary variables.
Definition: porousmediumflow/1pnc/volumevariables.hh:178
Scalar effectiveDiffusionCoefficient(int phaseIdx, int compIIdx, int compJIdx) const
Returns the effective diffusion coefficients for a phase in .
Definition: porousmediumflow/1pnc/volumevariables.hh:334
typename Traits::SolidState SolidState
Export type of solid state.
Definition: porousmediumflow/1pnc/volumevariables.hh:74
Scalar temperature() const
Returns the temperature inside the sub-control volume.
Definition: porousmediumflow/1pnc/volumevariables.hh:279
void completeFluidState(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv, FluidState &fluidState, SolidState &solidState)
Sets complete fluid state.
Definition: porousmediumflow/1pnc/volumevariables.hh:126
Scalar diffusionCoefficient(int phaseIdx, int compIIdx, int compJIdx) const
Returns the binary diffusion coefficients for a phase in .
Definition: porousmediumflow/1pnc/volumevariables.hh:324
Definition: porousmediumflow/nonisothermal/volumevariables.hh:75
The isothermal base class.
Definition: porousmediumflow/volumevariables.hh:40
static constexpr int numFluidComponents()
Return number of components considered by the model.
Definition: porousmediumflow/volumevariables.hh:52
const PrimaryVariables & priVars() const
Returns the vector of primary variables.
Definition: porousmediumflow/volumevariables.hh:76
void update(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv)
Updates all quantities for a given control volume.
Definition: porousmediumflow/volumevariables.hh:64
Base class for the model specific class which provides access to all volume averaged quantities.
Base class for the model specific class which provides access to all volume averaged quantities.