diff --git a/dumux/discretization/box/fickslaw.hh b/dumux/discretization/box/fickslaw.hh index 8acf0826b6bd13f204e9da958fe9561432ba1d61..46f65da48e6bb9b30fbc421784cdefd2ec587052 100644 --- a/dumux/discretization/box/fickslaw.hh +++ b/dumux/discretization/box/fickslaw.hh @@ -63,8 +63,8 @@ class FicksLawImplementation<TypeTag, DiscretizationMethod::box> enum { dimWorld = GridView::dimensionworld} ; enum { - numPhases = ModelTraits::numPhases(), - numComponents = ModelTraits::numComponents() + numPhases = ModelTraits::numFluidPhases(), + numComponents = ModelTraits::numFluidComponents() }; using DimWorldMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>; using ComponentFluxVector = Dune::FieldVector<Scalar, numComponents>; diff --git a/dumux/discretization/box/fourierslaw.hh b/dumux/discretization/box/fourierslaw.hh index 3378e20680b291c6792546ea820516f6bd3896fe..279adc65a9273d7786184e29346a077d6fccaed0 100644 --- a/dumux/discretization/box/fourierslaw.hh +++ b/dumux/discretization/box/fourierslaw.hh @@ -43,27 +43,15 @@ class FouriersLawImplementation<TypeTag, DiscretizationMethod::box> { using Scalar = GetPropType<TypeTag, Properties::Scalar>; using Problem = GetPropType<TypeTag, Properties::Problem>; - using FluidState = GetPropType<TypeTag, Properties::FluidState>; - using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; - using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; - using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; using ThermalConductivityModel = GetPropType<TypeTag, Properties::ThermalConductivityModel>; using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; using GridView = GetPropType<TypeTag, Properties::GridView>; - using IndexType = typename GridView::IndexSet::IndexType; using Element = typename GridView::template Codim<0>::Entity; - enum { dim = GridView::dimension} ; - enum { dimWorld = GridView::dimensionworld} ; - enum { numPhases = GetPropType<TypeTag, Properties::ModelTraits>::numPhases()} ; - - using DimWorldMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>; - public: static Scalar flux(const Problem& problem, const Element& element, @@ -93,7 +81,7 @@ public: const auto& fluxVarsCache = elemFluxVarsCache[scvf]; // compute the temperature gradient with the shape functions - Dune::FieldVector<Scalar, dimWorld> gradTemp(0.0); + Dune::FieldVector<Scalar, GridView::dimensionworld> gradTemp(0.0); for (auto&& scv : scvs(fvGeometry)) gradTemp.axpy(elemVolVars[scv].temperature(), fluxVarsCache.gradN(scv.indexInElement())); diff --git a/dumux/discretization/box/fourierslawnonequilibrium.hh b/dumux/discretization/box/fourierslawnonequilibrium.hh index 4e045c9b8e7e35de3ead7ef0d942b70b11afad0b..dd7e1b5d041962030d144d15997ccfe28726c79b 100644 --- a/dumux/discretization/box/fourierslawnonequilibrium.hh +++ b/dumux/discretization/box/fourierslawnonequilibrium.hh @@ -55,13 +55,8 @@ class FouriersLawNonEquilibriumImplementation<TypeTag, DiscretizationMethod::box using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Element = typename GridView::template Codim<0>::Entity; - enum { dim = GridView::dimension} ; - enum { dimWorld = GridView::dimensionworld} ; - - enum { numEnergyEqFluid = getPropValue<TypeTag, Properties::NumEnergyEqFluid>() }; - enum { sPhaseIdx = ModelTraits::numPhases() }; - - using DimWorldMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>; + static constexpr auto numEnergyEqFluid = getPropValue<TypeTag, Properties::NumEnergyEqFluid>(); + static constexpr auto sPhaseIdx = ModelTraits::numFluidPhases(); public: static Scalar flux(const Problem& problem, @@ -83,7 +78,7 @@ public: if (phaseIdx != sPhaseIdx) { //when number of energyEq for the fluid are smaller than numPhases that means that we need an effecitve law - if (numEnergyEqFluid < ModelTraits::numPhases()) + if (numEnergyEqFluid < ModelTraits::numFluidPhases()) { insideLambda += ThermalConductivityModel::effectiveThermalConductivity(insideVolVars, problem.spatialParams(), element, fvGeometry, insideScv); outsideLambda += ThermalConductivityModel::effectiveThermalConductivity(outsideVolVars, problem.spatialParams(), element, fvGeometry, outsideScv); @@ -111,7 +106,7 @@ public: // evaluate gradTemp at integration point const auto& fluxVarsCache = elemFluxVarsCache[scvf]; - Dune::FieldVector<Scalar, dimWorld> gradTemp(0.0); + Dune::FieldVector<Scalar, GridView::dimensionworld> gradTemp(0.0); for (auto&& scv : scvs(fvGeometry)) { // compute the temperature gradient with the shape functions diff --git a/dumux/discretization/box/maxwellstefanslaw.hh b/dumux/discretization/box/maxwellstefanslaw.hh index 3303d083acf286be3ea13bf81b1ab290cf493bf8..6af8175b279da8dbc1543edf62d746dcf2d72302 100644 --- a/dumux/discretization/box/maxwellstefanslaw.hh +++ b/dumux/discretization/box/maxwellstefanslaw.hh @@ -52,23 +52,14 @@ class MaxwellStefansLawImplementation<TypeTag, DiscretizationMethod::box > using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; using GridView = GetPropType<TypeTag, Properties::GridView>; - using IndexType = typename GridView::IndexSet::IndexType; - using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using Element = typename GridView::template Codim<0>::Entity; - using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - enum { dim = GridView::dimension} ; - enum { dimWorld = GridView::dimensionworld} ; - enum - { - numPhases = GetPropType<TypeTag, Properties::ModelTraits>::numPhases(), - numComponents = GetPropType<TypeTag, Properties::ModelTraits>::numComponents() - }; - using DimWorldMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>; + static constexpr auto numFluidPhases = GetPropType<TypeTag, Properties::ModelTraits>::numFluidPhases(); + static constexpr auto numComponents = GetPropType<TypeTag, Properties::ModelTraits>::numFluidComponents(); + using ComponentFluxVector = Dune::FieldVector<Scalar, numComponents>; using ReducedComponentVector = Dune::FieldVector<Scalar, numComponents-1>; using ReducedComponentMatrix = Dune::FieldMatrix<Scalar, numComponents-1, numComponents-1>; @@ -113,7 +104,7 @@ public: for (int compIdx = 0; compIdx < numComponents-1; compIdx++) { - Dune::FieldVector<Scalar, dimWorld> gradX(0.0); + Dune::FieldVector<Scalar, GridView::dimensionworld> gradX(0.0); for (auto&& scv : scvs(fvGeometry)) { const auto& volVars = elemVolVars[scv]; diff --git a/dumux/discretization/cellcentered/mpfa/fickslaw.hh b/dumux/discretization/cellcentered/mpfa/fickslaw.hh index 3d5e759d4d95babc40e4bd7a5de687110319cde0..bf568d6d0742b762a2d9df3acf062e3435a2fd10 100644 --- a/dumux/discretization/cellcentered/mpfa/fickslaw.hh +++ b/dumux/discretization/cellcentered/mpfa/fickslaw.hh @@ -58,7 +58,7 @@ class FicksLawImplementation<TypeTag, DiscretizationMethod::ccmpfa> using FluxVariablesCache = GetPropType<TypeTag, Properties::FluxVariablesCache>; using BalanceEqOpts = GetPropType<TypeTag, Properties::BalanceEqOpts>; - static constexpr int numComponents = GetPropType<TypeTag, Properties::ModelTraits>::numComponents(); + static constexpr int numComponents = GetPropType<TypeTag, Properties::ModelTraits>::numFluidComponents(); using ComponentFluxVector = Dune::FieldVector<Scalar, numComponents>; //! Class that fills the cache corresponding to mpfa Fick's Law @@ -97,7 +97,7 @@ class FicksLawImplementation<TypeTag, DiscretizationMethod::ccmpfa> using DualGridNodalIndexSet = GetPropType<TypeTag, Properties::DualGridNodalIndexSet>; using Stencil = typename DualGridNodalIndexSet::NodalGridStencilType; - static constexpr int numPhases = GetPropType<TypeTag, Properties::ModelTraits>::numPhases(); + static constexpr int numPhases = GetPropType<TypeTag, Properties::ModelTraits>::numFluidPhases(); static constexpr bool considerSecondaryIVs = FVGridGeometry::MpfaHelper::considerSecondaryIVs(); using PrimaryDataHandle = typename ElementFluxVariablesCache::PrimaryIvDataHandle::DiffusionHandle; using SecondaryDataHandle = typename ElementFluxVariablesCache::SecondaryIvDataHandle::DiffusionHandle; diff --git a/dumux/discretization/cellcentered/mpfa/fluxvariablescachefiller.hh b/dumux/discretization/cellcentered/mpfa/fluxvariablescachefiller.hh index e278f687e6f0db69e2da919a3adffff471db8f58..6c76cc826b1ee12a080179ae73c3bec75016a499 100644 --- a/dumux/discretization/cellcentered/mpfa/fluxvariablescachefiller.hh +++ b/dumux/discretization/cellcentered/mpfa/fluxvariablescachefiller.hh @@ -312,8 +312,8 @@ private: using DiffusionType = GetPropType<TypeTag, Properties::MolecularDiffusionType>; using DiffusionFiller = typename DiffusionType::Cache::Filler; - static constexpr int numPhases = ModelTraits::numPhases(); - static constexpr int numComponents = ModelTraits::numComponents(); + static constexpr int numPhases = ModelTraits::numFluidPhases(); + static constexpr int numComponents = ModelTraits::numFluidComponents(); for (unsigned int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) { @@ -446,7 +446,7 @@ private: localAssembler.assembleMatrices(handle.advectionHandle(), iv, LambdaFactory::getAdvectionLambda()); // assemble pressure vectors - for (unsigned int pIdx = 0; pIdx < ModelTraits::numPhases(); ++pIdx) + for (unsigned int pIdx = 0; pIdx < ModelTraits::numFluidPhases(); ++pIdx) { // set context in handle handle.advectionHandle().setPhaseIndex(pIdx); diff --git a/dumux/discretization/cellcentered/mpfa/gridfluxvariablescache.hh b/dumux/discretization/cellcentered/mpfa/gridfluxvariablescache.hh index 821f33abd8201ba95a7bf3b0d3b5a553fddef9c2..ebb1d9d0fcb97854cd94e0110f5e1719351bd350 100644 --- a/dumux/discretization/cellcentered/mpfa/gridfluxvariablescache.hh +++ b/dumux/discretization/cellcentered/mpfa/gridfluxvariablescache.hh @@ -41,8 +41,8 @@ struct IvDataHandlePhysicsTraits static constexpr bool enableMolecularDiffusion = ModelTraits::enableMolecularDiffusion(); static constexpr bool enableHeatConduction = ModelTraits::enableEnergyBalance(); - static constexpr int numPhases = ModelTraits::numPhases(); - static constexpr int numComponents = ModelTraits::numComponents(); + static constexpr int numPhases = ModelTraits::numFluidPhases(); + static constexpr int numComponents = ModelTraits::numFluidComponents(); }; /*! diff --git a/dumux/discretization/cellcentered/tpfa/fickslaw.hh b/dumux/discretization/cellcentered/tpfa/fickslaw.hh index c0f47995a946c58540d66431ac5d99cabee1d746..3c79c259f2211605de6cc0f5fe3b7acbf2c639a9 100644 --- a/dumux/discretization/cellcentered/tpfa/fickslaw.hh +++ b/dumux/discretization/cellcentered/tpfa/fickslaw.hh @@ -64,8 +64,8 @@ class FicksLawImplementation<TypeTag, DiscretizationMethod::cctpfa> static const int dim = GridView::dimension; static const int dimWorld = GridView::dimensionworld; - static const int numPhases = ModelTraits::numPhases(); - static const int numComponents = ModelTraits::numComponents(); + static const int numPhases = ModelTraits::numFluidPhases(); + static const int numComponents = ModelTraits::numFluidComponents(); using DimWorldMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>; using ComponentFluxVector = Dune::FieldVector<Scalar, numComponents>; diff --git a/dumux/discretization/cellcentered/tpfa/fluxvariablescachefiller.hh b/dumux/discretization/cellcentered/tpfa/fluxvariablescachefiller.hh index 0948f9b3a0a054459a609f1c4825d01ee15c3266..00531b00a8671f2a04658753cf6a394866dafd72 100644 --- a/dumux/discretization/cellcentered/tpfa/fluxvariablescachefiller.hh +++ b/dumux/discretization/cellcentered/tpfa/fluxvariablescachefiller.hh @@ -145,8 +145,8 @@ private: using DiffusionFiller = typename DiffusionType::Cache::Filler; using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; - static constexpr int numPhases = ModelTraits::numPhases(); - static constexpr int numComponents = ModelTraits::numComponents(); + static constexpr int numPhases = ModelTraits::numFluidPhases(); + static constexpr int numComponents = ModelTraits::numFluidComponents(); // forward to the filler of the diffusive quantities for (unsigned int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) diff --git a/dumux/discretization/cellcentered/tpfa/fourierslawnonequilibrium.hh b/dumux/discretization/cellcentered/tpfa/fourierslawnonequilibrium.hh index ba1958b1e13ebe4ed7eddb604d83096f4dcbf81b..5c25f2138a6220f73c8413ec3d70656b15be78a3 100644 --- a/dumux/discretization/cellcentered/tpfa/fourierslawnonequilibrium.hh +++ b/dumux/discretization/cellcentered/tpfa/fourierslawnonequilibrium.hh @@ -58,8 +58,8 @@ class FouriersLawNonEquilibriumImplementation<TypeTag, DiscretizationMethod::cct using ThermalConductivityModel = GetPropType<TypeTag, Properties::ThermalConductivityModel>; using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; - enum { numEnergyEqFluid = ModelTraits::numEnergyEqFluid() }; - enum { sPhaseIdx = ModelTraits::numPhases() }; + static constexpr auto numEnergyEqFluid = getPropValue<TypeTag, Properties::NumEnergyEqFluid>(); + static constexpr auto sPhaseIdx = ModelTraits::numFluidPhases(); public: //! state the discretization method this implementation belongs to @@ -114,7 +114,7 @@ public: if (phaseIdx != sPhaseIdx) { //when number of energyEq for the fluid are smaller than numPhases that means that we need an effecitve law - if (numEnergyEqFluid < ModelTraits::numPhases()) + if (numEnergyEqFluid < ModelTraits::numFluidPhases()) { insideLambda += ThermalConductivityModel::effectiveThermalConductivity(insideVolVars, problem.spatialParams(), element, fvGeometry, insideScv); } @@ -147,7 +147,7 @@ public: if (phaseIdx != sPhaseIdx) { //when number of energyEq for the fluid are smaller than numPhases that means that we need an effecitve law - if (numEnergyEqFluid < ModelTraits::numPhases()) + if (numEnergyEqFluid < ModelTraits::numFluidPhases()) { outsideLambda += ThermalConductivityModel::effectiveThermalConductivity(outsideVolVars, problem.spatialParams(), element, fvGeometry, outsideScv); } diff --git a/dumux/discretization/cellcentered/tpfa/maxwellstefanslaw.hh b/dumux/discretization/cellcentered/tpfa/maxwellstefanslaw.hh index 6c8f8e23f921abf76840ba215165d2224243a29a..6a0d3999110686d8e43522db96325f315fcc2be7 100644 --- a/dumux/discretization/cellcentered/tpfa/maxwellstefanslaw.hh +++ b/dumux/discretization/cellcentered/tpfa/maxwellstefanslaw.hh @@ -52,21 +52,18 @@ class MaxwellStefansLawImplementation<TypeTag, DiscretizationMethod::cctpfa > using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using GridView = GetPropType<TypeTag, Properties::GridView>; - using IndexType = typename GridView::IndexSet::IndexType; using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; using Element = typename GridView::template Codim<0>::Entity; using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; using FluxVariablesCache = GetPropType<TypeTag, Properties::FluxVariablesCache>; - using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; static const int dim = GridView::dimension; static const int dimWorld = GridView::dimensionworld; - static const int numPhases = GetPropType<TypeTag, Properties::ModelTraits>::numPhases(); - static const int numComponents = GetPropType<TypeTag, Properties::ModelTraits>::numComponents(); + static const int numPhases = GetPropType<TypeTag, Properties::ModelTraits>::numFluidPhases(); + static const int numComponents = GetPropType<TypeTag, Properties::ModelTraits>::numFluidComponents(); - using DimWorldMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>; using ComponentFluxVector = Dune::FieldVector<Scalar, numComponents>; using ReducedComponentVector = Dune::FieldVector<Scalar, numComponents-1>; using ReducedComponentMatrix = Dune::FieldMatrix<Scalar, numComponents-1, numComponents-1>; diff --git a/dumux/discretization/staggered/freeflow/fickslaw.hh b/dumux/discretization/staggered/freeflow/fickslaw.hh index b59ed496cfa2f9bf6fde78cc7aa8c12a453770e7..e2ac2065ba72795f69aa39615a6b9b4ae33814ea 100644 --- a/dumux/discretization/staggered/freeflow/fickslaw.hh +++ b/dumux/discretization/staggered/freeflow/fickslaw.hh @@ -58,10 +58,10 @@ class FicksLawImplementation<TypeTag, DiscretizationMethod::staggered > using Indices = typename ModelTraits::Indices; using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; - static constexpr int numComponents = ModelTraits::numComponents(); + static constexpr int numComponents = ModelTraits::numFluidComponents(); using NumEqVector = Dune::FieldVector<Scalar, numComponents>; - static_assert(ModelTraits::numPhases() == 1, "Only one phase supported!"); + static_assert(ModelTraits::numFluidPhases() == 1, "Only one phase supported!"); public: // state the discretization method this implementation belongs to diff --git a/dumux/discretization/staggered/freeflow/gridvolumevariables.hh b/dumux/discretization/staggered/freeflow/gridvolumevariables.hh index 83484dce356d2cfe8fb855f2f1d527a095333f86..54bd1c6dd9993ba6a6b5333588f715aa7e6e878b 100644 --- a/dumux/discretization/staggered/freeflow/gridvolumevariables.hh +++ b/dumux/discretization/staggered/freeflow/gridvolumevariables.hh @@ -112,8 +112,8 @@ struct StaggeredGridDefaultGridVolumeVariablesTraits } // make sure that a potential outflow condition is set for all components - std::array<bool, VolumeVariables::numComponents() - 1> isComponentOutflow; - for(int compIdx = 1; compIdx < VolumeVariables::numComponents(); ++compIdx) + std::array<bool, VolumeVariables::numFluidComponents() - 1> isComponentOutflow; + for(int compIdx = 1; compIdx < VolumeVariables::numFluidComponents(); ++compIdx) { const auto eqIdx = VolumeVariables::Indices::conti0EqIdx + compIdx; isComponentOutflow[compIdx -1] = bcTypes.isOutflow(eqIdx); diff --git a/dumux/discretization/staggered/freeflow/maxwellstefanslaw.hh b/dumux/discretization/staggered/freeflow/maxwellstefanslaw.hh index 0b90ca868285a8762e2fb0819ece82570a021aee..8aaa93ef7bf760865e669bb3b475030c7c958c5a 100644 --- a/dumux/discretization/staggered/freeflow/maxwellstefanslaw.hh +++ b/dumux/discretization/staggered/freeflow/maxwellstefanslaw.hh @@ -49,7 +49,6 @@ class MaxwellStefansLawImplementation<TypeTag, DiscretizationMethod::staggered > using Problem = GetPropType<TypeTag, Properties::Problem>; using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using FVElementGeometry = typename FVGridGeometry::LocalView; - using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using GridView = typename FVGridGeometry::GridView; using Element = typename GridView::template Codim<0>::Entity; @@ -59,22 +58,15 @@ class MaxwellStefansLawImplementation<TypeTag, DiscretizationMethod::staggered > using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; - static const int dim = GridView::dimension; - static const int dimWorld = GridView::dimensionworld; - using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; - static const int numComponents = ModelTraits::numComponents(); + static const int numComponents = ModelTraits::numFluidComponents(); static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); using ReducedComponentVector = Dune::FieldVector<Scalar, numComponents-1>; using ReducedComponentMatrix = Dune::FieldMatrix<Scalar, numComponents-1, numComponents-1>; - static_assert(ModelTraits::numPhases() == 1, "Only one phase allowed supported!"); - - enum { - conti0EqIdx = Indices::conti0EqIdx, - }; + static_assert(ModelTraits::numFluidPhases() == 1, "Only one phase allowed supported!"); public: // state the discretization method this implementation belongs to @@ -113,7 +105,7 @@ public: continue; // get equation index - const auto eqIdx = conti0EqIdx + compIdx; + const auto eqIdx = Indices::conti0EqIdx + compIdx; if(scvf.boundary()) { const auto bcTypes = problem.boundaryTypes(element, scvf); diff --git a/dumux/discretization/staggered/freeflow/velocityoutput.hh b/dumux/discretization/staggered/freeflow/velocityoutput.hh index 57ad84f92112e3782560c270296960f0fc88e91e..b2fff81e0a19c76124e54ceaf973e9fa2c5f3b5c 100644 --- a/dumux/discretization/staggered/freeflow/velocityoutput.hh +++ b/dumux/discretization/staggered/freeflow/velocityoutput.hh @@ -76,7 +76,7 @@ public: std::string phaseName(int phaseIdx) const override { return FluidSystem::phaseName(phaseIdx); } //! returns the number of phases - int numPhases() const override { return VolumeVariables::numPhases(); } + int numFluidPhases() const override { return VolumeVariables::numFluidPhases(); } //! Calculate the velocities for the scvs in the element //! We assume the local containers to be bound to the complete stencil diff --git a/dumux/freeflow/compositional/iofields.hh b/dumux/freeflow/compositional/iofields.hh index 2d2409d251954bd501152db5179829b96be32687..78210cc7608083b130fe75bb13926d5e7669a50e 100644 --- a/dumux/freeflow/compositional/iofields.hh +++ b/dumux/freeflow/compositional/iofields.hh @@ -78,7 +78,7 @@ struct FreeflowNCIOFields static std::string primaryVariableName(int pvIdx = 0, int state = 0) { // priVars: v_0, ..., v_dim-1, p, x_0, ..., x_numComp-1, otherPv ..., T - if (pvIdx > ModelTraits::dim() && pvIdx < ModelTraits::dim() + ModelTraits::numComponents()) + if (pvIdx > ModelTraits::dim() && pvIdx < ModelTraits::dim() + ModelTraits::numFluidComponents()) return ModelTraits::useMoles() ? IOName::moleFraction<FluidSystem>(0, pvIdx - ModelTraits::dim()) : IOName::massFraction<FluidSystem>(0, pvIdx - ModelTraits::dim()); else diff --git a/dumux/freeflow/compositional/kepsilonncmodel.hh b/dumux/freeflow/compositional/kepsilonncmodel.hh index 8aa3b0b7f6c6b3239c741b89556e4a4066833c9a..21e9af6dc3d68a2e7b9eb38c0dfe8ff69b9d7eae 100644 --- a/dumux/freeflow/compositional/kepsilonncmodel.hh +++ b/dumux/freeflow/compositional/kepsilonncmodel.hh @@ -99,10 +99,10 @@ private: using FST = GetPropType<TypeTag, Properties::FluidState>; using MT = GetPropType<TypeTag, Properties::ModelTraits>; - static_assert(FSY::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid system"); - static_assert(FST::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid state"); - static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); - static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); + static_assert(FSY::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid system"); + static_assert(FST::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid state"); + static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system"); + static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state"); using Traits = NavierStokesVolumeVariablesTraits<PV, FSY, FST, MT>; using NCVolVars = FreeflowNCVolumeVariables<Traits>; @@ -170,10 +170,10 @@ private: using FST = GetPropType<TypeTag, Properties::FluidState>; using MT = GetPropType<TypeTag, Properties::ModelTraits>; - static_assert(FSY::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid system"); - static_assert(FST::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid state"); - static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); - static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); + static_assert(FSY::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid system"); + static_assert(FST::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid state"); + static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system"); + static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state"); using Traits = NavierStokesVolumeVariablesTraits<PV, FSY, FST, MT>; using NCVolVars = FreeflowNCVolumeVariables<Traits>; diff --git a/dumux/freeflow/compositional/komegancmodel.hh b/dumux/freeflow/compositional/komegancmodel.hh index c5dd2b6fef73fa6022fac13ea2f5bdf0ba553c8e..46d3a398c45eda09a06087150f2224f2d7b1a786 100644 --- a/dumux/freeflow/compositional/komegancmodel.hh +++ b/dumux/freeflow/compositional/komegancmodel.hh @@ -104,10 +104,10 @@ private: using FST = GetPropType<TypeTag, Properties::FluidState>; using MT = GetPropType<TypeTag, Properties::ModelTraits>; - static_assert(FSY::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid system"); - static_assert(FST::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid state"); - static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); - static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); + static_assert(FSY::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid system"); + static_assert(FST::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid state"); + static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system"); + static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state"); using Traits = NavierStokesVolumeVariablesTraits<PV, FSY, FST, MT>; using NCVolVars = FreeflowNCVolumeVariables<Traits>; @@ -175,10 +175,10 @@ private: using FST = GetPropType<TypeTag, Properties::FluidState>; using MT = GetPropType<TypeTag, Properties::ModelTraits>; - static_assert(FSY::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid system"); - static_assert(FST::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid state"); - static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); - static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); + static_assert(FSY::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid system"); + static_assert(FST::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid state"); + static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system"); + static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state"); using Traits = NavierStokesVolumeVariablesTraits<PV, FSY, FST, MT>; using NCVolVars = FreeflowNCVolumeVariables<Traits>; diff --git a/dumux/freeflow/compositional/lowrekepsilonncmodel.hh b/dumux/freeflow/compositional/lowrekepsilonncmodel.hh index 2bb361528ff29b33c9ecdc4ca690194198e6e745..1cfd54b7f333dcbdc02cf953eaf8e34262af7803 100644 --- a/dumux/freeflow/compositional/lowrekepsilonncmodel.hh +++ b/dumux/freeflow/compositional/lowrekepsilonncmodel.hh @@ -104,10 +104,10 @@ private: using FST = GetPropType<TypeTag, Properties::FluidState>; using MT = GetPropType<TypeTag, Properties::ModelTraits>; - static_assert(FSY::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid system"); - static_assert(FST::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid state"); - static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); - static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); + static_assert(FSY::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid system"); + static_assert(FST::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid state"); + static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system"); + static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state"); using Traits = NavierStokesVolumeVariablesTraits<PV, FSY, FST, MT>; using NCVolVars = FreeflowNCVolumeVariables<Traits>; @@ -175,10 +175,10 @@ private: using FST = GetPropType<TypeTag, Properties::FluidState>; using MT = GetPropType<TypeTag, Properties::ModelTraits>; - static_assert(FSY::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid system"); - static_assert(FST::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid state"); - static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); - static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); + static_assert(FSY::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid system"); + static_assert(FST::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid state"); + static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system"); + static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state"); using Traits = NavierStokesVolumeVariablesTraits<PV, FSY, FST, MT>; using NCVolVars = FreeflowNCVolumeVariables<Traits>; diff --git a/dumux/freeflow/compositional/navierstokesncmodel.hh b/dumux/freeflow/compositional/navierstokesncmodel.hh index 7df4a068b2bd6503d72278c7ea28f4232af907af..f50f83b0ef3416274ca5cd158ce928fb975343c4 100644 --- a/dumux/freeflow/compositional/navierstokesncmodel.hh +++ b/dumux/freeflow/compositional/navierstokesncmodel.hh @@ -89,7 +89,7 @@ struct NavierStokesNCModelTraits : NavierStokesModelTraits<dimension> static constexpr int numEq() { return dimension+nComp; } //! The number of components - static constexpr int numComponents() { return nComp; } + static constexpr int numFluidComponents() { return nComp; } //! Use moles or not static constexpr bool useMoles() { return useM; } @@ -163,10 +163,10 @@ private: using FST = GetPropType<TypeTag, Properties::FluidState>; using MT = GetPropType<TypeTag, Properties::ModelTraits>; - static_assert(FSY::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid system"); - static_assert(FST::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid state"); - static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); - static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); + static_assert(FSY::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid system"); + static_assert(FST::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid state"); + static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system"); + static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state"); using Traits = NavierStokesVolumeVariablesTraits<PV, FSY, FST, MT>; public: diff --git a/dumux/freeflow/compositional/oneeqncmodel.hh b/dumux/freeflow/compositional/oneeqncmodel.hh index f77a56bc62a68ed4fc6d9da97a9efa0f8e0441a0..b8d7c2f37e3fda93e51b81305df4ce30de931143 100644 --- a/dumux/freeflow/compositional/oneeqncmodel.hh +++ b/dumux/freeflow/compositional/oneeqncmodel.hh @@ -104,10 +104,10 @@ private: using FST = GetPropType<TypeTag, Properties::FluidState>; using MT = GetPropType<TypeTag, Properties::ModelTraits>; - static_assert(FSY::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid system"); - static_assert(FST::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid state"); - static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); - static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); + static_assert(FSY::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid system"); + static_assert(FST::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid state"); + static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system"); + static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state"); using Traits = NavierStokesVolumeVariablesTraits<PV, FSY, FST, MT>; using NCVolVars = FreeflowNCVolumeVariables<Traits>; @@ -175,10 +175,10 @@ private: using FST = GetPropType<TypeTag, Properties::FluidState>; using MT = GetPropType<TypeTag, Properties::ModelTraits>; - static_assert(FSY::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid system"); - static_assert(FST::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid state"); - static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); - static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); + static_assert(FSY::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid system"); + static_assert(FST::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid state"); + static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system"); + static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state"); using Traits = NavierStokesVolumeVariablesTraits<PV, FSY, FST, MT>; using NCVolVars = FreeflowNCVolumeVariables<Traits>; diff --git a/dumux/freeflow/compositional/staggered/fluxvariables.hh b/dumux/freeflow/compositional/staggered/fluxvariables.hh index 7a42ee8d7aa4b2d92940eb931785868b6e9acab1..e63463b5490d3897e092f49ed9d7dce8b2b83206 100644 --- a/dumux/freeflow/compositional/staggered/fluxvariables.hh +++ b/dumux/freeflow/compositional/staggered/fluxvariables.hh @@ -56,7 +56,7 @@ class FreeflowNCFluxVariablesImpl<TypeTag, DiscretizationMethod::staggered> using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; public: - static constexpr auto numComponents = ModelTraits::numComponents(); + static constexpr auto numComponents = ModelTraits::numFluidComponents(); static constexpr bool useMoles = ModelTraits::useMoles(); using MolecularDiffusionType = GetPropType<TypeTag, Properties::MolecularDiffusionType>; diff --git a/dumux/freeflow/compositional/staggered/localresidual.hh b/dumux/freeflow/compositional/staggered/localresidual.hh index 7dae74bdace51371e91d7ff97234e4f672fadf36..5ac0fd66eb165ba50e83a1768f82738b94001c04 100644 --- a/dumux/freeflow/compositional/staggered/localresidual.hh +++ b/dumux/freeflow/compositional/staggered/localresidual.hh @@ -53,14 +53,9 @@ class FreeflowNCResidualImpl<TypeTag, DiscretizationMethod::staggered> using SubControlVolume = typename FVElementGeometry::SubControlVolume; using CellCenterPrimaryVariables = GetPropType<TypeTag, Properties::CellCenterPrimaryVariables>; using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; - using Indices = typename ModelTraits::Indices; - using CellCenterResidual = CellCenterPrimaryVariables; - - - static constexpr int numComponents =ModelTraits::numComponents(); + static constexpr int numComponents = ModelTraits::numFluidComponents(); static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); - static constexpr auto cellCenterOffset = ParentType::cellCenterOffset; using EnergyLocalResidual = typename ParentType::EnergyLocalResidual; diff --git a/dumux/freeflow/compositional/volumevariables.hh b/dumux/freeflow/compositional/volumevariables.hh index b9d9ac8690880ddc6ea755ea83a4a3dce7f1ba16..192b0936fbc7ab227fcd3ef302705d5179e6436c 100644 --- a/dumux/freeflow/compositional/volumevariables.hh +++ b/dumux/freeflow/compositional/volumevariables.hh @@ -75,9 +75,9 @@ public: typename FluidSystem::ParameterCache paramCache; paramCache.updateAll(fluidState_); - for (unsigned int compIIdx = 0; compIIdx < ParentType::numComponents(); ++compIIdx) + for (unsigned int compIIdx = 0; compIIdx < ParentType::numFluidComponents(); ++compIIdx) { - for (unsigned int compJIdx = 0; compJIdx < ParentType::numComponents(); ++compJIdx) + for (unsigned int compJIdx = 0; compJIdx < ParentType::numFluidComponents(); ++compJIdx) { // binary diffusion coefficients if(compIIdx != compJIdx) @@ -113,7 +113,7 @@ public: Scalar sumFracMinorComp = 0.0; - for(int compIdx = 1; compIdx < ParentType::numComponents(); ++compIdx) + for(int compIdx = 1; compIdx < ParentType::numFluidComponents(); ++compIdx) { // temporary add 1.0 to remove spurious differences in mole fractions // which are below the numerical accuracy @@ -278,7 +278,7 @@ public: protected: FluidState fluidState_; - std::array<std::array<Scalar, ParentType::numComponents()>, ParentType::numComponents()> diffCoefficient_ = {}; + std::array<std::array<Scalar, ParentType::numFluidComponents()>, ParentType::numFluidComponents()> diffCoefficient_ = {}; }; } // end namespace Dumux diff --git a/dumux/freeflow/compositional/zeroeqncmodel.hh b/dumux/freeflow/compositional/zeroeqncmodel.hh index 4907d98300b57ea0519a7ff3bf6db0c2643117ab..6ec22ef217bc13db052b4793ba274bae2f18a70e 100644 --- a/dumux/freeflow/compositional/zeroeqncmodel.hh +++ b/dumux/freeflow/compositional/zeroeqncmodel.hh @@ -92,10 +92,10 @@ private: using FST = GetPropType<TypeTag, Properties::FluidState>; using MT = GetPropType<TypeTag, Properties::ModelTraits>; - static_assert(FSY::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid system"); - static_assert(FST::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid state"); - static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); - static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); + static_assert(FSY::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid system"); + static_assert(FST::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid state"); + static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system"); + static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state"); using Traits = NavierStokesVolumeVariablesTraits<PV, FSY, FST, MT>; using CompositionalVolVars = FreeflowNCVolumeVariables<Traits>; @@ -143,10 +143,10 @@ private: using FST = GetPropType<TypeTag, Properties::FluidState>; using MT = GetPropType<TypeTag, Properties::ModelTraits>; - static_assert(FSY::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid system"); - static_assert(FST::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid state"); - static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); - static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); + static_assert(FSY::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid system"); + static_assert(FST::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid state"); + static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system"); + static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state"); using Traits = NavierStokesVolumeVariablesTraits<PV, FSY, FST, MT>; using NCVolVars = FreeflowNCVolumeVariables<Traits>; diff --git a/dumux/freeflow/navierstokes/model.hh b/dumux/freeflow/navierstokes/model.hh index 413b45c9adafb515989d238f85f84eb4b16fc8b9..58f3bdb4b8abc49c63961095103250dd4742a0c6 100644 --- a/dumux/freeflow/navierstokes/model.hh +++ b/dumux/freeflow/navierstokes/model.hh @@ -84,10 +84,10 @@ struct NavierStokesModelTraits static constexpr int numEq() { return dimension+1; } //! The number of phases is 1 - static constexpr int numPhases() { return 1; } + static constexpr int numFluidPhases() { return 1; } //! The number of components is 1 - static constexpr int numComponents() { return 1; } + static constexpr int numFluidComponents() { return 1; } //! Enable advection static constexpr bool enableAdvection() { return true; } @@ -191,8 +191,8 @@ private: using FST = GetPropType<TypeTag, Properties::FluidState>; using MT = GetPropType<TypeTag, Properties::ModelTraits>; - static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); - static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); + static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system"); + static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state"); static_assert(!FSY::isMiscible(), "The Navier-Stokes model only works with immiscible fluid systems."); using Traits = NavierStokesVolumeVariablesTraits<PV, FSY, FST, MT>; diff --git a/dumux/freeflow/navierstokes/staggered/fluxoversurface.hh b/dumux/freeflow/navierstokes/staggered/fluxoversurface.hh index dce407c072567d3d684bbf59fb7cf5edf8692985..3823ae7c5d4ed78bf94e2a944a9ca7f51729ce57 100644 --- a/dumux/freeflow/navierstokes/staggered/fluxoversurface.hh +++ b/dumux/freeflow/navierstokes/staggered/fluxoversurface.hh @@ -248,7 +248,7 @@ public: */ void calculateVolumeFluxes() { - const auto isCompositional = std::integral_constant<bool, (GetPropType<TypeTag, Properties::ModelTraits>::numComponents() > 1) >(); + const auto isCompositional = std::integral_constant<bool, (GetPropType<TypeTag, Properties::ModelTraits>::numFluidComponents() > 1) >(); calculateVolumeFluxesImpl_(isCompositional); } @@ -375,7 +375,7 @@ private: const auto avgDensity = 0.5*density(insideVolVars) + 0.5*density(outsideVolVars); constexpr auto replaceCompEqIdx = getPropValue<TypeTag, Properties::ReplaceCompEqIdx>(); - constexpr auto numComponents = GetPropType<TypeTag, Properties::ModelTraits>::numComponents(); + constexpr auto numComponents = GetPropType<TypeTag, Properties::ModelTraits>::numFluidComponents(); const Scalar cumulativeFlux = [replaceCompEqIdx, numComponents, &massOrMoleFlux]() { diff --git a/dumux/freeflow/navierstokes/staggered/localresidual.hh b/dumux/freeflow/navierstokes/staggered/localresidual.hh index fbcdebd518550474503827b4455bdc64d345f755..fe20d08b56e2b56eace14133145aa7d3c0efd582 100644 --- a/dumux/freeflow/navierstokes/staggered/localresidual.hh +++ b/dumux/freeflow/navierstokes/staggered/localresidual.hh @@ -80,10 +80,10 @@ class NavierStokesResidualImpl<TypeTag, DiscretizationMethod::staggered> using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; static constexpr bool enableEnergyBalance = ModelTraits::enableEnergyBalance(); - static constexpr bool isCompositional = ModelTraits::numComponents() > 1; + static constexpr bool isCompositional = ModelTraits::numFluidComponents() > 1; public: - using EnergyLocalResidual = FreeFlowEnergyLocalResidual<FVGridGeometry, FluxVariables, ModelTraits::enableEnergyBalance(), (ModelTraits::numComponents() > 1)>; + using EnergyLocalResidual = FreeFlowEnergyLocalResidual<FVGridGeometry, FluxVariables, ModelTraits::enableEnergyBalance(), (ModelTraits::numFluidComponents() > 1)>; // account for the offset of the cell center privars within the PrimaryVariables container static constexpr auto cellCenterOffset = ModelTraits::numEq() - CellCenterPrimaryVariables::dimension; diff --git a/dumux/freeflow/rans/oneeq/model.hh b/dumux/freeflow/rans/oneeq/model.hh index 7123351899dad45db58a1680905866ab6df421ac..1f346dc525cad62a7f57e0436a7f9baff2588b49 100644 --- a/dumux/freeflow/rans/oneeq/model.hh +++ b/dumux/freeflow/rans/oneeq/model.hh @@ -109,10 +109,10 @@ struct OneEqModelTraits : RANSModelTraits<dimension> static constexpr int numEq() { return dim()+1+1; } //! The number of components - static constexpr int numComponents() { return 1; } + static constexpr int numFluidComponents() { return 1; } //! the indices - using Indices = OneEqIndices<dim(), numComponents()>; + using Indices = OneEqIndices<dim(), numFluidComponents()>; }; /////////////////////////////////////////////////////////////////////////// @@ -166,8 +166,8 @@ private: using FST = GetPropType<TypeTag, Properties::FluidState>; using MT = GetPropType<TypeTag, Properties::ModelTraits>; - static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); - static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); + static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system"); + static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state"); static_assert(!FSY::isMiscible(), "The Navier-Stokes model only works with immiscible fluid systems."); using Traits = NavierStokesVolumeVariablesTraits<PV, FSY, FST, MT>; @@ -212,8 +212,8 @@ private: using FST = GetPropType<TypeTag, Properties::FluidState>; using MT = GetPropType<TypeTag, Properties::ModelTraits>; - static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); - static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); + static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system"); + static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state"); static_assert(!FSY::isMiscible(), "The Navier-Stokes model only works with immiscible fluid systems."); using Traits = NavierStokesVolumeVariablesTraits<PV, FSY, FST, MT>; diff --git a/dumux/freeflow/rans/twoeq/kepsilon/iofields.hh b/dumux/freeflow/rans/twoeq/kepsilon/iofields.hh index 59b31fc03b7b895917caaa304f4e1fc19ddf6a4b..7dbd0e59a538af50ccb0c5e87733bc079342e367 100644 --- a/dumux/freeflow/rans/twoeq/kepsilon/iofields.hh +++ b/dumux/freeflow/rans/twoeq/kepsilon/iofields.hh @@ -62,9 +62,9 @@ struct KEpsilonIOFields static std::string primaryVariableName(int pvIdx = 0, int state = 0) { std::cout << "kepsi called with " << pvIdx << std::endl; - if (pvIdx < ModelTraits::dim() + ModelTraits::numComponents()) + if (pvIdx < ModelTraits::dim() + ModelTraits::numFluidComponents()) return RANSIOFields::template primaryVariableName<ModelTraits, FluidSystem>(pvIdx, state); - else if (pvIdx == ModelTraits::dim() + ModelTraits::numComponents()) + else if (pvIdx == ModelTraits::dim() + ModelTraits::numFluidComponents()) return "k"; else return "epsilon"; diff --git a/dumux/freeflow/rans/twoeq/kepsilon/model.hh b/dumux/freeflow/rans/twoeq/kepsilon/model.hh index b816cd8612faf9ff3cb1dd6ab54021d7cae835af..bd5607a57beb10b45ba52cbc5f9edbb8b172c4cb 100644 --- a/dumux/freeflow/rans/twoeq/kepsilon/model.hh +++ b/dumux/freeflow/rans/twoeq/kepsilon/model.hh @@ -95,10 +95,10 @@ struct KEpsilonModelTraits : RANSModelTraits<dimension> static constexpr int numEq() { return dim()+1+2; } //! The number of components - static constexpr int numComponents() { return 1; } + static constexpr int numFluidComponents() { return 1; } //! the indices - using Indices = KEpsilonIndices<dim(), numComponents()>; + using Indices = KEpsilonIndices<dim(), numFluidComponents()>; }; /////////////////////////////////////////////////////////////////////////// @@ -152,8 +152,8 @@ private: using FST = GetPropType<TypeTag, Properties::FluidState>; using MT = GetPropType<TypeTag, Properties::ModelTraits>; - static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); - static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); + static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system"); + static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state"); static_assert(!FSY::isMiscible(), "The Navier-Stokes model only works with immiscible fluid systems."); using Traits = NavierStokesVolumeVariablesTraits<PV, FSY, FST, MT>; @@ -198,8 +198,8 @@ private: using FST = GetPropType<TypeTag, Properties::FluidState>; using MT = GetPropType<TypeTag, Properties::ModelTraits>; - static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); - static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); + static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system"); + static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state"); static_assert(!FSY::isMiscible(), "The Navier-Stokes model only works with immiscible fluid systems."); using Traits = NavierStokesVolumeVariablesTraits<PV, FSY, FST, MT>; diff --git a/dumux/freeflow/rans/twoeq/kepsilon/problem.hh b/dumux/freeflow/rans/twoeq/kepsilon/problem.hh index 81490d87d6fb7b299e4d03e74e3f162eb9ba7f1d..9ace1f88c6a770804ff01dff2aba8d6f9c2a905b 100644 --- a/dumux/freeflow/rans/twoeq/kepsilon/problem.hh +++ b/dumux/freeflow/rans/twoeq/kepsilon/problem.hh @@ -73,7 +73,7 @@ class KEpsilonProblem : public RANSProblem<TypeTag> using Indices = typename ModelTraits::Indices; static constexpr bool enableEnergyBalance = ModelTraits::enableEnergyBalance(); - static constexpr bool isCompositional = ModelTraits::numComponents() > 1; + static constexpr bool isCompositional = ModelTraits::numFluidComponents() > 1; // account for the offset of the cell center privars within the PrimaryVariables container static constexpr auto cellCenterOffset = ModelTraits::numEq() - CellCenterPrimaryVariables::dimension; @@ -384,7 +384,7 @@ public: unsigned int elementIdx = asImp_().fvGridGeometry().elementMapper().index(element); // component mass fluxes - for (int compIdx = 0; compIdx < ModelTraits::numComponents(); ++compIdx) + for (int compIdx = 0; compIdx < ModelTraits::numFluidComponents(); ++compIdx) { if (ModelTraits::replaceCompEqIdx() == compIdx) continue; @@ -404,7 +404,7 @@ public: + pFunction(schmidtNumber, asImp_().turbulentSchmidtNumber())); } - if (ModelTraits::replaceCompEqIdx() < ModelTraits::numComponents()) + if (ModelTraits::replaceCompEqIdx() < ModelTraits::numFluidComponents()) { wallFunctionFlux[ModelTraits::replaceCompEqIdx()] = -std::accumulate(wallFunctionFlux.begin(), wallFunctionFlux.end(), 0.0); diff --git a/dumux/freeflow/rans/twoeq/komega/iofields.hh b/dumux/freeflow/rans/twoeq/komega/iofields.hh index 8f0a7fff434109211d05eb5c16613cc764075e02..9f18c3c8263abc790efa5e80f5bc004d9ffa17d2 100644 --- a/dumux/freeflow/rans/twoeq/komega/iofields.hh +++ b/dumux/freeflow/rans/twoeq/komega/iofields.hh @@ -57,9 +57,9 @@ struct KOmegaIOFields template <class ModelTraits, class FluidSystem> static std::string primaryVariableName(int pvIdx = 0, int state = 0) { - if (pvIdx < ModelTraits::dim() + ModelTraits::numComponents()) + if (pvIdx < ModelTraits::dim() + ModelTraits::numFluidComponents()) return RANSIOFields::template primaryVariableName<ModelTraits, FluidSystem>(pvIdx, state); - else if (pvIdx == ModelTraits::dim() + ModelTraits::numComponents()) + else if (pvIdx == ModelTraits::dim() + ModelTraits::numFluidComponents()) return "k"; else return "omega"; diff --git a/dumux/freeflow/rans/twoeq/komega/model.hh b/dumux/freeflow/rans/twoeq/komega/model.hh index 0c6fe8dc3da5b6a7d88b4492b148a671b667ff89..36c63736d659a202fa4b401a53492e32e9473e2c 100644 --- a/dumux/freeflow/rans/twoeq/komega/model.hh +++ b/dumux/freeflow/rans/twoeq/komega/model.hh @@ -102,10 +102,10 @@ struct KOmegaModelTraits : RANSModelTraits<dimension> static constexpr int numEq() { return dim()+1+2; } //! The number of components - static constexpr int numComponents() { return 1; } + static constexpr int numFluidComponents() { return 1; } //! The indices - using Indices = KOmegaIndices<dim(), numComponents()>; + using Indices = KOmegaIndices<dim(), numFluidComponents()>; }; /////////////////////////////////////////////////////////////////////////// @@ -159,8 +159,8 @@ private: using FST = GetPropType<TypeTag, Properties::FluidState>; using MT = GetPropType<TypeTag, Properties::ModelTraits>; - static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); - static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); + static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system"); + static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state"); static_assert(!FSY::isMiscible(), "The Navier-Stokes model only works with immiscible fluid systems."); using Traits = NavierStokesVolumeVariablesTraits<PV, FSY, FST, MT>; @@ -206,8 +206,8 @@ private: using FST = GetPropType<TypeTag, Properties::FluidState>; using MT = GetPropType<TypeTag, Properties::ModelTraits>; - static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); - static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); + static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system"); + static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state"); static_assert(!FSY::isMiscible(), "The Navier-Stokes model only works with immiscible fluid systems."); using Traits = NavierStokesVolumeVariablesTraits<PV, FSY, FST, MT>; diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/iofields.hh b/dumux/freeflow/rans/twoeq/lowrekepsilon/iofields.hh index 3c66ddb0b92ae8fee7c7f99cb079d8efd6a8f649..da45cfe6fa7ca54c71dc0d49eec39742735e4f71 100644 --- a/dumux/freeflow/rans/twoeq/lowrekepsilon/iofields.hh +++ b/dumux/freeflow/rans/twoeq/lowrekepsilon/iofields.hh @@ -56,9 +56,9 @@ struct LowReKEpsilonIOFields template <class ModelTraits, class FluidSystem> static std::string primaryVariableName(int pvIdx = 0, int state = 0) { - if (pvIdx < ModelTraits::dim() + ModelTraits::numComponents()) + if (pvIdx < ModelTraits::dim() + ModelTraits::numFluidComponents()) return RANSIOFields::template primaryVariableName<ModelTraits, FluidSystem>(pvIdx, state); - else if (pvIdx == ModelTraits::dim() + ModelTraits::numComponents()) + else if (pvIdx == ModelTraits::dim() + ModelTraits::numFluidComponents()) return "k"; else return "epsilon"; diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/model.hh b/dumux/freeflow/rans/twoeq/lowrekepsilon/model.hh index 112137882328a802f028dcb0a6783c9e953e0e6e..ef3262a9ba934d43d007019c419c2bd62caa8049 100644 --- a/dumux/freeflow/rans/twoeq/lowrekepsilon/model.hh +++ b/dumux/freeflow/rans/twoeq/lowrekepsilon/model.hh @@ -111,10 +111,10 @@ struct LowReKEpsilonModelTraits : RANSModelTraits<dimension> static constexpr int numEq() { return dim()+1+2; } //! The number of components - static constexpr int numComponents() { return 1; } + static constexpr int numFluidComponents() { return 1; } //! the indices - using Indices = LowReKEpsilonIndices<dim(), numComponents()>; + using Indices = LowReKEpsilonIndices<dim(), numFluidComponents()>; }; /////////////////////////////////////////////////////////////////////////// @@ -168,8 +168,8 @@ private: using FST = GetPropType<TypeTag, Properties::FluidState>; using MT = GetPropType<TypeTag, Properties::ModelTraits>; - static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); - static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); + static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system"); + static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state"); static_assert(!FSY::isMiscible(), "The Navier-Stokes model only works with immiscible fluid systems."); using Traits = NavierStokesVolumeVariablesTraits<PV, FSY, FST, MT>; @@ -214,8 +214,8 @@ private: using FST = GetPropType<TypeTag, Properties::FluidState>; using MT = GetPropType<TypeTag, Properties::ModelTraits>; - static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); - static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); + static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system"); + static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state"); static_assert(!FSY::isMiscible(), "The Navier-Stokes model only works with immiscible fluid systems."); using Traits = NavierStokesVolumeVariablesTraits<PV, FSY, FST, MT>; diff --git a/dumux/freeflow/rans/zeroeq/model.hh b/dumux/freeflow/rans/zeroeq/model.hh index af6e6a816058674cf3978d94ebceab92ce63fe23..9cf068ea5658d4ef71ff474673060fcdf5749063 100644 --- a/dumux/freeflow/rans/zeroeq/model.hh +++ b/dumux/freeflow/rans/zeroeq/model.hh @@ -66,8 +66,8 @@ private: using FST = GetPropType<TypeTag, Properties::FluidState>; using MT = GetPropType<TypeTag, Properties::ModelTraits>; - static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); - static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); + static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system"); + static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state"); static_assert(!FSY::isMiscible(), "The Navier-Stokes model only works with immiscible fluid systems."); using Traits = NavierStokesVolumeVariablesTraits<PV, FSY, FST, MT>; @@ -96,8 +96,8 @@ private: using FST = GetPropType<TypeTag, Properties::FluidState>; using MT = GetPropType<TypeTag, Properties::ModelTraits>; - static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); - static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); + static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system"); + static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state"); static_assert(!FSY::isMiscible(), "The Navier-Stokes model only works with immiscible fluid systems."); using Traits = NavierStokesVolumeVariablesTraits<PV, FSY, FST, MT>; diff --git a/dumux/freeflow/volumevariables.hh b/dumux/freeflow/volumevariables.hh index e60b4a697c7a115a7da152dec2b94c60113e4432..a57032fb26cb0d62678a359ea6f3282d55ade784 100644 --- a/dumux/freeflow/volumevariables.hh +++ b/dumux/freeflow/volumevariables.hh @@ -57,9 +57,9 @@ public: using Indices = typename Traits::ModelTraits::Indices; //! return number of phases considered by the model - static constexpr int numPhases() { return Traits::ModelTraits::numPhases(); } + static constexpr int numFluidPhases() { return Traits::ModelTraits::numFluidPhases(); } //! return number of components considered by the model - static constexpr int numComponents() { return Traits::ModelTraits::numComponents(); } + static constexpr int numFluidComponents() { return Traits::ModelTraits::numFluidComponents(); } /*! diff --git a/dumux/io/loadsolution.hh b/dumux/io/loadsolution.hh index 1403eb1d0a5f5478548c3c8e16e39c9fdaf06d68..50b116420149704ab70b9eb1f90b6d4e86a79c43 100644 --- a/dumux/io/loadsolution.hh +++ b/dumux/io/loadsolution.hh @@ -230,7 +230,7 @@ auto createPVNameFunction(const std::string& paramGroup = "") { return [paramGroup](int pvIdx, int state = 0) { - static auto numStates = (1 << ModelTraits::numPhases()) - 1; + static auto numStates = (1 << ModelTraits::numFluidPhases()) - 1; const auto paramNameWithState = "LoadSolution.PriVarNamesState" + std::to_string(state); if (hasParamInGroup(paramGroup, "LoadSolution.PriVarNames") && !hasParamInGroup(paramGroup, paramNameWithState)) diff --git a/dumux/io/velocityoutput.hh b/dumux/io/velocityoutput.hh index 7aec5fdc0874cd2df4a29d2348d31b8c6e16d2c9..e1d9967d5eecca2dc86c370507fae5c4a85af9bd 100644 --- a/dumux/io/velocityoutput.hh +++ b/dumux/io/velocityoutput.hh @@ -62,7 +62,7 @@ public: virtual std::string phaseName(int phaseIdx) const { return "none"; } //! returns the number of phases - virtual int numPhases() const { return 0; } + virtual int numFluidPhases() const { return 0; } //! Calculate the velocities for the scvs in the element //! We assume the local containers to be bound to the complete stencil diff --git a/dumux/io/vtkoutputmodule.hh b/dumux/io/vtkoutputmodule.hh index 94b74580ba50584e18ddcdb92d63857292c0d8ff..ead2acb4daffdbbd35b740bbcfa2fb76e65afba3 100644 --- a/dumux/io/vtkoutputmodule.hh +++ b/dumux/io/vtkoutputmodule.hh @@ -260,7 +260,7 @@ private: // instantiate the velocity output using VelocityVector = typename VelocityOutput::VelocityVector; - std::vector<VelocityVector> velocity(velocityOutput_->numPhases()); + std::vector<VelocityVector> velocity(velocityOutput_->numFluidPhases()); // process rank static bool addProcessRank = getParamFromGroup<bool>(paramGroup_, "Vtk.AddProcessRank"); @@ -288,7 +288,7 @@ private: if (velocityOutput_->enableOutput()) { - for (int phaseIdx = 0; phaseIdx < velocityOutput_->numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < velocityOutput_->numFluidPhases(); ++phaseIdx) { if(isBox && dim == 1) velocity[phaseIdx].resize(numCells); @@ -340,7 +340,7 @@ private: // velocity output if (velocityOutput_->enableOutput()) - for (int phaseIdx = 0; phaseIdx < velocityOutput_->numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < velocityOutput_->numFluidPhases(); ++phaseIdx) velocityOutput_->calculateVelocity(velocity[phaseIdx], elemVolVars, fvGeometry, element, phaseIdx); //! the rank @@ -377,7 +377,7 @@ private: { if (isBox && dim > 1) { - for (int phaseIdx = 0; phaseIdx < velocityOutput_->numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < velocityOutput_->numFluidPhases(); ++phaseIdx) sequenceWriter_.addVertexData( Field(fvGridGeometry().gridView(), fvGridGeometry().vertexMapper(), velocity[phaseIdx], "velocity_" + velocityOutput_->phaseName(phaseIdx) + " (m/s)", /*numComp*/dimWorld, /*codim*/dim).get() ); @@ -385,7 +385,7 @@ private: // cell-centered models else { - for (int phaseIdx = 0; phaseIdx < velocityOutput_->numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < velocityOutput_->numFluidPhases(); ++phaseIdx) sequenceWriter_.addCellData( Field(fvGridGeometry().gridView(), fvGridGeometry().elementMapper(), velocity[phaseIdx], "velocity_" + velocityOutput_->phaseName(phaseIdx) + " (m/s)", /*numComp*/dimWorld, /*codim*/0).get() ); @@ -437,7 +437,7 @@ private: << " There will be no velocity output." << " Use the addVelocityOutput member function of the VTK output module." << std::endl; using VelocityVector = typename VelocityOutput::VelocityVector; - std::vector<VelocityVector> velocity(velocityOutput_->numPhases()); + std::vector<VelocityVector> velocity(velocityOutput_->numFluidPhases()); // process rank static bool addProcessRank = getParamFromGroup<bool>(paramGroup_, "Vtk.AddProcessRank"); @@ -467,7 +467,7 @@ private: if (velocityOutput_->enableOutput()) { - for (int phaseIdx = 0; phaseIdx < velocityOutput_->numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < velocityOutput_->numFluidPhases(); ++phaseIdx) { if(isBox && dim == 1) velocity[phaseIdx].resize(numCells); @@ -525,7 +525,7 @@ private: // velocity output if (velocityOutput_->enableOutput()) - for (int phaseIdx = 0; phaseIdx < velocityOutput_->numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < velocityOutput_->numFluidPhases(); ++phaseIdx) velocityOutput_->calculateVelocity(velocity[phaseIdx], elemVolVars, fvGeometry, element, phaseIdx); //! the rank @@ -551,14 +551,14 @@ private: { // node-wise velocities if (dim > 1) - for (int phaseIdx = 0; phaseIdx < velocityOutput_->numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < velocityOutput_->numFluidPhases(); ++phaseIdx) sequenceWriter_.addVertexData( Field(fvGridGeometry().gridView(), fvGridGeometry().vertexMapper(), velocity[phaseIdx], "velocity_" + velocityOutput_->phaseName(phaseIdx) + " (m/s)", /*numComp*/dimWorld, /*codim*/dim).get() ); // cell-wise velocities else - for (int phaseIdx = 0; phaseIdx < velocityOutput_->numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < velocityOutput_->numFluidPhases(); ++phaseIdx) sequenceWriter_.addCellData( Field(fvGridGeometry().gridView(), fvGridGeometry().elementMapper(), velocity[phaseIdx], "velocity_" + velocityOutput_->phaseName(phaseIdx) + " (m/s)", /*numComp*/dimWorld, /*codim*/0).get() ); diff --git a/dumux/material/fluidmatrixinteractions/mineralization/effectivesoliddensity.hh b/dumux/material/fluidmatrixinteractions/mineralization/effectivesoliddensity.hh index 17b80fefc2c86998f689e0666e1274b95ebfe20e..2def4d216c366e1c67f36bcbee4b5c49d9fd2259 100644 --- a/dumux/material/fluidmatrixinteractions/mineralization/effectivesoliddensity.hh +++ b/dumux/material/fluidmatrixinteractions/mineralization/effectivesoliddensity.hh @@ -46,10 +46,8 @@ class DUNE_DEPRECATED_MSG("Implement SolidSystems instead!") EffectiveSolidDensi using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; - static const int dim = GridView::dimension; - static const int dimWorld = GridView::dimensionworld; - static const int numComponents = GetPropType<TypeTag, Properties::ModelTraits>::numComponents(); - static const int numSolidPhases = GetPropType<TypeTag, Properties::ModelTraits>::numSPhases(); + static const int numComponents = GetPropType<TypeTag, Properties::ModelTraits>::numFluidComponents(); + static const int numSolidPhases = GetPropType<TypeTag, Properties::ModelTraits>::numSolidPhases(); using Element = typename GridView::template Codim<0>:: Entity; diff --git a/dumux/material/fluidmatrixinteractions/mineralization/effectivesolidheatcapacity.hh b/dumux/material/fluidmatrixinteractions/mineralization/effectivesolidheatcapacity.hh index 1678208ecd50e06a98d6eaa36a2ede45a0be8847..921f15d8a2b03e22cdea70968c991d48745db2bf 100644 --- a/dumux/material/fluidmatrixinteractions/mineralization/effectivesolidheatcapacity.hh +++ b/dumux/material/fluidmatrixinteractions/mineralization/effectivesolidheatcapacity.hh @@ -45,10 +45,8 @@ class DUNE_DEPRECATED_MSG("Implement SolidSystems instead!") EffectiveSolidHeatC using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; - static const int dim = GridView::dimension; - static const int dimWorld = GridView::dimensionworld; - static const int numComponents = GetPropType<TypeTag, Properties::ModelTraits>::numComponents(); - static const int numSolidPhases = GetPropType<TypeTag, Properties::ModelTraits>::numSPhases(); + static const int numComponents = GetPropType<TypeTag, Properties::ModelTraits>::numFluidComponents(); + static const int numSolidPhases = GetPropType<TypeTag, Properties::ModelTraits>::numSolidPhases(); using Element = typename GridView::template Codim<0>:: Entity; diff --git a/dumux/multidomain/boundary/stokesdarcy/couplingdata.hh b/dumux/multidomain/boundary/stokesdarcy/couplingdata.hh index dd03b033768d25990ae3fd84ab6b233ccfc004a1..abbd744eab26a16cb7dfbf3a9fa8bb1fba31ef2c 100644 --- a/dumux/multidomain/boundary/stokesdarcy/couplingdata.hh +++ b/dumux/multidomain/boundary/stokesdarcy/couplingdata.hh @@ -218,7 +218,7 @@ class StokesDarcyCouplingDataImplementation; template<class MDTraits, class CouplingManager> using StokesDarcyCouplingData = StokesDarcyCouplingDataImplementation<MDTraits, CouplingManager, GetPropType<typename MDTraits::template SubDomain<0>::TypeTag, Properties::ModelTraits>::enableEnergyBalance(), - (GetPropType<typename MDTraits::template SubDomain<0>::TypeTag, Properties::ModelTraits>::numComponents() > 1)>; + (GetPropType<typename MDTraits::template SubDomain<0>::TypeTag, Properties::ModelTraits>::numFluidComponents() > 1)>; /*! * \ingroup MultiDomain @@ -247,7 +247,7 @@ class StokesDarcyCouplingDataImplementationBase static constexpr auto stokesIdx = CouplingManager::stokesIdx; static constexpr auto darcyIdx = CouplingManager::darcyIdx; - static constexpr bool adapterUsed = ModelTraits<darcyIdx>::numPhases() > 1; + static constexpr bool adapterUsed = ModelTraits<darcyIdx>::numFluidPhases() > 1; using IndexHelper = Dumux::IndexHelper<stokesIdx, darcyIdx, FluidSystem<stokesIdx>, adapterUsed>; static constexpr int enableEnergyBalance = GetPropType<SubDomainTypeTag<stokesIdx>, Properties::ModelTraits>::enableEnergyBalance(); @@ -306,7 +306,7 @@ public: const ElementFaceVariables& stokesElemFaceVars, const SubControlVolumeFace<stokesIdx>& scvf) const { - static constexpr auto numPhasesDarcy = GetPropType<SubDomainTypeTag<darcyIdx>, Properties::ModelTraits>::numPhases(); + static constexpr auto numPhasesDarcy = GetPropType<SubDomainTypeTag<darcyIdx>, Properties::ModelTraits>::numFluidPhases(); Scalar momentumFlux(0.0); const auto& stokesContext = couplingManager_.stokesCouplingContext(element, scvf); @@ -488,7 +488,7 @@ class StokesDarcyCouplingDataImplementation<MDTraits, CouplingManager, enableEne template<std::size_t id> using ElementFaceVariables = typename GetPropType<SubDomainTypeTag<id>, Properties::GridFaceVariables>::LocalView; template<std::size_t id> using VolumeVariables = typename GetPropType<SubDomainTypeTag<id>, Properties::GridVolumeVariables>::VolumeVariables; - static_assert(GetPropType<SubDomainTypeTag<darcyIdx>, Properties::ModelTraits>::numComponents() == GetPropType<SubDomainTypeTag<darcyIdx>, Properties::ModelTraits>::numPhases(), + static_assert(GetPropType<SubDomainTypeTag<darcyIdx>, Properties::ModelTraits>::numFluidComponents() == GetPropType<SubDomainTypeTag<darcyIdx>, Properties::ModelTraits>::numFluidPhases(), "Darcy Model must not be compositional"); using DiffusionCoefficientAveragingType = typename StokesDarcyCouplingOptions::DiffusionCoefficientAveragingType; @@ -653,11 +653,11 @@ class StokesDarcyCouplingDataImplementation<MDTraits, CouplingManager, enableEne template<std::size_t id> using VolumeVariables = typename GetPropType<SubDomainTypeTag<id>, Properties::GridVolumeVariables>::VolumeVariables; template<std::size_t id> using FluidSystem = GetPropType<SubDomainTypeTag<id>, Properties::FluidSystem>; - static constexpr auto numComponents = GetPropType<SubDomainTypeTag<stokesIdx>, Properties::ModelTraits>::numComponents(); + static constexpr auto numComponents = GetPropType<SubDomainTypeTag<stokesIdx>, Properties::ModelTraits>::numFluidComponents(); static constexpr auto replaceCompEqIdx = GetPropType<SubDomainTypeTag<stokesIdx>, Properties::ModelTraits>::replaceCompEqIdx(); static constexpr bool useMoles = GetPropType<SubDomainTypeTag<stokesIdx>, Properties::ModelTraits>::useMoles(); - static_assert(GetPropType<SubDomainTypeTag<darcyIdx>, Properties::ModelTraits>::numComponents() == numComponents, "Submodels must use same number of components"); + static_assert(GetPropType<SubDomainTypeTag<darcyIdx>, Properties::ModelTraits>::numFluidComponents() == numComponents, "Submodels must use same number of components"); static_assert(getPropValue<SubDomainTypeTag<darcyIdx>, Properties::UseMoles>() == useMoles, "Both models must either use moles or not"); static_assert(getPropValue<SubDomainTypeTag<darcyIdx>, Properties::ReplaceCompEqIdx>() == replaceCompEqIdx, "Both models must use the same replaceCompEqIdx"); using NumEqVector = Dune::FieldVector<Scalar, numComponents>; diff --git a/dumux/multidomain/boundary/stokesdarcy/couplingmanager.hh b/dumux/multidomain/boundary/stokesdarcy/couplingmanager.hh index 16ed0624c1b041d26cdceb27ceb4a7069e111de1..54433e6bef96c8de03d6bfe5f5a7dd3b23b1b8ed 100644 --- a/dumux/multidomain/boundary/stokesdarcy/couplingmanager.hh +++ b/dumux/multidomain/boundary/stokesdarcy/couplingmanager.hh @@ -77,7 +77,7 @@ private: template<std::size_t id> using SubDomainTypeTag = typename MDTraits::template SubDomain<id>::TypeTag; - static constexpr bool isCompositional = GetPropType<SubDomainTypeTag<0>, Properties::ModelTraits>::numComponents() > 1; + static constexpr bool isCompositional = GetPropType<SubDomainTypeTag<0>, Properties::ModelTraits>::numFluidComponents()> 1; template<std::size_t id> using GridView = GetPropType<SubDomainTypeTag<id>, Properties::GridView>; template<std::size_t id> using Problem = GetPropType<SubDomainTypeTag<id>, Properties::Problem>; diff --git a/dumux/porousmediumflow/1p/model.hh b/dumux/porousmediumflow/1p/model.hh index c4550e6c729f6173a9fdd1ead78159df1a4bf4b3..3ec917cce172a2a13e7b5c291bf7728ef2e5b221 100644 --- a/dumux/porousmediumflow/1p/model.hh +++ b/dumux/porousmediumflow/1p/model.hh @@ -68,8 +68,8 @@ struct OnePModelTraits using Indices = OnePIndices<>; static constexpr int numEq() { return 1; } - static constexpr int numPhases() { return 1; } - static constexpr int numComponents() { return 1; } + static constexpr int numFluidPhases() { return 1; } + static constexpr int numFluidComponents() { return 1; } static constexpr bool enableAdvection() { return true; } static constexpr bool enableMolecularDiffusion() { return false; } diff --git a/dumux/porousmediumflow/1p/volumevariables.hh b/dumux/porousmediumflow/1p/volumevariables.hh index 948ba8cf1827cf8c115961bf1b460b579a308c1c..a780db473041327a7eb27b92c825f13ed07db3cb 100644 --- a/dumux/porousmediumflow/1p/volumevariables.hh +++ b/dumux/porousmediumflow/1p/volumevariables.hh @@ -50,7 +50,7 @@ class OnePVolumeVariables using Scalar = typename Traits::PrimaryVariables::value_type; using Indices = typename Traits::ModelTraits::Indices; using PermeabilityType = typename Traits::PermeabilityType; - static constexpr int numFluidComps = ParentType::numComponents(); + static constexpr int numFluidComps = ParentType::numFluidComponents(); public: //! export the underlying fluid system using FluidSystem = typename Traits::FluidSystem; diff --git a/dumux/porousmediumflow/1pnc/iofields.hh b/dumux/porousmediumflow/1pnc/iofields.hh index f442e41044e838ee89ae43a696e3740bbce30cb3..75e74ad1c6add25f956c1482de8ac090c7ee7bd4 100644 --- a/dumux/porousmediumflow/1pnc/iofields.hh +++ b/dumux/porousmediumflow/1pnc/iofields.hh @@ -52,11 +52,11 @@ public: out.addVolumeVariable([](const auto& volVars){ return volVars.pressure(0) - 1e5; }, "delp"); - for (int i = 0; i < VolumeVariables::numComponents(); ++i) + for (int i = 0; i < VolumeVariables::numFluidComponents(); ++i) out.addVolumeVariable([i](const auto& volVars){ return volVars.moleFraction(0, i); }, IOName::moleFraction<FluidSystem>(0, i)); - for (int i = 0; i < VolumeVariables::numComponents(); ++i) + for (int i = 0; i < VolumeVariables::numFluidComponents(); ++i) out.addVolumeVariable([i](const auto& volVars){ return volVars.massFraction(0, i); }, IOName::massFraction<FluidSystem>(0, i)); } diff --git a/dumux/porousmediumflow/1pnc/model.hh b/dumux/porousmediumflow/1pnc/model.hh index 0e0a5df02e8df2103a7a20b329a9833a2876094b..88f8d3715864e6aebe302849537582d5053b5791 100644 --- a/dumux/porousmediumflow/1pnc/model.hh +++ b/dumux/porousmediumflow/1pnc/model.hh @@ -91,8 +91,8 @@ struct OnePNCModelTraits using Indices = OnePNCIndices; static constexpr int numEq() { return nComp; } - static constexpr int numPhases() { return 1; } - static constexpr int numComponents() { return nComp; } + static constexpr int numFluidPhases() { return 1; } + static constexpr int numFluidComponents() { return nComp; } static constexpr int replaceCompEqIdx() { return repCompEqIdx; } static constexpr bool useMoles() { return useM; } @@ -198,10 +198,10 @@ private: using SST = GetPropType<TypeTag, Properties::SolidState>; using MT = GetPropType<TypeTag, Properties::ModelTraits>; using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; - static_assert(FSY::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid system"); - static_assert(FST::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid state"); - static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); - static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); + static_assert(FSY::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid system"); + static_assert(FST::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid state"); + static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system"); + static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state"); using Traits = OnePNCVolumeVariablesTraits<PV, FSY, FST, SSY, SST, PT, MT>; public: diff --git a/dumux/porousmediumflow/1pnc/volumevariables.hh b/dumux/porousmediumflow/1pnc/volumevariables.hh index 278d0142100a4ae02e4f3b1aa59fc681fbeb9073..290dc0154316df4ae95c420a92a1b3a1d70e0d88 100644 --- a/dumux/porousmediumflow/1pnc/volumevariables.hh +++ b/dumux/porousmediumflow/1pnc/volumevariables.hh @@ -52,7 +52,7 @@ class OnePNCVolumeVariables using Scalar = typename Traits::PrimaryVariables::value_type; using PermeabilityType = typename Traits::PermeabilityType; using Idx = typename Traits::ModelTraits::Indices; - static constexpr int numFluidComps = ParentType::numComponents(); + static constexpr int numFluidComps = ParentType::numFluidComponents(); enum { diff --git a/dumux/porousmediumflow/1pncmin/model.hh b/dumux/porousmediumflow/1pncmin/model.hh index 19f28ef7e5002e9261d32e10e3e7a140867b1e5a..af8fff7bb0eba64c385c91006148ffbfbd681468 100644 --- a/dumux/porousmediumflow/1pncmin/model.hh +++ b/dumux/porousmediumflow/1pncmin/model.hh @@ -110,10 +110,10 @@ private: using MT = GetPropType<TypeTag, Properties::ModelTraits>; using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; - static_assert(FSY::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid system"); - static_assert(FST::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid state"); - static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); - static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); + static_assert(FSY::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid system"); + static_assert(FST::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid state"); + static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system"); + static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state"); using Traits = OnePNCVolumeVariablesTraits<PV, FSY, FST, SSY, SST, PT, MT>; using NonMinVolVars = OnePNCVolumeVariables<Traits>; diff --git a/dumux/porousmediumflow/2p/incompressiblelocalresidual.hh b/dumux/porousmediumflow/2p/incompressiblelocalresidual.hh index 0d187dca2cc50d6ba227b2f4aa678ce74f48bc51..7809616eb0bdb4f135e875151bc136f7277d9fa1 100644 --- a/dumux/porousmediumflow/2p/incompressiblelocalresidual.hh +++ b/dumux/porousmediumflow/2p/incompressiblelocalresidual.hh @@ -64,7 +64,7 @@ class TwoPIncompressibleLocalResidual : public ImmiscibleLocalResidual<TypeTag> using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; - static constexpr int numPhases = ModelTraits::numPhases(); + static constexpr int numPhases = ModelTraits::numFluidPhases(); static constexpr int pressureIdx = ModelTraits::Indices::pressureIdx; static constexpr int saturationIdx = ModelTraits::Indices::saturationIdx; static constexpr int conti0EqIdx = ModelTraits::Indices::conti0EqIdx; @@ -97,7 +97,7 @@ public: "2p/incompressiblelocalresidual.hh: Only incompressible fluids are allowed!"); static_assert(!FluidSystem::isCompressible(1), "2p/incompressiblelocalresidual.hh: Only incompressible fluids are allowed!"); - static_assert(ModelTraits::numPhases() == 2, + static_assert(ModelTraits::numFluidPhases() == 2, "2p/incompressiblelocalresidual.hh: Only two-phase models are allowed!"); static_assert(ModelTraits::priVarFormulation() == TwoPFormulation::p0s1, "2p/incompressiblelocalresidual.hh: Analytic differentiation has to be checked for p1-s0 formulation!"); @@ -106,7 +106,7 @@ public: const auto poreVolume = scv.volume()*curVolVars.porosity(); static const std::array<Scalar, numPhases> rhos = { curVolVars.density(0), curVolVars.density(1) }; - for (int pIdx = 0; pIdx < ModelTraits::numPhases(); ++pIdx) + for (int pIdx = 0; pIdx < ModelTraits::numFluidPhases(); ++pIdx) { // partial derivative of wetting phase storage term w.r.t. p_w partialDerivatives[conti0EqIdx+pIdx][pressureIdx] += 0.0; @@ -165,7 +165,7 @@ public: "2p/incompressiblelocalresidual.hh: Only fluids with constant viscosities are allowed!"); static_assert(FluidSystem::viscosityIsConstant(1), "2p/incompressiblelocalresidual.hh: Only fluids with constant viscosities are allowed!"); - static_assert(ModelTraits::numPhases() == 2, + static_assert(ModelTraits::numFluidPhases() == 2, "2p/incompressiblelocalresidual.hh: Only two-phase models are allowed!"); static_assert(ModelTraits::priVarFormulation() == TwoPFormulation::p0s1, "2p/incompressiblelocalresidual.hh: Analytic differentiation has to be checked for p1-s0 formulation!"); @@ -283,7 +283,7 @@ public: "2p/incompressiblelocalresidual.hh: Only fluids with constant viscosities are allowed!"); static_assert(FluidSystem::viscosityIsConstant(1), "2p/incompressiblelocalresidual.hh: Only fluids with constant viscosities are allowed!"); - static_assert(ModelTraits::numPhases() == 2, + static_assert(ModelTraits::numFluidPhases() == 2, "2p/incompressiblelocalresidual.hh: Only two-phase models are allowed!"); static_assert(ModelTraits::priVarFormulation() == TwoPFormulation::p0s1, "2p/incompressiblelocalresidual.hh: Analytic differentiation has to be checked for p0-s1 formulation!"); diff --git a/dumux/porousmediumflow/2p/model.hh b/dumux/porousmediumflow/2p/model.hh index 1241f07b53d2ecf933f2513b7ac2f2bf252bf658..2ca3e1a32619a8d79736c6fafb84710445819d01 100644 --- a/dumux/porousmediumflow/2p/model.hh +++ b/dumux/porousmediumflow/2p/model.hh @@ -92,8 +92,8 @@ struct TwoPModelTraits { return formulation; } static constexpr int numEq() { return 2; } - static constexpr int numPhases() { return 2; } - static constexpr int numComponents() { return 2; } + static constexpr int numFluidPhases() { return 2; } + static constexpr int numFluidComponents() { return 2; } static constexpr bool enableAdvection() { return true; } static constexpr bool enableMolecularDiffusion() { return false; } diff --git a/dumux/porousmediumflow/2p/volumevariables.hh b/dumux/porousmediumflow/2p/volumevariables.hh index 5f906ff7700eee6c4397ad86f1e65c5c89164880..1d44bc77d265bfa7291df8369cb267dea41a401d 100644 --- a/dumux/porousmediumflow/2p/volumevariables.hh +++ b/dumux/porousmediumflow/2p/volumevariables.hh @@ -49,7 +49,7 @@ class TwoPVolumeVariables using Indices = typename ModelTraits::Indices; using Scalar = typename Traits::PrimaryVariables::value_type; using FS = typename Traits::FluidSystem; - static constexpr int numFluidComps = ParentType::numComponents(); + static constexpr int numFluidComps = ParentType::numFluidComponents(); enum { pressureIdx = Indices::pressureIdx, @@ -180,7 +180,7 @@ public: typename FluidSystem::ParameterCache paramCache; paramCache.updateAll(fluidState); - for (int phaseIdx = 0; phaseIdx < ModelTraits::numPhases(); ++phaseIdx) { + for (int phaseIdx = 0; phaseIdx < ModelTraits::numFluidPhases(); ++phaseIdx) { // compute and set the viscosity Scalar mu = FluidSystem::viscosity(fluidState, paramCache, phaseIdx); fluidState.setViscosity(phaseIdx, mu); @@ -290,7 +290,7 @@ private: Scalar pc_; Scalar porosity_; PermeabilityType permeability_; - Scalar mobility_[ModelTraits::numPhases()]; + Scalar mobility_[ModelTraits::numFluidPhases()]; }; } // end namespace Dumux diff --git a/dumux/porousmediumflow/2p1c/localresidual.hh b/dumux/porousmediumflow/2p1c/localresidual.hh index 21b124056ad976505fb5a9009f01e273a28cc4ee..3b7aab810c492a65c6b578a919e9ab9d168bfec3 100644 --- a/dumux/porousmediumflow/2p1c/localresidual.hh +++ b/dumux/porousmediumflow/2p1c/localresidual.hh @@ -51,16 +51,13 @@ class TwoPOneCLocalResidual : public ImmiscibleLocalResidual<TypeTag> using Element = typename GridView::template Codim<0>::Entity; using EnergyLocalResidual = GetPropType<TypeTag, Properties::EnergyLocalResidual>; using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; - // first index for the mass balance - enum { conti0EqIdx = Indices::conti0EqIdx }; - static const int numPhases = GetPropType<TypeTag, Properties::ModelTraits>::numPhases(); + static const auto numPhases = GetPropType<TypeTag, Properties::ModelTraits>::numFluidPhases(); public: //! Use the parent type's constructor using ParentType::ParentType; - //! Evaluate the storage term within a given scv NumEqVector computeStorage(const Problem& problem, const SubControlVolume& scv, @@ -70,7 +67,7 @@ public: // Compute storage term of all components within all phases for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) { - storage[conti0EqIdx] += + storage[Indices::conti0EqIdx] += volVars.porosity() * volVars.saturation(phaseIdx) * volVars.density(phaseIdx); @@ -101,7 +98,7 @@ public: auto upwindTerm = [phaseIdx](const auto& volVars) { return volVars.density(phaseIdx)*volVars.mobility(phaseIdx); }; - flux[conti0EqIdx] += fluxVars.advectiveFlux(phaseIdx, upwindTerm); + flux[Indices::conti0EqIdx] += fluxVars.advectiveFlux(phaseIdx, upwindTerm); // Add advective phase energy fluxes. For isothermal model the contribution is zero. EnergyLocalResidual::heatConvectionFlux(flux, fluxVars, phaseIdx); diff --git a/dumux/porousmediumflow/2p1c/model.hh b/dumux/porousmediumflow/2p1c/model.hh index 354f6f646292e7e90c0d0bfe78bfce9f59633155..17e93a7e31f3b5704fc4f0d10ebba1df72412c36 100644 --- a/dumux/porousmediumflow/2p1c/model.hh +++ b/dumux/porousmediumflow/2p1c/model.hh @@ -93,8 +93,8 @@ struct TwoPOneCNIModelTraits static constexpr int numEq() { return 2; } //! only one energy equation is needed when assuming thermal equilibrium static constexpr int numEnergyEq() { return 1; } - static constexpr int numPhases() { return 2; } - static constexpr int numComponents() { return 1; } + static constexpr int numFluidPhases() { return 2; } + static constexpr int numFluidComponents() { return 1; } static constexpr bool enableAdvection() { return true; } static constexpr bool enableMolecularDiffusion() { return false; } diff --git a/dumux/porousmediumflow/2p1c/volumevariables.hh b/dumux/porousmediumflow/2p1c/volumevariables.hh index 230c9dccadaff363d25e74dfc2da44b877f0deaa..f4b0c2d84aa9918f45a67575d4eb7a5080ea4a52 100644 --- a/dumux/porousmediumflow/2p1c/volumevariables.hh +++ b/dumux/porousmediumflow/2p1c/volumevariables.hh @@ -53,12 +53,12 @@ class TwoPOneCVolumeVariables using PermeabilityType = typename Traits::PermeabilityType; using FS = typename Traits::FluidSystem; using Idx = typename Traits::ModelTraits::Indices; - static constexpr int numFluidComps = ParentType::numComponents(); + static constexpr int numFluidComps = ParentType::numFluidComponents(); // primary variable indices enum { - numPhases = Traits::ModelTraits::numPhases(), + numFluidPhases = Traits::ModelTraits::numFluidPhases(), switchIdx = Idx::switchIdx, pressureIdx = Idx::pressureIdx }; @@ -100,8 +100,8 @@ public: static constexpr TwoPFormulation priVarFormulation() { return formulation; } // check for permissive combinations - static_assert(Traits::ModelTraits::numPhases() == 2, "NumPhases set in the model is not two!"); - static_assert(Traits::ModelTraits::numComponents() == 1, "NumComponents set in the model is not one!"); + static_assert(Traits::ModelTraits::numFluidPhases() == 2, "NumPhases set in the model is not two!"); + static_assert(Traits::ModelTraits::numFluidComponents() == 1, "NumComponents set in the model is not one!"); static_assert((formulation == TwoPFormulation::p0s1 || formulation == TwoPFormulation::p1s0), "Chosen TwoPFormulation not supported!"); /*! @@ -135,7 +135,7 @@ public: // became part of the fluid state. typename FluidSystem::ParameterCache paramCache; paramCache.updateAll(fluidState_); - for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < numFluidPhases; ++phaseIdx) { // relative permeabilities Scalar kr; @@ -220,7 +220,7 @@ public: updateTemperature(elemSol, problem, element, scv, fluidState, solidState); // set the densities - for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < numFluidPhases; ++phaseIdx) { Scalar rho = FluidSystem::density(fluidState, phaseIdx); Scalar rhoMolar = FluidSystem::molarDensity(fluidState, phaseIdx); @@ -230,7 +230,7 @@ public: } //get the viscosity and mobility - for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < numFluidPhases; ++phaseIdx) { // Mobilities const Scalar mu = @@ -240,7 +240,7 @@ public: } // the enthalpies (internal energies are directly calculated in the fluidstate - for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < numFluidPhases; ++phaseIdx) { const Scalar h = FluidSystem::enthalpy(fluidState, phaseIdx); fluidState.setEnthalpy(phaseIdx, h); @@ -390,7 +390,7 @@ private: PermeabilityType permeability_; //!< Effective permeability within the control volume //!< Relative permeability within the control volume - std::array<Scalar, numPhases> relativePermeability_; + std::array<Scalar, numFluidPhases> relativePermeability_; }; } // end namespace Dumux diff --git a/dumux/porousmediumflow/2p2c/volumevariables.hh b/dumux/porousmediumflow/2p2c/volumevariables.hh index 21113f458037babafe9dadd6a1d317a628f01c30..48af53a976fe64a854136e8608483e2eedcf4022 100644 --- a/dumux/porousmediumflow/2p2c/volumevariables.hh +++ b/dumux/porousmediumflow/2p2c/volumevariables.hh @@ -54,7 +54,7 @@ class TwoPTwoCVolumeVariables using Scalar = typename Traits::PrimaryVariables::value_type; using ModelTraits = typename Traits::ModelTraits; - static constexpr int numFluidComps = ParentType::numComponents(); + static constexpr int numFluidComps = ParentType::numFluidComponents(); // component indices enum { @@ -104,8 +104,8 @@ public: // check for permissive combinations static_assert(useMoles() || (!useMoles() && useConstraintSolver), "if !UseMoles, UseConstraintSolver has to be set to true"); - static_assert(ModelTraits::numPhases() == 2, "NumPhases set in the model is not two!"); - static_assert(ModelTraits::numComponents() == 2, "NumComponents set in the model is not two!"); + static_assert(ModelTraits::numFluidPhases() == 2, "NumPhases set in the model is not two!"); + static_assert(ModelTraits::numFluidComponents() == 2, "NumComponents set in the model is not two!"); static_assert((formulation == TwoPFormulation::p0s1 || formulation == TwoPFormulation::p1s0), "Chosen TwoPFormulation not supported!"); // The computations in the explicit composition update most probably assume a liquid-gas interface with @@ -230,10 +230,10 @@ public: // If constraint solver is not used, get the phase pressures and set the fugacity coefficients here if(!useConstraintSolver) { - for (int phaseIdx = 0; phaseIdx < ModelTraits::numPhases(); ++ phaseIdx) + for (int phaseIdx = 0; phaseIdx < ModelTraits::numFluidPhases(); ++ phaseIdx) { assert(FluidSystem::isIdealMixture(phaseIdx)); - for (int compIdx = 0; compIdx < ModelTraits::numComponents(); ++ compIdx) { + for (int compIdx = 0; compIdx < ModelTraits::numFluidComponents(); ++ compIdx) { Scalar phi = FluidSystem::fugacityCoefficient(fluidState, paramCache, phaseIdx, compIdx); fluidState.setFugacityCoefficient(phaseIdx, compIdx, phi); } @@ -371,7 +371,7 @@ public: } } - for (int phaseIdx = 0; phaseIdx < ModelTraits::numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < ModelTraits::numFluidPhases(); ++phaseIdx) { // set the viscosity and desity here if constraintsolver is not used if(!useConstraintSolver) @@ -534,10 +534,10 @@ private: PermeabilityType permeability_; //!< Effective permeability within the control volume //!< Relative permeability within the control volume - std::array<Scalar, ModelTraits::numPhases()> relativePermeability_; + std::array<Scalar, ModelTraits::numFluidPhases()> relativePermeability_; //!< Binary diffusion coefficients for the phases - std::array<Scalar, ModelTraits::numPhases()> diffCoeff_; + std::array<Scalar, ModelTraits::numFluidPhases()> diffCoeff_; }; } // end namespace Dumux diff --git a/dumux/porousmediumflow/2pnc/iofields.hh b/dumux/porousmediumflow/2pnc/iofields.hh index aee9f5cc2334f14c72f55983f8e233c9d314ac4e..955f4f4b37d6282071f09d9069614fc71d8710b5 100644 --- a/dumux/porousmediumflow/2pnc/iofields.hh +++ b/dumux/porousmediumflow/2pnc/iofields.hh @@ -47,13 +47,13 @@ public: TwoPIOFields::initOutputModule(out); // output additional to TwoP output: - for (int phaseIdx = 0; phaseIdx < VolumeVariables::numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < VolumeVariables::numFluidPhases(); ++phaseIdx) { - for (int compIdx = 0; compIdx < VolumeVariables::numComponents(); ++compIdx) + for (int compIdx = 0; compIdx < VolumeVariables::numFluidComponents(); ++compIdx) { out.addVolumeVariable([phaseIdx,compIdx](const auto& v){ return v.moleFraction(phaseIdx,compIdx); }, IOName::moleFraction<FluidSystem>(phaseIdx, compIdx)); - if (VolumeVariables::numComponents() < 3) + if (VolumeVariables::numFluidComponents() < 3) out.addVolumeVariable([phaseIdx,compIdx](const auto& v){ return v.massFraction(phaseIdx,compIdx); }, IOName::massFraction<FluidSystem>(phaseIdx, compIdx)); } diff --git a/dumux/porousmediumflow/2pnc/model.hh b/dumux/porousmediumflow/2pnc/model.hh index 4dbd3baee8d540e38cc3fd9f20fd21804568451c..07adefff74233946c3aad8ac01449a27533e9e21 100644 --- a/dumux/porousmediumflow/2pnc/model.hh +++ b/dumux/porousmediumflow/2pnc/model.hh @@ -121,8 +121,8 @@ struct TwoPNCModelTraits using Indices = TwoPNCIndices; static constexpr int numEq() { return nComp; } - static constexpr int numPhases() { return 2; } - static constexpr int numComponents() { return nComp; } + static constexpr int numFluidPhases() { return 2; } + static constexpr int numFluidComponents() { return nComp; } static constexpr int replaceCompEqIdx() { return repCompEqIdx; } static constexpr bool enableAdvection() { return true; } diff --git a/dumux/porousmediumflow/2pnc/primaryvariableswitch.hh b/dumux/porousmediumflow/2pnc/primaryvariableswitch.hh index 3042f017076a4480b4c873ba0a9e4a33f6792b5b..62a4e728fe00c9e08a97a6a0c5733fd8d7bbf4d8 100644 --- a/dumux/porousmediumflow/2pnc/primaryvariableswitch.hh +++ b/dumux/porousmediumflow/2pnc/primaryvariableswitch.hh @@ -59,10 +59,10 @@ protected: static constexpr int comp0Idx = FluidSystem::comp0Idx; static constexpr int comp1Idx = FluidSystem::comp1Idx; - static constexpr auto numComponents = VolumeVariables::numComponents(); + static constexpr auto numComponents = VolumeVariables::numFluidComponents(); static constexpr bool useMoles = VolumeVariables::useMoles(); static_assert(useMoles || numComponents < 3, "!useMoles is only implemented for numComponents < 3."); - static constexpr auto numMajorComponents = VolumeVariables::numPhases(); + static constexpr auto numMajorComponents = VolumeVariables::numFluidPhases(); static constexpr auto formulation = VolumeVariables::priVarFormulation(); static_assert( (formulation == TwoPFormulation::p0s1 || formulation == TwoPFormulation::p1s0), "Chosen TwoPFormulation not supported!"); diff --git a/dumux/porousmediumflow/2pnc/volumevariables.hh b/dumux/porousmediumflow/2pnc/volumevariables.hh index 25cebb9d811be45e63f1e90f1e8dc49b9d9858d0..52ac70436ac5fa4906386fc09580a496586ff40d 100644 --- a/dumux/porousmediumflow/2pnc/volumevariables.hh +++ b/dumux/porousmediumflow/2pnc/volumevariables.hh @@ -61,10 +61,10 @@ class TwoPNCVolumeVariables using PermeabilityType = typename Traits::PermeabilityType; using FS = typename Traits::FluidSystem; using ModelTraits = typename Traits::ModelTraits; - static constexpr int numFluidComps = ParentType::numComponents(); + static constexpr int numFluidComps = ParentType::numFluidComponents(); enum { - numMajorComponents = ModelTraits::numPhases(), + numMajorComponents = ModelTraits::numFluidPhases(), // phase indices phase0Idx = FS::phase0Idx, @@ -110,7 +110,7 @@ public: // check for permissive specifications static_assert(useMoles(), "use moles has to be set true in the 2pnc model"); - static_assert(ModelTraits::numPhases() == 2, "NumPhases set in the model is not two!"); + static_assert(ModelTraits::numFluidPhases() == 2, "NumPhases set in the model is not two!"); static_assert((formulation == TwoPFormulation::p0s1 || formulation == TwoPFormulation::p1s0), "Chosen TwoPFormulation not supported!"); /*! @@ -152,7 +152,7 @@ public: mobility_[nPhaseIdx] = MaterialLaw::krn(matParams, saturation(wPhaseIdx))/fluidState_.viscosity(nPhaseIdx); // binary diffusion coefficients - for (unsigned int compJIdx = 0; compJIdx < ModelTraits::numComponents(); ++compJIdx) + for (unsigned int compJIdx = 0; compJIdx < ModelTraits::numFluidComponents(); ++compJIdx) { if(compJIdx != comp0Idx) setDiffusionCoefficient_( phase0Idx, compJIdx, @@ -261,7 +261,7 @@ public: // can be used by the MiscibleMultiPhaseComposition constraint solver const int knownPhaseIdx = setFirstPhaseMoleFractions ? phase0Idx : phase1Idx; - for (int compIdx = numMajorComponents; compIdx < ModelTraits::numComponents(); ++compIdx) + for (int compIdx = numMajorComponents; compIdx < ModelTraits::numFluidComponents(); ++compIdx) fluidState.setMoleFraction(knownPhaseIdx, compIdx, priVars[compIdx]); MiscibleMultiPhaseComposition::solve(fluidState, @@ -271,12 +271,12 @@ public: else if (phasePresence == secondPhaseOnly) { - Dune::FieldVector<Scalar, ModelTraits::numComponents()> moleFrac; + Dune::FieldVector<Scalar, ModelTraits::numFluidComponents()> moleFrac; moleFrac[comp0Idx] = priVars[switchIdx]; Scalar sumMoleFracOtherComponents = moleFrac[comp0Idx]; - for (int compIdx = numMajorComponents; compIdx < ModelTraits::numComponents(); ++compIdx) + for (int compIdx = numMajorComponents; compIdx < ModelTraits::numFluidComponents(); ++compIdx) { moleFrac[compIdx] = priVars[compIdx]; sumMoleFracOtherComponents += moleFrac[compIdx]; @@ -285,7 +285,7 @@ public: moleFrac[comp1Idx] = 1 - sumMoleFracOtherComponents; // Set fluid state mole fractions - for (int compIdx = 0; compIdx < ModelTraits::numComponents(); ++compIdx) + for (int compIdx = 0; compIdx < ModelTraits::numFluidComponents(); ++compIdx) fluidState.setMoleFraction(phase1Idx, compIdx, moleFrac[compIdx]); // calculate the composition of the remaining phases (as @@ -299,11 +299,11 @@ public: { // only the first phase is present, i.e. first phase composition // is stored explicitly. extract _mass_ fractions in the second phase - Dune::FieldVector<Scalar, ModelTraits::numComponents()> moleFrac; + Dune::FieldVector<Scalar, ModelTraits::numFluidComponents()> moleFrac; moleFrac[comp1Idx] = priVars[switchIdx]; Scalar sumMoleFracOtherComponents = moleFrac[comp1Idx]; - for (int compIdx = numMajorComponents; compIdx < ModelTraits::numComponents(); ++compIdx) + for (int compIdx = numMajorComponents; compIdx < ModelTraits::numFluidComponents(); ++compIdx) { moleFrac[compIdx] = priVars[compIdx]; @@ -313,7 +313,7 @@ public: moleFrac[comp0Idx] = 1 - sumMoleFracOtherComponents; // convert mass to mole fractions and set the fluid state - for (int compIdx = 0; compIdx < ModelTraits::numComponents(); ++compIdx) + for (int compIdx = 0; compIdx < ModelTraits::numFluidComponents(); ++compIdx) fluidState.setMoleFraction(phase0Idx, compIdx, moleFrac[compIdx]); // calculate the composition of the remaining phases (as @@ -324,7 +324,7 @@ public: phase0Idx); } paramCache.updateAll(fluidState); - for (int phaseIdx = 0; phaseIdx < ModelTraits::numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < ModelTraits::numFluidPhases(); ++phaseIdx) { Scalar rho = FluidSystem::density(fluidState, paramCache, phaseIdx); Scalar rhoMolar = FluidSystem::molarDensity(fluidState, paramCache, phaseIdx); @@ -385,7 +385,7 @@ public: */ Scalar molarDensity(int phaseIdx) const { - if (phaseIdx < ModelTraits::numPhases()) + if (phaseIdx < ModelTraits::numFluidPhases()) return fluidState_.molarDensity(phaseIdx); else @@ -489,8 +489,8 @@ private: Scalar pc_; //!< The capillary pressure Scalar porosity_; //!< Effective porosity within the control volume PermeabilityType permeability_; //!> Effective permeability within the control volume - Scalar mobility_[ModelTraits::numPhases()]; //!< Effective mobility within the control volume - std::array<std::array<Scalar, ModelTraits::numComponents()-1>, ModelTraits::numPhases()> diffCoefficient_; + Scalar mobility_[ModelTraits::numFluidPhases()]; //!< Effective mobility within the control volume + std::array<std::array<Scalar, ModelTraits::numFluidComponents()-1>, ModelTraits::numFluidPhases()> diffCoefficient_; }; diff --git a/dumux/porousmediumflow/3p/iofields.hh b/dumux/porousmediumflow/3p/iofields.hh index 735115a60d31cdea66c83548de0fbb86e39e09d2..081b4821dd8386a4d417f123a082ae1bc54da877 100644 --- a/dumux/porousmediumflow/3p/iofields.hh +++ b/dumux/porousmediumflow/3p/iofields.hh @@ -43,7 +43,7 @@ public: using FluidSystem = typename VolumeVariables::FluidSystem; // register standardized output fields - for (int phaseIdx = 0; phaseIdx < VolumeVariables::numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < VolumeVariables::numFluidPhases(); ++phaseIdx) { out.addVolumeVariable([phaseIdx](const auto& v){ return v.saturation(phaseIdx); }, IOName::saturation<FluidSystem>(phaseIdx)); diff --git a/dumux/porousmediumflow/3p/model.hh b/dumux/porousmediumflow/3p/model.hh index 388ffbb00c5105852e191760e475b5022a0e02e4..4c2323a4cb91660481def04a07c48466b3f9f88d 100644 --- a/dumux/porousmediumflow/3p/model.hh +++ b/dumux/porousmediumflow/3p/model.hh @@ -83,8 +83,8 @@ struct ThreePModelTraits using Indices = ThreePIndices; static constexpr int numEq() { return 3; } - static constexpr int numPhases() { return 3; } - static constexpr int numComponents() { return 3; } + static constexpr int numFluidPhases() { return 3; } + static constexpr int numFluidComponents() { return 3; } static constexpr bool enableAdvection() { return true; } static constexpr bool enableMolecularDiffusion() { return false; } diff --git a/dumux/porousmediumflow/3p/volumevariables.hh b/dumux/porousmediumflow/3p/volumevariables.hh index 86a0f5ef99dd452cedcd074beaaf1fc680b96f47..ccf05eb8223c3716a72e61d6ded00465a224dedd 100644 --- a/dumux/porousmediumflow/3p/volumevariables.hh +++ b/dumux/porousmediumflow/3p/volumevariables.hh @@ -49,7 +49,7 @@ class ThreePVolumeVariables using PermeabilityType = typename Traits::PermeabilityType; using Indices = typename Traits::ModelTraits::Indices; using FS = typename Traits::FluidSystem; - static constexpr int numFluidComps = ParentType::numComponents(); + static constexpr int numFluidComps = ParentType::numFluidComponents(); enum { wPhaseIdx = FS::wPhaseIdx, @@ -95,7 +95,7 @@ public: completeFluidState(elemSol, problem, element, scv, fluidState_, solidState_); // mobilities - for (int phaseIdx = 0; phaseIdx < ParentType::numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < ParentType::numFluidPhases(); ++phaseIdx) { mobility_[phaseIdx] = MaterialLaw::kr(materialParams, phaseIdx, fluidState_.saturation(wPhaseIdx), @@ -169,7 +169,7 @@ public: typename FluidSystem::ParameterCache paramCache; paramCache.updateAll(fluidState); - for (int phaseIdx = 0; phaseIdx < ParentType::numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < ParentType::numFluidPhases(); ++phaseIdx) { // compute and set the viscosity const Scalar mu = FluidSystem::viscosity(fluidState, paramCache, phaseIdx); @@ -270,7 +270,7 @@ protected: private: PermeabilityType permeability_; - Scalar mobility_[ParentType::numPhases()]; + Scalar mobility_[ParentType::numFluidPhases()]; }; } // end namespace Dumux diff --git a/dumux/porousmediumflow/3p3c/iofields.hh b/dumux/porousmediumflow/3p3c/iofields.hh index d1c0ae3f53afadb6114a31388a72b591e1deaf99..b087247c8279d620be1c8720ed6f6de969c1ea22 100644 --- a/dumux/porousmediumflow/3p3c/iofields.hh +++ b/dumux/porousmediumflow/3p3c/iofields.hh @@ -44,7 +44,7 @@ public: using FluidSystem = typename VolumeVariables::FluidSystem; // register standardized output fields - for (int phaseIdx = 0; phaseIdx < VolumeVariables::numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < VolumeVariables::numFluidPhases(); ++phaseIdx) { out.addVolumeVariable( [phaseIdx](const auto& v){ return v.saturation(phaseIdx); }, IOName::saturation<FluidSystem>(phaseIdx)); @@ -53,7 +53,7 @@ public: out.addVolumeVariable( [phaseIdx](const auto& v){ return v.density(phaseIdx); }, IOName::density<FluidSystem>(phaseIdx)); - for (int compIdx = 0; compIdx < VolumeVariables::numComponents(); ++compIdx) + for (int compIdx = 0; compIdx < VolumeVariables::numFluidComponents(); ++compIdx) out.addVolumeVariable([phaseIdx, compIdx](const auto& v){ return v.moleFraction(phaseIdx, compIdx); }, IOName::moleFraction<FluidSystem>(phaseIdx, compIdx)); } diff --git a/dumux/porousmediumflow/3p3c/localresidual.hh b/dumux/porousmediumflow/3p3c/localresidual.hh index a8eee45e164237391c388b90e661ed37f07fe4f2..c465597b2e1e801bdb5ebfc5361bb3de382f0a06 100644 --- a/dumux/porousmediumflow/3p3c/localresidual.hh +++ b/dumux/porousmediumflow/3p3c/localresidual.hh @@ -57,8 +57,8 @@ class ThreePThreeCLocalResidual : public GetPropType<TypeTag, Properties::BaseLo using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; enum { - numPhases = GetPropType<TypeTag, Properties::ModelTraits>::numPhases(), - numComponents = GetPropType<TypeTag, Properties::ModelTraits>::numComponents(), + numPhases = GetPropType<TypeTag, Properties::ModelTraits>::numFluidPhases(), + numComponents = GetPropType<TypeTag, Properties::ModelTraits>::numFluidComponents(), contiWEqIdx = Indices::conti0EqIdx + FluidSystem::wPhaseIdx,//!< index of the mass conservation equation for the water component contiNEqIdx = Indices::conti0EqIdx + FluidSystem::nPhaseIdx,//!< index of the mass conservation equation for the contaminant component diff --git a/dumux/porousmediumflow/3p3c/model.hh b/dumux/porousmediumflow/3p3c/model.hh index cb80c0a7bf0815db70b79f0ec969fac13eb43ff7..cfd20bb12482614ce5bd2915cc30679317171f74 100644 --- a/dumux/porousmediumflow/3p3c/model.hh +++ b/dumux/porousmediumflow/3p3c/model.hh @@ -111,8 +111,8 @@ struct ThreePThreeCModelTraits using Indices = ThreePThreeCIndices; static constexpr int numEq() { return 3; } - static constexpr int numPhases() { return 3; } - static constexpr int numComponents() { return 3; } + static constexpr int numFluidPhases() { return 3; } + static constexpr int numFluidComponents() { return 3; } static constexpr bool enableAdvection() { return true; } static constexpr bool enableMolecularDiffusion() { return true; } @@ -177,7 +177,7 @@ struct UseConstraintSolver<TypeTag, TTag::ThreePThreeC> { static constexpr bool //! Set as default that _no_ component mass balance is replaced by the total mass balance template<class TypeTag> -struct ReplaceCompEqIdx<TypeTag, TTag::ThreePThreeC> { static constexpr int value = GetPropType<TypeTag, Properties::ModelTraits>::numComponents(); }; +struct ReplaceCompEqIdx<TypeTag, TTag::ThreePThreeC> { static constexpr int value = GetPropType<TypeTag, Properties::ModelTraits>::numFluidComponents(); }; /*! * \brief The fluid state which is used by the volume variables to * store the thermodynamic state. This should be chosen diff --git a/dumux/porousmediumflow/3p3c/volumevariables.hh b/dumux/porousmediumflow/3p3c/volumevariables.hh index 190ea7b123b4f67fc305bb26294595850c061551..41f9b8259d26a429d0fd92c8811ba3d7f86a9bf9 100644 --- a/dumux/porousmediumflow/3p3c/volumevariables.hh +++ b/dumux/porousmediumflow/3p3c/volumevariables.hh @@ -59,7 +59,7 @@ class ThreePThreeCVolumeVariables using ModelTraits = typename Traits::ModelTraits; using Idx = typename ModelTraits::Indices; - static constexpr int numFluidComps = ParentType::numComponents(); + static constexpr int numFluidComps = ParentType::numFluidComponents(); enum { wCompIdx = FS::wCompIdx, gCompIdx = FS::gCompIdx, @@ -196,10 +196,10 @@ public: // depend on composition! typename FluidSystem::ParameterCache paramCache; // assert(FluidSystem::isIdealGas(gPhaseIdx)); - for (int phaseIdx = 0; phaseIdx < ModelTraits::numPhases(); ++ phaseIdx) { + for (int phaseIdx = 0; phaseIdx < ModelTraits::numFluidPhases(); ++ phaseIdx) { assert(FluidSystem::isIdealMixture(phaseIdx)); - for (int compIdx = 0; compIdx < ModelTraits::numComponents(); ++ compIdx) { + for (int compIdx = 0; compIdx < ModelTraits::numFluidComponents(); ++ compIdx) { Scalar phi = FluidSystem::fugacityCoefficient(fluidState_, paramCache, phaseIdx, compIdx); fluidState_.setFugacityCoefficient(phaseIdx, compIdx, phi); } @@ -529,7 +529,7 @@ public: DUNE_THROW(Dune::InvalidStateException, "phasePresence: " << phasePresence << " is invalid."); } - for (int phaseIdx = 0; phaseIdx < ModelTraits::numPhases(); ++phaseIdx) { + for (int phaseIdx = 0; phaseIdx < ModelTraits::numFluidPhases(); ++phaseIdx) { // Mobilities const Scalar mu = FluidSystem::viscosity(fluidState_, @@ -571,7 +571,7 @@ public: permeability_ = problem.spatialParams().permeability(element, scv, elemSol); // compute and set the enthalpy - for (int phaseIdx = 0; phaseIdx < ModelTraits::numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < ModelTraits::numFluidPhases(); ++phaseIdx) { Scalar h = EnergyVolVars::enthalpy(fluidState_, paramCache, phaseIdx); fluidState_.setEnthalpy(phaseIdx, h); @@ -711,11 +711,11 @@ protected: private: Scalar sw_, sg_, sn_, pg_, pw_, pn_; - Scalar moleFrac_[ModelTraits::numPhases()][ModelTraits::numComponents()]; - Scalar massFrac_[ModelTraits::numPhases()][ModelTraits::numComponents()]; + Scalar moleFrac_[ModelTraits::numFluidPhases()][ModelTraits::numFluidComponents()]; + Scalar massFrac_[ModelTraits::numFluidPhases()][ModelTraits::numFluidComponents()]; PermeabilityType permeability_; //!< Effective permeability within the control volume - Scalar mobility_[ModelTraits::numPhases()]; //!< Effective mobility within the control volume + Scalar mobility_[ModelTraits::numFluidPhases()]; //!< Effective mobility within the control volume Scalar bulkDensTimesAdsorpCoeff_; //!< the basis for calculating adsorbed NAPL void setDiffusionCoefficient_(int phaseIdx, int compIdx, Scalar d) @@ -730,7 +730,7 @@ private: DUNE_THROW(Dune::InvalidStateException, "Diffusion coefficient for phaseIdx = compIdx doesn't exist"); } - std::array<std::array<Scalar, ModelTraits::numComponents()-1>, ModelTraits::numPhases()> diffCoefficient_; + std::array<std::array<Scalar, ModelTraits::numFluidComponents()-1>, ModelTraits::numFluidPhases()> diffCoefficient_; }; } // end namespace Dumux diff --git a/dumux/porousmediumflow/3pwateroil/iofields.hh b/dumux/porousmediumflow/3pwateroil/iofields.hh index 1da1f5382e67874293b8be2f05d820e4bf9e3c02..11894504306f35aa15e778bd003c4bf08c8f022a 100644 --- a/dumux/porousmediumflow/3pwateroil/iofields.hh +++ b/dumux/porousmediumflow/3pwateroil/iofields.hh @@ -44,7 +44,7 @@ public: using FluidSystem = typename VolumeVariables::FluidSystem; // register standardized output fields - for (int phaseIdx = 0; phaseIdx < VolumeVariables::numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < VolumeVariables::numFluidPhases(); ++phaseIdx) { out.addVolumeVariable([phaseIdx](const auto& v){ return v.saturation(phaseIdx); }, IOName::saturation<FluidSystem>(phaseIdx)); @@ -57,7 +57,7 @@ public: out.addVolumeVariable([phaseIdx](const auto& v){ return v.viscosity(phaseIdx); }, IOName::viscosity<FluidSystem>(phaseIdx)); - for (int compIdx = 0; compIdx < VolumeVariables::numComponents(); ++compIdx) + for (int compIdx = 0; compIdx < VolumeVariables::numFluidComponents(); ++compIdx) out.addVolumeVariable([phaseIdx, compIdx](const auto& v){ return v.moleFraction(phaseIdx, compIdx); }, IOName::moleFraction<FluidSystem>(phaseIdx, compIdx)); } diff --git a/dumux/porousmediumflow/3pwateroil/localresidual.hh b/dumux/porousmediumflow/3pwateroil/localresidual.hh index ea6dc23b0fbd21bed3903f8790db34a2f6bbc09c..e769d0890fad7058de7e0ec6044d0414a6a79731 100644 --- a/dumux/porousmediumflow/3pwateroil/localresidual.hh +++ b/dumux/porousmediumflow/3pwateroil/localresidual.hh @@ -57,8 +57,8 @@ protected: using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; enum { - numPhases = GetPropType<TypeTag, Properties::ModelTraits>::numPhases(), - numComponents = GetPropType<TypeTag, Properties::ModelTraits>::numComponents(), + numPhases = GetPropType<TypeTag, Properties::ModelTraits>::numFluidPhases(), + numComponents = GetPropType<TypeTag, Properties::ModelTraits>::numFluidComponents(), conti0EqIdx = Indices::conti0EqIdx,//!< Index of the mass conservation equation for the water component conti1EqIdx = conti0EqIdx + 1,//!< Index of the mass conservation equation for the contaminant component diff --git a/dumux/porousmediumflow/3pwateroil/model.hh b/dumux/porousmediumflow/3pwateroil/model.hh index bf5533536d507701489270a2f13670306be58813..f513274b2e4534639fec164650bf20c22ec882ae 100644 --- a/dumux/porousmediumflow/3pwateroil/model.hh +++ b/dumux/porousmediumflow/3pwateroil/model.hh @@ -102,8 +102,8 @@ struct ThreePWaterOilModelTraits using Indices = ThreePWaterOilIndices; static constexpr int numEq() { return 2; } - static constexpr int numPhases() { return 3; } - static constexpr int numComponents() { return 2; } + static constexpr int numFluidPhases() { return 3; } + static constexpr int numFluidComponents() { return 2; } static constexpr bool enableAdvection() { return true; } static constexpr bool enableMolecularDiffusion() { return true; } @@ -178,7 +178,7 @@ struct LocalResidual<TypeTag, TTag::ThreePWaterOilNI> { using type = ThreePWater //! Set as default that no component mass balance is replaced by the total mass balance template<class TypeTag> -struct ReplaceCompEqIdx<TypeTag, TTag::ThreePWaterOilNI> { static constexpr int value = GetPropType<TypeTag, Properties::ModelTraits>::numComponents(); }; +struct ReplaceCompEqIdx<TypeTag, TTag::ThreePWaterOilNI> { static constexpr int value = GetPropType<TypeTag, Properties::ModelTraits>::numFluidComponents(); }; //! The primary variables vector for the 3p3c model template<class TypeTag> diff --git a/dumux/porousmediumflow/3pwateroil/volumevariables.hh b/dumux/porousmediumflow/3pwateroil/volumevariables.hh index e30b252f28efb714f37c3177c598010808e9dec7..830bc54bafd1fcbf889c9a3c540937c0d698b6c5 100644 --- a/dumux/porousmediumflow/3pwateroil/volumevariables.hh +++ b/dumux/porousmediumflow/3pwateroil/volumevariables.hh @@ -58,10 +58,10 @@ class ThreePWaterOilVolumeVariables using Scalar = typename Traits::PrimaryVariables::value_type; using ModelTraits = typename Traits::ModelTraits; using FS = typename Traits::FluidSystem; - static constexpr int numFluidComps = ParentType::numComponents(); + static constexpr int numFluidComps = ParentType::numFluidComponents(); enum { - numPs = ParentType::numPhases(), + numPs = ParentType::numFluidPhases(), wCompIdx = FS::wCompIdx, nCompIdx = FS::nCompIdx, diff --git a/dumux/porousmediumflow/boxdfm/vtkoutputmodule.hh b/dumux/porousmediumflow/boxdfm/vtkoutputmodule.hh index ecbee3df2b24988d300ded2efa7358e1b5a37989..ebdd858a02ee6eab9c7f1a1e4d5b2e59ca4bb8c9 100644 --- a/dumux/porousmediumflow/boxdfm/vtkoutputmodule.hh +++ b/dumux/porousmediumflow/boxdfm/vtkoutputmodule.hh @@ -176,7 +176,7 @@ private: } if (this->velocityOutput().enableOutput()) - for (int phaseIdx = 0; phaseIdx < this->velocityOutput().numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < this->velocityOutput().numFluidPhases(); ++phaseIdx) velocity[phaseIdx].resize(numDofs); // maybe allocate space for the process rank @@ -228,7 +228,7 @@ private: // velocity output if (this->velocityOutput().enableOutput()) - for (int phaseIdx = 0; phaseIdx < this->velocityOutput().numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < this->velocityOutput().numFluidPhases(); ++phaseIdx) this->velocityOutput().calculateVelocity(velocity[phaseIdx], elemVolVars, fvGeometry, element, phaseIdx); //! the rank @@ -258,7 +258,7 @@ private: // the velocity field if (this->velocityOutput().enableOutput()) { - for (int phaseIdx = 0; phaseIdx < this->velocityOutput().numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < this->velocityOutput().numFluidPhases(); ++phaseIdx) this->sequenceWriter().addVertexData( Field(gridView, this->fvGridGeometry().vertexMapper(), velocity[phaseIdx], "velocity_" + std::string(this->velocityOutput().phaseName(phaseIdx)) + " (m/s)", /*numComp*/dimWorld, /*codim*/dim).get() ); @@ -345,7 +345,7 @@ private: } if (this->velocityOutput().enableOutput()) - for (int phaseIdx = 0; phaseIdx < this->velocityOutput().numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < this->velocityOutput().numFluidPhases(); ++phaseIdx) velocity[phaseIdx].resize(numDofs); // maybe allocate space for the process rank @@ -406,7 +406,7 @@ private: // velocity output if (this->velocityOutput().enableOutput()) - for (int phaseIdx = 0; phaseIdx < this->velocityOutput().numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < this->velocityOutput().numFluidPhases(); ++phaseIdx) this->velocityOutput().calculateVelocity(velocity[phaseIdx], elemVolVars, fvGeometry, element, phaseIdx); //! the rank @@ -442,7 +442,7 @@ private: // the velocity field if (this->velocityOutput().enableOutput()) { - for (int phaseIdx = 0; phaseIdx < this->velocityOutput().numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < this->velocityOutput().numFluidPhases(); ++phaseIdx) this->sequenceWriter().addVertexData( Field(gridView, this->fvGridGeometry().vertexMapper(), velocity[phaseIdx], "velocity_" + std::string(this->velocityOutput().phaseName(phaseIdx)) + " (m/s)", /*numComp*/dimWorld, /*codim*/dim).get() ); diff --git a/dumux/porousmediumflow/co2/volumevariables.hh b/dumux/porousmediumflow/co2/volumevariables.hh index 1691be48d362be97a6a5c31e12b6a7b25cd759da..062821b4c1562ca0c1faa6b983d863c44dac10a0 100644 --- a/dumux/porousmediumflow/co2/volumevariables.hh +++ b/dumux/porousmediumflow/co2/volumevariables.hh @@ -53,7 +53,7 @@ class TwoPTwoCCO2VolumeVariables using Scalar = typename Traits::PrimaryVariables::value_type; using ModelTraits = typename Traits::ModelTraits; - static constexpr int numFluidComps = ParentType::numComponents(); + static constexpr int numFluidComps = ParentType::numFluidComponents(); // component indices enum @@ -103,8 +103,8 @@ public: static constexpr TwoPFormulation priVarFormulation() { return formulation; } // check for permissive combinations - static_assert(ModelTraits::numPhases() == 2, "NumPhases set in the model is not two!"); - static_assert(ModelTraits::numComponents() == 2, "NumComponents set in the model is not two!"); + static_assert(ModelTraits::numFluidPhases() == 2, "NumPhases set in the model is not two!"); + static_assert(ModelTraits::numFluidComponents() == 2, "NumComponents set in the model is not two!"); static_assert((formulation == TwoPFormulation::p0s1 || formulation == TwoPFormulation::p1s0), "Chosen TwoPFormulation not supported!"); /*! @@ -291,7 +291,7 @@ public: } } - for (int phaseIdx = 0; phaseIdx < ModelTraits::numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < ModelTraits::numFluidPhases(); ++phaseIdx) { // set the viscosity and desity here if constraintsolver is not used paramCache.updateComposition(fluidState, phaseIdx); @@ -451,10 +451,10 @@ private: PermeabilityType permeability_; //!< Effective permeability within the control volume //!< Relative permeability within the control volume - std::array<Scalar, ModelTraits::numPhases()> relativePermeability_; + std::array<Scalar, ModelTraits::numFluidPhases()> relativePermeability_; //!< Binary diffusion coefficients for the phases - std::array<Scalar, ModelTraits::numPhases()> diffCoeff_; + std::array<Scalar, ModelTraits::numFluidPhases()> diffCoeff_; }; } // end namespace Dumux diff --git a/dumux/porousmediumflow/compositional/localresidual.hh b/dumux/porousmediumflow/compositional/localresidual.hh index b4f7160696d8777916b68410b4b231557ce9405a..dcdcc11e05f675d4a4b5ed0c10c700e4923f9694 100644 --- a/dumux/porousmediumflow/compositional/localresidual.hh +++ b/dumux/porousmediumflow/compositional/localresidual.hh @@ -57,8 +57,8 @@ class CompositionalLocalResidual: public GetPropType<TypeTag, Properties::BaseLo using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Indices = typename ModelTraits::Indices; - static constexpr int numPhases = ModelTraits::numPhases(); - static constexpr int numComponents = ModelTraits::numComponents(); + static constexpr int numPhases = ModelTraits::numFluidPhases(); + static constexpr int numComponents = ModelTraits::numFluidComponents(); static constexpr bool useMoles = ModelTraits::useMoles(); enum { conti0EqIdx = Indices::conti0EqIdx }; diff --git a/dumux/porousmediumflow/fluxvariables.hh b/dumux/porousmediumflow/fluxvariables.hh index 080ed71282bc75b402c24aea204c0ce7b64cf77f..0c04ffade61ee8f2702a94e3e63e9669f4b3ea29 100644 --- a/dumux/porousmediumflow/fluxvariables.hh +++ b/dumux/porousmediumflow/fluxvariables.hh @@ -64,8 +64,8 @@ class PorousMediumFluxVariables enum { - numPhases = ModelTraits::numPhases(), - numComponents = ModelTraits::numComponents() + numPhases = ModelTraits::numFluidPhases(), + numComponents = ModelTraits::numFluidComponents() }; public: diff --git a/dumux/porousmediumflow/immiscible/localresidual.hh b/dumux/porousmediumflow/immiscible/localresidual.hh index 21a4480f8b02e9080da56b9d8690cb8b26e0d72a..1c88a8fbc8de00a2a4028c0fb397fd986b5faae2 100644 --- a/dumux/porousmediumflow/immiscible/localresidual.hh +++ b/dumux/porousmediumflow/immiscible/localresidual.hh @@ -53,7 +53,7 @@ class ImmiscibleLocalResidual : public GetPropType<TypeTag, Properties::BaseLoca using EnergyLocalResidual = GetPropType<TypeTag, Properties::EnergyLocalResidual>; using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; - static constexpr int numPhases = ModelTraits::numPhases(); + static constexpr int numPhases = ModelTraits::numFluidPhases(); static constexpr int conti0EqIdx = ModelTraits::Indices::conti0EqIdx; //!< first index for the mass balance public: diff --git a/dumux/porousmediumflow/mineralization/localresidual.hh b/dumux/porousmediumflow/mineralization/localresidual.hh index 0ad4b1f558093f0a10fac361e299767a52c7250f..abbd311c982b21c167fbedde72bddd24e0ca5fc2 100644 --- a/dumux/porousmediumflow/mineralization/localresidual.hh +++ b/dumux/porousmediumflow/mineralization/localresidual.hh @@ -46,14 +46,12 @@ class MineralizationLocalResidual: public CompositionalLocalResidual<TypeTag> using Problem = GetPropType<TypeTag, Properties::Problem>; using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; - static constexpr int numPhases = ModelTraits::numPhases(); + static constexpr int numPhases = ModelTraits::numFluidPhases(); static constexpr int numSolidComps = ModelTraits::numSolidComps(); static constexpr int numInertSolidComps = ModelTraits::numInertSolidComps(); - static constexpr int numComponents = ModelTraits::numComponents(); + static constexpr int numComponents = ModelTraits::numFluidComponents(); static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); - enum { conti0EqIdx = Indices::conti0EqIdx }; - public: using ParentType::ParentType; @@ -83,7 +81,7 @@ public: // compute storage term of all components within all fluid phases for (int phaseIdx = 0; phaseIdx < numSolidComps-numInertSolidComps; ++phaseIdx) { - auto eqIdx = conti0EqIdx + numComponents + phaseIdx; + auto eqIdx = Indices::conti0EqIdx + numComponents + phaseIdx; storage[eqIdx] += volVars.solidVolumeFraction(phaseIdx) * massOrMoleDensity(volVars, phaseIdx); } diff --git a/dumux/porousmediumflow/mpnc/iofields.hh b/dumux/porousmediumflow/mpnc/iofields.hh index 2d1b54bc9159f213ce773e6475d79ffaad572fb6..6313719b084a3416729f3f8578aeaf82a1ef5fb0 100644 --- a/dumux/porousmediumflow/mpnc/iofields.hh +++ b/dumux/porousmediumflow/mpnc/iofields.hh @@ -42,7 +42,7 @@ public: using VolumeVariables = typename OutputModule::VolumeVariables; using FluidSystem = typename VolumeVariables::FluidSystem; - for (int i = 0; i < VolumeVariables::numPhases(); ++i) + for (int i = 0; i < VolumeVariables::numFluidPhases(); ++i) { out.addVolumeVariable([i](const auto& v){ return v.saturation(i); }, IOName::saturation<FluidSystem>(i)); @@ -53,12 +53,12 @@ public: out.addVolumeVariable([i](const auto& v){ return v.mobility(i); }, IOName::mobility<FluidSystem>(i)); - for (int j = 0; j < VolumeVariables::numComponents(); ++j) + for (int j = 0; j < VolumeVariables::numFluidComponents(); ++j) out.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); }, IOName::moleFraction<FluidSystem>(i, j)); } - for (int j = 0; j < VolumeVariables::numComponents(); ++j) + for (int j = 0; j < VolumeVariables::numFluidComponents(); ++j) out.addVolumeVariable([j](const auto& v){ return v.fugacity(j); }, "fugacity^"+ FluidSystem::componentName(j)); diff --git a/dumux/porousmediumflow/mpnc/localresidual.hh b/dumux/porousmediumflow/mpnc/localresidual.hh index c769c1fea6ecc86fe48039b0c34de0e99bd04f97..862149b69f50fca04eafa6d3e52a80ee047d28ec 100644 --- a/dumux/porousmediumflow/mpnc/localresidual.hh +++ b/dumux/porousmediumflow/mpnc/localresidual.hh @@ -53,7 +53,7 @@ class MPNCLocalResidual : public CompositionalLocalResidual<TypeTag> using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Indices = typename ModelTraits::Indices; - enum {numPhases = ModelTraits::numPhases()}; + enum {numPhases = ModelTraits::numFluidPhases()}; enum {phase0NcpIdx = Indices::phase0NcpIdx}; public: diff --git a/dumux/porousmediumflow/mpnc/model.hh b/dumux/porousmediumflow/mpnc/model.hh index 57153b7dbbe39c1df5175b4dc01908204a341cf7..19fbde06c077ed45721cc425211247f79df52aef 100644 --- a/dumux/porousmediumflow/mpnc/model.hh +++ b/dumux/porousmediumflow/mpnc/model.hh @@ -136,8 +136,8 @@ template<int nPhases, int nComp, MpNcPressureFormulation formulation, bool useM, struct MPNCModelTraits { static constexpr int numEq() { return numTransportEq()+numConstraintEq(); } - static constexpr int numPhases() { return nPhases; } - static constexpr int numComponents() { return nComp; } + static constexpr int numFluidPhases() { return nPhases; } + static constexpr int numFluidComponents() { return nComp; } static constexpr int numTransportEq() { return nComp;} static constexpr int numConstraintEq() { return nPhases; } static constexpr int replaceCompEqIdx() { return repCompEqIdx; } @@ -152,7 +152,7 @@ struct MPNCModelTraits static constexpr MpNcPressureFormulation pressureFormulation() { return formulation; } //! Per default, we use the indices without offset - using Indices = MPNCIndices< numPhases(), numEq() >; + using Indices = MPNCIndices< numFluidPhases(), numEq() >; }; /*! @@ -170,7 +170,7 @@ struct MPNCNonequilibriumModelTraits : public NonEquilTraits private: //! we overwrite the indices as the underlying mpnc indices depend on numTransportEq, //! which is again dependent on which form of non-equilibrium is considered - using MpNcIndices = MPNCIndices< NonEquilTraits::numPhases(), + using MpNcIndices = MPNCIndices< NonEquilTraits::numFluidPhases(), NonEquilTraits::numTransportEq()+NonEquilTraits::numConstraintEq() >; public: using Indices = NonEquilbriumIndices< MpNcIndices, diff --git a/dumux/porousmediumflow/mpnc/volumevariables.hh b/dumux/porousmediumflow/mpnc/volumevariables.hh index ff7f03165fa795f1352a06372b0a23ef39ff1aa7..9433b3fb8b2cd550afd9e7f44e6b165363a77b42 100644 --- a/dumux/porousmediumflow/mpnc/volumevariables.hh +++ b/dumux/porousmediumflow/mpnc/volumevariables.hh @@ -67,7 +67,7 @@ class MPNCVolumeVariablesImplementation<Traits, false> static constexpr bool enableDiffusion = ModelTraits::enableMolecularDiffusion(); using Indices = typename ModelTraits::Indices; - using ComponentVector = Dune::FieldVector<Scalar, ModelTraits::numComponents()>; + using ComponentVector = Dune::FieldVector<Scalar, ModelTraits::numFluidComponents()>; using CompositionFromFugacities = Dumux::CompositionFromFugacities<Scalar, typename Traits::FluidSystem>; public: @@ -81,9 +81,9 @@ public: using SolidSystem = typename Traits::SolidSystem; //! return number of phases considered by the model - static constexpr int numPhases() { return ModelTraits::numPhases(); } + static constexpr int numFluidPhases() { return ModelTraits::numFluidPhases(); } //! return number of components considered by the model - static constexpr int numFluidComps = ParentType::numComponents(); + static constexpr int numFluidComps = ParentType::numFluidComponents(); /*! * \brief Update all quantities for a given control volume @@ -108,7 +108,7 @@ public: const auto& materialParams = problem.spatialParams().materialLawParams(element, scv, elemSol); // relative permeabilities using MaterialLaw = typename Problem::SpatialParams::MaterialLaw; - using MPAdapter = MPAdapter<MaterialLaw, numPhases()>; + using MPAdapter = MPAdapter<MaterialLaw, numFluidPhases()>; MPAdapter::relativePermeabilities(relativePermeability_, materialParams, fluidState_); @@ -116,7 +116,7 @@ public: paramCache.updateAll(fluidState_); if (enableDiffusion) { - for (int phaseIdx = 0; phaseIdx < numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < numFluidPhases(); ++phaseIdx) { int compIIdx = phaseIdx; for (unsigned int compJIdx = 0; compJIdx < numFluidComps; ++compJIdx) @@ -170,12 +170,12 @@ public: ///////////// auto&& priVars = elemSol[scv.localDofIndex()]; Scalar sumSat = 0; - for (int phaseIdx = 0; phaseIdx < numPhases() - 1; ++phaseIdx) { + for (int phaseIdx = 0; phaseIdx < numFluidPhases() - 1; ++phaseIdx) { sumSat += priVars[Indices::s0Idx + phaseIdx]; fluidState.setSaturation(phaseIdx, priVars[Indices::s0Idx + phaseIdx]); } Valgrind::CheckDefined(sumSat); - fluidState.setSaturation(numPhases() - 1, 1.0 - sumSat); + fluidState.setSaturation(numFluidPhases() - 1, 1.0 - sumSat); ///////////// // set the phase pressures @@ -186,9 +186,9 @@ public: const auto& materialParams = problem.spatialParams().materialLawParams(element, scv, elemSol); // capillary pressures - std::vector<Scalar> capPress(numPhases()); + std::vector<Scalar> capPress(numFluidPhases()); using MaterialLaw = typename Problem::SpatialParams::MaterialLaw; - using MPAdapter = MPAdapter<MaterialLaw, numPhases()>; + using MPAdapter = MPAdapter<MaterialLaw, numFluidPhases()>; MPAdapter::capillaryPressures(capPress, materialParams, fluidState, wPhaseIdx); // add to the pressure of the first fluid phase @@ -197,15 +197,15 @@ public: // This means that the pressures are sorted from the most wetting to the least wetting-1 in the primary variables vector. // For two phases this means that there is one pressure as primary variable: pw const Scalar pw = priVars[Indices::p0Idx]; - for (int phaseIdx = 0; phaseIdx < numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < numFluidPhases(); ++phaseIdx) fluidState.setPressure(phaseIdx, pw - capPress[0] + capPress[phaseIdx]); } else if(pressureFormulation == MpNcPressureFormulation::leastWettingFirst){ // This means that the pressures are sorted from the least wetting to the most wetting-1 in the primary variables vector. // For two phases this means that there is one pressure as primary variable: pn const Scalar pn = priVars[Indices::p0Idx]; - for (int phaseIdx = numPhases()-1; phaseIdx >= 0; --phaseIdx) - fluidState.setPressure(phaseIdx, pn - capPress[numPhases()-1] + capPress[phaseIdx]); + for (int phaseIdx = numFluidPhases()-1; phaseIdx >= 0; --phaseIdx) + fluidState.setPressure(phaseIdx, pn - capPress[numFluidPhases()-1] + capPress[phaseIdx]); } else DUNE_THROW(Dune::InvalidStateException, "MPNCVolumeVariables do not support the chosen pressure formulation"); @@ -222,7 +222,7 @@ public: fug[compIdx] = priVars[Indices::fug0Idx + compIdx]; // calculate phase compositions - for (int phaseIdx = 0; phaseIdx < numPhases(); ++phaseIdx) { + for (int phaseIdx = 0; phaseIdx < numFluidPhases(); ++phaseIdx) { // initial guess for (int compIdx = 0; compIdx < numFluidComps; ++compIdx) { Scalar x_ij = 1.0/numFluidComps; @@ -239,7 +239,7 @@ public: } // dynamic viscosities - for (int phaseIdx = 0; phaseIdx < numPhases(); ++phaseIdx) { + for (int phaseIdx = 0; phaseIdx < numFluidPhases(); ++phaseIdx) { // viscosities Scalar mu = FluidSystem::viscosity(fluidState, paramCache, phaseIdx); fluidState.setViscosity(phaseIdx, mu); @@ -490,9 +490,9 @@ protected: DUNE_THROW(Dune::InvalidStateException, "Diffusion coeffiecient for phaseIdx = compIdx doesn't exist"); } - std::array<std::array<Scalar, numFluidComps-1>, numPhases()> diffCoefficient_; + std::array<std::array<Scalar, numFluidComps-1>, numFluidPhases()> diffCoefficient_; Scalar porosity_; //!< Effective porosity within the control volume - std::array<Scalar, ModelTraits::numPhases()> relativePermeability_; //!< Effective relative permeability within the control volume + std::array<Scalar, ModelTraits::numFluidPhases()> relativePermeability_; //!< Effective relative permeability within the control volume PermeabilityType permeability_; //! Mass fractions of each component within each phase @@ -519,7 +519,7 @@ class MPNCVolumeVariablesImplementation<Traits, true> static constexpr bool enableDiffusion = ModelTraits::enableMolecularDiffusion(); using Indices = typename ModelTraits::Indices; - using ComponentVector = Dune::FieldVector<Scalar, ModelTraits::numComponents()>; + using ComponentVector = Dune::FieldVector<Scalar, ModelTraits::numFluidComponents()>; using CompositionFromFugacities = Dumux::CompositionFromFugacities<Scalar, typename Traits::FluidSystem>; using ParameterCache = typename Traits::FluidSystem::ParameterCache; @@ -534,9 +534,9 @@ public: using SolidSystem = typename Traits::SolidSystem; //! return number of phases considered by the model - static constexpr int numPhases() { return ModelTraits::numPhases(); } + static constexpr int numFluidPhases() { return ModelTraits::numFluidPhases(); } //! return number of components considered by the model - static constexpr int numFluidComps = ParentType::numComponents(); + static constexpr int numFluidComps = ParentType::numFluidComponents(); using ConstraintSolver = MiscibleMultiPhaseComposition<Scalar, FluidSystem>; /*! @@ -563,7 +563,7 @@ public: // relative permeabilities using MaterialLaw = typename Problem::SpatialParams::MaterialLaw; - using MPAdapter = MPAdapter<MaterialLaw, numPhases()>; + using MPAdapter = MPAdapter<MaterialLaw, numFluidPhases()>; MPAdapter::relativePermeabilities(relativePermeability_, materialParams, fluidState_); @@ -571,7 +571,7 @@ public: paramCache.updateAll(fluidState_); if (enableDiffusion) { - for (int phaseIdx = 0; phaseIdx < numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < numFluidPhases(); ++phaseIdx) { int compIIdx = phaseIdx; for (unsigned int compJIdx = 0; compJIdx < numFluidComps; ++compJIdx) @@ -624,12 +624,12 @@ public: ///////////// auto&& priVars = elemSol[scv.localDofIndex()]; Scalar sumSat = 0; - for (int phaseIdx = 0; phaseIdx < numPhases() - 1; ++phaseIdx) { + for (int phaseIdx = 0; phaseIdx < numFluidPhases() - 1; ++phaseIdx) { sumSat += priVars[Indices::s0Idx + phaseIdx]; fluidState.setSaturation(phaseIdx, priVars[Indices::s0Idx + phaseIdx]); } Valgrind::CheckDefined(sumSat); - fluidState.setSaturation(numPhases() - 1, 1.0 - sumSat); + fluidState.setSaturation(numFluidPhases() - 1, 1.0 - sumSat); ///////////// // set the phase pressures @@ -640,9 +640,9 @@ public: const int wPhaseIdx = problem.spatialParams().template wettingPhase<FluidSystem>(element, scv, elemSol); fluidState.setWettingPhase(wPhaseIdx); // capillary pressures - std::vector<Scalar> capPress(numPhases()); + std::vector<Scalar> capPress(numFluidPhases()); using MaterialLaw = typename Problem::SpatialParams::MaterialLaw; - using MPAdapter = MPAdapter<MaterialLaw, numPhases()>; + using MPAdapter = MPAdapter<MaterialLaw, numFluidPhases()>; MPAdapter::capillaryPressures(capPress, materialParams, fluidState, wPhaseIdx); // add to the pressure of the first fluid phase @@ -651,15 +651,15 @@ public: // This means that the pressures are sorted from the most wetting to the least wetting-1 in the primary variables vector. // For two phases this means that there is one pressure as primary variable: pw const Scalar pw = priVars[Indices::p0Idx]; - for (int phaseIdx = 0; phaseIdx < numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < numFluidPhases(); ++phaseIdx) fluidState.setPressure(phaseIdx, pw - capPress[0] + capPress[phaseIdx]); } else if(pressureFormulation == MpNcPressureFormulation::leastWettingFirst){ // This means that the pressures are sorted from the least wetting to the most wetting-1 in the primary variables vector. // For two phases this means that there is one pressure as primary variable: pn const Scalar pn = priVars[Indices::p0Idx]; - for (int phaseIdx = numPhases()-1; phaseIdx >= 0; --phaseIdx) - fluidState.setPressure(phaseIdx, pn - capPress[numPhases()-1] + capPress[phaseIdx]); + for (int phaseIdx = numFluidPhases()-1; phaseIdx >= 0; --phaseIdx) + fluidState.setPressure(phaseIdx, pn - capPress[numFluidPhases()-1] + capPress[phaseIdx]); } else DUNE_THROW(Dune::InvalidStateException, "MPNCVolumeVariables do not support the chosen pressure formulation"); @@ -682,7 +682,7 @@ public: // dynamic viscosities - for (int phaseIdx = 0; phaseIdx < numPhases(); ++phaseIdx) { + for (int phaseIdx = 0; phaseIdx < numFluidPhases(); ++phaseIdx) { // viscosities Scalar mu = FluidSystem::viscosity(fluidState, paramCache, phaseIdx); fluidState.setViscosity(phaseIdx, mu); @@ -707,7 +707,7 @@ public: const typename Traits::PrimaryVariables& priVars) { // setting the mole fractions of the fluid state - for(int phaseIdx=0; phaseIdx<numPhases(); ++phaseIdx) + for(int phaseIdx=0; phaseIdx<numFluidPhases(); ++phaseIdx) { // set the component mole fractions for (int compIdx = 0; compIdx < numFluidComps; ++compIdx) { @@ -721,7 +721,7 @@ public: // // For using the ... other way of calculating equilibrium // THIS IS ONLY FOR silencing Valgrind but is not used in this model - for(int phaseIdx=0; phaseIdx<numPhases(); ++phaseIdx) + for(int phaseIdx=0; phaseIdx<numFluidPhases(); ++phaseIdx) for (int compIdx = 0; compIdx < numFluidComps; ++compIdx) { const Scalar phi = FluidSystem::fugacityCoefficient(actualFluidState, paramCache, @@ -738,14 +738,14 @@ public: paramCache) ; // Setting the equilibrium composition (in a kinetic model not necessarily the same as the actual mole fraction) - for(int phaseIdx=0; phaseIdx<numPhases(); ++phaseIdx){ + for(int phaseIdx=0; phaseIdx<numFluidPhases(); ++phaseIdx){ for (int compIdx=0; compIdx< numFluidComps; ++ compIdx){ xEquil_[phaseIdx][compIdx] = equilFluidState.moleFraction(phaseIdx, compIdx); } } // compute densities of all phases - for(int phaseIdx=0; phaseIdx<numPhases(); ++phaseIdx){ + for(int phaseIdx=0; phaseIdx<numFluidPhases(); ++phaseIdx){ const Scalar rho = FluidSystem::density(actualFluidState, paramCache, phaseIdx); actualFluidState.setDensity(phaseIdx, rho); const Scalar rhoMolar = FluidSystem::molarDensity(actualFluidState, paramCache, phaseIdx); @@ -1003,10 +1003,10 @@ protected: DUNE_THROW(Dune::InvalidStateException, "Diffusion coeffiecient for phaseIdx = compIdx doesn't exist"); } - std::array<std::array<Scalar, numFluidComps-1>, numPhases()> diffCoefficient_; - std::array<Scalar, ModelTraits::numPhases()> relativePermeability_; //!< Effective relative permeability within the control volume + std::array<std::array<Scalar, numFluidComps-1>, numFluidPhases()> diffCoefficient_; + std::array<Scalar, ModelTraits::numFluidPhases()> relativePermeability_; //!< Effective relative permeability within the control volume PermeabilityType permeability_; - Scalar xEquil_[numPhases()][numFluidComps]; + std::array<std::array<Scalar, numFluidComps>, numFluidPhases()> xEquil_; //! Mass fractions of each component within each phase FluidState fluidState_; diff --git a/dumux/porousmediumflow/nonequilibrium/gridvariables.hh b/dumux/porousmediumflow/nonequilibrium/gridvariables.hh index bcf2e3c4343d383586c710dfbea61def7da930f8..b4d237b5c55474d739a636e2260ce22ad86356f0 100644 --- a/dumux/porousmediumflow/nonequilibrium/gridvariables.hh +++ b/dumux/porousmediumflow/nonequilibrium/gridvariables.hh @@ -51,10 +51,10 @@ class NonEquilibriumGridVariables using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>; using GridView = typename FVGridGeometry::GridView; - enum { dim = GridView::dimension }; // Grid and world dimension - enum { dimWorld = GridView::dimensionworld }; + static constexpr auto dim = GridView::dimension; // Grid and world dimension + static constexpr auto dimWorld = GridView::dimensionworld; - static constexpr int numPhases = GetPropType<TypeTag, Properties::ModelTraits>::numPhases(); + static constexpr int numPhases = GetPropType<TypeTag, Properties::ModelTraits>::numFluidPhases(); static constexpr bool isBox = FVGridGeometry::discMethod == DiscretizationMethod::box; public: diff --git a/dumux/porousmediumflow/nonequilibrium/iofields.hh b/dumux/porousmediumflow/nonequilibrium/iofields.hh index 514d828143c978b047e1ec9d4c2b284bd3fe463f..ca0c1bd59a9721beb7c95505da1cca9fb40d3375 100644 --- a/dumux/porousmediumflow/nonequilibrium/iofields.hh +++ b/dumux/porousmediumflow/nonequilibrium/iofields.hh @@ -44,11 +44,16 @@ public: EquilibriumIOFields::initOutputModule(out); for (int i = 0; i < ModelTraits::numEnergyEqFluid(); ++i) + { out.addVolumeVariable([i](const auto& v){ return v.temperatureFluid(i); }, - IOName::fluidTemperature<FluidSystem>(i)); + IOName::fluidTemperature<FluidSystem>(i)); + } + out.addVolumeVariable([](const auto& v){ return v.temperatureSolid(); }, IOName::solidTemperature()); - for (int i = 0; i < ModelTraits::numPhases(); ++i){ + + for (int i = 0; i < ModelTraits::numFluidPhases(); ++i) + { out.addVolumeVariable( [i](const auto& v){ return v.reynoldsNumber(i); }, "reynoldsNumber_" + FluidSystem::phaseName(i) ); out.addVolumeVariable( [i](const auto& v){ return v.nusseltNumber(i); }, "nusseltNumber_" + FluidSystem::phaseName(i) ); out.addVolumeVariable( [i](const auto& v){ return v.prandtlNumber(i); }, "prandtlNumber_" + FluidSystem::phaseName(i) ); diff --git a/dumux/porousmediumflow/nonequilibrium/localresidual.hh b/dumux/porousmediumflow/nonequilibrium/localresidual.hh index eb4ad8f804ffe7e69e080946ff9f751b4cff19d7..72a864113a5c37b8b4ae312103f5fd7d44768fd3 100644 --- a/dumux/porousmediumflow/nonequilibrium/localresidual.hh +++ b/dumux/porousmediumflow/nonequilibrium/localresidual.hh @@ -60,8 +60,8 @@ class NonEquilibriumLocalResidualImplementation<TypeTag, true, false>: public Ge using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Indices = typename ModelTraits::Indices; - static constexpr int numPhases = ModelTraits::numPhases(); - static constexpr int numComponents = ModelTraits::numComponents(); + static constexpr int numPhases = ModelTraits::numFluidPhases(); + static constexpr int numComponents = ModelTraits::numFluidComponents(); enum { conti0EqIdx = Indices::conti0EqIdx }; public: using ParentType::ParentType; @@ -161,11 +161,9 @@ class NonEquilibriumLocalResidualImplementation<TypeTag, true, true>: public Get using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; - using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>; using FluxVariables = GetPropType<TypeTag, Properties::FluxVariables>; using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView; - using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>; using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; @@ -177,16 +175,16 @@ class NonEquilibriumLocalResidualImplementation<TypeTag, true, true>: public Get using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Indices = typename ModelTraits::Indices; - static constexpr int numPhases = ModelTraits::numPhases(); - static constexpr int numComponents = ModelTraits::numComponents(); + static constexpr int numPhases = ModelTraits::numFluidPhases(); + static constexpr int numComponents = ModelTraits::numFluidComponents(); static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); using ComponentVector = Dune::FieldVector<Scalar, numComponents>; - enum { conti0EqIdx = Indices::conti0EqIdx }; - enum { comp1Idx = FluidSystem::comp1Idx } ; - enum { comp0Idx = FluidSystem::comp0Idx } ; - enum { phase0Idx = FluidSystem::phase0Idx} ; - enum { phase1Idx = FluidSystem::phase1Idx} ; + static constexpr auto conti0EqIdx = Indices::conti0EqIdx; + static constexpr auto comp1Idx = FluidSystem::comp1Idx; + static constexpr auto comp0Idx = FluidSystem::comp0Idx; + static constexpr auto phase0Idx = FluidSystem::phase0Idx; + static constexpr auto phase1Idx = FluidSystem::phase1Idx; public: using ParentType::ParentType; diff --git a/dumux/porousmediumflow/nonequilibrium/model.hh b/dumux/porousmediumflow/nonequilibrium/model.hh index 893f81330c3e7a597c8837d12547cd887dcf607f..c36ff21f15fbcdab873bd58813f72b52235ec475 100644 --- a/dumux/porousmediumflow/nonequilibrium/model.hh +++ b/dumux/porousmediumflow/nonequilibrium/model.hh @@ -63,7 +63,7 @@ template<class ET, bool chem, bool therm, int numEF, int numES, NusseltFormulati struct NonEquilibriumModelTraits : public ET { static constexpr int numEq() { return numEnergyEqFluid()+numEnergyEqSolid()+numTransportEq()+ET::numConstraintEq(); } - static constexpr int numTransportEq() { return chem ? ET::numPhases()*ET::numComponents() : ET::numComponents(); } + static constexpr int numTransportEq() { return chem ? ET::numFluidPhases()*ET::numFluidComponents() : ET::numFluidComponents(); } static constexpr int numEnergyEqFluid() { return therm ? numEF : 0; } static constexpr int numEnergyEqSolid() { return therm ? numES : 0; } @@ -120,7 +120,7 @@ struct EnableChemicalNonEquilibrium<TypeTag, TTag::NonEquilibrium> { static cons template<class TypeTag> struct NumEnergyEqSolid<TypeTag, TTag::NonEquilibrium> { static constexpr int value = 1; }; template<class TypeTag> -struct NumEnergyEqFluid<TypeTag, TTag::NonEquilibrium> { static constexpr int value = GetPropType<TypeTag, Properties::EquilibriumModelTraits>::numPhases(); }; +struct NumEnergyEqFluid<TypeTag, TTag::NonEquilibrium> { static constexpr int value = GetPropType<TypeTag, Properties::EquilibriumModelTraits>::numFluidPhases(); }; template<class TypeTag> struct EnergyLocalResidual<TypeTag, TTag::NonEquilibrium> { using type = EnergyLocalResidualNonEquilibrium<TypeTag, getPropValue<TypeTag, Properties::NumEnergyEqFluid>()>; }; diff --git a/dumux/porousmediumflow/nonequilibrium/thermal/localresidual.hh b/dumux/porousmediumflow/nonequilibrium/thermal/localresidual.hh index b55b9e0e0ded869fc52c7c9b1c145237742e9531..1fd2b2a5b633a6849383b2e04f2cf87eccfc4bd2 100644 --- a/dumux/porousmediumflow/nonequilibrium/thermal/localresidual.hh +++ b/dumux/porousmediumflow/nonequilibrium/thermal/localresidual.hh @@ -58,14 +58,13 @@ class EnergyLocalResidualNonEquilibrium<TypeTag, 1/*numEnergyEqFluid*/> using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Indices = typename ModelTraits::Indices; - enum { numEnergyEqFluid = ModelTraits::numEnergyEqFluid() }; - enum { numEnergyEqSolid = ModelTraits::numEnergyEqSolid() }; - enum { energyEq0Idx = Indices::energyEq0Idx }; - enum { energyEqSolidIdx = Indices::energyEqSolidIdx}; - - enum { numPhases = ModelTraits::numPhases() }; + static constexpr auto numEnergyEqFluid = ModelTraits::numEnergyEqFluid(); + static constexpr auto numEnergyEqSolid = ModelTraits::numEnergyEqSolid(); + static constexpr auto energyEq0Idx = Indices::energyEq0Idx; + static constexpr auto energyEqSolidIdx = Indices::energyEqSolidIdx; - enum { numComponents = ModelTraits::numComponents() }; + static constexpr auto numPhases = ModelTraits::numFluidPhases(); + static constexpr auto numComponents = ModelTraits::numFluidComponents(); public: //! The energy storage in the fluid phase with index phaseIdx @@ -222,14 +221,14 @@ class EnergyLocalResidualNonEquilibrium<TypeTag, 2 /*numEnergyEqFluid*/> using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Indices = typename ModelTraits::Indices; - enum { numPhases = ModelTraits::numPhases() }; + enum { numPhases = ModelTraits::numFluidPhases() }; enum { numEnergyEqFluid = ModelTraits::numEnergyEqFluid() }; enum { numEnergyEqSolid = ModelTraits::numEnergyEqSolid() }; enum { energyEq0Idx = Indices::energyEq0Idx }; enum { energyEqSolidIdx = Indices::energyEqSolidIdx}; enum { conti0EqIdx = Indices::conti0EqIdx }; - enum { numComponents = ModelTraits::numComponents() }; + enum { numComponents = ModelTraits::numFluidComponents() }; enum { phase0Idx = FluidSystem::phase0Idx}; enum { phase1Idx = FluidSystem::phase1Idx}; enum { sPhaseIdx = numPhases}; diff --git a/dumux/porousmediumflow/nonequilibrium/volumevariables.hh b/dumux/porousmediumflow/nonequilibrium/volumevariables.hh index f07f08c0b0686cd363af9c443df466ac4a5af4a2..327e25f71326c0b29b054ad1b9ac95686f897fff 100644 --- a/dumux/porousmediumflow/nonequilibrium/volumevariables.hh +++ b/dumux/porousmediumflow/nonequilibrium/volumevariables.hh @@ -80,6 +80,10 @@ class NonEquilibriumVolumeVariablesImplementation< Traits, using DimLessNum = DimensionlessNumbers<Scalar>; + using NumFluidPhasesArray = std::array<Scalar, ModelTraits::numFluidPhases()>; + using InterfacialAreasArray = std::array<std::array<Scalar, ModelTraits::numFluidPhases()+numEnergyEqSolid>, + ModelTraits::numFluidPhases()+numEnergyEqSolid>; + public: using FluidState = typename Traits::FluidState; using Indices = typename ModelTraits::Indices; @@ -130,7 +134,7 @@ public: // set the dimensionless numbers and obtain respective quantities const unsigned int vIdxGlobal = scv.dofIndex(); - for (int phaseIdx = 0; phaseIdx < ModelTraits::numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < ModelTraits::numFluidPhases(); ++phaseIdx) { const auto darcyMagVelocity = problem.gridVariables().volumeDarcyMagVelocity(phaseIdx, vIdxGlobal); const auto dynamicViscosity = fluidState.viscosity(phaseIdx); @@ -239,14 +243,14 @@ public: private: //! dimensionless numbers - Scalar reynoldsNumber_[ModelTraits::numPhases()]; - Scalar prandtlNumber_[ModelTraits::numPhases()]; - Scalar nusseltNumber_[ModelTraits::numPhases()]; + NumFluidPhasesArray reynoldsNumber_; + NumFluidPhasesArray prandtlNumber_; + NumFluidPhasesArray nusseltNumber_; Scalar characteristicLength_; Scalar factorEnergyTransfer_; Scalar solidSurface_ ; - Scalar interfacialArea_[ModelTraits::numPhases()+numEnergyEqSolid][ModelTraits::numPhases()+numEnergyEqSolid]; + InterfacialAreasArray interfacialArea_; }; ///////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -272,6 +276,8 @@ class NonEquilibriumVolumeVariablesImplementation< Traits, using DimLessNum = DimensionlessNumbers<Scalar>; + using NumFluidPhasesArray = std::array<Scalar, ModelTraits::numFluidPhases()>; + public: using FluidState = typename Traits::FluidState; /*! @@ -322,7 +328,7 @@ public: // set the dimensionless numbers and obtain respective quantities const unsigned int vIdxGlobal = scv.dofIndex(); - for (int phaseIdx = 0; phaseIdx < ModelTraits::numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < ModelTraits::numFluidPhases(); ++phaseIdx) { const auto darcyMagVelocity = problem.gridVariables().volumeDarcyMagVelocity(phaseIdx, vIdxGlobal); const auto dynamicViscosity = fluidState.viscosity(phaseIdx); @@ -381,9 +387,9 @@ public: private: //! dimensionless numbers - Scalar reynoldsNumber_[ModelTraits::numPhases()]; - Scalar prandtlNumber_[ModelTraits::numPhases()]; - Scalar nusseltNumber_[ModelTraits::numPhases()]; + NumFluidPhasesArray reynoldsNumber_; + NumFluidPhasesArray prandtlNumber_; + NumFluidPhasesArray nusseltNumber_; Scalar characteristicLength_; Scalar factorEnergyTransfer_; @@ -416,6 +422,9 @@ class NonEquilibriumVolumeVariablesImplementation< Traits, static constexpr auto nCompIdx = FS::comp1Idx; using DimLessNum = DimensionlessNumbers<Scalar>; + + using NumFluidPhasesArray = std::array<Scalar, ModelTraits::numFluidPhases()>; + public: /*! * \brief Update all quantities for a given control volume @@ -464,7 +473,7 @@ public: // set the dimensionless numbers and obtain respective quantities. const auto globalVertexIdx = problem.fvGridGeometry().vertexMapper().subIndex(element, scv, Element::Geometry::mydimension); - for (int phaseIdx = 0; phaseIdx < ModelTraits::numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < ModelTraits::numFluidPhases(); ++phaseIdx) { const auto darcyMagVelocity = problem.gridVariables().volumeDarcyMagVelocity(phaseIdx, globalVertexIdx); const auto dynamicViscosity = fluidState.viscosity(phaseIdx); @@ -544,9 +553,9 @@ private: Scalar factorMassTransfer_; Scalar solidSurface_ ; Scalar interfacialArea_ ; - Scalar sherwoodNumber_[ModelTraits::numPhases()] ; - Scalar schmidtNumber_[ModelTraits::numPhases()] ; - Scalar reynoldsNumber_[ModelTraits::numPhases()] ; + NumFluidPhasesArray sherwoodNumber_; + NumFluidPhasesArray schmidtNumber_; + NumFluidPhasesArray reynoldsNumber_; }; // Specialization where everything is in non-equilibrium. @@ -578,6 +587,10 @@ class NonEquilibriumVolumeVariablesImplementation< Traits, using DimLessNum = DimensionlessNumbers<Scalar>; static_assert((numEnergyEqFluid > 1), "This model only deals with energy transfer between two fluids and one solid phase"); + using NumFluidPhasesArray = std::array<Scalar, ModelTraits::numFluidPhases()>; + using InterfacialAreasArray = std::array<std::array<Scalar, ModelTraits::numFluidPhases()+numEnergyEqSolid>, + ModelTraits::numFluidPhases()+numEnergyEqSolid>; + public: /*! * \brief Update all quantities for a given control volume @@ -627,7 +640,7 @@ public: const auto vIdxGlobal = scv.dofIndex(); using FluidSystem = typename Traits::FluidSystem; - for (int phaseIdx = 0; phaseIdx < ModelTraits::numPhases(); ++phaseIdx) + for (int phaseIdx = 0; phaseIdx < ModelTraits::numFluidPhases(); ++phaseIdx) { const auto darcyMagVelocity = problem.gridVariables().volumeDarcyMagVelocity(phaseIdx, vIdxGlobal); const auto dynamicViscosity = fluidState.viscosity(phaseIdx); @@ -753,16 +766,16 @@ public: private: //! dimensionless numbers - Scalar reynoldsNumber_[ModelTraits::numPhases()]; - Scalar prandtlNumber_[ModelTraits::numPhases()]; - Scalar nusseltNumber_[ModelTraits::numPhases()]; - Scalar schmidtNumber_[ModelTraits::numPhases()]; - Scalar sherwoodNumber_[ModelTraits::numPhases()]; + NumFluidPhasesArray reynoldsNumber_; + NumFluidPhasesArray prandtlNumber_; + NumFluidPhasesArray nusseltNumber_; + NumFluidPhasesArray schmidtNumber_; + NumFluidPhasesArray sherwoodNumber_; Scalar characteristicLength_; Scalar factorEnergyTransfer_; Scalar factorMassTransfer_; Scalar solidSurface_ ; - Scalar interfacialArea_[ModelTraits::numPhases()+numEnergyEqSolid][ModelTraits::numPhases()+numEnergyEqSolid]; + InterfacialAreasArray interfacialArea_; }; } // namespace Dumux diff --git a/dumux/porousmediumflow/richards/model.hh b/dumux/porousmediumflow/richards/model.hh index a4eb5b344798472c2515b1ddd86eded09924d2c6..4ab0261692f7807174528c269f8ee32a47efe886 100644 --- a/dumux/porousmediumflow/richards/model.hh +++ b/dumux/porousmediumflow/richards/model.hh @@ -128,8 +128,8 @@ struct RichardsModelTraits using Indices = RichardsIndices; static constexpr int numEq() { return 1; } - static constexpr int numPhases() { return 2; } - static constexpr int numComponents() { return 1; } + static constexpr int numFluidPhases() { return 2; } + static constexpr int numFluidComponents() { return 1; } static constexpr bool enableAdvection() { return true; } static constexpr bool enableMolecularDiffusion() { return enableDiff; } diff --git a/dumux/porousmediumflow/richards/volumevariables.hh b/dumux/porousmediumflow/richards/volumevariables.hh index 3b629d328af9c29ec7eddb82b945d6d9d8efea13..3872a386426fe1f8d9c9d2de275db9421aba0563 100644 --- a/dumux/porousmediumflow/richards/volumevariables.hh +++ b/dumux/porousmediumflow/richards/volumevariables.hh @@ -68,7 +68,7 @@ class RichardsVolumeVariables using Scalar = typename Traits::PrimaryVariables::value_type; using PermeabilityType = typename Traits::PermeabilityType; using ModelTraits = typename Traits::ModelTraits; - static constexpr int numFluidComps = ParentType::numComponents(); + static constexpr int numFluidComps = ParentType::numFluidComponents(); public: //! export type of the fluid system using FluidSystem = typename Traits::FluidSystem; @@ -445,8 +445,8 @@ protected: Scalar relativePermeabilityWetting_; //!< the relative permeability of the wetting phase PermeabilityType permeability_; //!< the instrinsic permeability Scalar minPc_; //!< the minimum capillary pressure (entry pressure) - Scalar moleFraction_[ParentType::numPhases()]; //!< The water mole fractions in water and air - Scalar molarDensity_[ParentType::numPhases()]; //!< The molar density of water and air + Scalar moleFraction_[ParentType::numFluidPhases()]; //!< The water mole fractions in water and air + Scalar molarDensity_[ParentType::numFluidPhases()]; //!< The molar density of water and air Scalar diffCoeff_; //!< The binary diffusion coefficient of water in air }; diff --git a/dumux/porousmediumflow/richardsnc/iofields.hh b/dumux/porousmediumflow/richardsnc/iofields.hh index 865623ad384a80fc879a915fedf087e68547c500..be8a36f5d961d232ebb52bcacfa36ea61abcc794 100644 --- a/dumux/porousmediumflow/richardsnc/iofields.hh +++ b/dumux/porousmediumflow/richardsnc/iofields.hh @@ -70,7 +70,7 @@ public: out.addVolumeVariable([](const auto& v){ return v.waterContent(VolumeVariables::liquidPhaseIdx); }, IOName::waterContent()); - for (int compIdx = 0; compIdx < VolumeVariables::numComponents(); ++compIdx) + for (int compIdx = 0; compIdx < VolumeVariables::numFluidComponents(); ++compIdx) out.addVolumeVariable([compIdx](const auto& v){ return v.moleFraction(VolumeVariables::liquidPhaseIdx, compIdx); }, IOName::moleFraction<FS>(VolumeVariables::liquidPhaseIdx, compIdx)); diff --git a/dumux/porousmediumflow/richardsnc/model.hh b/dumux/porousmediumflow/richardsnc/model.hh index 20c94c006ebe1a4b5ba391294d11e7d1b96d97b2..de40139301b70e624f03faf1d53b0184437760f5 100644 --- a/dumux/porousmediumflow/richardsnc/model.hh +++ b/dumux/porousmediumflow/richardsnc/model.hh @@ -105,8 +105,8 @@ struct RichardsNCModelTraits using Indices = RichardsNCIndices; static constexpr int numEq() { return nComp; } - static constexpr int numPhases() { return 1; } - static constexpr int numComponents() { return nComp; } + static constexpr int numFluidPhases() { return 1; } + static constexpr int numFluidComponents() { return nComp; } static constexpr int replaceCompEqIdx() { return repCompEqIdx; } static constexpr bool enableAdvection() { return true; } @@ -173,10 +173,10 @@ private: using MT = GetPropType<TypeTag, Properties::ModelTraits>; using PT = typename GetPropType<TypeTag, Properties::SpatialParams>::PermeabilityType; - static_assert(FSY::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid system"); - static_assert(FST::numComponents == MT::numComponents(), "Number of components mismatch between model and fluid state"); - static_assert(FSY::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid system"); - static_assert(FST::numPhases == MT::numPhases(), "Number of phases mismatch between model and fluid state"); + static_assert(FSY::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid system"); + static_assert(FST::numComponents == MT::numFluidComponents(), "Number of components mismatch between model and fluid state"); + static_assert(FSY::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid system"); + static_assert(FST::numPhases == MT::numFluidPhases(), "Number of phases mismatch between model and fluid state"); using Traits = RichardsVolumeVariablesTraits<PV, FSY, FST, SSY, SST, PT, MT>; public: diff --git a/dumux/porousmediumflow/richardsnc/volumevariables.hh b/dumux/porousmediumflow/richardsnc/volumevariables.hh index 389bd83e811a10f6808ddc6c18003c0ad12f0436..0f2293015a391488302aebc9a1563a93dd100f19 100644 --- a/dumux/porousmediumflow/richardsnc/volumevariables.hh +++ b/dumux/porousmediumflow/richardsnc/volumevariables.hh @@ -96,7 +96,7 @@ public: minPc_ = MaterialLaw::endPointPc(materialParams); pn_ = problem.nonWettingReferencePressure(); //porosity - updateSolidVolumeFractions(elemSol, problem, element, scv, solidState_, ParentType::numComponents()); + updateSolidVolumeFractions(elemSol, problem, element, scv, solidState_, ParentType::numFluidComponents()); EnergyVolVars::updateSolidEnergyParams(elemSol, problem, element, scv, solidState_); permeability_ = problem.spatialParams().permeability(element, scv, elemSol); @@ -107,7 +107,7 @@ public: paramCache.updatePhase(fluidState_, 0); const int compIIdx = 0; - for (unsigned int compJIdx = 0; compJIdx < ParentType::numComponents(); ++compJIdx) + for (unsigned int compJIdx = 0; compJIdx < ParentType::numFluidComponents(); ++compJIdx) if(compIIdx != compJIdx) setDiffusionCoefficient_(compJIdx, FluidSystem::binaryDiffusionCoefficient(fluidState_, @@ -160,7 +160,7 @@ public: if(useMoles) { Scalar sumSecondaryFractions = 0.0; - for (int compIdx = 1; compIdx < ParentType::numComponents(); ++compIdx) + for (int compIdx = 1; compIdx < ParentType::numFluidComponents(); ++compIdx) { fluidState.setMoleFraction(0, compIdx, priVars[compIdx]); sumSecondaryFractions += priVars[compIdx]; @@ -169,7 +169,7 @@ public: } else { - for (int compIdx = 1; compIdx < ParentType::numComponents(); ++compIdx) + for (int compIdx = 1; compIdx < ParentType::numFluidComponents(); ++compIdx) fluidState.setMassFraction(0, compIdx, priVars[compIdx]); } @@ -398,7 +398,7 @@ private: void setDiffusionCoefficient_(int compIdx, Scalar d) { diffCoefficient_[compIdx-1] = d; } - std::array<Scalar, ParentType::numComponents()-1> diffCoefficient_; + std::array<Scalar, ParentType::numFluidComponents()-1> diffCoefficient_; Scalar relativePermeabilityWetting_; //!< the relative permeability of the wetting phase SolidState solidState_; diff --git a/dumux/porousmediumflow/tracer/iofields.hh b/dumux/porousmediumflow/tracer/iofields.hh index 98718ad4c807354768cfbccbc8f1c3fd99661e45..67bb8447edf47c89c2af54722175e242a468258f 100644 --- a/dumux/porousmediumflow/tracer/iofields.hh +++ b/dumux/porousmediumflow/tracer/iofields.hh @@ -45,7 +45,7 @@ public: using FluidSystem = typename VolumeVariables::FluidSystem; // register standardized out output fields - for (int compIdx = 0; compIdx < VolumeVariables::numComponents(); ++compIdx) + for (int compIdx = 0; compIdx < VolumeVariables::numFluidComponents(); ++compIdx) { out.addVolumeVariable([compIdx](const auto& v){ return v.moleFraction(0, compIdx); }, "x^" + FluidSystem::componentName(compIdx)); diff --git a/dumux/porousmediumflow/tracer/localresidual.hh b/dumux/porousmediumflow/tracer/localresidual.hh index f78b6017facbd6ab0599b211553a56036ccb26e4..79dbc7b05dd8edee3dd2a75ecfa6956c6a410daf 100644 --- a/dumux/porousmediumflow/tracer/localresidual.hh +++ b/dumux/porousmediumflow/tracer/localresidual.hh @@ -56,7 +56,7 @@ class TracerLocalResidual: public GetPropType<TypeTag, Properties::BaseLocalResi using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; - static constexpr int numComponents = GetPropType<TypeTag, Properties::ModelTraits>::numComponents(); + static constexpr int numComponents = GetPropType<TypeTag, Properties::ModelTraits>::numFluidComponents(); static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>(); static constexpr int phaseIdx = 0; diff --git a/dumux/porousmediumflow/tracer/model.hh b/dumux/porousmediumflow/tracer/model.hh index 6a0228f1e6fad4869930fe0f68aa3296fa92e94b..e2707e1b29e3db9e5b72013b6fac93b5b3eabc19 100644 --- a/dumux/porousmediumflow/tracer/model.hh +++ b/dumux/porousmediumflow/tracer/model.hh @@ -77,8 +77,8 @@ struct TracerModelTraits using Indices = TracerIndices; static constexpr int numEq() { return nComp; } - static constexpr int numPhases() { return 1; } - static constexpr int numComponents() { return nComp; } + static constexpr int numFluidPhases() { return 1; } + static constexpr int numFluidComponents() { return nComp; } static constexpr bool enableAdvection() { return true; } static constexpr bool enableMolecularDiffusion() { return true; } diff --git a/dumux/porousmediumflow/tracer/volumevariables.hh b/dumux/porousmediumflow/tracer/volumevariables.hh index 9948c11a618f0f62eb4a79a39170325aedc34954..4a743bac791eeaaf15bc198b2213f82cabe89e74 100644 --- a/dumux/porousmediumflow/tracer/volumevariables.hh +++ b/dumux/porousmediumflow/tracer/volumevariables.hh @@ -67,14 +67,14 @@ public: // update parent type sets primary variables ParentType::update(elemSol, problem, element, scv); - updateSolidVolumeFractions(elemSol, problem, element, scv, solidState_, ParentType::numComponents()); + updateSolidVolumeFractions(elemSol, problem, element, scv, solidState_, ParentType::numFluidComponents()); // dispersivity_ = problem.spatialParams().dispersivity(element, scv, elemSol); // the spatial params special to the tracer model fluidDensity_ = problem.spatialParams().fluidDensity(element, scv); fluidMolarMass_ = problem.spatialParams().fluidMolarMass(element, scv); - for (int compIdx = 0; compIdx < ParentType::numComponents(); ++compIdx) + for (int compIdx = 0; compIdx < ParentType::numFluidComponents(); ++compIdx) { moleOrMassFraction_[compIdx] = this->priVars()[compIdx]; diffCoeff_[compIdx] = FluidSystem::binaryDiffusionCoefficient(compIdx, problem, element, scv); @@ -180,8 +180,8 @@ protected: SolidState solidState_; Scalar fluidDensity_, fluidMolarMass_; // DispersivityType dispersivity_; - std::array<Scalar, ParentType::numComponents()> diffCoeff_; - std::array<Scalar, ParentType::numComponents()> moleOrMassFraction_; + std::array<Scalar, ParentType::numFluidComponents()> diffCoeff_; + std::array<Scalar, ParentType::numFluidComponents()> moleOrMassFraction_; }; } // end namespace Dumux diff --git a/dumux/porousmediumflow/velocityoutput.hh b/dumux/porousmediumflow/velocityoutput.hh index b29aa21021a5f66aed10d21d12df3670d819b75c..8ea269f5a59ada4d5bb72384a00936e85fc9f27c 100644 --- a/dumux/porousmediumflow/velocityoutput.hh +++ b/dumux/porousmediumflow/velocityoutput.hh @@ -103,7 +103,7 @@ public: std::string phaseName(int phaseIdx) const override { return FluidSystem::phaseName(phaseIdx); } //! returns the number of phases - int numPhases() const override { return VolumeVariables::numPhases(); } + int numFluidPhases() const override { return VolumeVariables::numFluidPhases(); } //! Calculate the velocities for the scvs in the element //! We assume the local containers to be bound to the complete stencil diff --git a/dumux/porousmediumflow/volumevariables.hh b/dumux/porousmediumflow/volumevariables.hh index 55bc93f5c172f7279710c448786a1a2cf6150a80..35a00ba9a881d45e527954012f1379bdfd76397b 100644 --- a/dumux/porousmediumflow/volumevariables.hh +++ b/dumux/porousmediumflow/volumevariables.hh @@ -46,9 +46,9 @@ public: using Indices = typename Traits::ModelTraits::Indices; //! return number of phases considered by the model - static constexpr int numPhases() { return Traits::ModelTraits::numPhases(); } + static constexpr int numFluidPhases() { return Traits::ModelTraits::numFluidPhases(); } //! return number of components considered by the model - static constexpr int numComponents() { return Traits::ModelTraits::numComponents(); } + static constexpr int numFluidComponents() { return Traits::ModelTraits::numFluidComponents(); } /*! * \brief Update all quantities for a given control volume diff --git a/test/io/vtk/test_vtk_staggeredfreeflowpvnames.cc b/test/io/vtk/test_vtk_staggeredfreeflowpvnames.cc index 76d41225c8067d96f6206cf0999830a068dfb6ae..a8411875e26ffd22d75d5aa629134e29efd61b58 100644 --- a/test/io/vtk/test_vtk_staggeredfreeflowpvnames.cc +++ b/test/io/vtk/test_vtk_staggeredfreeflowpvnames.cc @@ -119,7 +119,7 @@ private: using MTraits = GetPropType<TypeTag, Properties::ModelTraits>; static constexpr auto dim = MTraits::dim(); - static constexpr auto nComp = MTraits::numComponents(); + static constexpr auto nComp = MTraits::numFluidComponents(); static constexpr auto numEq = MTraits::numEq(); using BaseTurbulentProblem = std::conditional_t<(std::is_same<typename MTraits::Indices, KOmegaIndices<dim, nComp>>::value || diff --git a/test/porousmediumflow/2p2c/implicit/mpnccomparison/iofields.hh b/test/porousmediumflow/2p2c/implicit/mpnccomparison/iofields.hh index de56ae98b8b29e661145ca4b34ae3995804331b1..b4c0cf5a398a058ff113bd653e722b5faa2e8dfb 100644 --- a/test/porousmediumflow/2p2c/implicit/mpnccomparison/iofields.hh +++ b/test/porousmediumflow/2p2c/implicit/mpnccomparison/iofields.hh @@ -66,13 +66,13 @@ public: out.addVolumeVariable([](const auto& v){ return v.mobility(FS::phase1Idx); }, IOName::mobility<FS>(FS::phase1Idx)); - for (int i = 0; i < VolumeVariables::numPhases(); ++i) - for (int j = 0; j < VolumeVariables::numComponents(); ++j) + for (int i = 0; i < VolumeVariables::numFluidPhases(); ++i) + for (int j = 0; j < VolumeVariables::numFluidComponents(); ++j) out.addVolumeVariable([i,j](const auto& v){ return v.massFraction(i,j); }, IOName::massFraction<FS>(i, j)); - for (int i = 0; i < VolumeVariables::numPhases(); ++i) - for (int j = 0; j < VolumeVariables::numComponents(); ++j) + for (int i = 0; i < VolumeVariables::numFluidPhases(); ++i) + for (int j = 0; j < VolumeVariables::numFluidComponents(); ++j) out.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); }, IOName::moleFraction<FS>(i, j)); } diff --git a/test/porousmediumflow/mpnc/implicit/2p2ccomparison/problem.hh b/test/porousmediumflow/mpnc/implicit/2p2ccomparison/problem.hh index 12436f264ebb71f4afe36111a15c4de6131d25f4..09e186c78d92d828643ceac19ed4c319e1b29d06 100644 --- a/test/porousmediumflow/mpnc/implicit/2p2ccomparison/problem.hh +++ b/test/porousmediumflow/mpnc/implicit/2p2ccomparison/problem.hh @@ -116,18 +116,15 @@ class MPNCComparisonProblem using FluidState = GetPropType<TypeTag, Properties::FluidState>; using ParameterCache = typename FluidSystem::ParameterCache; - // world dimension - enum {dimWorld = GridView::dimensionworld}; - enum {numPhases = GetPropType<TypeTag, Properties::ModelTraits>::numPhases()}; - enum {numComponents = GetPropType<TypeTag, Properties::ModelTraits>::numComponents()}; - enum {gasPhaseIdx = FluidSystem::gasPhaseIdx}; - enum {liquidPhaseIdx = FluidSystem::liquidPhaseIdx}; - enum {wCompIdx = FluidSystem::H2OIdx}; - enum {nCompIdx = FluidSystem::N2Idx}; - enum {fug0Idx = Indices::fug0Idx}; - enum {s0Idx = Indices::s0Idx}; - enum {p0Idx = Indices::p0Idx}; - + static constexpr auto numPhases = GetPropType<TypeTag, Properties::ModelTraits>::numFluidPhases(); + static constexpr auto numComponents = GetPropType<TypeTag, Properties::ModelTraits>::numFluidComponents(); + static constexpr auto gasPhaseIdx = FluidSystem::gasPhaseIdx; + static constexpr auto liquidPhaseIdx = FluidSystem::liquidPhaseIdx; + static constexpr auto wCompIdx = FluidSystem::H2OIdx; + static constexpr auto nCompIdx = FluidSystem::N2Idx; + static constexpr auto fug0Idx = Indices::fug0Idx; + static constexpr auto s0Idx = Indices::s0Idx; + static constexpr auto p0Idx = Indices::p0Idx; using GlobalPosition = typename SubControlVolumeFace::GlobalPosition; using PhaseVector = Dune::FieldVector<Scalar, numPhases>; diff --git a/test/porousmediumflow/mpnc/implicit/kinetic/problem.hh b/test/porousmediumflow/mpnc/implicit/kinetic/problem.hh index 92dd18bd10115b859dcd1bf6d9f12fd4e3a091c4..8a202850feabafda7afda4afe5abda078e1c6e64 100644 --- a/test/porousmediumflow/mpnc/implicit/kinetic/problem.hh +++ b/test/porousmediumflow/mpnc/implicit/kinetic/problem.hh @@ -158,8 +158,8 @@ class EvaporationAtmosphereProblem: public PorousMediumFlowProblem<TypeTag> using Indices = typename ModelTraits::Indices; enum { dimWorld = GridView::dimensionworld }; - enum { numPhases = ModelTraits::numPhases() }; - enum { numComponents = ModelTraits::numComponents() }; + enum { numPhases = ModelTraits::numFluidPhases() }; + enum { numComponents = ModelTraits::numFluidComponents() }; enum { s0Idx = Indices::s0Idx }; enum { p0Idx = Indices::p0Idx }; enum { conti00EqIdx = Indices::conti0EqIdx }; diff --git a/test/porousmediumflow/mpnc/implicit/kinetic/spatialparams.hh b/test/porousmediumflow/mpnc/implicit/kinetic/spatialparams.hh index 6d9eea798cf78d44a5411d2e3bff11c4be3f748f..de8e630a7d200054675b93d01d6e0b9519576639 100644 --- a/test/porousmediumflow/mpnc/implicit/kinetic/spatialparams.hh +++ b/test/porousmediumflow/mpnc/implicit/kinetic/spatialparams.hh @@ -57,9 +57,9 @@ class EvaporationAtmosphereSpatialParams using ThisType = EvaporationAtmosphereSpatialParams<FVGridGeometry, Scalar>; using ParentType = FVNonEquilibriumSpatialParams<FVGridGeometry, Scalar, ThisType>; - using GlobalPosition = Dune::FieldVector<Scalar, GridView::dimension>; + using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - enum { dimWorld = GridView::dimensionworld }; + static constexpr auto dimWorld = GridView::dimensionworld; public: //! export the type used for the permeability using PermeabilityType = Scalar; diff --git a/test/porousmediumflow/mpnc/implicit/obstacle/problem.hh b/test/porousmediumflow/mpnc/implicit/obstacle/problem.hh index 93276cb70179d2a05420334c650f23487cefb5df..5b35a29b0538cfa54f5ab9291a58025d4ce377c0 100644 --- a/test/porousmediumflow/mpnc/implicit/obstacle/problem.hh +++ b/test/porousmediumflow/mpnc/implicit/obstacle/problem.hh @@ -143,8 +143,8 @@ class ObstacleProblem using Indices = typename ModelTraits::Indices; enum { dimWorld = GridView::dimensionworld }; - enum { numPhases = ModelTraits::numPhases() }; - enum { numComponents = ModelTraits::numComponents() }; + enum { numPhases = ModelTraits::numFluidPhases() }; + enum { numComponents = ModelTraits::numFluidComponents() }; enum { gasPhaseIdx = FluidSystem::gasPhaseIdx }; enum { liquidPhaseIdx = FluidSystem::liquidPhaseIdx }; enum { H2OIdx = FluidSystem::H2OIdx }; diff --git a/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/combustionlocalresidual.hh b/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/combustionlocalresidual.hh index 4810977f3f39625fe36d3318a3685eef3309e0d6..e71082b1459ee521e0f6432ed8a597470e799dfa 100644 --- a/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/combustionlocalresidual.hh +++ b/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/combustionlocalresidual.hh @@ -47,9 +47,7 @@ class CombustionEnergyLocalResidual using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; - using FluxVariables = GetPropType<TypeTag, Properties::FluxVariables>; using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>; - using SolidSystem = GetPropType<TypeTag, Properties::SolidSystem>; using GridView = GetPropType<TypeTag, Properties::GridView>; using Element = typename GridView::template Codim<0>::Entity; using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; @@ -58,12 +56,9 @@ class CombustionEnergyLocalResidual using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; using Indices = typename ModelTraits::Indices; - enum { numEnergyEqFluid = ModelTraits::numEnergyEqFluid() }; - enum { numEnergyEqSolid = ModelTraits::numEnergyEqSolid() }; - enum { energyEq0Idx = Indices::energyEq0Idx }; - enum { energyEqSolidIdx = Indices::energyEqSolidIdx}; - - enum { numComponents = ModelTraits::numComponents() }; + static constexpr auto numEnergyEqFluid = ModelTraits::numEnergyEqFluid(); + static constexpr auto numEnergyEqSolid = ModelTraits::numEnergyEqSolid(); + static constexpr auto energyEq0Idx = Indices::energyEq0Idx; public: /*! diff --git a/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/problem.hh b/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/problem.hh index dc56fb8f76e6872a17a4895e0c4ff700d5c0777c..9af3d204ba13ea137767ae293de317d35fb4c042 100644 --- a/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/problem.hh +++ b/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/problem.hh @@ -189,8 +189,8 @@ class CombustionProblemOneComponent: public PorousMediumFlowProblem<TypeTag> using Indices = typename ModelTraits::Indices; enum {dimWorld = GridView::dimensionworld}; - enum {numPhases = ModelTraits::numPhases()}; - enum {numComponents = ModelTraits::numComponents()}; + enum {numPhases = ModelTraits::numFluidPhases()}; + enum {numComponents = ModelTraits::numFluidComponents()}; enum {s0Idx = Indices::s0Idx}; enum {p0Idx = Indices::p0Idx}; enum {conti00EqIdx = Indices::conti0EqIdx};