Skip to content
Draft
Show file tree
Hide file tree
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
18 changes: 18 additions & 0 deletions examples/problems/co2ptflashproblem.hh
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,24 @@ public:
return Opm::CompositionalConfig::EOSType::PR;
}

template <class Context>
unsigned pvtRegionIndex(const Context&, unsigned, unsigned) const
{
return 0;
}

template <class Context>
Scalar rockCompressibility(const Context&, unsigned, unsigned) const
{
return 0.0;
}

template <class Context>
Scalar rockReferencePressure(const Context&, unsigned, unsigned) const
{
return 1.0e5;
}

/*!
* \copydoc FvBaseProblem::finishInit
*/
Expand Down
11 changes: 10 additions & 1 deletion opm/models/ptflash/flashintensivequantities.hh
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ public:

// Update phases
typename FluidSystem::template ParameterCache<Evaluation> paramCache(eos_type);
// the water properties of the cell's PVT region
paramCache.setRegionIndex(problem.pvtRegionIndex(elemCtx, dofIdx, timeIdx));
paramCache.updatePhase(fluidState_, FluidSystem::oilPhaseIdx);
paramCache.updatePhase(fluidState_, FluidSystem::gasPhaseIdx);

Expand Down Expand Up @@ -323,8 +325,15 @@ public:
// Compute the remaining quantities
/////////////

// porosity
// porosity, scaled with the pressure by the rock compressibility of the
// cell's region as in the black-oil model
porosity_ = problem.porosity(elemCtx, dofIdx, timeIdx);
const Scalar rockCompressibility = problem.rockCompressibility(elemCtx, dofIdx, timeIdx);
if (rockCompressibility > 0.0) {
const Scalar rockRefPressure = problem.rockReferencePressure(elemCtx, dofIdx, timeIdx);
const Evaluation x = rockCompressibility * (p - rockRefPressure);
porosity_ *= 1.0 + x + 0.5 * x * x;
}
Valgrind::CheckDefined(porosity_);

// intrinsic permeability
Expand Down
1 change: 1 addition & 0 deletions opm/simulators/flow/FlowProblemComp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ class FlowProblemComp : public FlowProblem<TypeTag>
getEosType(),
vanguard.cellCenterDepths(),
eqlnum,
this->pvtnum_,
vanguard.gridView().comm(),
this->gravity()[dimWorld - 1],
this->numPressurePointsEquil(),
Expand Down
239 changes: 199 additions & 40 deletions opm/simulators/flow/equil/InitStateEquilComp.hpp

Large diffs are not rendered by default.

85 changes: 85 additions & 0 deletions regressionTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,23 @@ add_test_compareECLFiles(
compositional/equilibration
)

add_test_compareECLFiles(
CASENAME
equil_1d_compvd_water_gascap_contact_mismatch
FILENAME
EQUIL_1D_COMPVD_WATER_GASCAP_CONTACT_MISMATCH
SIMULATOR
flow_comp
REFERENCE_SIMULATOR
flow_comp
ABS_TOL
${abs_tol}
REL_TOL
${rel_tol}
DIR
compositional/equilibration
)

add_test_compareECLFiles(
CASENAME
equil_1d_compvd_oil
Expand All @@ -235,6 +252,74 @@ add_test_compareECLFiles(
compositional/equilibration
)

add_test_compareECLFiles(
CASENAME
pvtnum_water
FILENAME
PVTNUM_WATER
SIMULATOR
flow_comp
REFERENCE_SIMULATOR
flow_comp
ABS_TOL
${abs_tol}
REL_TOL
${rel_tol}
DIR
compositional/pvt_regions
)

add_test_compareECLFiles(
CASENAME
pvtnum_equil
FILENAME
PVTNUM_EQUIL
SIMULATOR
flow_comp
REFERENCE_SIMULATOR
flow_comp
ABS_TOL
${abs_tol}
REL_TOL
${rel_tol}
DIR
compositional/pvt_regions
)

add_test_compareECLFiles(
CASENAME
pvtnum_equil_shared
FILENAME
PVTNUM_EQUIL_SHARED
SIMULATOR
flow_comp
REFERENCE_SIMULATOR
flow_comp
ABS_TOL
${abs_tol}
REL_TOL
${rel_tol}
DIR
compositional/pvt_regions
)

add_test_compareECLFiles(
CASENAME
pvtnum_rock
FILENAME
PVTNUM_ROCK
SIMULATOR
flow_comp
REFERENCE_SIMULATOR
flow_comp
ABS_TOL
${abs_tol}
REL_TOL
${rel_tol}
DIR
compositional/pvt_regions
)

add_test_compareECLFiles(
CASENAME
spe12
Expand Down
Loading
Loading