Opm::BlackoilSequentialModel< Grid, WellModel, PressureModelT, TransportModelT > Class Template Reference

A sequential splitting model implementation for three-phase black oil. More...

#include <BlackoilSequentialModel.hpp>

Public Types

typedef BlackoilState ReservoirState
 
typedef WellStateFullyImplicitBlackoil WellState
 
typedef BlackoilSequentialModelParameters ModelParameters
 
typedef DefaultBlackoilSolutionState SolutionState
 
typedef PressureModelT< Grid, WellModel > PressureModel
 
typedef TransportModelT< Grid, WellModel > TransportModel
 
typedef NonlinearSolver< PressureModel > PressureSolver
 
typedef NonlinearSolver< TransportModel > TransportSolver
 
typedef TransportModel::SimulatorData SimulatorData
 
typedef TransportModel::FIPDataType FIPDataType
 

Public Member Functions

 BlackoilSequentialModel (const ModelParameters &param, const Grid &grid, const BlackoilPropsAdFromDeck &fluid, const DerivedGeology &geo, const RockCompressibility *rock_comp_props, const WellModel well_model, const NewtonIterationBlackoilInterface &linsolver, std::shared_ptr< const EclipseState > eclState, const bool has_disgas, const bool has_vapoil, const bool terminal_output)
 Construct the model. More...
 
void prepareStep (const SimulatorTimerInterface &, const ReservoirState &reservoir_state, const WellState &well_state)
 Called once before each time step. More...
 
template<class NonlinearSolverType >
SimulatorReport nonlinearIteration (const int iteration, const SimulatorTimerInterface &timer, NonlinearSolverType &, ReservoirState &reservoir_state, WellState &well_state)
 Called once per nonlinear iteration. More...
 
void afterStep (const SimulatorTimerInterface &, ReservoirState &, WellState &)
 Called once after each time step. More...
 
void setThresholdPressures (const std::vector< double > &threshold_pressures_by_face)
 Set threshold pressures that prevent or reduce flow. More...
 
bool terminalOutputEnabled () const
 Return true if output to cout is wanted.
 
double relativeChange (const SimulationDataContainer &previous, const SimulationDataContainer &current) const
 Return the relative change in variables relevant to this model.
 
const WellModel & wellModel () const
 Return the well model.
 
std::vector< std::vector< double > > computeFluidInPlace (const ReservoirState &x, const std::vector< int > &fipnum) const
 Compute fluid in place. More...
 
const SimulatorData & getSimulatorData (const SimulationDataContainer &localState) const
 Return reservoir simulation data (for output functionality)
 
FIPDataType getFIPData () const
 Return fluid-in-place data (for output functionality)
 
const SimulatorReport & failureReport () const
 return the statistics if the nonlinearIteration() method failed. More...
 

Protected Attributes

SimulatorReport failureReport_
 
std::unique_ptr< PressureModel > pressure_model_
 
std::unique_ptr< TransportModel > transport_model_
 
PressureSolver pressure_solver_
 
TransportSolver transport_solver_
 
ReservoirState initial_reservoir_state_
 
WellState initial_well_state_
 
bool iterate_to_fully_implicit_
 

Detailed Description

template<class Grid, class WellModel, template< class G, class W > class PressureModelT, template< class G, class W > class TransportModelT>
class Opm::BlackoilSequentialModel< Grid, WellModel, PressureModelT, TransportModelT >

A sequential splitting model implementation for three-phase black oil.

Constructor & Destructor Documentation

◆ BlackoilSequentialModel()

template<class Grid , class WellModel , template< class G, class W > class PressureModelT, template< class G, class W > class TransportModelT>
Opm::BlackoilSequentialModel< Grid, WellModel, PressureModelT, TransportModelT >::BlackoilSequentialModel ( const ModelParameters param,
const Grid &  grid,
const BlackoilPropsAdFromDeck fluid,
const DerivedGeology geo,
const RockCompressibility *  rock_comp_props,
const WellModel  well_model,
const NewtonIterationBlackoilInterface linsolver,
std::shared_ptr< const EclipseState >  eclState,
const bool  has_disgas,
const bool  has_vapoil,
const bool  terminal_output 
)
inline

Construct the model.

It will retain references to the arguments of this functions, and they are expected to remain in scope for the lifetime of the solver.

