mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #1016 from andlaus/flow_ebos-remove-redundant-gravity
flow_ebos: remove the redundant gravity objects
This commit is contained in:
@@ -60,6 +60,8 @@ namespace Opm
|
|||||||
typedef typename GET_PROP(TypeTag, MaterialLaw)::EclMaterialLawManager MaterialLawManager;
|
typedef typename GET_PROP(TypeTag, MaterialLaw)::EclMaterialLawManager MaterialLawManager;
|
||||||
typedef typename GET_PROP_TYPE(TypeTag, Simulator) EbosSimulator;
|
typedef typename GET_PROP_TYPE(TypeTag, Simulator) EbosSimulator;
|
||||||
typedef typename GET_PROP_TYPE(TypeTag, Grid) Grid;
|
typedef typename GET_PROP_TYPE(TypeTag, Grid) Grid;
|
||||||
|
typedef typename GET_PROP_TYPE(TypeTag, Problem) Problem;
|
||||||
|
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
|
||||||
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
|
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
|
||||||
|
|
||||||
typedef Opm::SimulatorFullyImplicitBlackoilEbos Simulator;
|
typedef Opm::SimulatorFullyImplicitBlackoilEbos Simulator;
|
||||||
@@ -377,7 +379,6 @@ namespace Opm
|
|||||||
// Create grid and property objects.
|
// Create grid and property objects.
|
||||||
// Writes to:
|
// Writes to:
|
||||||
// fluidprops_
|
// fluidprops_
|
||||||
// gravity_
|
|
||||||
void setupGridAndProps()
|
void setupGridAndProps()
|
||||||
{
|
{
|
||||||
Dune::CpGrid& grid = ebosSimulator_->gridManager().grid();
|
Dune::CpGrid& grid = ebosSimulator_->gridManager().grid();
|
||||||
@@ -388,16 +389,9 @@ namespace Opm
|
|||||||
materialLawManager(),
|
materialLawManager(),
|
||||||
grid));
|
grid));
|
||||||
|
|
||||||
// Gravity.
|
|
||||||
static_assert(Grid::dimension == 3, "Only 3D grids are supported");
|
|
||||||
gravity_.fill(0.0);
|
|
||||||
if (!deck().hasKeyword("NOGRAV"))
|
|
||||||
gravity_[2] =
|
|
||||||
param_.getDefault("gravity", unit::gravity);
|
|
||||||
|
|
||||||
// Geological properties
|
// Geological properties
|
||||||
bool use_local_perm = param_.getDefault("use_local_perm", true);
|
bool use_local_perm = param_.getDefault("use_local_perm", true);
|
||||||
geoprops_.reset(new DerivedGeology(grid, *fluidprops_, eclState(), use_local_perm, gravity_.data()));
|
geoprops_.reset(new DerivedGeology(grid, *fluidprops_, eclState(), use_local_perm, &ebosProblem().gravity()[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
const Deck& deck() const
|
const Deck& deck() const
|
||||||
@@ -446,7 +440,7 @@ namespace Opm
|
|||||||
Opm::UgGridHelpers::beginFaceCentroids(grid),
|
Opm::UgGridHelpers::beginFaceCentroids(grid),
|
||||||
Opm::UgGridHelpers::beginCellCentroids(grid),
|
Opm::UgGridHelpers::beginCellCentroids(grid),
|
||||||
Grid::dimension,
|
Grid::dimension,
|
||||||
props, param_, gravity_[2], *state_);
|
props, param_, gravity(), *state_);
|
||||||
|
|
||||||
initBlackoilSurfvol(Opm::UgGridHelpers::numCells(grid), props, *state_);
|
initBlackoilSurfvol(Opm::UgGridHelpers::numCells(grid), props, *state_);
|
||||||
|
|
||||||
@@ -469,7 +463,7 @@ namespace Opm
|
|||||||
Opm::UgGridHelpers::numFaces(grid),
|
Opm::UgGridHelpers::numFaces(grid),
|
||||||
props.numPhases()));
|
props.numPhases()));
|
||||||
|
|
||||||
initStateEquil(grid, props, deck(), eclState(), gravity_[2], *state_);
|
initStateEquil(grid, props, deck(), eclState(), gravity(), *state_);
|
||||||
//state_.faceflux().resize(Opm::UgGridHelpers::numFaces(grid), 0.0);
|
//state_.faceflux().resize(Opm::UgGridHelpers::numFaces(grid), 0.0);
|
||||||
} else {
|
} else {
|
||||||
state_.reset( new ReservoirState( Opm::UgGridHelpers::numCells(grid),
|
state_.reset( new ReservoirState( Opm::UgGridHelpers::numCells(grid),
|
||||||
@@ -482,7 +476,7 @@ namespace Opm
|
|||||||
Opm::UgGridHelpers::beginFaceCentroids(grid),
|
Opm::UgGridHelpers::beginFaceCentroids(grid),
|
||||||
Opm::UgGridHelpers::beginCellCentroids(grid),
|
Opm::UgGridHelpers::beginCellCentroids(grid),
|
||||||
Opm::UgGridHelpers::dimensions(grid),
|
Opm::UgGridHelpers::dimensions(grid),
|
||||||
props, deck(), gravity_[2], *state_);
|
props, deck(), gravity(), *state_);
|
||||||
}
|
}
|
||||||
|
|
||||||
// The capillary pressure is scaled in fluidprops_ to match the scaled capillary pressure in props.
|
// The capillary pressure is scaled in fluidprops_ to match the scaled capillary pressure in props.
|
||||||
@@ -646,7 +640,6 @@ namespace Opm
|
|||||||
*geoprops_,
|
*geoprops_,
|
||||||
*fluidprops_,
|
*fluidprops_,
|
||||||
*fis_solver_,
|
*fis_solver_,
|
||||||
gravity_.data(),
|
|
||||||
FluidSystem::enableDissolvedGas(),
|
FluidSystem::enableDissolvedGas(),
|
||||||
FluidSystem::enableVaporizedOil(),
|
FluidSystem::enableVaporizedOil(),
|
||||||
eclState(),
|
eclState(),
|
||||||
@@ -707,8 +700,17 @@ namespace Opm
|
|||||||
Grid& grid()
|
Grid& grid()
|
||||||
{ return ebosSimulator_->gridManager().grid(); }
|
{ return ebosSimulator_->gridManager().grid(); }
|
||||||
|
|
||||||
|
Problem& ebosProblem()
|
||||||
|
{ return ebosSimulator_->problem(); }
|
||||||
|
|
||||||
|
const Problem& ebosProblem() const
|
||||||
|
{ return ebosSimulator_->problem(); }
|
||||||
|
|
||||||
std::shared_ptr<MaterialLawManager> materialLawManager()
|
std::shared_ptr<MaterialLawManager> materialLawManager()
|
||||||
{ return ebosSimulator_->problem().materialLawManager(); }
|
{ return ebosProblem().materialLawManager(); }
|
||||||
|
|
||||||
|
Scalar gravity() const
|
||||||
|
{ return ebosProblem().gravity()[2]; }
|
||||||
|
|
||||||
std::unordered_set<std::string> defunctWellNames() const
|
std::unordered_set<std::string> defunctWellNames() const
|
||||||
{ return ebosSimulator_->gridManager().defunctWellNames(); }
|
{ return ebosSimulator_->gridManager().defunctWellNames(); }
|
||||||
@@ -721,7 +723,6 @@ namespace Opm
|
|||||||
bool output_to_files_ = false;
|
bool output_to_files_ = false;
|
||||||
std::string output_dir_ = std::string(".");
|
std::string output_dir_ = std::string(".");
|
||||||
std::unique_ptr<BlackoilPropsAdFromDeck> fluidprops_;
|
std::unique_ptr<BlackoilPropsAdFromDeck> fluidprops_;
|
||||||
std::array<double, 3> gravity_;
|
|
||||||
std::unique_ptr<DerivedGeology> geoprops_;
|
std::unique_ptr<DerivedGeology> geoprops_;
|
||||||
std::unique_ptr<ReservoirState> state_;
|
std::unique_ptr<ReservoirState> state_;
|
||||||
std::unique_ptr<EclipseWriter> eclipse_writer_;
|
std::unique_ptr<EclipseWriter> eclipse_writer_;
|
||||||
|
|||||||
@@ -85,7 +85,6 @@ public:
|
|||||||
/// \param[in] geo derived geological properties
|
/// \param[in] geo derived geological properties
|
||||||
/// \param[in] props fluid and rock properties
|
/// \param[in] props fluid and rock properties
|
||||||
/// \param[in] linsolver linear solver
|
/// \param[in] linsolver linear solver
|
||||||
/// \param[in] gravity if non-null, gravity vector
|
|
||||||
/// \param[in] has_disgas true for dissolved gas option
|
/// \param[in] has_disgas true for dissolved gas option
|
||||||
/// \param[in] has_vapoil true for vaporized oil option
|
/// \param[in] has_vapoil true for vaporized oil option
|
||||||
/// \param[in] eclipse_state the object which represents an internalized ECL deck
|
/// \param[in] eclipse_state the object which represents an internalized ECL deck
|
||||||
@@ -96,7 +95,6 @@ public:
|
|||||||
DerivedGeology& geo,
|
DerivedGeology& geo,
|
||||||
BlackoilPropsAdFromDeck& props,
|
BlackoilPropsAdFromDeck& props,
|
||||||
NewtonIterationBlackoilInterface& linsolver,
|
NewtonIterationBlackoilInterface& linsolver,
|
||||||
const double* gravity,
|
|
||||||
const bool has_disgas,
|
const bool has_disgas,
|
||||||
const bool has_vapoil,
|
const bool has_vapoil,
|
||||||
const EclipseState& eclState,
|
const EclipseState& eclState,
|
||||||
@@ -107,7 +105,6 @@ public:
|
|||||||
model_param_(param),
|
model_param_(param),
|
||||||
solver_param_(param),
|
solver_param_(param),
|
||||||
props_(props),
|
props_(props),
|
||||||
gravity_(gravity),
|
|
||||||
geo_(geo),
|
geo_(geo),
|
||||||
solver_(linsolver),
|
solver_(linsolver),
|
||||||
has_disgas_(has_disgas),
|
has_disgas_(has_disgas),
|
||||||
@@ -758,7 +755,6 @@ protected:
|
|||||||
|
|
||||||
// Observed objects.
|
// Observed objects.
|
||||||
BlackoilPropsAdFromDeck& props_;
|
BlackoilPropsAdFromDeck& props_;
|
||||||
const double* gravity_;
|
|
||||||
// Solvers
|
// Solvers
|
||||||
DerivedGeology& geo_;
|
DerivedGeology& geo_;
|
||||||
NewtonIterationBlackoilInterface& solver_;
|
NewtonIterationBlackoilInterface& solver_;
|
||||||
|
|||||||
Reference in New Issue
Block a user