mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
move assignment of oil fractions into CompositionalContainer
This commit is contained in:
parent
0496f4bb8a
commit
ae23b39d40
@ -80,6 +80,20 @@ assignMoleFractions(const unsigned globalDofIdx,
|
|||||||
{ comp[globalDofIdx] = fractions(c++); });
|
{ comp[globalDofIdx] = fractions(c++); });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<class FluidSystem>
|
||||||
|
void CompositionalContainer<FluidSystem>::
|
||||||
|
assignOilFractions(const unsigned globalDofIdx,
|
||||||
|
const AssignFunction& fractions)
|
||||||
|
{
|
||||||
|
if (phaseMoleFractions_[oilPhaseIdx][0].empty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
std::for_each(phaseMoleFractions_[oilPhaseIdx].begin(),
|
||||||
|
phaseMoleFractions_[oilPhaseIdx].end(),
|
||||||
|
[globalDofIdx, &fractions, c = 0](auto& comp) mutable
|
||||||
|
{ comp[globalDofIdx] = fractions(c++); });
|
||||||
|
}
|
||||||
|
|
||||||
template<class FluidSystem>
|
template<class FluidSystem>
|
||||||
void CompositionalContainer<FluidSystem>::
|
void CompositionalContainer<FluidSystem>::
|
||||||
outputRestart(data::Solution& sol)
|
outputRestart(data::Solution& sol)
|
||||||
|
@ -58,6 +58,9 @@ public:
|
|||||||
void assignMoleFractions(const unsigned globalDofIdx,
|
void assignMoleFractions(const unsigned globalDofIdx,
|
||||||
const AssignFunction& fractions);
|
const AssignFunction& fractions);
|
||||||
|
|
||||||
|
void assignOilFractions(const unsigned globalDofIdx,
|
||||||
|
const AssignFunction& fractions);
|
||||||
|
|
||||||
void outputRestart(data::Solution& sol);
|
void outputRestart(data::Solution& sol);
|
||||||
|
|
||||||
bool allocated() const
|
bool allocated() const
|
||||||
|
@ -195,13 +195,15 @@ public:
|
|||||||
this->compC_.assignMoleFractions(globalDofIdx,
|
this->compC_.assignMoleFractions(globalDofIdx,
|
||||||
[&fs](const unsigned compIdx)
|
[&fs](const unsigned compIdx)
|
||||||
{ return getValue(fs.moleFraction(compIdx)); });
|
{ return getValue(fs.moleFraction(compIdx)); });
|
||||||
|
|
||||||
|
if (FluidSystem::phaseIsActive(oilPhaseIdx)) {
|
||||||
|
this->compC_.assignOilFractions(globalDofIdx,
|
||||||
|
[&fs](const unsigned compIdx)
|
||||||
|
{ return getValue(fs.moleFraction(oilPhaseIdx, compIdx)); });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// XMF and YMF
|
// XMF and YMF
|
||||||
for (unsigned compIdx = 0; compIdx < numComponents; ++compIdx) {
|
for (unsigned compIdx = 0; compIdx < numComponents; ++compIdx) {
|
||||||
if (FluidSystem::phaseIsActive(oilPhaseIdx)) {
|
|
||||||
if (this->compC_.phaseMoleFractions_[oilPhaseIdx][compIdx].empty()) continue;
|
|
||||||
this->compC_.phaseMoleFractions_[oilPhaseIdx][compIdx][globalDofIdx] = getValue(fs.moleFraction(oilPhaseIdx, compIdx));
|
|
||||||
}
|
|
||||||
if (FluidSystem::phaseIsActive(gasPhaseIdx)) {
|
if (FluidSystem::phaseIsActive(gasPhaseIdx)) {
|
||||||
if (this->compC_.phaseMoleFractions_[gasPhaseIdx][compIdx].empty()) continue;
|
if (this->compC_.phaseMoleFractions_[gasPhaseIdx][compIdx].empty()) continue;
|
||||||
this->compC_.phaseMoleFractions_[gasPhaseIdx][compIdx][globalDofIdx] = getValue(fs.moleFraction(gasPhaseIdx, compIdx));
|
this->compC_.phaseMoleFractions_[gasPhaseIdx][compIdx][globalDofIdx] = getValue(fs.moleFraction(gasPhaseIdx, compIdx));
|
||||||
|
Loading…
Reference in New Issue
Block a user