Parameters
[in]paramparameters
[in]gridgrid data structure
[in]fluidfluid properties
[in]georock properties
[in]rock_comp_propsif non-null, rock compressibility properties
[in]wellswell structure
[in]vfp_propertiesVertical flow performance tables
[in]linsolverlinear solver
[in]eclStateeclipse state
[in]has_disgasturn on dissolved gas
[in]has_vapoilturn on vaporized oil feature
[in]terminal_outputrequest output to cout/cerr

Member Function Documentation

◆ afterStep()

template<class Grid , class WellModel , template< class G, class W > class PressureModelT, template< class G, class W > class TransportModelT>
void Opm::BlackoilSequentialModel< Grid, WellModel, PressureModelT, TransportModelT >::afterStep ( const SimulatorTimerInterface ,
ReservoirState &  ,
WellState  
)
inline

Called once after each time step.

In this class, this function does nothing.

Parameters
[in]timersimulation timer
[in,out]reservoir_statereservoir state variables
[in,out]well_statewell state variables

◆ computeFluidInPlace()

template<class Grid , class WellModel , template< class G, class W > class PressureModelT, template< class G, class W > class TransportModelT>
std::vector<std::vector<double> > Opm::BlackoilSequentialModel< Grid, WellModel, PressureModelT, TransportModelT >::computeFluidInPlace ( const ReservoirState &  x,
const std::vector< int > &  fipnum 
) const
inline

Compute fluid in place.

Parameters
[in]ReservoirState
[in]FIPNUMfor active cells not global cells.
Returns
fluid in place, number of fip regions, each region contains 5 values which are liquid, vapour, water, free gas and dissolved gas.

◆ failureReport()

template<class Grid , class WellModel , template< class G, class W > class PressureModelT, template< class G, class W > class TransportModelT>
const SimulatorReport& Opm::BlackoilSequentialModel< Grid, WellModel, PressureModelT, TransportModelT >::failureReport ( ) const
inline

return the statistics if the nonlinearIteration() method failed.

NOTE: for the flow_legacy simulator family this method is a stub, i.e. the failure report object will not contain any meaningful data.

◆ nonlinearIteration()

template<class Grid , class WellModel , template< class G, class W > class PressureModelT, template< class G, class W > class TransportModelT>
template<class NonlinearSolverType >
SimulatorReport Opm::BlackoilSequentialModel< Grid, WellModel, PressureModelT, TransportModelT >::nonlinearIteration ( const int  iteration,
const SimulatorTimerInterface timer,
NonlinearSolverType &  ,
ReservoirState &  reservoir_state,
WellState well_state 
)
inline

Called once per nonlinear iteration.

This model will first solve the pressure model to convergence, then the transport model.

Parameters
[in]iterationshould be 0 for the first call of a new timestep
[in]timersimulation timer
[in]nonlinear_solvernonlinear solver used (for oscillation/relaxation control)
[in,out]reservoir_statereservoir state variables
[in,out]well_statewell state variables

◆ prepareStep()

template<class Grid , class WellModel , template< class G, class W > class PressureModelT, template< class G, class W > class TransportModelT>
void Opm::BlackoilSequentialModel< Grid, WellModel, PressureModelT, TransportModelT >::prepareStep ( const SimulatorTimerInterface ,
const ReservoirState &  reservoir_state,
const WellState well_state 
)
inline

Called once before each time step.

Parameters
[in]timersimulation timer
[in]reservoir_statereservoir state variables
[in]well_statewell state variables

◆ setThresholdPressures()

template<class Grid , class WellModel , template< class G, class W > class PressureModelT, template< class G, class W > class TransportModelT>
void Opm::BlackoilSequentialModel< Grid, WellModel, PressureModelT, TransportModelT >::setThresholdPressures ( const std::vector< double > &  threshold_pressures_by_face)
inline

Set threshold pressures that prevent or reduce flow.

This prevents flow across faces if the potential difference is less than the threshold. If the potential difference is greater, the threshold value is subtracted before calculating flow. This is treated symmetrically, so flow is prevented or reduced in both directions equally.

Parameters
[in]threshold_pressures_by_facearray of size equal to the number of faces of the grid passed in the constructor.

The documentation for this class was generated from the following file: