FIPContainer: add accessor for phase vectors

This commit is contained in:
Arne Morten Kvarving
2025-01-31 10:40:50 +01:00
parent 51efe81015
commit 651ecf7223
4 changed files with 14 additions and 6 deletions

View File

@@ -79,11 +79,20 @@ allocate(const std::size_t bufferSize,
template<class FluidSystem>
void
FIPContainer<FluidSystem>::add(const Inplace::Phase phase)
FIPContainer<FluidSystem>::
add(const Inplace::Phase phase)
{
this->fip_[phase].resize(bufferSize_, 0.0);
}
template<class FluidSystem>
const std::vector<typename FIPContainer<FluidSystem>::Scalar>&
FIPContainer<FluidSystem>::
get(const Inplace::Phase phase) const
{
return this->fip_.at(phase);
}
template<class FluidSystem>
bool
FIPContainer<FluidSystem>::

View File

@@ -77,6 +77,8 @@ public:
Scalar strandedGas;
};
const std::vector<Scalar>& get(const Inplace::Phase phase) const;
bool has(const Inplace::Phase phase) const;
bool hasCo2InGas() const;

View File

@@ -1518,10 +1518,7 @@ makeRegionSum(Inplace& inplace,
this->dynamicPoreVolume_);
for (const auto& phase : Inplace::phases()) {
auto fipPos = this->fip_.find(phase);
if (fipPos != this->fip_.end()) {
update_inplace(phase, fipPos->second);
}
update_inplace(phase, this->fipC_.get(phase));
}
}

View File

@@ -1438,7 +1438,7 @@ private:
!this->pressureTimesPoreVolume_.empty())
{
assert(this->hydrocarbonPoreVolume_.size() == this->pressureTimesHydrocarbonVolume_.size());
assert(this->fip_[Inplace::Phase::PoreVolume].size() == this->pressureTimesPoreVolume_.size());
assert(this->fipC_.get(Inplace::Phase::PoreVolume).size() == this->pressureTimesPoreVolume_.size());
if (FluidSystem::phaseIsActive(oilPhaseIdx)) {
this->pressureTimesPoreVolume_[globalDofIdx] =