diff --git a/dumux/material/fluidmatrixinteractions/2p/thermalconductivitysomerton.hh b/dumux/material/fluidmatrixinteractions/2p/thermalconductivitysomerton.hh index 7fb5c8773119feeb91b0028a0ebb75448bf18847..b7128ad24d7a7bcf5a7d49d72c8d887e875a4eb3 100644 --- a/dumux/material/fluidmatrixinteractions/2p/thermalconductivitysomerton.hh +++ b/dumux/material/fluidmatrixinteractions/2p/thermalconductivitysomerton.hh @@ -85,10 +85,10 @@ public: { using FluidSystem = typename VolumeVariables::FluidSystem; static_assert(FluidSystem::numPhases == 2, "ThermalConductivitySomerton only works for two-phase fluid systems!"); - static_assert(!FluidSystem::isLiquid(0) || !FluidSystem::isLiquid(1), "ThermalConductivitySomerton only works if one phase is gaseous and one is liquid!"); + static_assert(FluidSystem::isGas(0) || FluidSystem::isGas(1), "ThermalConductivitySomerton only works if one phase is gaseous and one is liquid!"); - constexpr int liquidPhaseIdx = FluidSystem::isLiquid(0) ? 0 : 1; - constexpr int gasPhaseIdx = FluidSystem::isLiquid(0) ? 1 : 0; + constexpr int liquidPhaseIdx = FluidSystem::isGas(0) ? 1 : 0; + constexpr int gasPhaseIdx = FluidSystem::isGas(0) ? 0 : 1; const Scalar satLiquid = volVars.saturation(liquidPhaseIdx); const Scalar lambdaLiquid = volVars.fluidThermalConductivity(liquidPhaseIdx); diff --git a/dumux/material/fluidsystems/1padapter.hh b/dumux/material/fluidsystems/1padapter.hh index b9e46cb9f38eabb5c3f12bace21d3a51bc3ab5d0..80b213e1e9d4792b316e7d38768342e35d10edd6 100644 --- a/dumux/material/fluidsystems/1padapter.hh +++ b/dumux/material/fluidsystems/1padapter.hh @@ -136,10 +136,10 @@ public: { return false; } /*! - * \brief Returns whether the fluid is a liquid + * \brief Returns whether the fluid is gaseous */ - static constexpr bool isLiquid(int phaseIdx = 0) - { return MultiPhaseFluidSystem::isLiquid(phase); } + static constexpr bool isGas(int phaseIdx = 0) + { return MultiPhaseFluidSystem::isGas(phase); } /*! * \brief Returns true if and only if a fluid phase is assumed to diff --git a/dumux/material/fluidsystems/1pgas.hh b/dumux/material/fluidsystems/1pgas.hh index 39086ca859b9a8fd8cf59a6caf3a2125ff751116..34ce4dd55f5fa0fbaaa44d6bfddbb16cf3f333c5 100644 --- a/dumux/material/fluidsystems/1pgas.hh +++ b/dumux/material/fluidsystems/1pgas.hh @@ -96,10 +96,10 @@ public: { return false; } /*! - * \brief Returns whether the fluid is a liquid + * \brief Returns whether the fluid is gaseous */ - static constexpr bool isLiquid(int phaseIdx = 0) - { return false; } + static constexpr bool isGas(int phaseIdx = 0) + { return true; } /*! * \brief Returns true if and only if a fluid phase is assumed to diff --git a/dumux/material/fluidsystems/1pliquid.hh b/dumux/material/fluidsystems/1pliquid.hh index e828093dc29246d1f808f47577fd02546b2eb28c..25f8f994ed515d34d6406cdb143889cbeeb6b028 100644 --- a/dumux/material/fluidsystems/1pliquid.hh +++ b/dumux/material/fluidsystems/1pliquid.hh @@ -98,8 +98,8 @@ public: /*! * \brief Returns whether the fluid is a liquid */ - static constexpr bool isLiquid(int phaseIdx = 0) - { return true; } + static constexpr bool isGas(int phaseIdx = 0) + { return false; } /*! * \brief Returns true if and only if a fluid phase is assumed to diff --git a/dumux/material/fluidsystems/2p1c.hh b/dumux/material/fluidsystems/2p1c.hh index 06f369f5d3418cb6c426f7022164ae7362ff38e3..66d9a3ebc140048040eb0b692496b38f0e6c0ae6 100644 --- a/dumux/material/fluidsystems/2p1c.hh +++ b/dumux/material/fluidsystems/2p1c.hh @@ -83,14 +83,14 @@ public: { return false; } /*! - * \brief Return whether a phase is liquid + * \brief Return whether a phase is gaseous * * \param phaseIdx The index of the fluid phase to consider */ - static constexpr bool isLiquid(int phaseIdx) + static constexpr bool isGas(int phaseIdx) { assert(0 <= phaseIdx && phaseIdx < numPhases); - return phaseIdx == liquidPhaseIdx; + return phaseIdx == gasPhaseIdx; } /*! diff --git a/dumux/material/fluidsystems/2pimmiscible.hh b/dumux/material/fluidsystems/2pimmiscible.hh index e65823f8d8300c007665a5db556d8e676b17c9cd..4851aa99c1b005073ce2e79e7080b96f16cea797 100644 --- a/dumux/material/fluidsystems/2pimmiscible.hh +++ b/dumux/material/fluidsystems/2pimmiscible.hh @@ -60,7 +60,7 @@ class TwoPImmiscible static_assert((Fluid0::numComponents == 1), "Fluid0 has more than one component"); static_assert((Fluid1::numComponents == 1), "Fluid1 has more than one component"); // two gaseous phases at once do not make sense physically! (but two liquids are fine) - static_assert(Fluid0::isLiquid() || Fluid1::isLiquid(), "One phase has to be a liquid!"); + static_assert(!Fluid0::isGas() || !Fluid1::isGas(), "One phase has to be a liquid!"); using ThisType = TwoPImmiscible<Scalar, Fluid0, Fluid1>; using Base = BaseFluidSystem<Scalar, ThisType>; @@ -98,16 +98,16 @@ public: { return false; } /*! - * \brief Return whether a phase is liquid + * \brief Return whether a phase is gaseous * \param phaseIdx The index of the fluid phase to consider */ - static constexpr bool isLiquid(int phaseIdx) + static constexpr bool isGas(int phaseIdx) { assert(0 <= phaseIdx && phaseIdx < numPhases); if (phaseIdx == phase0Idx) - return Fluid0::isLiquid(); - return Fluid1::isLiquid(); + return Fluid0::isGas(); + return Fluid1::isGas(); } /*! diff --git a/dumux/material/fluidsystems/3pimmiscible.hh b/dumux/material/fluidsystems/3pimmiscible.hh index 4cb1e876dbbffe3ec52e53ca8271b539ecec5301..3d0fc2c71fdb952224efc8c7b6225283ffd2992d 100644 --- a/dumux/material/fluidsystems/3pimmiscible.hh +++ b/dumux/material/fluidsystems/3pimmiscible.hh @@ -105,18 +105,18 @@ public: { return false; } /*! - * \brief Return whether a phase is liquid + * \brief Return whether a phase is gaseous * \param phaseIdx The index of the fluid phase to consider */ - static constexpr bool isLiquid(int phaseIdx) + static constexpr bool isGas(int phaseIdx) { assert(0 <= phaseIdx && phaseIdx < numPhases); switch (phaseIdx) { - case wPhaseIdx: return WettingFluid::isLiquid(); break; - case nPhaseIdx: return NonwettingFluid::isLiquid(); break; - case gPhaseIdx: return Gas::isLiquid(); break; + case wPhaseIdx: return WettingFluid::isGas(); break; + case nPhaseIdx: return NonwettingFluid::isGas(); break; + case gPhaseIdx: return Gas::isGas(); break; } } @@ -288,7 +288,7 @@ public: { // two gaseous phases at once do not make sense physically! // (But two liquids are fine) - static_assert(WettingFluid::isLiquid() && NonwettingFluid::isLiquid() && !Gas::isLiquid(), "There can only be one gaseous phase!"); + static_assert(!WettingFluid::isGas() && !NonwettingFluid::isGas() && Gas::isGas(), "There can only be one gaseous phase!"); } /*! @@ -306,7 +306,7 @@ public: Scalar pressMin, Scalar pressMax, unsigned nPress) { // two gaseous phases at once do not make sense physically! - static_assert(WettingFluid::isLiquid() && NonwettingFluid::isLiquid() && !Gas::isLiquid(), "There can only be one gaseous phase!"); + static_assert(!WettingFluid::isGas() && !NonwettingFluid::isGas() && Gas::isGas(), "There can only be one gaseous phase!"); if (WettingFluid::Component::isTabulated) { diff --git a/dumux/material/fluidsystems/brine.hh b/dumux/material/fluidsystems/brine.hh index 2ac1d7ae960a3467acc0312c45bf79faec92871a..29497d63995b65869e033b80571cee3e728d2840 100644 --- a/dumux/material/fluidsystems/brine.hh +++ b/dumux/material/fluidsystems/brine.hh @@ -82,13 +82,13 @@ public: } /*! - * \brief Return whether a phase is liquid + * \brief Return whether a phase is gaseous * \param phaseIdx The index of the fluid phase to consider */ - static constexpr bool isLiquid(int phaseIdx = liquidPhaseIdx) + static constexpr bool isGas(int phaseIdx = liquidPhaseIdx) { assert(phaseIdx == liquidPhaseIdx); - return true; + return false; } /*! diff --git a/dumux/material/fluidsystems/brineair.hh b/dumux/material/fluidsystems/brineair.hh index 640df7d37b2be04340c996c35d084ede7b946992..e6a8ed9de1ff4c09a96ab7f035ced9a0ae2cfe25 100644 --- a/dumux/material/fluidsystems/brineair.hh +++ b/dumux/material/fluidsystems/brineair.hh @@ -161,16 +161,6 @@ public: static constexpr bool isMiscible() { return true; } - /*! - * \brief Return whether a phase is liquid - * \param phaseIdx The index of the fluid phase to consider - */ - static bool isLiquid(int phaseIdx) - { - assert(0 <= phaseIdx && phaseIdx < numPhases); - return phaseIdx != gasPhaseIdx; - } - /*! * \brief Return whether a phase is gaseous * \param phaseIdx The index of the fluid phase to consider diff --git a/dumux/material/fluidsystems/brineco2.hh b/dumux/material/fluidsystems/brineco2.hh index 1bed0e4cef7ce7b742ea746939503afd25e3306d..708837a0e3fc8587bdd582fd92133f6e99069b62 100644 --- a/dumux/material/fluidsystems/brineco2.hh +++ b/dumux/material/fluidsystems/brineco2.hh @@ -103,15 +103,15 @@ public: { return true; } /*! - * \brief Return whether a phase is liquid + * \brief Return whether a phase is gaseous * * \param phaseIdx The index of the fluid phase to consider */ - static constexpr bool isLiquid(int phaseIdx) + static constexpr bool isGas(int phaseIdx) { assert(0 <= phaseIdx && phaseIdx < numPhases); - return phaseIdx != gasPhaseIdx; + return phaseIdx == gasPhaseIdx; } /*! diff --git a/dumux/material/fluidsystems/h2oair.hh b/dumux/material/fluidsystems/h2oair.hh index 1adae56100e2a1a1a667d322f7006ebe85e519da..d88edd7b005297d45c7a75c7f9835bb5a30e4543 100644 --- a/dumux/material/fluidsystems/h2oair.hh +++ b/dumux/material/fluidsystems/h2oair.hh @@ -115,17 +115,6 @@ public: static constexpr bool isMiscible() { return true; } - /*! - * \brief Return whether a phase is liquid - * - * \param phaseIdx The index of the fluid phase to consider - */ - static constexpr bool isLiquid(int phaseIdx) - { - assert(0 <= phaseIdx && phaseIdx < numPhases); - return phaseIdx != gasPhaseIdx; - } - /*! * \brief Return whether a phase is gaseous * diff --git a/dumux/material/fluidsystems/h2oairmesitylene.hh b/dumux/material/fluidsystems/h2oairmesitylene.hh index e725bc6fe9f40be38a00c81e858a6e23cb89b6e0..555b4a972c200172ac3c2c0481a67362d856a531 100644 --- a/dumux/material/fluidsystems/h2oairmesitylene.hh +++ b/dumux/material/fluidsystems/h2oairmesitylene.hh @@ -123,17 +123,6 @@ public: static constexpr bool isMiscible() { return true; } - /*! - * \brief Return whether a phase is liquid - * - * \param phaseIdx The index of the fluid phase to consider - */ - static bool isLiquid(int phaseIdx) - { - assert(0 <= phaseIdx && phaseIdx < numPhases); - return phaseIdx != gPhaseIdx; - } - /*! * \brief Return whether a phase is gaseous * diff --git a/dumux/material/fluidsystems/h2oairxylene.hh b/dumux/material/fluidsystems/h2oairxylene.hh index bd48994c5fcb7656e4470867e0ee7e7526f1ae4d..ffd95a07678930268480cc0f719ca467ca7f906c 100644 --- a/dumux/material/fluidsystems/h2oairxylene.hh +++ b/dumux/material/fluidsystems/h2oairxylene.hh @@ -123,17 +123,6 @@ public: static constexpr bool isMiscible() { return true; } - /*! - * \brief Return whether a phase is liquid - * - * \param phaseIdx The index of the fluid phase to consider - */ - static bool isLiquid(int phaseIdx) - { - assert(0 <= phaseIdx && phaseIdx < numPhases); - return phaseIdx != gPhaseIdx; - } - /*! * \brief Return whether a phase is gaseous * diff --git a/dumux/material/fluidsystems/h2oheavyoil.hh b/dumux/material/fluidsystems/h2oheavyoil.hh index 4b697d02f86ceeb3f1c927288c851b55387dc05b..43520fc4925b1abde46527fe556537a9c3e86c4c 100644 --- a/dumux/material/fluidsystems/h2oheavyoil.hh +++ b/dumux/material/fluidsystems/h2oheavyoil.hh @@ -113,17 +113,6 @@ public: static constexpr bool isMiscible() { return true; } - /*! - * \brief Return whether a phase is liquid - * - * \param phaseIdx The index of the fluid phase to consider - */ - static bool isLiquid(int phaseIdx) - { - assert(0 <= phaseIdx && phaseIdx < numPhases); - return phaseIdx != gPhaseIdx; - } - /*! * \brief Return whether a phase is gaseous * diff --git a/dumux/material/fluidsystems/h2on2.hh b/dumux/material/fluidsystems/h2on2.hh index 7322dd791571f575ee0f11c5630cc7a1fc737975..ca2a1310d0f0671797ff0522b1aefccaa7359045 100644 --- a/dumux/material/fluidsystems/h2on2.hh +++ b/dumux/material/fluidsystems/h2on2.hh @@ -113,17 +113,6 @@ public: static constexpr bool isMiscible() { return true; } - /*! - * \brief Return whether a phase is liquid - * - * \param phaseIdx The index of the fluid phase to consider - */ - static constexpr bool isLiquid(int phaseIdx) - { - assert(0 <= phaseIdx && phaseIdx < numPhases); - return phaseIdx != gasPhaseIdx; - } - /*! * \brief Return whether a phase is gaseous * diff --git a/dumux/material/fluidsystems/h2on2o2.hh b/dumux/material/fluidsystems/h2on2o2.hh index f0a8582dadf5e7af9957a95db27286df2a89fd97..6156b7b182c2f9e19d64c85deeb9d3f0111c8934 100644 --- a/dumux/material/fluidsystems/h2on2o2.hh +++ b/dumux/material/fluidsystems/h2on2o2.hh @@ -130,17 +130,6 @@ public: return name[phaseIdx]; } - /*! - * \brief Return whether a phase is liquid - * - * \param phaseIdx The index of the fluid phase to consider - */ - static bool isLiquid(int phaseIdx) - { - assert(0 <= phaseIdx && phaseIdx < numPhases); - return phaseIdx != gasPhaseIdx; - } - /*! * \brief Return whether a phase is gaseous * diff --git a/dumux/material/fluidsystems/liquidphase2c.hh b/dumux/material/fluidsystems/liquidphase2c.hh index 6e3065e7df3e1dda2a170cf8220b5b5374094de7..334d20eabf9b77cbd5ffdd411156ce7c7aa3f0f4 100644 --- a/dumux/material/fluidsystems/liquidphase2c.hh +++ b/dumux/material/fluidsystems/liquidphase2c.hh @@ -99,10 +99,10 @@ public: { return "LiquidPhaseTwoC"; } /*! - * \brief Returns whether the fluid is a liquid + * \brief Returns whether the fluid is gaseous */ - static bool isLiquid(int phaseIdx = 0) - { return true; } + static constexpr bool isGas(int phaseIdx = 0) + { return false; } /*! * \brief Returns true if and only if a fluid phase is assumed to diff --git a/dumux/material/fluidsystems/spe5.hh b/dumux/material/fluidsystems/spe5.hh index 09d4f7ae4604a2a2205a4a4cc714e121b4358784..bfdbef98bdba61855ce955a38e9ee3fe6c67c7c5 100644 --- a/dumux/material/fluidsystems/spe5.hh +++ b/dumux/material/fluidsystems/spe5.hh @@ -103,13 +103,13 @@ public: { return true; } /*! - * \brief Return whether a phase is liquid + * \brief Return whether a phase is gaseous * \param phaseIdx The index of the fluid phase to consider */ - static bool isLiquid(int phaseIdx) + static constexpr bool isGas(int phaseIdx) { assert(0 <= phaseIdx && phaseIdx < numPhases); - return phaseIdx != gPhaseIdx; + return phaseIdx == gPhaseIdx; } /*! diff --git a/dumux/porousmediumflow/2p2c/volumevariables.hh b/dumux/porousmediumflow/2p2c/volumevariables.hh index 56e169ab67016683c77f94a6fcf84c773788057a..05c0d41e63225c5710f9335b0f5a3349e4452368 100644 --- a/dumux/porousmediumflow/2p2c/volumevariables.hh +++ b/dumux/porousmediumflow/2p2c/volumevariables.hh @@ -110,7 +110,7 @@ public: // The computations in the explicit composition update most probably assume a liquid-gas interface with // liquid as first phase. TODO: is this really needed? The constraint solver does the job anyway, doesn't it? - static_assert(useConstraintSolver || (FluidSystem::isLiquid(phase0Idx) && !FluidSystem::isLiquid(phase1Idx)), + static_assert(useConstraintSolver || (!FluidSystem::isGas(phase0Idx) && FluidSystem::isGas(phase1Idx)), "Explicit composition calculation has to be re-checked for NON-liquid-gas equilibria"); /*! diff --git a/test/material/fluidsystems/checkfluidsystem.hh b/test/material/fluidsystems/checkfluidsystem.hh index 4643fa5a2ee4e8194b95195994d1df8c503dbf42..857ed169829e9a099c955e90906dbaa2b4e15297 100644 --- a/test/material/fluidsystems/checkfluidsystem.hh +++ b/test/material/fluidsystems/checkfluidsystem.hh @@ -623,13 +623,13 @@ int checkFluidSystem() } } - // test for phaseName(), isLiquid() and isIdealGas() + // test for phaseName(), isGas() and isIdealGas() for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) { std::string DUNE_UNUSED name = FluidSystem::phaseName(phaseIdx); bool DUNE_UNUSED - bVal = FluidSystem::isLiquid(phaseIdx); + bVal = FluidSystem::isGas(phaseIdx); bVal = FluidSystem::isIdealGas(phaseIdx); } diff --git a/test/porousmediumflow/mpnc/implicit/combustionfluidsystem.hh b/test/porousmediumflow/mpnc/implicit/combustionfluidsystem.hh index dbb01a8c164cc8ff9b7bb766d6b2b8eede34ccda..064582ab549a4226ae3eb36cd3b0ee13f2014edf 100644 --- a/test/porousmediumflow/mpnc/implicit/combustionfluidsystem.hh +++ b/test/porousmediumflow/mpnc/implicit/combustionfluidsystem.hh @@ -97,14 +97,14 @@ public: } /*! - * \brief Return whether a phase is liquid + * \brief Return whether a phase is gaseous * * \param phaseIdx The index of the fluid phase to consider */ - static bool isLiquid(int phaseIdx) + static constexpr bool isGas(int phaseIdx) { assert(0 <= phaseIdx && phaseIdx < numPhases); - return phaseIdx != nPhaseIdx; + return phaseIdx == nPhaseIdx; } /*!