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);
319 typename FluidSystem::ParameterCache paramCache;
321 return FluidSystem::binaryDiffusionCoefficient(
fluidState_, paramCache, phaseIdx, compIIdx, compJIdx);
328 {
return effectiveDiffCoeff_(phaseIdx, compIIdx, compJIdx); }
337 assert(compIdx < numFluidComps);
348 assert(compIdx < numFluidComps);
356 {
return permeability_; }
363 PermeabilityType permeability_;
366 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:359
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:360
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:346
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:355
Scalar molarity(int compIdx) const
Returns the molarity of a component in the phase.
Definition: porousmediumflow/1pnc/volumevariables.hh:335
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:327
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:317
Definition: porousmediumflow/nonisothermal/volumevariables.hh:76
The isothermal base class.
Definition: porousmediumflow/volumevariables.hh:42
static constexpr int numFluidComponents()
Return number of components considered by the model.
Definition: porousmediumflow/volumevariables.hh:54
const PrimaryVariables & priVars() const
Returns the vector of primary variables.
Definition: porousmediumflow/volumevariables.hh:78
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:66
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.