diff --git a/flow/flow_micp.cpp b/flow/flow_micp.cpp index aeef32e657..48edcd0bb6 100644 --- a/flow/flow_micp.cpp +++ b/flow/flow_micp.cpp @@ -18,15 +18,16 @@ #include +#include + #include #include - -#include -#include -#include #include #include +#include +#include + namespace Opm { namespace Properties { namespace TTag { diff --git a/flowexperimental/BlackOilIntensiveQuantitiesGlobalIndex.hpp b/flowexperimental/BlackOilIntensiveQuantitiesGlobalIndex.hpp index d20e805a7b..a080953d0f 100644 --- a/flowexperimental/BlackOilIntensiveQuantitiesGlobalIndex.hpp +++ b/flowexperimental/BlackOilIntensiveQuantitiesGlobalIndex.hpp @@ -53,6 +53,7 @@ #include +#include #include #include diff --git a/opm/models/blackoil/blackoilindices.hh b/opm/models/blackoil/blackoilindices.hh index d0760ea60f..53f4ed6bba 100644 --- a/opm/models/blackoil/blackoilindices.hh +++ b/opm/models/blackoil/blackoilindices.hh @@ -147,24 +147,24 @@ struct BlackOilIndices numPolymers > 1 ? polymerConcentrationIdx + 1 : -1000; //! Index of the primary variable for the first MICP component - static constexpr int biofilmConcentrationIdx = + static constexpr int microbialConcentrationIdx = enableMICP ? PVOffset + numPhases + numSolvents : -1000; //! Index of the primary variable for the second MICP component - static constexpr int microbialConcentrationIdx = - numMICPs > 1 ? biofilmConcentrationIdx + 1 : -1000; + static constexpr int oxygenConcentrationIdx = + numMICPs > 1 ? microbialConcentrationIdx + 1 : -1000; //! Index of the primary variable for the third MICP component - static constexpr int oxygenConcentrationIdx = - numMICPs > 2 ? microbialConcentrationIdx + 1 : -1000; + static constexpr int ureaConcentrationIdx = + numMICPs > 2 ? oxygenConcentrationIdx + 1 : -1000; //! Index of the primary variable for the fourth MICP component - static constexpr int ureaConcentrationIdx = - numMICPs > 3 ? oxygenConcentrationIdx + 1 : -1000; + static constexpr int biofilmConcentrationIdx = + numMICPs > 3 ? ureaConcentrationIdx + 1 : -1000; //! Index of the primary variable for the fifth MICP component static constexpr int calciteConcentrationIdx = - numMICPs > 4 ? ureaConcentrationIdx + 1 : -1000; + numMICPs > 4 ? biofilmConcentrationIdx + 1 : -1000; //! Index of the primary variable for the foam static constexpr int foamConcentrationIdx = @@ -204,24 +204,24 @@ struct BlackOilIndices numPolymers > 1 ? contiPolymerEqIdx + 1 : -1000; //! Index of the continuity equation for the first MICP component - static constexpr int contiBiofilmEqIdx = + static constexpr int contiMicrobialEqIdx = enableMICP ? PVOffset + numPhases + numSolvents + numExtbos : -1000; //! Index of the continuity equation for the second MICP component - static constexpr int contiMicrobialEqIdx = - numMICPs > 1 ? contiBiofilmEqIdx + 1 : -1000; + static constexpr int contiOxygenEqIdx = + numMICPs > 1 ? contiMicrobialEqIdx + 1 : -1000; //! Index of the continuity equation for the third MICP component - static constexpr int contiOxygenEqIdx = - numMICPs > 2 ? contiMicrobialEqIdx + 1 : -1000; + static constexpr int contiUreaEqIdx = + numMICPs > 2 ? contiOxygenEqIdx + 1 : -1000; //! Index of the continuity equation for the fourth MICP component - static constexpr int contiUreaEqIdx = - numMICPs > 3 ? contiOxygenEqIdx + 1 : -1000; + static constexpr int contiBiofilmEqIdx = + numMICPs > 3 ? contiUreaEqIdx + 1 : -1000; //! Index of the continuity equation for the fifth MICP component static constexpr int contiCalciteEqIdx = - numMICPs > 4 ? contiUreaEqIdx + 1 : -1000; + numMICPs > 4 ? contiBiofilmEqIdx + 1 : -1000; //! Index of the continuity equation for the foam component static constexpr int contiFoamEqIdx = diff --git a/opm/models/blackoil/blackoilintensivequantities.hh b/opm/models/blackoil/blackoilintensivequantities.hh index 074a460736..de87a64747 100644 --- a/opm/models/blackoil/blackoilintensivequantities.hh +++ b/opm/models/blackoil/blackoilintensivequantities.hh @@ -696,11 +696,15 @@ public: const Evaluation& permFactor() const { - if constexpr (enableMICP) + if constexpr (enableMICP) { return MICPIntQua::permFactor(); - if constexpr (enableSaltPrecipitation) + } + else if constexpr (enableSaltPrecipitation) { return BrineIntQua::permFactor(); - throw std::logic_error("permFactor() called but salt precipitation or MICP are disabled"); + } + else { + throw std::logic_error("permFactor() called but salt precipitation or MICP are disabled"); + } } private: diff --git a/opm/models/blackoil/blackoilmicpparams.cpp b/opm/models/blackoil/blackoilmicpparams.cpp index 1ac9e937e2..fd6c2da7de 100644 --- a/opm/models/blackoil/blackoilmicpparams.cpp +++ b/opm/models/blackoil/blackoilmicpparams.cpp @@ -29,8 +29,8 @@ #include #include #include -#include #include +#include #endif #include diff --git a/opm/models/blackoil/blackoilonephaseindices.hh b/opm/models/blackoil/blackoilonephaseindices.hh index 9305fdc4b7..863c8b00ea 100644 --- a/opm/models/blackoil/blackoilonephaseindices.hh +++ b/opm/models/blackoil/blackoilonephaseindices.hh @@ -145,24 +145,24 @@ struct BlackOilOnePhaseIndices numPolymers > 1 ? polymerConcentrationIdx + 1 : -1000; //! Index of the primary variable for the first MICP component - static constexpr int biofilmConcentrationIdx = + static constexpr int microbialConcentrationIdx = enableMICP ? PVOffset + numPhases + numSolvents : -1000; //! Index of the primary variable for the second MICP component - static constexpr int microbialConcentrationIdx = - numMICPs > 1 ? biofilmConcentrationIdx + 1 : -1000; + static constexpr int oxygenConcentrationIdx = + numMICPs > 1 ? microbialConcentrationIdx + 1 : -1000; //! Index of the primary variable for the third MICP component - static constexpr int oxygenConcentrationIdx = - numMICPs > 2 ? microbialConcentrationIdx + 1 : -1000; + static constexpr int ureaConcentrationIdx = + numMICPs > 2 ? oxygenConcentrationIdx + 1 : -1000; //! Index of the primary variable for the fourth MICP component - static constexpr int ureaConcentrationIdx = - numMICPs > 3 ? oxygenConcentrationIdx + 1 : -1000; + static constexpr int biofilmConcentrationIdx = + numMICPs > 3 ? ureaConcentrationIdx + 1 : -1000; //! Index of the primary variable for the fifth MICP component static constexpr int calciteConcentrationIdx = - numMICPs > 4 ? ureaConcentrationIdx + 1 : -1000; + numMICPs > 4 ? biofilmConcentrationIdx + 1 : -1000; //! Index of the primary variable for the foam static constexpr int foamConcentrationIdx = @@ -221,24 +221,24 @@ struct BlackOilOnePhaseIndices numPolymers > 1 ? contiPolymerEqIdx + 1 : -1000; //! Index of the continuity equation for the first MICP component - static constexpr int contiBiofilmEqIdx = + static constexpr int contiMicrobialEqIdx = enableMICP ? PVOffset + numPhases + numSolvents : -1000; //! Index of the continuity equation for the second MICP component - static constexpr int contiMicrobialEqIdx = - numMICPs > 1 ? contiBiofilmEqIdx + 1 : -1000; + static constexpr int contiOxygenEqIdx = + numMICPs > 1 ? contiMicrobialEqIdx + 1 : -1000; //! Index of the continuity equation for the third MICP component - static constexpr int contiOxygenEqIdx = - numMICPs > 2 ? contiMicrobialEqIdx + 1 : -1000; + static constexpr int contiUreaEqIdx = + numMICPs > 2 ? contiOxygenEqIdx + 1 : -1000; //! Index of the continuity equation for the fourth MICP component - static constexpr int contiUreaEqIdx = - numMICPs > 3 ? contiOxygenEqIdx + 1 : -1000; + static constexpr int contiBiofilmEqIdx = + numMICPs > 3 ? contiUreaEqIdx + 1 : -1000; //! Index of the continuity equation for the fifth MICP component static constexpr int contiCalciteEqIdx = - numMICPs > 4 ? contiUreaEqIdx + 1 : -1000; + numMICPs > 4 ? contiBiofilmEqIdx + 1 : -1000; //! Index of the continuity equation for the foam component static constexpr int contiFoamEqIdx = diff --git a/opm/models/blackoil/blackoiltwophaseindices.hh b/opm/models/blackoil/blackoiltwophaseindices.hh index 27d1630bb6..9d112a1488 100644 --- a/opm/models/blackoil/blackoiltwophaseindices.hh +++ b/opm/models/blackoil/blackoiltwophaseindices.hh @@ -145,24 +145,24 @@ struct BlackOilTwoPhaseIndices numPolymers > 1 ? polymerConcentrationIdx + 1 : -1000; //! Index of the primary variable for the first MICP component - static constexpr int biofilmConcentrationIdx = + static constexpr int microbialConcentrationIdx = enableMICP ? PVOffset + numPhases + numSolvents : -1000; //! Index of the primary variable for the second MICP component - static constexpr int microbialConcentrationIdx = - numMICPs > 1 ? biofilmConcentrationIdx + 1 : -1000; + static constexpr int oxygenConcentrationIdx = + numMICPs > 1 ? microbialConcentrationIdx + 1 : -1000; //! Index of the primary variable for the third MICP component - static constexpr int oxygenConcentrationIdx = - numMICPs > 2 ? microbialConcentrationIdx + 1 : -1000; + static constexpr int ureaConcentrationIdx = + numMICPs > 2 ? oxygenConcentrationIdx + 1 : -1000; //! Index of the primary variable for the fourth MICP component - static constexpr int ureaConcentrationIdx = - numMICPs > 3 ? oxygenConcentrationIdx + 1 : -1000; + static constexpr int biofilmConcentrationIdx = + numMICPs > 3 ? ureaConcentrationIdx + 1 : -1000; //! Index of the primary variable for the fifth MICP component static constexpr int calciteConcentrationIdx = - numMICPs > 4 ? ureaConcentrationIdx + 1 : -1000; + numMICPs > 4 ? biofilmConcentrationIdx + 1 : -1000; //! Index of the primary variable for the foam static constexpr int foamConcentrationIdx = @@ -240,24 +240,24 @@ struct BlackOilTwoPhaseIndices numPolymers > 1 ? contiPolymerEqIdx + 1 : -1000; //! Index of the continuity equation for the first MICP component - static constexpr int contiBiofilmEqIdx = + static constexpr int contiMicrobialEqIdx = enableMICP ? PVOffset + numPhases + numSolvents : -1000; //! Index of the continuity equation for the second MICP component - static constexpr int contiMicrobialEqIdx = - numMICPs > 1 ? contiBiofilmEqIdx + 1 : -1000; + static constexpr int contiOxygenEqIdx = + numMICPs > 1 ? contiMicrobialEqIdx + 1 : -1000; //! Index of the continuity equation for the third MICP component - static constexpr int contiOxygenEqIdx = - numMICPs > 2 ? contiMicrobialEqIdx + 1 : -1000; + static constexpr int contiUreaEqIdx = + numMICPs > 2 ? contiOxygenEqIdx + 1 : -1000; //! Index of the continuity equation for the fourth MICP component - static constexpr int contiUreaEqIdx = - numMICPs > 3 ? contiOxygenEqIdx + 1 : -1000; + static constexpr int contiBiofilmEqIdx = + numMICPs > 3 ? contiUreaEqIdx + 1 : -1000; //! Index of the continuity equation for the fifth MICP component static constexpr int contiCalciteEqIdx = - numMICPs > 4 ? contiUreaEqIdx + 1 : -1000; + numMICPs > 4 ? contiBiofilmEqIdx + 1 : -1000; //! Index of the continuity equation for the foam component static constexpr int contiFoamEqIdx = diff --git a/opm/models/io/vtkblackoilmicpmodule.hpp b/opm/models/io/vtkblackoilmicpmodule.hpp index 4e791b8cb7..713f294b1c 100644 --- a/opm/models/io/vtkblackoilmicpmodule.hpp +++ b/opm/models/io/vtkblackoilmicpmodule.hpp @@ -141,7 +141,7 @@ public: } if (params_.ureaConcentrationOutput_) { - // multypliging by scaling factor 10 (see WellInterfaceGeneric.cpp) + // multiplying by scaling factor 10 (see WellInterfaceGeneric.cpp) ureaConcentration_[globalDofIdx] = 10 * scalarValue(intQuants.ureaConcentration()); } diff --git a/opm/simulators/flow/FlowGenericProblem_impl.hpp b/opm/simulators/flow/FlowGenericProblem_impl.hpp index ac2850f3ed..d61acbde92 100644 --- a/opm/simulators/flow/FlowGenericProblem_impl.hpp +++ b/opm/simulators/flow/FlowGenericProblem_impl.hpp @@ -527,7 +527,12 @@ readBlackoilExtentionsInitialConditions_(std::size_t numDof, micp_.oxygenConcentration.resize(numDof, 0.0); } if (eclState_.fieldProps().has_double("SUREA")) { - micp_.ureaConcentration = getArray(eclState_.fieldProps().get_double("SUREA")); + // dividing by scaling factor 10 (see WellInterfaceGeneric.cpp) + micp_.ureaConcentration.resize(numDof, 0.1); + const auto& urea = getArray(eclState_.fieldProps().get_double("SUREA")); + for (std::size_t xIdx = 0; xIdx < numDof; ++xIdx) { + micp_.ureaConcentration[xIdx] *= urea[xIdx]; + } } else { micp_.ureaConcentration.resize(numDof, 0.0); } diff --git a/opm/simulators/utils/phaseUsageFromDeck.hpp b/opm/simulators/utils/phaseUsageFromDeck.hpp index 473982a5f7..245cba3e66 100644 --- a/opm/simulators/utils/phaseUsageFromDeck.hpp +++ b/opm/simulators/utils/phaseUsageFromDeck.hpp @@ -40,7 +40,7 @@ namespace Opm /// to determine active phases. PhaseUsage phaseUsageFromDeck(const Deck& deck); - /// Handels MICP + /// Handles MICP PhaseUsage phaseUsageMICP(const Phases& phases); } diff --git a/opm/simulators/wells/WellInterfaceGeneric.cpp b/opm/simulators/wells/WellInterfaceGeneric.cpp index 302d73de08..a16e73f30c 100644 --- a/opm/simulators/wells/WellInterfaceGeneric.cpp +++ b/opm/simulators/wells/WellInterfaceGeneric.cpp @@ -797,7 +797,7 @@ Scalar WellInterfaceGeneric::wurea_() const if (injectorType == InjectorType::WATER) { WellMICPProperties urea = this->well_ecl_.getMICPProperties(); - const Scalar urea_injection_concentration = urea.m_ureaConcentration / 10;//Dividing by scaling factor 10 + const Scalar urea_injection_concentration = urea.m_ureaConcentration / 10; return urea_injection_concentration; } else { // Not a water injection well => no urea.