diff --git a/opm/material/fluidstates/BlackOilFluidState.hpp b/opm/material/fluidstates/BlackOilFluidState.hpp index 71fe7587ff2..088e5fa0351 100644 --- a/opm/material/fluidstates/BlackOilFluidState.hpp +++ b/opm/material/fluidstates/BlackOilFluidState.hpp @@ -706,6 +706,17 @@ class BlackOilFluidState } } + /// \brief Return a pointer to the fluid system used by this fluid state. + OPM_HOST_DEVICE FluidSystem const* fluidSystemPtr() const + { + if constexpr (fluidSystemIsStatic) { + static FluidSystem instance; + return &instance; + } else { + return fluidSystemPtr_; + } + } + private: OPM_HOST_DEVICE static unsigned storageToCanonicalPhaseIndex_(unsigned storagePhaseIdx, const FluidSystem& fluidSystem) {