Skip to content

Commit

Permalink
add diffusion in water phase. Only for co2brine module
Browse files Browse the repository at this point in the history
  • Loading branch information
Tor Harald Sandve committed Dec 12, 2022
1 parent 4207f54 commit b023556
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 1 deletion.
4 changes: 3 additions & 1 deletion opm/material/fluidsystems/BlackOilFluidSystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,8 @@ class BlackOilFluidSystem : public BaseFluidSystem<Scalar, BlackOilFluidSystem<S
{
switch (phaseIdx) {
case waterPhaseIdx:
if (enableDissolvedGasInWater())
return gasCompIdx;
throw std::logic_error("The water phase does not have any solutes in the black oil model!");
case oilPhaseIdx:
return gasCompIdx;
Expand Down Expand Up @@ -1665,7 +1667,7 @@ class BlackOilFluidSystem : public BaseFluidSystem<Scalar, BlackOilFluidSystem<S
switch (phaseIdx) {
case oilPhaseIdx: return oilPvt().diffusionCoefficient(T, p, compIdx);
case gasPhaseIdx: return gasPvt().diffusionCoefficient(T, p, compIdx);
case waterPhaseIdx: return 0.0;
case waterPhaseIdx: return waterPvt().diffusionCoefficient(T, p, compIdx);
default: throw std::logic_error("Unhandled phase index "+std::to_string(phaseIdx));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,14 @@ class ConstantCompressibilityBrinePvt
const Evaluation& /*saltconcentration*/) const
{ return 0.0; /* this is dead water! */ }

template <class Evaluation>
Evaluation diffusionCoefficient(const Evaluation& /*temperature*/,
const Evaluation& /*pressure*/,
unsigned /*compIdx*/) const
{
throw std::runtime_error("Not implemented: The PVT model does not provide a diffusionCoefficient()");
}

const Scalar waterReferenceDensity(unsigned regionIdx) const
{ return waterReferenceDensity_[regionIdx]; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,14 @@ class ConstantCompressibilityWaterPvt
const Evaluation& /*saltconcentration*/) const
{ return 0.0; /* this is dead water, so there isn't any meaningful saturation pressure! */ }

template <class Evaluation>
Evaluation diffusionCoefficient(const Evaluation& /*temperature*/,
const Evaluation& /*pressure*/,
unsigned /*compIdx*/) const
{
throw std::runtime_error("Not implemented: The PVT model does not provide a diffusionCoefficient()");
}

/*!
* \brief Returns the gas dissolution factor \f$R_s\f$ [m^3/m^3] of the water phase.
*/
Expand Down
11 changes: 11 additions & 0 deletions opm/material/fluidsystems/blackoilpvt/WaterPvtMultiplexer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,17 @@ class WaterPvtMultiplexer
{ OPM_WATER_PVT_MULTIPLEXER_CALL(return pvtImpl.saturationPressure(regionIdx, temperature, Rs, saltconcentration)); return 0; }


/*!
* \copydoc BaseFluidSystem::diffusionCoefficient
*/
template <class Evaluation>
Evaluation diffusionCoefficient(const Evaluation& temperature,
const Evaluation& pressure,
unsigned compIdx) const
{
OPM_WATER_PVT_MULTIPLEXER_CALL(return pvtImpl.diffusionCoefficient(temperature, pressure, compIdx)); return 0;
}

void setApproach(WaterPvtApproach appr)
{
switch (appr) {
Expand Down
8 changes: 8 additions & 0 deletions opm/material/fluidsystems/blackoilpvt/WaterPvtThermal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,14 @@ class WaterPvtThermal
const Evaluation& /*saltconcentration*/) const
{ return 0.0; /* this is dead water! */ }

template <class Evaluation>
Evaluation diffusionCoefficient(const Evaluation& /*temperature*/,
const Evaluation& /*pressure*/,
unsigned /*compIdx*/) const
{
throw std::runtime_error("Not implemented: The PVT model does not provide a diffusionCoefficient()");
}

const IsothermalPvt* isoThermalPvt() const
{ return isothermalPvt_; }

Expand Down

0 comments on commit b023556

Please sign in to comment.