14#ifndef DUMUX_1PNC_VOLUME_VARIABLES_HH
15#define DUMUX_1PNC_VOLUME_VARIABLES_HH
17#include <dune/common/fvector.hh>
34template <
class Traits>
41 using Scalar =
typename Traits::PrimaryVariables::value_type;
42 using PermeabilityType =
typename Traits::PermeabilityType;
43 using EffDiffModel =
typename Traits::EffectiveDiffusivityModel;
44 using Idx =
typename Traits::ModelTraits::Indices;
46 using DiffusionCoefficients =
typename Traits::DiffusionType::DiffusionCoefficientsContainer;
51 pressureIdx = Idx::pressureIdx
60 using Indices =
typename Traits::ModelTraits::Indices;
67 static constexpr bool useMoles() {
return Traits::ModelTraits::useMoles(); }
78 template<
class ElemSol,
class Problem,
class Element,
class Scv>
80 const Problem &problem,
81 const Element &element,
90 EnergyVolVars::updateSolidEnergyParams(elemSol, problem, element, scv,
solidState_);
91 permeability_ = problem.spatialParams().permeability(element, scv, elemSol);
92 EnergyVolVars::updateEffectiveThermalConductivity();
94 auto getEffectiveDiffusionCoefficient = [&](
int phaseIdx,
int compIIdx,
int compJIdx)
96 return EffDiffModel::effectiveDiffusionCoefficient(*
this, phaseIdx, compIIdx, compJIdx);
99 effectiveDiffCoeff_.update(getEffectiveDiffusionCoefficient);
113 template<
class ElemSol,
class Problem,
class Element,
class Scv>
115 const Problem& problem,
116 const Element& element,
124 const auto&
priVars = elemSol[scv.localDofIndex()];
130 Scalar sumMoleFracNotMainComp = 0;
131 for (
int compIdx = 1; compIdx < numFluidComps; ++compIdx)
134 sumMoleFracNotMainComp +=
priVars[compIdx];
136 fluidState.setMoleFraction(0, 0, 1.0 - sumMoleFracNotMainComp);
142 for (
int compIdx = 1; compIdx < numFluidComps; ++compIdx)
146 typename FluidSystem::ParameterCache paramCache;
158 Scalar h = EnergyVolVars::enthalpy(
fluidState, paramCache, 0);
226 assert(compIdx < numFluidComps);
242 assert(compIdx < numFluidComps);
307 typename FluidSystem::ParameterCache paramCache;
309 return FluidSystem::binaryDiffusionCoefficient(
fluidState_, paramCache, phaseIdx, compIIdx, compJIdx);
316 {
return effectiveDiffCoeff_(phaseIdx, compIIdx, compJIdx); }
325 assert(compIdx < numFluidComps);
336 assert(compIdx < numFluidComps);
344 {
return permeability_; }
351 PermeabilityType permeability_;
354 DiffusionCoefficients effectiveDiffCoeff_;
Definition: porousmediumflow/nonisothermal/volumevariables.hh:63
Contains the quantities which are are constant within a finite volume in the one-phase,...
Definition: porousmediumflow/1pnc/volumevariables.hh:38
Scalar saturation(int phaseIdx=0) const
Returns the saturation.
Definition: porousmediumflow/1pnc/volumevariables.hh:211
FluidState fluidState_
Definition: porousmediumflow/1pnc/volumevariables.hh:347
Scalar massFraction(int phaseIdx, int compIdx) const
Returns the mass fraction of a component in the phase.
Definition: porousmediumflow/1pnc/volumevariables.hh:239
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:79
Scalar viscosity(int phaseIdx=0) const
Returns the dynamic viscosity of the fluid within the control volume.
Definition: porousmediumflow/1pnc/volumevariables.hh:291
SolidState solidState_
Definition: porousmediumflow/1pnc/volumevariables.hh:348
static constexpr bool useMoles()
Returns whether moles or masses are balanced.
Definition: porousmediumflow/1pnc/volumevariables.hh:67
Scalar density(int phaseIdx=0) const
Returns density the of the fluid phase.
Definition: porousmediumflow/1pnc/volumevariables.hh:189
Scalar mobility(int phaseIdx=0) const
Returns the mobility .
Definition: porousmediumflow/1pnc/volumevariables.hh:279
Scalar massFraction(int compIdx) const
Returns the mass fraction of a component in the phase.
Definition: porousmediumflow/1pnc/volumevariables.hh:334
typename Traits::ModelTraits::Indices Indices
Export indices.
Definition: porousmediumflow/1pnc/volumevariables.hh:60
Scalar molarDensity(int phaseIdx=0) const
Returns molar density the of the fluid phase.
Definition: porousmediumflow/1pnc/volumevariables.hh:200
Scalar porosity() const
Returns the average porosity within the control volume.
Definition: porousmediumflow/1pnc/volumevariables.hh:299
typename Traits::SolidSystem SolidSystem
Export type of solid system.
Definition: porousmediumflow/1pnc/volumevariables.hh:64
Scalar pressure(int phaseIdx=0) const
Returns the effective pressure of a given phase within the control volume.
Definition: porousmediumflow/1pnc/volumevariables.hh:255
const PermeabilityType & permeability() const
Returns the permeability within the control volume in .
Definition: porousmediumflow/1pnc/volumevariables.hh:343
Scalar molarity(int compIdx) const
Returns the molarity of a component in the phase.
Definition: porousmediumflow/1pnc/volumevariables.hh:323
Scalar averageMolarMass(int phaseIdx=0) const
Returns the average molar mass of the fluid phase.
Definition: porousmediumflow/1pnc/volumevariables.hh:180
Scalar moleFraction(int phaseIdx, int compIdx) const
Returns the mole fraction of a component in the phase.
Definition: porousmediumflow/1pnc/volumevariables.hh:223
typename Traits::FluidState FluidState
Export fluid state type.
Definition: porousmediumflow/1pnc/volumevariables.hh:56
const SolidState & solidState() const
Returns the phase state for the control volume.
Definition: porousmediumflow/1pnc/volumevariables.hh:172
typename Traits::FluidSystem FluidSystem
Export fluid system type.
Definition: porousmediumflow/1pnc/volumevariables.hh:58
const FluidState & fluidState() const
Returns the fluid configuration at the given primary variables.
Definition: porousmediumflow/1pnc/volumevariables.hh:166
Scalar effectiveDiffusionCoefficient(int phaseIdx, int compIIdx, int compJIdx) const
Returns the effective diffusion coefficients for a phase in .
Definition: porousmediumflow/1pnc/volumevariables.hh:315
typename Traits::SolidState SolidState
Export type of solid state.
Definition: porousmediumflow/1pnc/volumevariables.hh:62
Scalar temperature() const
Returns the temperature inside the sub-control volume.
Definition: porousmediumflow/1pnc/volumevariables.hh:267
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:114
Scalar diffusionCoefficient(int phaseIdx, int compIIdx, int compJIdx) const
Returns the binary diffusion coefficients for a phase in .
Definition: porousmediumflow/1pnc/volumevariables.hh:305
The isothermal base class.
Definition: porousmediumflow/volumevariables.hh:28
static constexpr int numFluidComponents()
Return number of components considered by the model.
Definition: porousmediumflow/volumevariables.hh:40
const PrimaryVariables & priVars() const
Returns the vector of primary variables.
Definition: porousmediumflow/volumevariables.hh:64
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:52
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:24
std::string viscosity(int phaseIdx) noexcept
I/O name of viscosity for multiphase systems.
Definition: name.hh:62
std::string molarDensity(int phaseIdx) noexcept
I/O name of molar density for multiphase systems.
Definition: name.hh:71
std::string density(int phaseIdx) noexcept
I/O name of density for multiphase systems.
Definition: name.hh:53
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.
Update the solid volume fractions (inert and reacitve) and set them in the solidstate.