mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-09-05 04:40:19 -05:00
refactor updateCO2InWater
This commit is contained in:
@@ -1329,20 +1329,7 @@ private:
|
|||||||
(FluidSystem::phaseIsActive(waterPhaseIdx) ||
|
(FluidSystem::phaseIsActive(waterPhaseIdx) ||
|
||||||
FluidSystem::phaseIsActive(oilPhaseIdx)))
|
FluidSystem::phaseIsActive(oilPhaseIdx)))
|
||||||
{
|
{
|
||||||
const auto co2InWater = FluidSystem::phaseIsActive(oilPhaseIdx)
|
this->updateCO2InWater(globalDofIdx, pv, fs);
|
||||||
? this->co2InWaterFromOil(fs, pv)
|
|
||||||
: this->co2InWaterFromWater(fs, pv);
|
|
||||||
|
|
||||||
const Scalar mM = FluidSystem::molarMass(gasCompIdx, fs.pvtRegionIndex());
|
|
||||||
if (!this->fip_[Inplace::Phase::CO2Mass].empty()) {
|
|
||||||
this->fip_[Inplace::Phase::CO2Mass][globalDofIdx] += co2InWater * mM;
|
|
||||||
}
|
|
||||||
if (!this->fip_[Inplace::Phase::CO2MassInWaterPhase].empty()) {
|
|
||||||
this->fip_[Inplace::Phase::CO2MassInWaterPhase][globalDofIdx] = co2InWater * mM;
|
|
||||||
}
|
|
||||||
if (!this->fip_[Inplace::Phase::CO2InWaterPhase].empty()) {
|
|
||||||
this->fip_[Inplace::Phase::CO2InWaterPhase][globalDofIdx] = co2InWater;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1520,6 +1507,27 @@ private:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename FluidState>
|
||||||
|
void updateCO2InWater(const unsigned globalDofIdx,
|
||||||
|
const double pv,
|
||||||
|
const FluidState& fs)
|
||||||
|
{
|
||||||
|
const auto co2InWater = FluidSystem::phaseIsActive(oilPhaseIdx)
|
||||||
|
? this->co2InWaterFromOil(fs, pv)
|
||||||
|
: this->co2InWaterFromWater(fs, pv);
|
||||||
|
|
||||||
|
const Scalar mM = FluidSystem::molarMass(gasCompIdx, fs.pvtRegionIndex());
|
||||||
|
if (!this->fip_[Inplace::Phase::CO2Mass].empty()) {
|
||||||
|
this->fip_[Inplace::Phase::CO2Mass][globalDofIdx] += co2InWater * mM;
|
||||||
|
}
|
||||||
|
if (!this->fip_[Inplace::Phase::CO2MassInWaterPhase].empty()) {
|
||||||
|
this->fip_[Inplace::Phase::CO2MassInWaterPhase][globalDofIdx] = co2InWater * mM;
|
||||||
|
}
|
||||||
|
if (!this->fip_[Inplace::Phase::CO2InWaterPhase].empty()) {
|
||||||
|
this->fip_[Inplace::Phase::CO2InWaterPhase][globalDofIdx] = co2InWater;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
template <typename FluidState>
|
template <typename FluidState>
|
||||||
Scalar co2InWaterFromWater(const FluidState& fs, const double pv) const
|
Scalar co2InWaterFromWater(const FluidState& fs, const double pv) const
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user