diff --git a/dumux/io/loadsolution.hh b/dumux/io/loadsolution.hh index 5519764afb5d9bad00ca31bf61f9afb5b5ecf966..e01e338230950fa7705f58cd69de46c688b6a987 100644 --- a/dumux/io/loadsolution.hh +++ b/dumux/io/loadsolution.hh @@ -232,7 +232,7 @@ auto loadSolutionFromVtkFile(SolutionVector& sol, * \brief helper function to determine the primary variable names of a model with privar state * \note use this as input for the load solution function */ -template<class ModelTraits, class FluidSystem = void> +template<class ModelTraits, class FluidSystem = void, class SolidSystem = void> std::function<std::string(int,int)> createPVNameFunctionWithState(const std::string& paramGroup = "") { return [paramGroup](int pvIdx, int state = 0) @@ -250,7 +250,7 @@ std::function<std::string(int,int)> createPVNameFunctionWithState(const std::str return pvName[pvIdx]; } else - return ModelTraits::template primaryVariableName<FluidSystem>(pvIdx, state); + return ModelTraits::template primaryVariableName<FluidSystem, SolidSystem>(pvIdx, state); }; } @@ -259,7 +259,7 @@ std::function<std::string(int,int)> createPVNameFunctionWithState(const std::str * \brief helper function to determine the primary variable names of a model without state * \note use this as input for the load solution function */ -template<class ModelTraits, class FluidSystem = void> +template<class ModelTraits, class FluidSystem = void, class SolidSystem = void> std::function<std::string(int,int)> createPVNameFunction(const std::string& paramGroup = "") { if (hasParamInGroup(paramGroup, "LoadSolution.PriVarNames")) @@ -268,7 +268,7 @@ std::function<std::string(int,int)> createPVNameFunction(const std::string& para return [n = std::move(pvName)](int pvIdx, int state = 0){ return n[pvIdx]; }; } else - return [](int pvIdx, int state = 0){ return ModelTraits::template primaryVariableName<FluidSystem>(pvIdx, state); }; + return [](int pvIdx, int state = 0){ return ModelTraits::template primaryVariableName<FluidSystem, SolidSystem>(pvIdx, state); }; } /*! diff --git a/dumux/porousmediumflow/1p/model.hh b/dumux/porousmediumflow/1p/model.hh index 44e6c1b6501ca7b2686315093a027c691bc37767..51b0bc168aa59ffd8cae1ead63a0f8d983a4589a 100644 --- a/dumux/porousmediumflow/1p/model.hh +++ b/dumux/porousmediumflow/1p/model.hh @@ -75,7 +75,7 @@ struct OnePModelTraits static constexpr bool enableMolecularDiffusion() { return false; } static constexpr bool enableEnergyBalance() { return false; } - template <class FluidSystem = void> + template <class FluidSystem = void, class SolidSystem = void> static std::string primaryVariableName(int pvIdx = 0, int state = 0) { return "p"; diff --git a/dumux/porousmediumflow/1pnc/model.hh b/dumux/porousmediumflow/1pnc/model.hh index c525fe8ab923748577e9e84e1ce195d8130955bd..fdc27342d63de7ba3c85358df786cae9d28fdef7 100644 --- a/dumux/porousmediumflow/1pnc/model.hh +++ b/dumux/porousmediumflow/1pnc/model.hh @@ -98,7 +98,7 @@ struct OnePNCModelTraits static constexpr bool enableMolecularDiffusion() { return true; } static constexpr bool enableEnergyBalance() { return false; } - template <class FluidSystem> + template <class FluidSystem, class SolidSystem = void> static std::string primaryVariableName(int pvIdx, int state = 0) { const std::string xString = useMoles() ? "x" : "X"; diff --git a/dumux/porousmediumflow/2p/model.hh b/dumux/porousmediumflow/2p/model.hh index 4a363dacf90af47fc7b2af16e0ee8888c16503c2..b73fa645ccd12c2763bf9f3378145bce3ae6c5ea 100644 --- a/dumux/porousmediumflow/2p/model.hh +++ b/dumux/porousmediumflow/2p/model.hh @@ -99,7 +99,7 @@ struct TwoPModelTraits static constexpr bool enableMolecularDiffusion() { return false; } static constexpr bool enableEnergyBalance() { return false; } - template <class FluidSystem = void> + template <class FluidSystem = void, class SolidSystem = void> static std::string primaryVariableName(int pvIdx, int state = 0) { if (priVarFormulation() == TwoPFormulation::p0s1) diff --git a/dumux/porousmediumflow/2p1c/model.hh b/dumux/porousmediumflow/2p1c/model.hh index 01db1d71d655167d83e7eda2a5276ee0f1df9423..1da0530204ff7654e5ebda8ba91797e32f0c2a49 100644 --- a/dumux/porousmediumflow/2p1c/model.hh +++ b/dumux/porousmediumflow/2p1c/model.hh @@ -103,7 +103,7 @@ struct TwoPOneCNIModelTraits static constexpr TwoPFormulation priVarFormulation() { return f; } - template <class FluidSystem = void> + template <class FluidSystem = void, class SolidSystem = void> static std::string primaryVariableName(int pvIdx, int state) { if (priVarFormulation() == TwoPFormulation::p0s1) diff --git a/dumux/porousmediumflow/2p2c/model.hh b/dumux/porousmediumflow/2p2c/model.hh index 91e814930837b65695537c32c966711b192f7f1c..08f9138bb8938e1cfad8fe891faee943ee211fb2 100644 --- a/dumux/porousmediumflow/2p2c/model.hh +++ b/dumux/porousmediumflow/2p2c/model.hh @@ -103,7 +103,7 @@ namespace Dumux { template<TwoPFormulation formulation, bool useMol, int replCompEqIdx = 2> struct TwoPTwoCModelTraits : public TwoPNCModelTraits</*numComps=*/2, useMol, /*setMFracForFirstPhase=*/true, formulation, replCompEqIdx> { - template <class FluidSystem> + template <class FluidSystem, class SolidSystem = void> static std::string primaryVariableName(int pvIdx, int state) { static const std::string xString = useMol ? "x" : "X"; diff --git a/dumux/porousmediumflow/2pnc/model.hh b/dumux/porousmediumflow/2pnc/model.hh index ba6238a91995d77b9196b04fa04d44af9f546569..5815573505c2c7fc804b9fff0d6bec088e004d23 100644 --- a/dumux/porousmediumflow/2pnc/model.hh +++ b/dumux/porousmediumflow/2pnc/model.hh @@ -135,7 +135,7 @@ struct TwoPNCModelTraits static constexpr TwoPFormulation priVarFormulation() { return formulation; } - template <class FluidSystem> + template <class FluidSystem, class SolidSystem = void> static std::string primaryVariableName(int pvIdx, int state) { const std::string xString = useMoles() ? "x" : "X"; diff --git a/dumux/porousmediumflow/3p/model.hh b/dumux/porousmediumflow/3p/model.hh index 858dd85e5d23840df8ef4e2ca6a99e3bb117225d..2156f7b7db6385f51d54835167ce31a1cefac36d 100644 --- a/dumux/porousmediumflow/3p/model.hh +++ b/dumux/porousmediumflow/3p/model.hh @@ -90,7 +90,7 @@ struct ThreePModelTraits static constexpr bool enableMolecularDiffusion() { return false; } static constexpr bool enableEnergyBalance() { return false; } - template <class FluidSystem = void> + template <class FluidSystem = void, class SolidSystem = void> static std::string primaryVariableName(int pvIdx, int state = 0) { switch (pvIdx) diff --git a/dumux/porousmediumflow/3p3c/model.hh b/dumux/porousmediumflow/3p3c/model.hh index 0e24f410d6e02184617afb922e98df7eb611686a..9d5cd0172af1ff26b8210ecc122d30351856ff09 100644 --- a/dumux/porousmediumflow/3p3c/model.hh +++ b/dumux/porousmediumflow/3p3c/model.hh @@ -122,7 +122,7 @@ struct ThreePThreeCModelTraits static constexpr bool useConstraintSolver() { return useCS; } static constexpr bool useMoles() { return useMol; } - template <class FluidSystem> + template <class FluidSystem, class SolidSystem = void> static std::string primaryVariableName(int pvIdx, int state) { switch (state) diff --git a/dumux/porousmediumflow/3pwateroil/model.hh b/dumux/porousmediumflow/3pwateroil/model.hh index b3bdb846cb1742f38c2608e7164eb91de348e844..f33abc1f824b85e421e2c81135836f0e4a99716c 100644 --- a/dumux/porousmediumflow/3pwateroil/model.hh +++ b/dumux/porousmediumflow/3pwateroil/model.hh @@ -112,7 +112,7 @@ struct ThreePWaterOilModelTraits static constexpr bool onlyGasPhaseCanDisappear() { return onlyGasPhase; } - template <class FluidSystem> + template <class FluidSystem, class SolidSystem = void> static std::string primaryVariableName(int pvIdx, int state) { switch (state) diff --git a/dumux/porousmediumflow/mineralization/model.hh b/dumux/porousmediumflow/mineralization/model.hh index 3e7f01258a76f1e3b88641e1e97e58d39bec8272..45f6dd59421a89a55338e54381ca63a26ed5d129 100644 --- a/dumux/porousmediumflow/mineralization/model.hh +++ b/dumux/porousmediumflow/mineralization/model.hh @@ -51,6 +51,15 @@ struct MineralizationModelTraits : public NonMinTraits static constexpr int numInertSolidComps() { return numInertSC; } //! we additionally solve one equation per precipitating mineral phase static constexpr int numEq() { return NonMinTraits::numEq() + numSC - numInertSC; } + + template <class FluidSystem, class SolidSystem> + static std::string primaryVariableName(int pvIdx, int state = 0) + { + if (pvIdx < NonMinTraits::numEq()) + return NonMinTraits::template primaryVariableName<FluidSystem, SolidSystem>(pvIdx, state); + else + return "precipitateVolumeFraction^" + SolidSystem::componentName(pvIdx -NonMinTraits::numEq()); + } }; } // end namespace Dumux diff --git a/dumux/porousmediumflow/nonisothermal/model.hh b/dumux/porousmediumflow/nonisothermal/model.hh index 1af387e2424af748bf55fbe90dfe8eb141b4fa08..edf37038bede13644d596d6fbab1149309817b83 100644 --- a/dumux/porousmediumflow/nonisothermal/model.hh +++ b/dumux/porousmediumflow/nonisothermal/model.hh @@ -75,11 +75,11 @@ struct PorousMediumFlowNIModelTraits : public IsothermalTraits //! The indices related to the non-isothermal model using Indices = EnergyIndices< typename IsothermalTraits::Indices, numEq()>; - template <class FluidSystem = void> + template <class FluidSystem = void, class SolidSystem = void> static std::string primaryVariableName(int pvIdx, int state = 0) { if (pvIdx < numEq() - 1) - return IsothermalTraits::template primaryVariableName<FluidSystem>(pvIdx, state); + return IsothermalTraits::template primaryVariableName<FluidSystem, SolidSystem>(pvIdx, state); else return "T"; } diff --git a/dumux/porousmediumflow/richards/model.hh b/dumux/porousmediumflow/richards/model.hh index 365e077131ffa2bb623ebf7a66100883888f08a3..330b3b927e54762dce7b3ae6deec8736a14db8b2 100644 --- a/dumux/porousmediumflow/richards/model.hh +++ b/dumux/porousmediumflow/richards/model.hh @@ -136,7 +136,7 @@ struct RichardsModelTraits static constexpr bool enableMolecularDiffusion() { return enableDiff; } static constexpr bool enableEnergyBalance() { return false; } - template<class FluidSystem = void> + template<class FluidSystem = void, class SolidSystem = void> static std::string primaryVariableName(int pvIdx, int state) { if (state == Indices::gasPhaseOnly) diff --git a/dumux/porousmediumflow/richardsnc/model.hh b/dumux/porousmediumflow/richardsnc/model.hh index 4b7490301fb11e444316d4afd8fa6f56019be966..812e485435a93dfce3c90a38b072a58eee4113f1 100644 --- a/dumux/porousmediumflow/richardsnc/model.hh +++ b/dumux/porousmediumflow/richardsnc/model.hh @@ -115,7 +115,7 @@ struct RichardsNCModelTraits static constexpr bool useMoles() { return useMol; } - template <class FluidSystem> + template <class FluidSystem, class SolidSystem = void> static std::string primaryVariableName(int pvIdx, int state = 0) { const std::string xString = useMoles() ? "x" : "X"; diff --git a/dumux/porousmediumflow/tracer/model.hh b/dumux/porousmediumflow/tracer/model.hh index c157b2eaa7383917b6e330cdff7e65b11ccdc2d0..e6793e455a0fcf5798fe75c466235edb8bbd0508 100644 --- a/dumux/porousmediumflow/tracer/model.hh +++ b/dumux/porousmediumflow/tracer/model.hh @@ -86,7 +86,7 @@ struct TracerModelTraits static constexpr bool useMoles() { return useMol; } - template <class FluidSystem> + template <class FluidSystem, class SolidSystem = void> static std::string primaryVariableName(int pvIdx, int state = 0) { const std::string xString = useMoles() ? "x" : "X";