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;
61 pressureIdx = Idx::pressureIdx
77 static constexpr bool useMoles() {
return Traits::ModelTraits::useMoles(); }
88 template<
class ElemSol,
class Problem,
class Element,
class Scv>
90 const Problem &problem,
91 const Element &element,
100 EnergyVolVars::updateSolidEnergyParams(elemSol, problem, element, scv,
solidState_);
101 permeability_ = problem.spatialParams().permeability(element, scv, elemSol);
106 typename FluidSystem::ParameterCache paramCache;
110 for (
unsigned int compIIdx = 0; compIIdx < numFluidComps; ++compIIdx)
112 for (
unsigned int compJIdx = 0; compJIdx < numFluidComps; ++compJIdx)
114 if(compIIdx != compJIdx)
115 diffCoeff_[compIIdx][compJIdx] = FluidSystem::binaryDiffusionCoefficient(
fluidState_,
135 template<
class ElemSol,
class Problem,
class Element,
class Scv>
137 const Problem& problem,
138 const Element& element,
146 const auto&
priVars = elemSol[scv.localDofIndex()];
152 Scalar sumMoleFracNotMainComp = 0;
153 for (
int compIdx = 1; compIdx < numFluidComps; ++compIdx)
156 sumMoleFracNotMainComp +=
priVars[compIdx];
158 fluidState.setMoleFraction(0, 0, 1.0 - sumMoleFracNotMainComp);
164 for (
int compIdx = 1; compIdx < numFluidComps; ++compIdx)
168 typename FluidSystem::ParameterCache paramCache;
180 Scalar h = EnergyVolVars::enthalpy(
fluidState, paramCache, 0);
248 assert(compIdx < numFluidComps);
264 assert(compIdx < numFluidComps);
329 assert(compIdx < numFluidComps);
330 return diffCoeff_[phaseIdx][compIdx];
340 assert(compIdx < numFluidComps);
351 assert(compIdx < numFluidComps);
359 {
return permeability_; }
366 PermeabilityType permeability_;
367 std::array<std::array<Scalar, numFluidComps>, numFluidComps> diffCoeff_;
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
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
Property tag Indices
Definition: porousmediumflow/sequential/properties.hh:59
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:233
FluidState fluidState_
Definition: porousmediumflow/1pnc/volumevariables.hh:362
Scalar massFraction(int phaseIdx, int compIdx) const
Returns the mass fraction of a component in the phase.
Definition: porousmediumflow/1pnc/volumevariables.hh:261
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:89
Scalar viscosity(int phaseIdx=0) const
Returns the dynamic viscosity of the fluid within the control volume.
Definition: porousmediumflow/1pnc/volumevariables.hh:313
SolidState solidState_
Definition: porousmediumflow/1pnc/volumevariables.hh:363
Scalar diffusionCoefficient(int phaseIdx, int compIdx) const
Returns the binary diffusion coefficient in the fluid.
Definition: porousmediumflow/1pnc/volumevariables.hh:327
static constexpr bool useMoles()
Returns whether moles or masses are balanced.
Definition: porousmediumflow/1pnc/volumevariables.hh:77
Scalar density(int phaseIdx=0) const
Returns density the of the fluid phase.
Definition: porousmediumflow/1pnc/volumevariables.hh:211
Scalar mobility(int phaseIdx=0) const
Returns the mobility .
Definition: porousmediumflow/1pnc/volumevariables.hh:301
Scalar massFraction(int compIdx) const
Returns the mass fraction of a component in the phase.
Definition: porousmediumflow/1pnc/volumevariables.hh:349
typename Traits::ModelTraits::Indices Indices
Export indices.
Definition: porousmediumflow/1pnc/volumevariables.hh:70
Scalar molarDensity(int phaseIdx=0) const
Returns molar density the of the fluid phase.
Definition: porousmediumflow/1pnc/volumevariables.hh:222
Scalar porosity() const
Returns the average porosity within the control volume.
Definition: porousmediumflow/1pnc/volumevariables.hh:321
typename Traits::SolidSystem SolidSystem
Export type of solid system.
Definition: porousmediumflow/1pnc/volumevariables.hh:74
Scalar pressure(int phaseIdx=0) const
Returns the effective pressure of a given phase within the control volume.
Definition: porousmediumflow/1pnc/volumevariables.hh:277
const PermeabilityType & permeability() const
Returns the permeability within the control volume in .
Definition: porousmediumflow/1pnc/volumevariables.hh:358
Scalar molarity(int compIdx) const
Returns the molarity of a component in the phase.
Definition: porousmediumflow/1pnc/volumevariables.hh:338
Scalar averageMolarMass(int phaseIdx=0) const
Returns the average molar mass of the fluid phase.
Definition: porousmediumflow/1pnc/volumevariables.hh:202
Scalar moleFraction(int phaseIdx, int compIdx) const
Returns the mole fraction of a component in the phase.
Definition: porousmediumflow/1pnc/volumevariables.hh:245
typename Traits::FluidState FluidState
Export fluid state type.
Definition: porousmediumflow/1pnc/volumevariables.hh:66
const SolidState & solidState() const
Returns the phase state for the control volume.
Definition: porousmediumflow/1pnc/volumevariables.hh:194
typename Traits::FluidSystem FluidSystem
Export fluid system type.
Definition: porousmediumflow/1pnc/volumevariables.hh:68
const FluidState & fluidState() const
Returns the fluid configuration at the given primary variables.
Definition: porousmediumflow/1pnc/volumevariables.hh:188
typename Traits::SolidState SolidState
Export type of solid state.
Definition: porousmediumflow/1pnc/volumevariables.hh:72
Scalar temperature() const
Returns the temperature inside the sub-control volume.
Definition: porousmediumflow/1pnc/volumevariables.hh:289
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:136
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.