24#ifndef DUMUX_FREEFLOW_NC_STAGGERED_LOCAL_RESIDUAL_HH
25#define DUMUX_FREEFLOW_NC_STAGGERED_LOCAL_RESIDUAL_HH
34template<
class TypeTag, DiscretizationMethod discMethod>
35class FreeflowNCResidualImpl;
41template<
class TypeTag>
50 using GridView =
typename GridGeometry::GridView;
51 using Element =
typename GridView::template Codim<0>::Entity;
53 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
57 static constexpr int numComponents = ModelTraits::numFluidComponents();
58 static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>();
63 using ParentType::ParentType;
66 template<
class VolumeVariables>
68 const SubControlVolume& scv,
69 const VolumeVariables& volVars)
const
71 CellCenterPrimaryVariables storage(0.0);
73 const Scalar
density = useMoles ? volVars.molarDensity() : volVars.density();
76 for (
int compIdx = 0; compIdx < numComponents; ++compIdx)
78 const int eqIdx = compIdx;
80 const Scalar
massOrMoleFraction = useMoles ? volVars.moleFraction(compIdx) : volVars.massFraction(compIdx);
83 if (eqIdx != ModelTraits::replaceCompEqIdx())
88 if(ModelTraits::replaceCompEqIdx() < numComponents)
89 storage[ModelTraits::replaceCompEqIdx()] =
density;
91 EnergyLocalResidual::fluidPhaseStorage(storage, volVars);
The available discretization methods in Dumux.
DiscretizationMethod
The available discretization methods in Dumux.
Definition: method.hh:37
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
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
EnergyLocalResidualImplementation< TypeTag, GetPropType< TypeTag, Properties::ModelTraits >::enableEnergyBalance()> EnergyLocalResidual
Definition: porousmediumflow/nonisothermal/localresidual.hh:38
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition: propertysystem.hh:149
std::string density(int phaseIdx) noexcept
I/O name of density for multiphase systems.
Definition: name.hh:65
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:67
Definition: freeflow/navierstokes/localresidual.hh:35
Declares all properties used in Dumux.