From 44e518dcad4f63eade5e938cd00baaf93b6c5361 Mon Sep 17 00:00:00 2001 From: Sina Ackermann <sina.ackermann@iws.uni-stuttgart.de> Date: Wed, 25 Jul 2018 14:55:52 +0200 Subject: [PATCH] [fluidsystems] Change phase names from n, w to actual phase names --- dumux/material/fluidsystems/2pimmiscible.hh | 4 ++-- dumux/material/fluidsystems/3pimmiscible.hh | 14 +++++++------- dumux/material/fluidsystems/brine.hh | 2 +- dumux/material/fluidsystems/brineco2.hh | 4 ++-- dumux/material/fluidsystems/h2oair.hh | 5 +++-- dumux/material/fluidsystems/h2oairmesitylene.hh | 10 ++++++---- dumux/material/fluidsystems/h2oairxylene.hh | 10 ++++++---- dumux/material/fluidsystems/h2oheavyoil.hh | 12 +++++++----- dumux/material/fluidsystems/h2on2.hh | 10 +++++++--- dumux/material/fluidsystems/h2on2o2.hh | 14 +++++++------- dumux/material/fluidsystems/spe5.hh | 14 +++++++------- .../mpnc/implicit/combustionfluidsystem.hh | 14 +++++++------- 12 files changed, 62 insertions(+), 51 deletions(-) diff --git a/dumux/material/fluidsystems/2pimmiscible.hh b/dumux/material/fluidsystems/2pimmiscible.hh index d713d150d6..dcf2cafb88 100644 --- a/dumux/material/fluidsystems/2pimmiscible.hh +++ b/dumux/material/fluidsystems/2pimmiscible.hh @@ -86,9 +86,9 @@ public: assert(0 <= phaseIdx && phaseIdx < numPhases); if (phaseIdx == phase0Idx) - return Fluid0::phaseName(); + return Fluid0::isGas() ? "gas"+Fluid0::phaseName() : "liq"+Fluid0::phaseName(); else - return Fluid1::phaseName(); + return Fluid1::isGas() ? "gas"+Fluid1::phaseName() : "liq"+Fluid1::phaseName(); } /*! diff --git a/dumux/material/fluidsystems/3pimmiscible.hh b/dumux/material/fluidsystems/3pimmiscible.hh index a670e8c49b..f26fc1751f 100644 --- a/dumux/material/fluidsystems/3pimmiscible.hh +++ b/dumux/material/fluidsystems/3pimmiscible.hh @@ -89,13 +89,13 @@ public: static std::string phaseName(int phaseIdx) { assert(0 <= phaseIdx && phaseIdx < numPhases); - - static std::string name[] = { - std::string("w"), - std::string("n"), - std::string("g") - }; - return name[phaseIdx]; + switch (phaseIdx) + { + case wPhaseIdx: return WettingFluid::phaseName(); + case nPhaseIdx: return NonwettingFluid::phaseName(); + case gPhaseIdx: return Gas::phaseName(); + } + DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } /*! diff --git a/dumux/material/fluidsystems/brine.hh b/dumux/material/fluidsystems/brine.hh index beba2dfe3e..663ecd2aca 100644 --- a/dumux/material/fluidsystems/brine.hh +++ b/dumux/material/fluidsystems/brine.hh @@ -69,7 +69,7 @@ public: static const std::string phaseName(int phaseIdx = liquidPhaseIdx) { assert(phaseIdx == liquidPhaseIdx); - return "brine"; + return "Brine"; } /*! diff --git a/dumux/material/fluidsystems/brineco2.hh b/dumux/material/fluidsystems/brineco2.hh index 7c1c603735..55eb96777b 100644 --- a/dumux/material/fluidsystems/brineco2.hh +++ b/dumux/material/fluidsystems/brineco2.hh @@ -195,8 +195,8 @@ public: { switch (phaseIdx) { - case liquidPhaseIdx: return "l"; - case gasPhaseIdx: return "g"; + case liquidPhaseIdx: return "liq"; + case gasPhaseIdx: return "gas"; } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/h2oair.hh b/dumux/material/fluidsystems/h2oair.hh index 79f23ff2d7..c97dcbe31c 100644 --- a/dumux/material/fluidsystems/h2oair.hh +++ b/dumux/material/fluidsystems/h2oair.hh @@ -101,10 +101,11 @@ public: */ static std::string phaseName(int phaseIdx) { + assert(0 <= phaseIdx && phaseIdx < numPhases); switch (phaseIdx) { - case liquidPhaseIdx: return "liquid"; - case gasPhaseIdx: return "gas"; + case liquidPhaseIdx: return "Water"; + case gasPhaseIdx: return Air::name(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/h2oairmesitylene.hh b/dumux/material/fluidsystems/h2oairmesitylene.hh index e06bee221d..1658b93bf6 100644 --- a/dumux/material/fluidsystems/h2oairmesitylene.hh +++ b/dumux/material/fluidsystems/h2oairmesitylene.hh @@ -194,10 +194,12 @@ public: */ static std::string phaseName(int phaseIdx) { - switch (phaseIdx) { - case wPhaseIdx: return "w"; - case nPhaseIdx: return "n"; - case gPhaseIdx: return "g"; + assert(0 <= phaseIdx && phaseIdx < numPhases); + switch (phaseIdx) + { + case wPhaseIdx: return "Water"; + case nPhaseIdx: return "NAPL"; + case gPhaseIdx: return Air::name(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/h2oairxylene.hh b/dumux/material/fluidsystems/h2oairxylene.hh index 15ead95724..a50fccefa6 100644 --- a/dumux/material/fluidsystems/h2oairxylene.hh +++ b/dumux/material/fluidsystems/h2oairxylene.hh @@ -195,10 +195,12 @@ public: */ static std::string phaseName(int phaseIdx) { - switch (phaseIdx) { - case wPhaseIdx: return "w"; - case nPhaseIdx: return "n"; - case gPhaseIdx: return "g"; + assert(0 <= phaseIdx && phaseIdx < numPhases); + switch (phaseIdx) + { + case wPhaseIdx: return "Water"; + case nPhaseIdx: return "NAPL"; + case gPhaseIdx: return Air::name(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/h2oheavyoil.hh b/dumux/material/fluidsystems/h2oheavyoil.hh index 45ebf44435..4c93f9a286 100644 --- a/dumux/material/fluidsystems/h2oheavyoil.hh +++ b/dumux/material/fluidsystems/h2oheavyoil.hh @@ -184,11 +184,13 @@ public: */ static std::string phaseName(int phaseIdx) { - switch (phaseIdx) { - case wPhaseIdx: return "w"; - case nPhaseIdx: return "n"; - case gPhaseIdx: return "g"; - }; + assert(0 <= phaseIdx && phaseIdx < numPhases); + switch (phaseIdx) + { + case wPhaseIdx: return "Water"; + case nPhaseIdx: return "NAPL"; + case gPhaseIdx: return "Gas"; + } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/h2on2.hh b/dumux/material/fluidsystems/h2on2.hh index 68f8ba5b61..cd834ba386 100644 --- a/dumux/material/fluidsystems/h2on2.hh +++ b/dumux/material/fluidsystems/h2on2.hh @@ -100,11 +100,15 @@ public: * * \param phaseIdx The index of the fluid phase to consider */ - static const std::string& phaseName(int phaseIdx) + static std::string phaseName(int phaseIdx) { - static const std::string name[] = { std::string("w"), std::string("n") }; assert(0 <= phaseIdx && phaseIdx < numPhases); - return name[phaseIdx]; + switch (phaseIdx) + { + case liquidPhaseIdx: return "Water"; + case gasPhaseIdx: return "Nitrogen"; + } + DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } /*! diff --git a/dumux/material/fluidsystems/h2on2o2.hh b/dumux/material/fluidsystems/h2on2o2.hh index b0a32cb97b..b1e9639195 100644 --- a/dumux/material/fluidsystems/h2on2o2.hh +++ b/dumux/material/fluidsystems/h2on2o2.hh @@ -119,15 +119,15 @@ public: * * \param phaseIdx The index of the fluid phase to consider */ - static const std::string& phaseName(int phaseIdx) + static std::string phaseName(int phaseIdx) { - static const std::string name[] = { - std::string("l"), - std::string("g") - }; - assert(0 <= phaseIdx && phaseIdx < numPhases); - return name[phaseIdx]; + switch (phaseIdx) + { + case liquidPhaseIdx: return "Water"; + case gasPhaseIdx: return "Nitrogen"; + } + DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } /*! diff --git a/dumux/material/fluidsystems/spe5.hh b/dumux/material/fluidsystems/spe5.hh index bfdbef98bd..597bdb07bc 100644 --- a/dumux/material/fluidsystems/spe5.hh +++ b/dumux/material/fluidsystems/spe5.hh @@ -86,14 +86,14 @@ public: */ static std::string phaseName(int phaseIdx) { - static std::string name[] = { - std::string("g"), - std::string("w"), - std::string("o"), - }; - assert(0 <= phaseIdx && phaseIdx < numPhases); - return name[phaseIdx]; + switch (phaseIdx) + { + case gPhaseIdx: return "Gas"; + case wPhaseIdx: return "Water"; + case oPhaseIdx: return "Oil"; + } + DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } /*! diff --git a/test/porousmediumflow/mpnc/implicit/combustionfluidsystem.hh b/test/porousmediumflow/mpnc/implicit/combustionfluidsystem.hh index e3b95e4bc0..d1deef98b1 100644 --- a/test/porousmediumflow/mpnc/implicit/combustionfluidsystem.hh +++ b/test/porousmediumflow/mpnc/implicit/combustionfluidsystem.hh @@ -86,14 +86,14 @@ public: */ static std::string phaseName(int phaseIdx) { - static std::string name[] = { - std::string("w"), - std::string("n"), - std::string("s") - }; - assert(0 <= phaseIdx && phaseIdx < numPhases); - return name[phaseIdx]; + switch (phaseIdx) + { + case wPhaseIdx: return "Water"; + case nPhaseIdx: return "Nitrogen"; + case sPhaseIdx: return "Solid"; + } + DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } /*! -- GitLab