flow_ebos: retrieve the simulation grid from the ebos simulator object

This commit is contained in:
Andreas Lauser 2016-08-08 14:41:52 +02:00
parent 77f103fca5
commit f29bf8f694
2 changed files with 9 additions and 17 deletions

View File

@ -93,13 +93,6 @@ namespace Opm {
/// where gas can be dissolved in oil and vice versa. It /// where gas can be dissolved in oil and vice versa. It
/// uses an industry-standard TPFA discretization with per-phase /// uses an industry-standard TPFA discretization with per-phase
/// upwind weighting of mobilities. /// upwind weighting of mobilities.
///
/// It uses automatic differentiation via the class AutoDiffBlock
/// to simplify assembly of the jacobian matrix.
/// \tparam Grid UnstructuredGrid or CpGrid.
/// \tparam WellModel WellModel employed.
/// \tparam Implementation Provides concrete state types.
template<class Grid>
class BlackoilModelEbos class BlackoilModelEbos
{ {
public: public:
@ -115,6 +108,7 @@ namespace Opm {
typedef typename TTAG(EclFlowProblem) TypeTag; typedef typename TTAG(EclFlowProblem) TypeTag;
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator ; typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator ;
typedef typename GET_PROP_TYPE(TypeTag, Grid) Grid;
typedef typename GET_PROP_TYPE(TypeTag, SolutionVector) SolutionVector ; typedef typename GET_PROP_TYPE(TypeTag, SolutionVector) SolutionVector ;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables ; typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables ;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
@ -140,7 +134,6 @@ namespace Opm {
/// \param[in] terminal_output request output to cout/cerr /// \param[in] terminal_output request output to cout/cerr
BlackoilModelEbos(Simulator& ebosSimulator, BlackoilModelEbos(Simulator& ebosSimulator,
const ModelParameters& param, const ModelParameters& param,
const Grid& grid ,
const BlackoilPropsAdInterface& fluid, const BlackoilPropsAdInterface& fluid,
const DerivedGeology& geo , const DerivedGeology& geo ,
const RockCompressibility* rock_comp_props, const RockCompressibility* rock_comp_props,
@ -151,7 +144,7 @@ namespace Opm {
const bool has_vapoil, const bool has_vapoil,
const bool terminal_output) const bool terminal_output)
: ebosSimulator_(ebosSimulator) : ebosSimulator_(ebosSimulator)
, grid_ (grid) , grid_(ebosSimulator_.gridManager().grid())
, fluid_ (fluid) , fluid_ (fluid)
, geo_ (geo) , geo_ (geo)
, rock_comp_props_(rock_comp_props) , rock_comp_props_(rock_comp_props)
@ -161,18 +154,18 @@ namespace Opm {
, linsolver_ (linsolver) , linsolver_ (linsolver)
, active_(detail::activePhases(fluid.phaseUsage())) , active_(detail::activePhases(fluid.phaseUsage()))
, canph_ (detail::active2Canonical(fluid.phaseUsage())) , canph_ (detail::active2Canonical(fluid.phaseUsage()))
, cells_ (detail::buildAllCells(Opm::AutoDiffGrid::numCells(grid))) , cells_ (detail::buildAllCells(Opm::AutoDiffGrid::numCells(grid_)))
, ops_ (grid, geo.nnc()) , ops_ (grid_, geo.nnc())
, has_disgas_(has_disgas) , has_disgas_(has_disgas)
, has_vapoil_(has_vapoil) , has_vapoil_(has_vapoil)
, param_( param ) , param_( param )
, use_threshold_pressure_(false) , use_threshold_pressure_(false)
, rq_ (fluid.numPhases()) , rq_ (fluid.numPhases())
, phaseCondition_(AutoDiffGrid::numCells(grid)) , phaseCondition_(AutoDiffGrid::numCells(grid_))
, well_model_ (well_model) , well_model_ (well_model)
, isRs_(V::Zero(AutoDiffGrid::numCells(grid))) , isRs_(V::Zero(AutoDiffGrid::numCells(grid_)))
, isRv_(V::Zero(AutoDiffGrid::numCells(grid))) , isRv_(V::Zero(AutoDiffGrid::numCells(grid_)))
, isSg_(V::Zero(AutoDiffGrid::numCells(grid))) , isSg_(V::Zero(AutoDiffGrid::numCells(grid_)))
, residual_ ( { std::vector<ADB>(fluid.numPhases(), ADB::null()), , residual_ ( { std::vector<ADB>(fluid.numPhases(), ADB::null()),
ADB::null(), ADB::null(),
ADB::null(), ADB::null(),

View File

@ -43,7 +43,7 @@ public:
typedef BlackoilState ReservoirState; typedef BlackoilState ReservoirState;
typedef BlackoilOutputWriter OutputWriter; typedef BlackoilOutputWriter OutputWriter;
typedef GridT Grid; typedef GridT Grid;
typedef BlackoilModelEbos<Grid> Model; typedef BlackoilModelEbos Model;
typedef BlackoilModelParameters ModelParameters; typedef BlackoilModelParameters ModelParameters;
typedef NonlinearSolver<Model> Solver; typedef NonlinearSolver<Model> Solver;
typedef StandardWells WellModel; typedef StandardWells WellModel;
@ -354,7 +354,6 @@ protected:
{ {
auto model = std::unique_ptr<Model>(new Model(*ebosSimulator_, auto model = std::unique_ptr<Model>(new Model(*ebosSimulator_,
model_param_, model_param_,
grid_,
props_, props_,
geo_, geo_,
rock_comp_props_, rock_comp_props_,