Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions opm/material/fluidstates/BlackOilFluidState.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,16 @@ friend class BlackOilFluidState;
OPM_HOST_DEVICE void setRsSolw(const ValueType& newRsSolw)
{ *rsSolw_ = newRsSolw; }

/*!
* \brief Set the reservoir volume per unit surface volume [-].
*
* This quantity is used in wellbore accumulation term calculation.
* It is only meaningful in a wellbore context and is not set for
* regular reservoir fluid states for now
*/
OPM_HOST_DEVICE void setVolumeRatio(const ValueType& value)
{ volume_ratio_ = value; }

/*!
* \brief Return the pressure of a fluid phase [Pa]
*/
Expand Down Expand Up @@ -636,6 +646,27 @@ friend class BlackOilFluidState;
}
}

/*!
* \brief Return whether the volume ratio has been set.
*
* This is only true for wellbore fluid states; regular reservoir
* fluid states do not carry this quantity for now.
*/
OPM_HOST_DEVICE bool hasVolumeRatio() const
{ return volume_ratio_.has_value(); }

/*!
* \brief Return the reservoir volume per unit surface volume [-].
*
* This quantity is used in wellbore accumulation term calculation.
* Only valid if hasVolumeRatio() returns true.
*/
OPM_HOST_DEVICE ValueType volumeRatio() const
{
assert(volume_ratio_.has_value());
return *volume_ratio_;
}

/*!
* \brief Return the PVT region where the current fluid state is assumed to be part of.
*
Expand Down Expand Up @@ -867,6 +898,9 @@ friend class BlackOilFluidState;
ConditionalStorage<storeTemperature, ValueType> temperature_{};
ConditionalStorage<storeEnthalpy, std::array<ValueType, numStoragePhases> > enthalpy_{};
ValueType totalSaturation_{};
// reservoir volume per unit surface volume
// currently, it is used in wellbore accumulation term calculation
std::optional<ValueType> volume_ratio_{};
std::array<ValueType, numStoragePhases> pressure_{};
std::array<ValueType, numStoragePhases> saturation_{};
std::array<ValueType, numStoragePhases> invB_{};
Expand All @@ -882,6 +916,8 @@ friend class BlackOilFluidState;
ConditionalStorage<enableSolvent, ValueType> solventInvB_{};
ConditionalStorage<enableSolvent, ValueType> rsSolw_{};



unsigned short pvtRegionIdx_{};

// If we have a non-static fluid system, we need to store a pointer
Expand Down