mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
move extraction of MICP solution into MICPContainer
This commit is contained in:
parent
d1e2d81d84
commit
1fefab59d6
@ -1142,6 +1142,10 @@ protected:
|
||||
// Initialize mixing controls before trying to set any lastRx valuesx
|
||||
this->mixControls_.init(numElems, restart_step, eclState.runspec().tabdims().getNumPVTTables());
|
||||
|
||||
if constexpr (enableMICP) {
|
||||
this->micp_ = this->eclWriter_->outputModule().getMICP().getSolution();
|
||||
}
|
||||
|
||||
for (std::size_t elemIdx = 0; elemIdx < numElems; ++elemIdx) {
|
||||
auto& elemFluidState = this->initialFluidStates_[elemIdx];
|
||||
elemFluidState.setPvtRegionIndex(pvtRegionIndex(elemIdx));
|
||||
@ -1179,13 +1183,6 @@ protected:
|
||||
|
||||
if constexpr (enablePolymer)
|
||||
this->polymer_.concentration[elemIdx] = this->eclWriter_->outputModule().getPolymerConcentration(elemIdx);
|
||||
if constexpr (enableMICP){
|
||||
this->micp_.microbialConcentration[elemIdx] = this->eclWriter_->outputModule().getMICP().getMicrobialConcentration(elemIdx);
|
||||
this->micp_.oxygenConcentration[elemIdx] = this->eclWriter_->outputModule().getMICP().getOxygenConcentration(elemIdx);
|
||||
this->micp_.ureaConcentration[elemIdx] = this->eclWriter_->outputModule().getMICP().getUreaConcentration(elemIdx);
|
||||
this->micp_.biofilmConcentration[elemIdx] = this->eclWriter_->outputModule().getMICP().getBiofilmConcentration(elemIdx);
|
||||
this->micp_.calciteConcentration[elemIdx] = this->eclWriter_->outputModule().getMICP().getCalciteConcentration(elemIdx);
|
||||
}
|
||||
// if we need to restart for polymer molecular weight simulation, we need to add related here
|
||||
}
|
||||
|
||||
|
@ -27,6 +27,8 @@
|
||||
|
||||
#include <opm/output/data/Solution.hpp>
|
||||
|
||||
#include <opm/simulators/flow/SolutionContainers.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <string>
|
||||
@ -63,6 +65,20 @@ assign(const unsigned globalDofIdx,
|
||||
cCalcite_[globalDofIdx] = calciteConcentration;
|
||||
}
|
||||
|
||||
template<class Scalar>
|
||||
MICPSolutionContainer<Scalar>
|
||||
MICPContainer<Scalar>::
|
||||
getSolution() const
|
||||
{
|
||||
return {
|
||||
cMicrobes_,
|
||||
cOxygen_,
|
||||
cUrea_,
|
||||
cBiofilm_,
|
||||
cCalcite_
|
||||
};
|
||||
}
|
||||
|
||||
template<class Scalar>
|
||||
void MICPContainer<Scalar>::
|
||||
outputRestart(data::Solution& sol)
|
||||
|
@ -31,6 +31,7 @@
|
||||
namespace Opm {
|
||||
|
||||
namespace data { class Solution; }
|
||||
template<class Scalar> class MICPSolutionContainer;
|
||||
|
||||
template<class Scalar>
|
||||
class MICPContainer
|
||||
@ -47,6 +48,8 @@ public:
|
||||
const Scalar biofilmConcentration,
|
||||
const Scalar calciteConcentration);
|
||||
|
||||
MICPSolutionContainer<Scalar> getSolution() const;
|
||||
|
||||
void outputRestart(data::Solution& sol);
|
||||
|
||||
void readRestart(const unsigned globalDofIdx,
|
||||
@ -56,46 +59,6 @@ public:
|
||||
bool allocated() const
|
||||
{ return allocated_; }
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
bool allocated_ = false;
|
||||
ScalarBuffer cMicrobes_;
|
||||
ScalarBuffer cOxygen_;
|
||||
|
Loading…
Reference in New Issue
Block a user