Commit for saving.

This commit is contained in:
Kai Bao 2014-07-24 17:06:43 +02:00
parent 99f1620963
commit 8da842d1f3
2 changed files with 29 additions and 19 deletions

View File

@ -37,6 +37,8 @@ namespace Opm
class SimulatorTimer; class SimulatorTimer;
class BlackoilState; class BlackoilState;
class WellStateFullyImplicitBlackoil; class WellStateFullyImplicitBlackoil;
class EclipseState;
class EclipseWriter;
struct SimulatorReport; struct SimulatorReport;
/// Class collecting all necessary components for a two-phase simulation. /// Class collecting all necessary components for a two-phase simulation.
@ -68,15 +70,18 @@ namespace Opm
/// \param[in] well_manager well manager, may manage no (null) wells /// \param[in] well_manager well manager, may manage no (null) wells
/// \param[in] linsolver linear solver /// \param[in] linsolver linear solver
/// \param[in] gravity if non-null, gravity vector /// \param[in] gravity if non-null, gravity vector
/// \param[in] eclipse_state
/// \param[in] output_writer
SimulatorFullyImplicitBlackoil(const parameter::ParameterGroup& param, SimulatorFullyImplicitBlackoil(const parameter::ParameterGroup& param,
const Grid& grid, const Grid& grid,
BlackoilPropsAdInterface& props, BlackoilPropsAdInterface& props,
const RockCompressibility* rock_comp_props, const RockCompressibility* rock_comp_props,
WellsManager& wells_manager,
NewtonIterationBlackoilInterface& linsolver, NewtonIterationBlackoilInterface& linsolver,
const double* gravity, const double* gravity,
const bool disgas, const bool disgas,
const bool vapoil ); const bool vapoil,
std::shared_ptr<EclipseState> eclipse_state,
EclipseWriter& output_writer);
/// Run the simulation. /// Run the simulation.
/// This will run succesive timesteps until timer.done() is true. It will /// This will run succesive timesteps until timer.done() is true. It will
@ -86,8 +91,7 @@ namespace Opm
/// \param[in,out] well_state state of wells: bhp, perforation rates /// \param[in,out] well_state state of wells: bhp, perforation rates
/// \return simulation report, with timing data /// \return simulation report, with timing data
SimulatorReport run(SimulatorTimer& timer, SimulatorReport run(SimulatorTimer& timer,
BlackoilState& state, BlackoilState& state);
WellStateFullyImplicitBlackoil& well_state);
private: private:
class Impl; class Impl;

View File

