24#ifndef DUMUX_FREEFLOW_NC_STAGGERED_LOCAL_RESIDUAL_HH
25#define DUMUX_FREEFLOW_NC_STAGGERED_LOCAL_RESIDUAL_HH
39template<
class TypeTag,
class DiscretizationMethod>
40class FreeflowNCResidualImpl;
42template<
class TypeTag>
51 using GridView =
typename GridGeometry::GridView;
52 using Element =
typename GridView::template Codim<0>::Entity;
54 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
58 static constexpr int numComponents = ModelTraits::numFluidComponents();
59 static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>();
64 using ParentType::ParentType;
67 template<
class VolumeVariables>
69 const SubControlVolume& scv,
70 const VolumeVariables& volVars)
const
72 CellCenterPrimaryVariables storage(0.0);
74 const Scalar
density = useMoles ? volVars.molarDensity() : volVars.density();
77 for (
int compIdx = 0; compIdx < numComponents; ++compIdx)
79 const int eqIdx = compIdx;
81 const Scalar
massOrMoleFraction = useMoles ? volVars.moleFraction(compIdx) : volVars.massFraction(compIdx);
84 if (eqIdx != ModelTraits::replaceCompEqIdx())
89 if(ModelTraits::replaceCompEqIdx() < numComponents)
90 storage[ModelTraits::replaceCompEqIdx()] =
density;
92 EnergyLocalResidual::fluidPhaseStorage(storage, volVars);
The available discretization methods in Dumux.
VolumeVariables::PrimaryVariables::value_type massOrMoleFraction(const VolumeVariables &volVars, ReferenceSystemFormulation referenceSys, const int phaseIdx, const int compIdx)
returns the mass or mole fraction to be used in Fick's law based on the reference system
Definition: referencesystemformulation.hh:66
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
EnergyLocalResidualImplementation< TypeTag, GetPropType< TypeTag, Properties::ModelTraits >::enableEnergyBalance()> EnergyLocalResidual
Definition: porousmediumflow/nonisothermal/localresidual.hh:39
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:180
std::string density(int phaseIdx) noexcept
I/O name of density for multiphase systems.
Definition: name.hh:65
Element-wise calculation of the multi-component free-flow residual for models using the staggered dis...
Definition: freeflow/compositional/localresidual.hh:36
CellCenterPrimaryVariables computeStorageForCellCenter(const Problem &problem, const SubControlVolume &scv, const VolumeVariables &volVars) const
Evaluate fluxes entering or leaving the cell center control volume.
Definition: freeflow/compositional/staggered/localresidual.hh:68
Element-wise calculation of the Navier-Stokes residual for models using the staggered discretization.
Definition: freeflow/navierstokes/localresidual.hh:35
Declares all properties used in Dumux.