mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Changes to try to make naming and classes more consistent. This is a start to make devide models and tranport solvers so that VE models is more easely handled
This commit is contained in:
parent
77fbdcf8d3
commit
6c666f90a8
@ -98,7 +98,15 @@ namespace Opm
|
||||
const FlowBoundaryConditions* bcs_;
|
||||
// Solvers
|
||||
IncompTpfa psolver_;
|
||||
TransportModelTwophase tsolver_;
|
||||
typedef Opm::SinglePointUpwindTwoPhase<TwophaseFluid> TransportModel;
|
||||
typedef Opm::ImplicitTransport<TransportModel,
|
||||
JacSys ,
|
||||
MaxNorm ,
|
||||
VectorNegater ,
|
||||
VectorZero ,
|
||||
MatrixZero ,
|
||||
VectorAssign > ImpliciteTwoPhaseTransportSolver;
|
||||
ImpliciteTwoPhaseTransporSolver tsolver_;
|
||||
// Needed by column-based gravity segregation solver.
|
||||
std::vector< std::vector<int> > columns_;
|
||||
// Misc. data
|
||||
@ -316,7 +324,8 @@ namespace Opm
|
||||
WellsManager& wells_manager,
|
||||
const std::vector<double>& src,
|
||||
const FlowBoundaryConditions* bcs,
|
||||
LinearSolverInterface& linsolver,
|
||||
LinearSolverInterface& linsolverp,
|
||||
LinearSolverInterface& linsolvert,
|
||||
const double* gravity)
|
||||
: grid_(grid),
|
||||
props_(props),
|
||||
@ -325,15 +334,30 @@ namespace Opm
|
||||
wells_(wells_manager.c_wells()),
|
||||
src_(src),
|
||||
bcs_(bcs),
|
||||
psolver_(grid, props, rock_comp_props, linsolver,
|
||||
psolver_(grid, props, rock_comp_props, linsolverp,
|
||||
param.getDefault("nl_pressure_residual_tolerance", 0.0),
|
||||
param.getDefault("nl_pressure_change_tolerance", 1.0),
|
||||
param.getDefault("nl_pressure_maxiter", 10),
|
||||
gravity, wells_manager.c_wells(), src, bcs),
|
||||
tsolver_(grid, props,
|
||||
param.getDefault("nl_tolerance", 1e-9),
|
||||
param.getDefault("nl_maxiter", 30))
|
||||
{
|
||||
const bool use_reorder = param.getDefault("use_reorder", true);
|
||||
if(use_reorder){
|
||||
tsolver_ = new TransportSolverTwoPhaseReorder(grid, props, rock_comp_props, linsolver,
|
||||
param.getDefault("nl_pressure_residual_tolerance", 0.0),
|
||||
param.getDefault("nl_pressure_change_tolerance", 1.0),
|
||||
param.getDefault("nl_pressure_maxiter", 10),
|
||||
gravity, wells_manager.c_wells(), src, bcs);
|
||||
}else{
|
||||
//Opm::ImplicitTransportDetails::NRReport rpt;
|
||||
Opm::ImplicitTransportDetails::NRControl ctrl;
|
||||
ctrl.max_it = param.getDefault("max_it", 20);
|
||||
ctrl.verbosity = param.getDefault("verbosity", 0);
|
||||
ctrl.max_it_ls = param.getDefault("max_it_ls", 5);
|
||||
tsolver_ = new ImpliciteTransportSolverTwoPhase(grid, props,
|
||||
ctrl);
|
||||
|
||||
}
|
||||
|
||||
// For output.
|
||||
output_ = param.getDefault("output", true);
|
||||
if (output_) {
|
||||
@ -523,8 +547,9 @@ namespace Opm
|
||||
double injected[2] = { 0.0 };
|
||||
double produced[2] = { 0.0 };
|
||||
for (int tr_substep = 0; tr_substep < num_transport_substeps_; ++tr_substep) {
|
||||
tsolver_.solve(&state.faceflux()[0], &initial_porevol[0], &transport_src[0],
|
||||
stepsize, state.saturation());
|
||||
//tsolver_.solve(&state.faceflux()[0], &initial_porevol[0], &transport_src[0],
|
||||
// stepsize, state.saturation());
|
||||
tsolver_.solve(*grid_->c_grid(), tsrc, stepsize, ctrl, state, linsolve, rpt);
|
||||
double substep_injected[2] = { 0.0 };
|
||||
double substep_produced[2] = { 0.0 };
|
||||
Opm::computeInjectedProduced(props_, state.saturation(), transport_src, stepsize,
|
||||
@ -533,17 +558,18 @@ namespace Opm
|
||||
injected[1] += substep_injected[1];
|
||||
produced[0] += substep_produced[0];
|
||||
produced[1] += substep_produced[1];
|
||||
if (use_segregation_split_) {
|
||||
tsolver_.solveGravity(columns_, &initial_porevol[0], stepsize, state.saturation());
|
||||
}
|
||||
|
||||
|
||||
watercut.push(timer.currentTime() + timer.currentStepLength(),
|
||||
produced[0]/(produced[0] + produced[1]),
|
||||
tot_produced[0]/tot_porevol_init);
|
||||
|
||||
if (wells_) {
|
||||
wellreport.push(props_, *wells_, state.saturation(),
|
||||
timer.currentTime() + timer.currentStepLength(),
|
||||
well_state.bhp(), well_state.perfRates());
|
||||
}
|
||||
|
||||
}
|
||||
transport_timer.stop();
|
||||
double tt = transport_timer.secsSinceStart();
|
||||
|
Loading…
Reference in New Issue
Block a user