first version of micp implementation in flow

This commit is contained in:
daavid00
2021-10-06 19:32:35 +02:00
parent b0fbc1a6dc
commit 48b175904a
47 changed files with 749 additions and 126 deletions

View File

@@ -57,7 +57,8 @@ public:
getPropValue<TypeTag, Properties::EnableFoam>(),
getPropValue<TypeTag, Properties::EnableBrine>(),
/*PVOffset=*/0,
/*disabledCompIdx=*/FluidSystem::waterCompIdx> type;
/*disabledCompIdx=*/FluidSystem::waterCompIdx,
getPropValue<TypeTag, Properties::EnableMICP>()> type;
};
} // namespace Opm::Properties

View File

@@ -60,7 +60,8 @@ public:
getPropValue<TypeTag, Properties::EnableFoam>(),
getPropValue<TypeTag, Properties::EnableBrine>(),
/*PVOffset=*/0,
/*disabledCompIdx=*/FluidSystem::oilCompIdx> type;
/*disabledCompIdx=*/FluidSystem::oilCompIdx,
getPropValue<TypeTag, Properties::EnableMICP>()> type;
};
} // namespace Opm::Properties

View File

@@ -56,7 +56,8 @@ public:
getPropValue<TypeTag, Properties::EnableFoam>(),
getPropValue<TypeTag, Properties::EnableBrine>(),
/*PVOffset=*/0,
/*disabledCompIdx=*/FluidSystem::gasCompIdx> type;
/*disabledCompIdx=*/FluidSystem::gasCompIdx,
getPropValue<TypeTag, Properties::EnableMICP>()> type;
};
} // namespace Opm::Properties

View File

@@ -61,7 +61,8 @@ public:
getPropValue<TypeTag, Properties::EnableFoam>(),
getPropValue<TypeTag, Properties::EnableBrine>(),
/*PVOffset=*/0,
/*disabledCompIdx=*/FluidSystem::gasCompIdx> type;
/*disabledCompIdx=*/FluidSystem::gasCompIdx,
getPropValue<TypeTag, Properties::EnableMICP>()> type;
};
} // namespace Opm::Properties

View File