@ -30,6 +30,7 @@
#include <opm/core/wells.h> #include <opm/core/wells.h>
#include <opm/core/pressure/flow_bc.h> #include <opm/core/pressure/flow_bc.h>
#include <opm/core/io/eclipse/EclipseWriter.hpp>
#include <opm/core/simulator/SimulatorReport.hpp> #include <opm/core/simulator/SimulatorReport.hpp>
#include <opm/core/simulator/SimulatorTimer.hpp> #include <opm/core/simulator/SimulatorTimer.hpp>
#include <opm/core/utility/StopWatch.hpp> #include <opm/core/utility/StopWatch.hpp>
@ -68,11 +69,12 @@ namespace Opm
NewtonIterationBlackoilInterface& linsolver, NewtonIterationBlackoilInterface& linsolver,
const double* gravity, const double* gravity,
bool has_disgas, bool has_disgas,
bool has_vapoil ); bool has_vapoil,
std::shared_ptr<EclipseState> eclipse_state,
EclipseWriter& output_writer);
SimulatorReport run(SimulatorTimer& timer, SimulatorReport run(SimulatorTimer& timer,
BlackoilState& state, BlackoilState& state);
WellStateFullyImplicitBlackoil& well_state);
private: private:
// Data. // Data.
@ -89,14 +91,16 @@ namespace Opm
const Grid& grid_; const Grid& grid_;
BlackoilPropsAdInterface& props_; BlackoilPropsAdInterface& props_;
const RockCompressibility* rock_comp_props_; const RockCompressibility* rock_comp_props_;
WellsManager& wells_manager_;
const Wells* wells_;
const double* gravity_; const double* gravity_;
// Solvers // Solvers
DerivedGeology geo_; DerivedGeology geo_;
FullyImplicitBlackoilSolver<Grid> solver_; FullyImplicitBlackoilSolver<Grid> solver_;
// Misc. data // Misc. data
std::vector<int> allcells_; std::vector<int> allcells_;
// eclipse_state
std::shared_ptr<EclipseState> eclipse_state_;
// output_writer
EclipseWriter& output_writer_;
}; };
@ -111,10 +115,12 @@ namespace Opm
NewtonIterationBlackoilInterface& linsolver, NewtonIterationBlackoilInterface& linsolver,
const double* gravity, const double* gravity,
const bool has_disgas, const bool has_disgas,
const bool has_vapoil ) const bool has_vapoil,
std::shared_ptr<EclipseState> eclipse_state,
EclipseWriter& output_writer)
{ {
pimpl_.reset(new Impl(param, grid, props, rock_comp_props, wells_manager, linsolver, gravity, has_disgas, has_vapoil)); pimpl_.reset(new Impl(param, grid, props, rock_comp_props, wells_manager, linsolver, gravity, has_disgas, has_vapoil, eclipse_state, output_writer));
} }
@ -123,10 +129,9 @@ namespace Opm
template<class T> template<class T>
SimulatorReport SimulatorFullyImplicitBlackoil<T>::run(SimulatorTimer& timer, SimulatorReport SimulatorFullyImplicitBlackoil<T>::run(SimulatorTimer& timer,
BlackoilState& state, BlackoilState& state)
WellStateFullyImplicitBlackoil& well_state)
{ {
return pimpl_->run(timer, state, well_state); return pimpl_->run(timer, state);
} }
@ -198,15 +203,17 @@ namespace Opm
NewtonIterationBlackoilInterface& linsolver, NewtonIterationBlackoilInterface& linsolver,
const double* gravity, const double* gravity,
const bool has_disgas, const bool has_disgas,
const bool has_vapoil) const bool has_vapoil,
std::shared_ptr<EclipseState> eclipse_state,
EclipseWriter& output_writer)
: grid_(grid), : grid_(grid),
props_(props), props_(props),
rock_comp_props_(rock_comp_props), rock_comp_props_(rock_comp_props),
wells_manager_(wells_manager),
wells_(wells_manager.c_wells()),
gravity_(gravity), gravity_(gravity),
geo_(grid_, props_, gravity_), geo_(grid_, props_, gravity_),
solver_(param, grid_, props_, geo_, rock_comp_props, *wells_manager.c_wells(), linsolver, has_disgas, has_vapoil) solver_(param, grid_, props_, geo_, rock_comp_props, *wells_manager.c_wells(), linsolver, has_disgas, has_vapoil)
eclipse_state_(eclipse_state),
output_writer_(output_writer)
/* param.getDefault("nl_pressure_residual_tolerance", 0.0), /* param.getDefault("nl_pressure_residual_tolerance", 0.0),
param.getDefault("nl_pressure_change_tolerance", 1.0), param.getDefault("nl_pressure_change_tolerance", 1.0),
param.getDefault("nl_pressure_maxiter", 10), param.getDefault("nl_pressure_maxiter", 10),
@ -242,8 +249,7 @@ namespace Opm
template<class T> template<class T>
SimulatorReport SimulatorFullyImplicitBlackoil<T>::Impl::run(SimulatorTimer& timer, SimulatorReport SimulatorFullyImplicitBlackoil<T>::Impl::run(SimulatorTimer& timer,
BlackoilState& state, BlackoilState& state)
WellStateFullyImplicitBlackoil& well_state)
{ {
// Initialisation. // Initialisation.
std::vector<double> porevol; std::vector<double> porevol;