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 BlackoilState;
class WellStateFullyImplicitBlackoil;
class EclipseState;
class EclipseWriter;
struct SimulatorReport;
/// 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] linsolver linear solver
/// \param[in] gravity if non-null, gravity vector
/// \param[in] eclipse_state
/// \param[in] output_writer
SimulatorFullyImplicitBlackoil(const parameter::ParameterGroup& param,
const Grid& grid,
BlackoilPropsAdInterface& props,
const RockCompressibility* rock_comp_props,
WellsManager& wells_manager,
NewtonIterationBlackoilInterface& linsolver,
const double* gravity,
const bool disgas,
const bool vapoil );
const bool vapoil,
std::shared_ptr<EclipseState> eclipse_state,
EclipseWriter& output_writer);
/// Run the simulation.
/// 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
/// \return simulation report, with timing data
SimulatorReport run(SimulatorTimer& timer,
BlackoilState& state,
WellStateFullyImplicitBlackoil& well_state);
BlackoilState& state);
private:
class Impl;

View File

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