@@ -2,20 +2,16 @@
// vi: set et ts=4 sw=4 sts=4:
/*
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
Consult the COPYING file in the top-level source directory of this
module for the precise wording of the license and the list of
copyright holders.
@@ -79,7 +75,8 @@ EclGenericOutputBlackoilModule(const EclipseState& eclState,
bool enablePolymer,
bool enableFoam,
bool enableBrine,
bool enableExtbo)
bool enableExtbo,
bool enableMICP)
: eclState_(eclState)
, schedule_(schedule)
, summaryConfig_(summaryConfig)
@@ -91,6 +88,7 @@ EclGenericOutputBlackoilModule(const EclipseState& eclState,
, enableFoam_(enableFoam)
, enableBrine_(enableBrine)
, enableExtbo_(enableExtbo)
, enableMICP_(enableMICP)
{
const auto& fp = eclState_.fieldProps();
@@ -592,15 +590,19 @@ assignToSolution(data::Solution& sol)
{"1OVERBG", UnitSystem::measure::gas_inverse_formation_volume_factor, data::TargetType::RESTART_AUXILIARY, invB_[gasPhaseIdx]},
{"1OVERBO", UnitSystem::measure::oil_inverse_formation_volume_factor, data::TargetType::RESTART_AUXILIARY, invB_[oilPhaseIdx]},
{"1OVERBW", UnitSystem::measure::water_inverse_formation_volume_factor, data::TargetType::RESTART_AUXILIARY, invB_[waterPhaseIdx]},
{"BIOFILM", UnitSystem::measure::identity, data::TargetType::RESTART_SOLUTION, cBiofilm_},
{"CALCITE", UnitSystem::measure::identity, data::TargetType::RESTART_SOLUTION, cCalcite_},
{"FOAM", UnitSystem::measure::identity, data::TargetType::RESTART_SOLUTION, cFoam_},
{"GASKR", UnitSystem::measure::identity, data::TargetType::RESTART_AUXILIARY, relativePermeability_[gasPhaseIdx]},
{"GAS_DEN", UnitSystem::measure::density, data::TargetType::RESTART_AUXILIARY, density_[gasPhaseIdx]},
{"GAS_VISC", UnitSystem::measure::viscosity, data::TargetType::RESTART_AUXILIARY, viscosity_[gasPhaseIdx]},
{"KRNSW_GO", UnitSystem::measure::identity, data::TargetType::RESTART_AUXILIARY, krnSwMdcGo_},
{"KRNSW_OW", UnitSystem::measure::identity, data::TargetType::RESTART_AUXILIARY, krnSwMdcOw_},
{"MICROBES", UnitSystem::measure::density, data::TargetType::RESTART_SOLUTION, cMicrobes_},
{"OILKR", UnitSystem::measure::identity, data::TargetType::RESTART_AUXILIARY, relativePermeability_[oilPhaseIdx]},
{"OIL_DEN", UnitSystem::measure::density, data::TargetType::RESTART_AUXILIARY, density_[oilPhaseIdx]},
{"OIL_VISC", UnitSystem::measure::viscosity, data::TargetType::RESTART_AUXILIARY, viscosity_[oilPhaseIdx]},
{"OXYGEN", UnitSystem::measure::density, data::TargetType::RESTART_SOLUTION, cOxygen_},
{"PBUB", UnitSystem::measure::identity, data::TargetType::RESTART_AUXILIARY, bubblePointPressure_},
{"PCSWM_GO", UnitSystem::measure::identity, data::TargetType::RESTART_AUXILIARY, pcSwMdcGo_},
{"PCSWM_OW", UnitSystem::measure::identity, data::TargetType::RESTART_AUXILIARY, pcSwMdcOw_},
@@ -625,6 +627,7 @@ assignToSolution(data::Solution& sol)
{"STD_GAS", UnitSystem::measure::identity, data::TargetType::RESTART_SOLUTION, mFracGas_},
{"STD_OIL", UnitSystem::measure::identity, data::TargetType::RESTART_SOLUTION, mFracOil_},
{"SWMAX", UnitSystem::measure::identity, data::TargetType::RESTART_SOLUTION, swMax_},
{"UREA", UnitSystem::measure::density, data::TargetType::RESTART_SOLUTION, cUrea_},
{"TMULT_RC", UnitSystem::measure::identity, data::TargetType::RESTART_SOLUTION, rockCompTransMultiplier_},
{"WATKR", UnitSystem::measure::identity, data::TargetType::RESTART_AUXILIARY, relativePermeability_[waterPhaseIdx]},
{"WAT_DEN", UnitSystem::measure::density, data::TargetType::RESTART_AUXILIARY, density_[waterPhaseIdx]},
@@ -729,6 +732,16 @@ setRestart(const data::Solution& sol,
krnSwMdcGo_[elemIdx] = sol.data("KRNSW_GO")[globalDofIndex];
if (!ppcw_.empty() && sol.has("PPCW"))
ppcw_[elemIdx] = sol.data("PPCW")[globalDofIndex];
if (!cMicrobes_.empty() && sol.has("MICROBES"))
cMicrobes_[elemIdx] = sol.data("MICROBES")[globalDofIndex];
if (!cOxygen_.empty() && sol.has("OXYGEN"))
cOxygen_[elemIdx] = sol.data("OXYGEN")[globalDofIndex];
if (!cUrea_.empty() && sol.has("UREA"))
cUrea_[elemIdx] = sol.data("UREA")[globalDofIndex];
if (!cBiofilm_.empty() && sol.has("BIOFILM"))
cBiofilm_[elemIdx] = sol.data("BIOFILM")[globalDofIndex];
if (!cCalcite_.empty() && sol.has("CALCITE"))
cCalcite_[elemIdx] = sol.data("CALCITE")[globalDofIndex];
}
template<class FluidSystem,class Scalar>
@@ -908,6 +921,13 @@ doAllocBuffers(unsigned bufferSize,
mFracGas_.resize(bufferSize, 0.0);
mFracCo2_.resize(bufferSize, 0.0);
}
if (enableMICP_){
cMicrobes_.resize(bufferSize, 0.0);
cOxygen_.resize(bufferSize, 0.0);
cUrea_.resize(bufferSize, 0.0);
cBiofilm_.resize(bufferSize, 0.0);
cCalcite_.resize(bufferSize, 0.0);
}
if (vapparsActive)
soMax_.resize(bufferSize, 0.0);
@@ -1164,14 +1184,14 @@ outputResvFluidInPlace_(std::unordered_map<Inplace::Phase, Scalar> cipr, const i
}
ss << ":---------:---------------:---------------:---------------:---------------:---------------:\n"
<< ": REGION : TOTAL PORE : PORE VOLUME : PORE VOLUME : PORE VOLUME : PORE VOLUME :\n"
<< ": : VOLUME : CONTAINING : CONTAINING : CONTAINING : CONTAINING :\n"
<< ": : : OIL : WATER : GAS : HYDRO-CARBON :\n"
<< ": : VOLUME : CONTAINING : CONTAINING : CONTAINING : CONTAINING :\n"
<< ": : : OIL : WATER : GAS : HYDRO-CARBON :\n"
<< ":---------:---------------:---------------:---------------:---------------:---------------\n";
}
else {
}
else {
ss << std::right << std::fixed << std::setprecision(0) << ":" << std::setw (9) << reg << ":" << std::setw(15) << cipr[Inplace::Phase::DynamicPoreVolume] << ":" << std::setw(15) << cipr[Inplace::Phase::OilResVolume] << ":" << std::setw(15) << cipr[Inplace::Phase::WaterResVolume] << ":" << std::setw(15) << cipr[Inplace::Phase::GasResVolume] << ":" << std::setw(15) << cipr[Inplace::Phase::OilResVolume] + cipr[Inplace::Phase::GasResVolume] << ":\n"
<< ":---------:---------------:---------------:---------------:---------------:---------------:\n";
}
}
OpmLog::note(ss.str());
}

View File

@@ -2,20 +2,16 @@
// vi: set et ts=4 sw=4 sts=4:
/*
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
Consult the COPYING file in the top-level source directory of this
module for the precise wording of the license and the list of
copyright holders.
@@ -132,6 +128,46 @@ public:
return 0;
}
Scalar getMicrobialConcentration(unsigned elemIdx) const
{
if (cMicrobes_.size() > elemIdx)
return cMicrobes_[elemIdx];
return 0;
}
Scalar getOxygenConcentration(unsigned elemIdx) const
{
if (cOxygen_.size() > elemIdx)
return cOxygen_[elemIdx];
return 0;
}
Scalar getUreaConcentration(unsigned elemIdx) const
{
if (cUrea_.size() > elemIdx)
return cUrea_[elemIdx];
return 0;
}
Scalar getBiofilmConcentration(unsigned elemIdx) const
{
if (cBiofilm_.size() > elemIdx)
return cBiofilm_[elemIdx];
return 0;
}
Scalar getCalciteConcentration(unsigned elemIdx) const
{
if (cCalcite_.size() > elemIdx)
return cCalcite_[elemIdx];
return 0;
}
const std::map<std::size_t, double>& getWBPData() const
{
return this->wbpData_;
@@ -168,7 +204,8 @@ protected:
bool enablePolymer,
bool enableFoam,
bool enableBrine,
bool enableExtbo);
bool enableExtbo,
bool enableMICP);
struct WellProdDataType
{
@@ -324,6 +361,7 @@ protected:
bool enableFoam_;
bool enableBrine_;
bool enableExtbo_;
bool enableMICP_;
bool forceDisableFipOutput_;
bool forceDisableFipresvOutput_;
@@ -376,6 +414,11 @@ protected:
ScalarBuffer minimumOilPressure_;
ScalarBuffer saturatedOilFormationVolumeFactor_;
ScalarBuffer rockCompTransMultiplier_;
ScalarBuffer cMicrobes_;
ScalarBuffer cOxygen_;
ScalarBuffer cUrea_;
ScalarBuffer cBiofilm_;
ScalarBuffer cCalcite_;
std::array<ScalarBuffer, numPhases> saturation_;
std::array<ScalarBuffer, numPhases> invB_;

View File

@@ -407,7 +407,8 @@ checkDeckCompatibility_(const Deck& deck,
int numPhases,
bool indicesGasEnabled,
bool indicesOilEnabled,
bool indicesWaterEnabled) const
bool indicesWaterEnabled,
bool enableMICP) const
{
if (enableApiTracking)
throw std::logic_error("API tracking is not yet implemented but requested at compile time.");
@@ -424,6 +425,11 @@ checkDeckCompatibility_(const Deck& deck,
else if (!enablePolymer && deck.hasKeyword("POLYMER"))
throw std::runtime_error("The deck enables the polymer option, but the simulator is compiled without it.");
if (enableMICP && !deck.hasKeyword("MICP"))
throw std::runtime_error("The simulator requires the MICP option to be enabled, but the deck does not.");
else if (!enableMICP && deck.hasKeyword("MICP"))
throw std::runtime_error("The deck enables the MICP option, but the simulator is compiled without it.");
if (enableExtbo && !deck.hasKeyword("PVTSOL"))
throw std::runtime_error("The simulator requires the extendedBO option to be enabled, but the deck does not.");
else if (!enableExtbo && deck.hasKeyword("PVTSOL"))
@@ -476,7 +482,8 @@ void EclGenericProblem<GridView,FluidSystem,Scalar>::
readBlackoilExtentionsInitialConditions_(size_t numDof,
bool enableSolvent,
bool enablePolymer,
bool enablePolymerMolarWeight)
bool enablePolymerMolarWeight,
bool enableMICP)
{
if (enableSolvent) {
if (eclState_.fieldProps().has_double("SSOL"))
@@ -498,6 +505,29 @@ readBlackoilExtentionsInitialConditions_(size_t numDof,
else
polymerMoleWeight_.resize(numDof, 0.0);
}
if (enableMICP) {
if (eclState_.fieldProps().has_double("SMICR"))
microbialConcentration_ = eclState_.fieldProps().get_double("SMICR");
else
microbialConcentration_.resize(numDof, 0.0);
if (eclState_.fieldProps().has_double("SOXYG"))
oxygenConcentration_ = eclState_.fieldProps().get_double("SOXYG");
else
oxygenConcentration_.resize(numDof, 0.0);
if (eclState_.fieldProps().has_double("SUREA"))
ureaConcentration_ = eclState_.fieldProps().get_double("SUREA");
else
ureaConcentration_.resize(numDof, 0.0);
if (eclState_.fieldProps().has_double("SBIOF"))
biofilmConcentration_ = eclState_.fieldProps().get_double("SBIOF");
else
biofilmConcentration_.resize(numDof, 0.0);
if (eclState_.fieldProps().has_double("SCALC"))
calciteConcentration_ = eclState_.fieldProps().get_double("SCALC");
else
calciteConcentration_.resize(numDof, 0.0);
}
}
@@ -561,6 +591,56 @@ polymerMolecularWeight(const unsigned elemIdx) const
return polymerMoleWeight_[elemIdx];
}
template<class GridView, class FluidSystem, class Scalar>
Scalar EclGenericProblem<GridView,FluidSystem,Scalar>::
microbialConcentration(unsigned elemIdx) const
{
if (microbialConcentration_.empty())
return 0;
return microbialConcentration_[elemIdx];
}
template<class GridView, class FluidSystem, class Scalar>
Scalar EclGenericProblem<GridView,FluidSystem,Scalar>::
oxygenConcentration(unsigned elemIdx) const
{
if (oxygenConcentration_.empty())
return 0;
return oxygenConcentration_[elemIdx];
}
template<class GridView, class FluidSystem, class Scalar>
Scalar EclGenericProblem<GridView,FluidSystem,Scalar>::
ureaConcentration(unsigned elemIdx) const
{
if (ureaConcentration_.empty())
return 0;
return ureaConcentration_[elemIdx];
}
template<class GridView, class FluidSystem, class Scalar>
Scalar EclGenericProblem<GridView,FluidSystem,Scalar>::
biofilmConcentration(unsigned elemIdx) const
{
if (biofilmConcentration_.empty())
return 0;
return biofilmConcentration_[elemIdx];
}
template<class GridView, class FluidSystem, class Scalar>
Scalar EclGenericProblem<GridView,FluidSystem,Scalar>::
calciteConcentration(unsigned elemIdx) const
{
if (calciteConcentration_.empty())
return 0;
return calciteConcentration_[elemIdx];
}
template<class GridView, class FluidSystem, class Scalar>
unsigned EclGenericProblem<GridView,FluidSystem,Scalar>::
pvtRegionIndex(unsigned elemIdx) const

View File

@@ -145,6 +145,31 @@ public:
// TODO: remove this function if not called
Scalar polymerMolecularWeight(const unsigned elemIdx) const;
/*!
* \brief Returns the initial microbial concentration for a given a cell index
*/
Scalar microbialConcentration(unsigned elemIdx) const;
/*!
* \brief Returns the initial oxygen concentration for a given a cell index
*/
Scalar oxygenConcentration(unsigned elemIdx) const;
/*!
* \brief Returns the initial urea concentration for a given a cell index
*/
Scalar ureaConcentration(unsigned elemIdx) const;
/*!
* \brief Returns the initial biofilm concentration for a given a cell index
*/
Scalar biofilmConcentration(unsigned elemIdx) const;
/*!
* \brief Returns the initial calcite concentration for a given a cell index
*/
Scalar calciteConcentration(unsigned elemIdx) const;
/*!
* \brief Returns the index the relevant PVT region given a cell index
*/
@@ -231,7 +256,8 @@ protected:
int numPhases,
bool indicesGasEnabled,
bool indicesOilEnabled,
bool indicesWaterEnabled) const;
bool indicesWaterEnabled,
bool enableMICP) const;
void readRockParameters_(const std::vector<Scalar>& cellCenterDepths);
@@ -240,7 +266,8 @@ protected:
void readBlackoilExtentionsInitialConditions_(size_t numDof,
bool enableSolvent,
bool enablePolymer,
bool enablePolymerMolarWeight);
bool enablePolymerMolarWeight,
bool enableMICP);
void updatePvtnum_();
void updateSatnum_();
@@ -274,6 +301,11 @@ protected:
std::vector<Scalar> polymerConcentration_;
std::vector<Scalar> polymerMoleWeight_; // polymer molecular weight
std::vector<Scalar> solventSaturation_;
std::vector<Scalar> microbialConcentration_;
std::vector<Scalar> oxygenConcentration_;
std::vector<Scalar> ureaConcentration_;
std::vector<Scalar> biofilmConcentration_;
std::vector<Scalar> calciteConcentration_;
std::vector<Scalar> lastRv_;
std::vector<Scalar> maxDRv_;

