mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #4718 from vkip/num_pressure_points_equil
Adding --num-pressure-points-equil as a developer parameter
This commit is contained in:
@@ -118,7 +118,8 @@ public:
|
|||||||
vanguard.grid(),
|
vanguard.grid(),
|
||||||
vanguard.gridView(),
|
vanguard.gridView(),
|
||||||
vanguard.cartesianMapper(),
|
vanguard.cartesianMapper(),
|
||||||
simulator.problem().gravity()[dimWorld - 1]);
|
simulator.problem().gravity()[dimWorld - 1],
|
||||||
|
simulator.problem().numPressurePointsEquil());
|
||||||
|
|
||||||
// copy the result into the array of initial fluid states
|
// copy the result into the array of initial fluid states
|
||||||
initialFluidStates_.resize(numElems);
|
initialFluidStates_.resize(numElems);
|
||||||
|
@@ -272,6 +272,9 @@ public:
|
|||||||
{ return maxFails_; }
|
{ return maxFails_; }
|
||||||
|
|
||||||
bool vapparsActive(int episodeIdx) const;
|
bool vapparsActive(int episodeIdx) const;
|
||||||
|
|
||||||
|
int numPressurePointsEquil() const
|
||||||
|
{ return numPressurePointsEquil_; }
|
||||||
|
|
||||||
bool operator==(const EclGenericProblem& rhs) const;
|
bool operator==(const EclGenericProblem& rhs) const;
|
||||||
|
|
||||||
@@ -404,6 +407,9 @@ protected:
|
|||||||
Scalar restartShrinkFactor_;
|
Scalar restartShrinkFactor_;
|
||||||
unsigned maxFails_;
|
unsigned maxFails_;
|
||||||
Scalar minTimeStepSize_;
|
Scalar minTimeStepSize_;
|
||||||
|
|
||||||
|
// equilibration parameters
|
||||||
|
int numPressurePointsEquil_;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
template<class T>
|
template<class T>
|
||||||
|
@@ -91,6 +91,8 @@
|
|||||||
|
|
||||||
#include <opm/common/OpmLog/OpmLog.hpp>
|
#include <opm/common/OpmLog/OpmLog.hpp>
|
||||||
|
|
||||||
|
#include <opm/input/eclipse/Parser/ParserKeywords/E.hpp>
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -198,6 +200,12 @@ template<class TypeTag, class MyTypeTag>
|
|||||||
struct OutputMode {
|
struct OutputMode {
|
||||||
using type = UndefinedProperty;
|
using type = UndefinedProperty;
|
||||||
};
|
};
|
||||||
|
// Parameterize equilibration accuracy
|
||||||
|
template<class TypeTag, class MyTypeTag>
|
||||||
|
struct NumPressurePointsEquil {
|
||||||
|
using type = UndefinedProperty;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// Set the problem property
|
// Set the problem property
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
@@ -583,6 +591,12 @@ template<class TypeTag>
|
|||||||
struct OutputMode<TypeTag, TTag::EclBaseProblem> {
|
struct OutputMode<TypeTag, TTag::EclBaseProblem> {
|
||||||
static constexpr auto value = "all";
|
static constexpr auto value = "all";
|
||||||
};
|
};
|
||||||
|
// Parameterize equilibration accuracy
|
||||||
|
template<class TypeTag>
|
||||||
|
struct NumPressurePointsEquil<TypeTag, TTag::EclBaseProblem> {
|
||||||
|
static constexpr int value = ParserKeywords::EQLDIMS::DEPTH_NODES_P::defaultValue;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
} // namespace Opm::Properties
|
} // namespace Opm::Properties
|
||||||
|
|
||||||
@@ -727,6 +741,9 @@ public:
|
|||||||
"Honor some aspects of the TUNING keyword from the ECL deck.");
|
"Honor some aspects of the TUNING keyword from the ECL deck.");
|
||||||
EWOMS_REGISTER_PARAM(TypeTag, std::string, OutputMode,
|
EWOMS_REGISTER_PARAM(TypeTag, std::string, OutputMode,
|
||||||
"Specify which messages are going to be printed. Valid values are: none, log, all (default)");
|
"Specify which messages are going to be printed. Valid values are: none, log, all (default)");
|
||||||
|
EWOMS_REGISTER_PARAM(TypeTag, int, NumPressurePointsEquil,
|
||||||
|
"Number of pressure points (in each direction) in tables used for equilibration");
|
||||||
|
EWOMS_HIDE_PARAM(TypeTag, NumPressurePointsEquil); // Users will typically not need to modify this parameter..
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -806,6 +823,17 @@ public:
|
|||||||
this->maxTimeStepAfterWellEvent_ = EWOMS_GET_PARAM(TypeTag, Scalar, EclMaxTimeStepSizeAfterWellEvent);
|
this->maxTimeStepAfterWellEvent_ = EWOMS_GET_PARAM(TypeTag, Scalar, EclMaxTimeStepSizeAfterWellEvent);
|
||||||
this->restartShrinkFactor_ = EWOMS_GET_PARAM(TypeTag, Scalar, EclRestartShrinkFactor);
|
this->restartShrinkFactor_ = EWOMS_GET_PARAM(TypeTag, Scalar, EclRestartShrinkFactor);
|
||||||
this->maxFails_ = EWOMS_GET_PARAM(TypeTag, unsigned, MaxTimeStepDivisions);
|
this->maxFails_ = EWOMS_GET_PARAM(TypeTag, unsigned, MaxTimeStepDivisions);
|
||||||
|
|
||||||
|
// The value N for this parameter is defined in the following order of presedence:
|
||||||
|
// 1. Command line value (--num-pressure-points-equil=N)
|
||||||
|
// 2. EQLDIMS item 2
|
||||||
|
// Default value is defined in opm-common/src/opm/input/eclipse/share/keywords/000_Eclipse100/E/EQLDIMS
|
||||||
|
if (EWOMS_PARAM_IS_SET(TypeTag, int, NumPressurePointsEquil))
|
||||||
|
{
|
||||||
|
this->numPressurePointsEquil_ = EWOMS_GET_PARAM(TypeTag, int, NumPressurePointsEquil);
|
||||||
|
} else {
|
||||||
|
this->numPressurePointsEquil_ = simulator.vanguard().eclState().getTableManager().getEqldims().getNumDepthNodesP();
|
||||||
|
}
|
||||||
|
|
||||||
RelpermDiagnostics relpermDiagnostics;
|
RelpermDiagnostics relpermDiagnostics;
|
||||||
relpermDiagnostics.diagnosis(vanguard.eclState(), vanguard.cartesianIndexMapper());
|
relpermDiagnostics.diagnosis(vanguard.eclState(), vanguard.cartesianIndexMapper());
|
||||||
|
@@ -57,6 +57,7 @@ template InitialStateComputer<BlackOilFluidSystem<double>,
|
|||||||
const GridView&,
|
const GridView&,
|
||||||
const Dune::CartesianIndexMapper<Dune::CpGrid>&,
|
const Dune::CartesianIndexMapper<Dune::CpGrid>&,
|
||||||
const double,
|
const double,
|
||||||
|
const int,
|
||||||
const bool);
|
const bool);
|
||||||
#if HAVE_DUNE_ALUGRID
|
#if HAVE_DUNE_ALUGRID
|
||||||
#if HAVE_MPI
|
#if HAVE_MPI
|
||||||
@@ -84,6 +85,7 @@ template InitialStateComputer<BlackOilFluidSystem<double>,
|
|||||||
const ALUGridView&,
|
const ALUGridView&,
|
||||||
const Dune::CartesianIndexMapper<ALUGrid3CN>&,
|
const Dune::CartesianIndexMapper<ALUGrid3CN>&,
|
||||||
const double,
|
const double,
|
||||||
|
const int,
|
||||||
const bool);
|
const bool);
|
||||||
#endif //HAVE_DUNE_ALUGRID
|
#endif //HAVE_DUNE_ALUGRID
|
||||||
|
|
||||||
|
@@ -686,6 +686,7 @@ public:
|
|||||||
const GridView& gridView,
|
const GridView& gridView,
|
||||||
const CartesianIndexMapper& cartMapper,
|
const CartesianIndexMapper& cartMapper,
|
||||||
const double grav,
|
const double grav,
|
||||||
|
const int num_pressure_points = 2000,
|
||||||
const bool applySwatInit = true);
|
const bool applySwatInit = true);
|
||||||
|
|
||||||
using Vec = std::vector<double>;
|
using Vec = std::vector<double>;
|
||||||
@@ -763,6 +764,7 @@ private:
|
|||||||
Vec cellCenterDepth_;
|
Vec cellCenterDepth_;
|
||||||
std::vector<std::pair<double,double>> cellZSpan_;
|
std::vector<std::pair<double,double>> cellZSpan_;
|
||||||
std::vector<std::pair<double,double>> cellZMinMax_;
|
std::vector<std::pair<double,double>> cellZMinMax_;
|
||||||
|
int num_pressure_points_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace DeckDependent
|
} // namespace DeckDependent
|
||||||
|
@@ -1309,6 +1309,7 @@ InitialStateComputer(MaterialLawManager& materialLawManager,
|
|||||||
const GridView& gridView,
|
const GridView& gridView,
|
||||||
const CartesianIndexMapper& cartMapper,
|
const CartesianIndexMapper& cartMapper,
|
||||||
const double grav,
|
const double grav,
|
||||||
|
const int num_pressure_points,
|
||||||
const bool applySwatInit)
|
const bool applySwatInit)
|
||||||
: temperature_(grid.size(/*codim=*/0)),
|
: temperature_(grid.size(/*codim=*/0)),
|
||||||
saltConcentration_(grid.size(/*codim=*/0)),
|
saltConcentration_(grid.size(/*codim=*/0)),
|
||||||
@@ -1320,7 +1321,8 @@ InitialStateComputer(MaterialLawManager& materialLawManager,
|
|||||||
rs_(grid.size(/*codim=*/0)),
|
rs_(grid.size(/*codim=*/0)),
|
||||||
rv_(grid.size(/*codim=*/0)),
|
rv_(grid.size(/*codim=*/0)),
|
||||||
rvw_(grid.size(/*codim=*/0)),
|
rvw_(grid.size(/*codim=*/0)),
|
||||||
cartesianIndexMapper_(cartMapper)
|
cartesianIndexMapper_(cartMapper),
|
||||||
|
num_pressure_points_(num_pressure_points)
|
||||||
{
|
{
|
||||||
//Check for presence of kw SWATINIT
|
//Check for presence of kw SWATINIT
|
||||||
if (applySwatInit) {
|
if (applySwatInit) {
|
||||||
@@ -1760,8 +1762,8 @@ calcPressSatRsRv(const RMap& reg,
|
|||||||
using PhaseSat = Details::PhaseSaturations<
|
using PhaseSat = Details::PhaseSaturations<
|
||||||
MaterialLawManager, FluidSystem, EquilReg, typename RMap::CellId
|
MaterialLawManager, FluidSystem, EquilReg, typename RMap::CellId
|
||||||
>;
|
>;
|
||||||
|
|
||||||
auto ptable = Details::PressureTable<FluidSystem, EquilReg>{ grav };
|
auto ptable = Details::PressureTable<FluidSystem, EquilReg>{ grav, this->num_pressure_points_ };
|
||||||
auto psat = PhaseSat { materialLawManager, this->swatInit_ };
|
auto psat = PhaseSat { materialLawManager, this->swatInit_ };
|
||||||
auto vspan = std::array<double, 2>{};
|
auto vspan = std::array<double, 2>{};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user