View File

@@ -135,7 +135,8 @@ public:
getPropValue<TypeTag, Properties::EnablePolymer>(),
getPropValue<TypeTag, Properties::EnableFoam>(),
getPropValue<TypeTag, Properties::EnableBrine>(),
getPropValue<TypeTag, Properties::EnableExtbo>())
getPropValue<TypeTag, Properties::EnableExtbo>(),
getPropValue<TypeTag, Properties::EnableMICP>())
, simulator_(simulator)
{
const SummaryConfig summaryConfig = simulator_.vanguard().summaryConfig();
@@ -359,6 +360,26 @@ public:
this->mFracCo2_[globalDofIdx] = stdVolCo2*rhoCO2/stdMassTotal;
}
if (!this->cMicrobes_.empty()) {
this->cMicrobes_[globalDofIdx] = intQuants.microbialConcentration().value();
}
if (!this->cOxygen_.empty()) {
this->cOxygen_[globalDofIdx] = intQuants.oxygenConcentration().value();
}
if (!this->cUrea_.empty()) {
this->cUrea_[globalDofIdx] = 10 * intQuants.ureaConcentration().value(); //Reescaling back the urea concentration (see WellInterface_impl.hpp)
}
if (!this->cBiofilm_.empty()) {
this->cBiofilm_[globalDofIdx] = intQuants.biofilmConcentration().value();
}
if (!this->cCalcite_.empty()) {
this->cCalcite_[globalDofIdx] = intQuants.calciteConcentration().value();
}
if (!this->bubblePointPressure_.empty()) {
try {
this->bubblePointPressure_[globalDofIdx] = getValue(FluidSystem::bubblePointPressure(fs, intQuants.pvtRegionIndex()));
@@ -666,7 +687,7 @@ private:
this->pressureTimesPoreVolume_[globalDofIdx] = getValue(fs.pressure(gasPhaseIdx)) * pv;
this->pressureTimesHydrocarbonVolume_[globalDofIdx] = this->pressureTimesPoreVolume_[globalDofIdx] * hydrocarbon;
} else if (FluidSystem::phaseIsActive(waterPhaseIdx)) {
this->pressureTimesPoreVolume_[globalDofIdx] = getValue(fs.pressure(waterPhaseIdx)) * pv;
this->pressureTimesPoreVolume_[globalDofIdx] = getValue(fs.pressure(waterPhaseIdx)) * pv;
}
}
@@ -680,7 +701,7 @@ private:
continue;
const double b = getValue(fs.invB(phaseIdx));
const double s = getValue(fs.saturation(phaseIdx));
const double s = getValue(fs.saturation(phaseIdx));
fipr[phaseIdx] = s * pv;
fip[phaseIdx] = b * fipr[phaseIdx];
}
@@ -698,8 +719,8 @@ private:
this->fip_[Inplace::Phase::GasResVolume][globalDofIdx] = fipr[gasPhaseIdx];
if (FluidSystem::phaseIsActive(waterPhaseIdx) && !this->fip_[Inplace::Phase::WaterResVolume].empty())
this->fip_[Inplace::Phase::WaterResVolume][globalDofIdx] = fipr[waterPhaseIdx];
if (FluidSystem::phaseIsActive(waterPhaseIdx) && !this->fip_[Inplace::Phase::SALT].empty())
if (FluidSystem::phaseIsActive(waterPhaseIdx) && !this->fip_[Inplace::Phase::SALT].empty())
this->fip_[Inplace::Phase::SALT][globalDofIdx] = fipr[waterPhaseIdx] * fs.saltConcentration().value();
// Store the pure oil and gas Fip

View File

@@ -539,6 +539,10 @@ template<class TypeTag>
struct EnableExtbo<TypeTag, TTag::EclBaseProblem> {
static constexpr bool value = false;
};
template<class TypeTag>
struct EnableMICP<TypeTag, TTag::EclBaseProblem> {
static constexpr bool value = false;
};
// disable thermal flux boundaries by default
template<class TypeTag>
@@ -627,6 +631,7 @@ class EclProblem : public GetPropType<TypeTag, Properties::BaseProblem>
enum { enableDiffusion = getPropValue<TypeTag, Properties::EnableDiffusion>() };
enum { enableThermalFluxBoundaries = getPropValue<TypeTag, Properties::EnableThermalFluxBoundaries>() };
enum { enableApiTracking = getPropValue<TypeTag, Properties::EnableApiTracking>() };
enum { enableMICP = getPropValue<TypeTag, Properties::EnableMICP>() };
enum { gasPhaseIdx = FluidSystem::gasPhaseIdx };
enum { oilPhaseIdx = FluidSystem::oilPhaseIdx };
enum { waterPhaseIdx = FluidSystem::waterPhaseIdx };
@@ -658,6 +663,7 @@ class EclProblem : public GetPropType<TypeTag, Properties::BaseProblem>
using FoamModule = BlackOilFoamModule<TypeTag>;
using BrineModule = BlackOilBrineModule<TypeTag>;
using ExtboModule = BlackOilExtboModule<TypeTag>;
using MICPModule= BlackOilMICPModule<TypeTag>;
using InitialFluidState = typename EclEquilInitializer<TypeTag>::ScalarFluidState;
@@ -789,6 +795,7 @@ public:
FoamModule::initFromState(vanguard.eclState());
BrineModule::initFromState(vanguard.eclState());
ExtboModule::initFromState(vanguard.eclState());
MICPModule::initFromState(vanguard.eclState());
// create the ECL writer
eclWriter_.reset(new EclWriterType(simulator));
@@ -908,7 +915,8 @@ public:
Indices::numPhases,
Indices::gasEnabled,
Indices::oilEnabled,
Indices::waterEnabled);
Indices::waterEnabled,
enableMICP);
}
catch(const std::exception& e)
{
@@ -1161,6 +1169,16 @@ public:
schedule,
simulator.vanguard().actionState(),
simulator.vanguard().summaryState());
// deal with "clogging" for the MICP model
if constexpr (enableMICP){
auto& model = this->model();
const auto& residual = this->model().linearizer().residual();
for (unsigned globalDofIdx = 0; globalDofIdx < residual.size(); globalDofIdx ++) {
auto& phi = this->referencePorosity_[/*timeIdx=*/1][globalDofIdx];
MICPModule::checkCloggingMICP(model, phi, globalDofIdx);
}
}
}
/*!
@@ -1805,6 +1823,14 @@ public:
if constexpr (enableBrine)
values[Indices::saltConcentrationIdx] = initialFluidStates_[globalDofIdx].saltConcentration();
if constexpr (enableMICP){
values[Indices::microbialConcentrationIdx]= this->microbialConcentration_[globalDofIdx];
values[Indices::oxygenConcentrationIdx]= this->oxygenConcentration_[globalDofIdx];
values[Indices::ureaConcentrationIdx]= this->ureaConcentration_[globalDofIdx];
values[Indices::calciteConcentrationIdx]= this->calciteConcentration_[globalDofIdx];
values[Indices::biofilmConcentrationIdx]= this->biofilmConcentration_[globalDofIdx];
}
values.checkDefined();
}
@@ -2298,11 +2324,12 @@ private:
else
readExplicitInitialCondition_();
if constexpr (enableSolvent || enablePolymer || enablePolymerMolarWeight)
if constexpr (enableSolvent || enablePolymer || enablePolymerMolarWeight || enableMICP)
this->readBlackoilExtentionsInitialConditions_(this->model().numGridDof(),
enableSolvent,
enablePolymer,
enablePolymerMolarWeight);
enablePolymerMolarWeight,
enableMICP);
//initialize min/max values
size_t numElems = this->model().numGridDof();
@@ -2373,6 +2400,14 @@ private:
this->polymerMoleWeight_.resize(numElems, 0.0);
}
if constexpr (enableMICP){
this->microbialConcentration_.resize(numElems, 0.0);
this->oxygenConcentration_.resize(numElems, 0.0);
this->ureaConcentration_.resize(numElems, 0.0);
this->biofilmConcentration_.resize(numElems, 0.0);
this->calciteConcentration_.resize(numElems, 0.0);
}
for (size_t elemIdx = 0; elemIdx < numElems; ++elemIdx) {
auto& elemFluidState = initialFluidStates_[elemIdx];
elemFluidState.setPvtRegionIndex(pvtRegionIndex(elemIdx));
@@ -2406,6 +2441,13 @@ private:
if constexpr (enablePolymer)
this->polymerConcentration_[elemIdx] = eclWriter_->eclOutputModule().getPolymerConcentration(elemIdx);
if constexpr (enableMICP){
this->microbialConcentration_[elemIdx] = eclWriter_->eclOutputModule().getMicrobialConcentration(elemIdx);
this->oxygenConcentration_[elemIdx] = eclWriter_->eclOutputModule().getOxygenConcentration(elemIdx);
this->ureaConcentration_[elemIdx] = eclWriter_->eclOutputModule().getUreaConcentration(elemIdx);
this->biofilmConcentration_[elemIdx] = eclWriter_->eclOutputModule().getBiofilmConcentration(elemIdx);
this->calciteConcentration_[elemIdx] = eclWriter_->eclOutputModule().getCalciteConcentration(elemIdx);
}
// if we need to restart for polymer molecular weight simulation, we need to add related here
}