#include <NonlinearSystemBlackOilReservoir.hpp>

Inheritance diagram for Opm::NonlinearSystemBlackOilReservoir< TypeTag >:
Inheritance graph

Classes

struct  CnvPvSplitData
 
struct  MaxSolutionUpdateData
 

Public Types

enum class  DebugFlags { STRICT = 0 , RELAXED = 1 , TUNINGDP = 2 }
 
using ParentType = NonlinearSystem< TypeTag >
 
using Simulator = typename ParentType::Simulator
 
using Grid = typename ParentType::Grid
 
using ElementContext = GetPropType< TypeTag, Properties::ElementContext >
 
using IntensiveQuantities = GetPropType< TypeTag, Properties::IntensiveQuantities >
 
using SparseMatrixAdapter = GetPropType< TypeTag, Properties::SparseMatrixAdapter >
 
using SolutionVector = GetPropType< TypeTag, Properties::SolutionVector >
 
using PrimaryVariables = GetPropType< TypeTag, Properties::PrimaryVariables >
 
using FluidSystem = GetPropType< TypeTag, Properties::FluidSystem >
 
using Indices = GetPropType< TypeTag, Properties::Indices >
 
using MaterialLaw = GetPropType< TypeTag, Properties::MaterialLaw >
 
using MaterialLawParams = GetPropType< TypeTag, Properties::MaterialLawParams >
 
using Scalar = GetPropType< TypeTag, Properties::Scalar >
 
using GlobalEqVector = typename ParentType::GlobalEqVector
 
using ModelParameters = BlackoilModelParameters< Scalar >
 
using VectorBlockType = Dune::FieldVector< Scalar, numEq >
 
using MatrixBlockType = typename SparseMatrixAdapter::MatrixBlock
 
using Mat = typename SparseMatrixAdapter::IstlMatrix
 
using BVector = Dune::BlockVector< VectorBlockType >
 
using ComponentName = ::Opm::ComponentName< FluidSystem, Indices >
 
using WellModel = GetPropType< TypeTag, Properties::WellModel >
 

Public Member Functions

 NonlinearSystemBlackOilReservoir (Simulator &simulator, const ModelParameters &param, BlackoilWellModel< TypeTag > &well_model, const bool terminal_output)
 
const EclipseState & eclState () const
 
SimulatorReportSingle prepareStep (const SimulatorTimerInterface &timer)
 
void initialLinearization (SimulatorReportSingle &report, const int minIter, const int maxIter, const SimulatorTimerInterface &timer) override
 
template<class NonlinearSolverType >
SimulatorReportSingle nonlinearIteration (const SimulatorTimerInterface &timer, NonlinearSolverType &nonlinear_solver)
 
template<class NonlinearSolverType >
SimulatorReportSingle nonlinearIterationNewton (const SimulatorTimerInterface &timer, NonlinearSolverType &nonlinear_solver)
 
Scalar relativeChange () const
 
int linearIterationsLastSolve () const
 Number of linear iterations used in last call to solveJacobianSystem(). More...
 
double & linearSolveSetupTime ()
 
void solveJacobianSystem (BVector &x)
 
bool shouldStoreSolutionUpdate () const override
 Get solution update vector as a PrimaryVariable. More...
 
void prepareSolutionUpdate () override
 
void storeSolutionUpdate (const GlobalEqVector &dx) override
 
MaxSolutionUpdateData getMaxSolutionUpdate (const std::vector< unsigned > &ixCells)
 
std::tuple< Scalar, ScalarconvergenceReduction (Parallel::Communication comm, const Scalar pvSumLocal, const Scalar numAquiferPvSumLocal, std::vector< Scalar > &R_sum, std::vector< Scalar > &maxCoeff, std::vector< Scalar > &B_avg)
 
std::pair< Scalar, ScalarlocalConvergenceData (std::vector< Scalar > &R_sum, std::vector< Scalar > &maxCoeff, std::vector< Scalar > &B_avg, std::vector< int > &maxCoeffCell)
 Get reservoir quantities on this process needed for convergence calculations. More...
 
CnvPvSplitData characteriseCnvPvSplit (const std::vector< Scalar > &B_avg, const double dt)
 Compute pore-volume/cell count split among "converged", "relaxed converged", "unconverged" cells based on CNV point measures. Also returns list of cells where CNV is greater than its strict tolerance. More...
 
void convergencePerCell (const std::vector< Scalar > &B_avg, const double dt, const double tol_cnv, const double tol_cnv_energy)
 Compute the number of Newtons required by each cell in order to satisfy the solution change convergence criteria at the last time step. More...
 
ConvergenceReport getReservoirConvergence (const double reportTime, const double dt, const int maxIter, std::vector< Scalar > &B_avg, std::vector< Scalar > &residual_norms)
 
ConvergenceReport getConvergence (const SimulatorTimerInterface &timer, const int maxIter, std::vector< Scalar > &residual_norms)
 
template<class T >
std::vector< std::vector< Scalar > > computeFluidInPlace (const T &, const std::vector< int > &fipnum) const
 Wrapper required due to not following generic API. More...
 
std::vector< std::vector< Scalar > > computeFluidInPlace (const std::vector< int > &) const
 Should not be called. More...
 
const SimulatorReportlocalAccumulatedReports () const
 return the statistics of local solves accumulated for this rank More...
 
const std::vector< SimulatorReport > & domainAccumulatedReports () const
 return the statistics of local solves accumulated for each domain on this rank More...
 
void writeNonlinearIterationsPerCell (const std::filesystem::path &odir) const
 Write the number of nonlinear iterations per cell to a file in ResInsight compatible format. More...
 
void popLastConvergenceReport ()
 Remove the last convergence report entry and residual norms history entry. More...
 
void writePartitions (const std::filesystem::path &odir) const
 
template<class FluidState , class Residual >
void getMaxCoeff (const unsigned cell_idx, const IntensiveQuantities &intQuants, const FluidState &fs, const Residual &modelResid, const Scalar pvValue, std::vector< Scalar > &B_avg, std::vector< Scalar > &R_sum, std::vector< Scalar > &maxCoeff, std::vector< int > &maxCoeffCell)
 
bool hasNlddSolver () const
 Returns true if an NLDD solver exists. More...
 
bool isParallel () const
 
const Simulatorsimulator () const
 
Simulatorsimulator ()
 
bool terminalOutputEnabled () const
 
int numPhases () const
 
const SimulatorReportSinglefailureReport () const
 
const std::vector< StepReport > & stepReports () const
 
const ComponentNamecompNames () const
 
const ModelParametersparam () const
 
WellModelwellModel ()
 
const WellModelwellModel () const
 
void beginReportStep ()
 
void endReportStep ()
 
SimulatorReportSingle assembleReservoir (const SimulatorTimerInterface &timer)
 
void updateTUNING (const Tuning &tuning)
 
void updateTUNINGDP (const TuningDp &tuning_dp)
 
void updateSolution (const GlobalEqVector &dx)
 
template<class LogFailure >
void addReservoirConvergenceMetrics (ConvergenceReport &report, const int componentIdx, const std::string_view componentName, const std::span< const Scalar > residuals, const std::span< const ConvergenceReport::ReservoirFailure::Type > types, const std::span< const Scalar > tolerances, const Scalar maxResidualAllowed, LogFailure &&logFailure) const
 

Static Public Attributes

static constexpr bool enableSaltPrecipitation = getPropValue<TypeTag, Properties::EnableSaltPrecipitation>()
 
static constexpr int numEq = Indices::numEq
 
static constexpr int contiSolventEqIdx = Indices::contiSolventEqIdx
 
static constexpr int contiZfracEqIdx = Indices::contiZfracEqIdx
 
static constexpr int contiPolymerEqIdx = Indices::contiPolymerEqIdx
 
static constexpr int contiEnergyEqIdx = Indices::contiEnergyEqIdx
 
static constexpr int contiPolymerMWEqIdx = Indices::contiPolymerMWEqIdx
 
static constexpr int contiFoamEqIdx = Indices::contiFoamEqIdx
 
static constexpr int contiBrineEqIdx = Indices::contiBrineEqIdx
 
static constexpr int contiMicrobialEqIdx = Indices::contiMicrobialEqIdx
 
static constexpr int contiOxygenEqIdx = Indices::contiOxygenEqIdx
 
static constexpr int contiUreaEqIdx = Indices::contiUreaEqIdx
 
static constexpr int contiBiofilmEqIdx = Indices::contiBiofilmEqIdx
 
static constexpr int contiCalciteEqIdx = Indices::contiCalciteEqIdx
 
static constexpr unsigned solventSaturationIdx = Indices::solventSaturationIdx
 
static constexpr unsigned zFractionIdx = Indices::zFractionIdx
 
static constexpr unsigned polymerConcentrationIdx = Indices::polymerConcentrationIdx
 
static constexpr unsigned polymerMoleWeightIdx = Indices::polymerMoleWeightIdx
 
static constexpr unsigned temperatureIdx = Indices::temperatureIdx
 
static constexpr unsigned foamConcentrationIdx = Indices::foamConcentrationIdx
 
static constexpr unsigned saltConcentrationIdx = Indices::saltConcentrationIdx
 
static constexpr unsigned microbialConcentrationIdx = Indices::microbialConcentrationIdx
 
static constexpr unsigned oxygenConcentrationIdx = Indices::oxygenConcentrationIdx
 
static constexpr unsigned ureaConcentrationIdx = Indices::ureaConcentrationIdx
 
static constexpr unsigned biofilmVolumeFractionIdx = Indices::biofilmVolumeFractionIdx
 
static constexpr unsigned calciteVolumeFractionIdx = Indices::calciteVolumeFractionIdx
 

Protected Member Functions

template<class WellModelType >
SimulatorReportSingle assembleReservoir (WellModelType &wellModel)
 
template<class ModelParametersType >
void applyTUNING (ModelParametersType &param, const Tuning &tuning)
 
template<class ModelParametersType >
void applyTUNINGDP (ModelParametersType &param, const TuningDp &tuning_dp)
 
template<class ValueType >
std::tuple< ValueType, ValueType > convergenceReduction (Parallel::Communication comm, const ValueType primaryVolumeLocal, const ValueType secondaryVolumeLocal, std::vector< ValueType > &sumValues, std::vector< ValueType > &maxValues, std::vector< ValueType > &averagedValues)
 
void popLastStepReport ()
 

Protected Attributes

long int global_nc_
 The number of cells of the global grid. More...
 
SolutionVector solUpd_
 
std::unique_ptr< NonlinearSystemNldd< TypeTag > > nlddSolver_
 Non-linear DD solver. More...
 
BlackoilModelConvergenceMonitor< Scalarconv_monitor_
 
Simulatorsimulator_
 
const Gridgrid_
 
bool terminal_output_
 
ModelParameters param_
 
WellModelwell_model_
 
SimulatorReportSingle failureReport_
 
std::vector< StepReportconvergence_reports_
 
ComponentName compNames_ {}
 
std::vector< std::vector< Scalar > > residual_norms_history_
 
Scalar current_relaxation_
 
GlobalEqVector dx_old_
 

Static Protected Attributes

static constexpr bool has_solvent_ = getPropValue<TypeTag, Properties::EnableSolvent>()
 
static constexpr bool has_extbo_ = getPropValue<TypeTag, Properties::EnableExtbo>()
 
static constexpr bool has_polymer_ = getPropValue<TypeTag, Properties::EnablePolymer>()
 
static constexpr bool has_polymermw_ = getPropValue<TypeTag, Properties::EnablePolymerMW>()
 
static constexpr bool has_energy_ = getPropValue<TypeTag, Properties::EnergyModuleType>() == EnergyModules::FullyImplicitThermal
 
static constexpr bool has_foam_ = getPropValue<TypeTag, Properties::EnableFoam>()
 
static constexpr bool has_brine_ = getPropValue<TypeTag, Properties::EnableBrine>()
 
static constexpr bool has_bioeffects_ = getPropValue<TypeTag, Properties::EnableBioeffects>()
 
static constexpr bool has_micp_ = Indices::enableMICP
 

Detailed Description

template<class TypeTag>
class Opm::NonlinearSystemBlackOilReservoir< TypeTag >

A model implementation for three-phase black oil.

The simulator is capable of handling three-phase problems where gas can be dissolved in oil and vice versa. It uses an industry-standard TPFA discretization with per-phase upwind weighting of mobilities.

Member Typedef Documentation

◆ BVector

template<class TypeTag >
using Opm::NonlinearSystemBlackOilReservoir< TypeTag >::BVector = Dune::BlockVector<VectorBlockType>

◆ ComponentName

template<class TypeTag >
using Opm::NonlinearSystemBlackOilReservoir< TypeTag >::ComponentName = ::Opm::ComponentName<FluidSystem,Indices>

◆ ElementContext

template<class TypeTag >
using Opm::NonlinearSystemBlackOilReservoir< TypeTag >::ElementContext = GetPropType<TypeTag, Properties::ElementContext>

◆ FluidSystem

template<class TypeTag >
using Opm::NonlinearSystemBlackOilReservoir< TypeTag >::FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>

◆ GlobalEqVector

template<class TypeTag >
using Opm::NonlinearSystemBlackOilReservoir< TypeTag >::GlobalEqVector = typename ParentType::GlobalEqVector

◆ Grid

template<class TypeTag >
using Opm::NonlinearSystemBlackOilReservoir< TypeTag >::Grid = typename ParentType::Grid

◆ Indices

template<class TypeTag >
using Opm::NonlinearSystemBlackOilReservoir< TypeTag >::Indices = GetPropType<TypeTag, Properties::Indices>

◆ IntensiveQuantities

template<class TypeTag >
using Opm::NonlinearSystemBlackOilReservoir< TypeTag >::IntensiveQuantities = GetPropType<TypeTag, Properties::IntensiveQuantities>

◆ Mat

template<class TypeTag >
using Opm::NonlinearSystemBlackOilReservoir< TypeTag >::Mat = typename SparseMatrixAdapter::IstlMatrix

◆ MaterialLaw

template<class TypeTag >
using Opm::NonlinearSystemBlackOilReservoir< TypeTag >::MaterialLaw = GetPropType<TypeTag, Properties::MaterialLaw>

◆ MaterialLawParams

template<class TypeTag >
using Opm::NonlinearSystemBlackOilReservoir< TypeTag >::MaterialLawParams = GetPropType<TypeTag, Properties::MaterialLawParams>

◆ MatrixBlockType

template<class TypeTag >
using Opm::NonlinearSystemBlackOilReservoir< TypeTag >::MatrixBlockType = typename SparseMatrixAdapter::MatrixBlock

◆ ModelParameters

template<class TypeTag >
using Opm::NonlinearSystemBlackOilReservoir< TypeTag >::ModelParameters = BlackoilModelParameters<Scalar>

◆ ParentType

template<class TypeTag >
using Opm::NonlinearSystemBlackOilReservoir< TypeTag >::ParentType = NonlinearSystem<TypeTag>

◆ PrimaryVariables

template<class TypeTag >
using Opm::NonlinearSystemBlackOilReservoir< TypeTag >::PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>

◆ Scalar

template<class TypeTag >
using Opm::NonlinearSystemBlackOilReservoir< TypeTag >::Scalar = GetPropType<TypeTag, Properties::Scalar>

◆ Simulator

template<class TypeTag >
using Opm::NonlinearSystemBlackOilReservoir< TypeTag >::Simulator = typename ParentType::Simulator

◆ SolutionVector

template<class TypeTag >
using Opm::NonlinearSystemBlackOilReservoir< TypeTag >::SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>

◆ SparseMatrixAdapter

template<class TypeTag >
using Opm::NonlinearSystemBlackOilReservoir< TypeTag >::SparseMatrixAdapter = GetPropType<TypeTag, Properties::SparseMatrixAdapter>

◆ VectorBlockType

template<class TypeTag >
using Opm::NonlinearSystemBlackOilReservoir< TypeTag >::VectorBlockType = Dune::FieldVector<Scalar, numEq>

◆ WellModel

template<class TypeTag >
using Opm::NonlinearSystem< TypeTag >::WellModel = GetPropType<TypeTag, Properties::WellModel>
inherited

Member Enumeration Documentation

◆ DebugFlags

template<class TypeTag >
enum class Opm::NonlinearSystemBlackOilReservoir::DebugFlags
strong
Enumerator
STRICT 
RELAXED 
TUNINGDP 

Constructor & Destructor Documentation

◆ NonlinearSystemBlackOilReservoir()

template<class TypeTag >
Opm::NonlinearSystemBlackOilReservoir< TypeTag >::NonlinearSystemBlackOilReservoir ( Simulator simulator,
const ModelParameters param,
BlackoilWellModel< TypeTag > &  well_model,
const bool  terminal_output 
)

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
simulatorReference to main simulator
[in]paramparameters
[in]well_modelReference to well model
[in]terminal_outputrequest output to cout/cerr

References Opm::NonlinearSystem< TypeTag >::convergence_reports_, Opm::detail::countGlobalCells(), Opm::NonlinearSystemBlackOilReservoir< TypeTag >::global_nc_, Opm::NonlinearSystem< TypeTag >::grid_, Opm::NonlinearSystemBlackOilReservoir< TypeTag >::nlddSolver_, Opm::BlackoilModelParameters< Scalar >::nonlinear_solver_, and Opm::NonlinearSystem< TypeTag >::param_.

Member Function Documentation

◆ addReservoirConvergenceMetrics()

template<class TypeTag >
template<class LogFailure >
void Opm::NonlinearSystem< TypeTag >::addReservoirConvergenceMetrics ( ConvergenceReport report,
const int  componentIdx,
const std::string_view  componentName,
const std::span< const Scalar residuals,
const std::span< const ConvergenceReport::ReservoirFailure::Type types,
const std::span< const Scalar tolerances,
const Scalar  maxResidualAllowed,
LogFailure &&  logFailure 
) const
inherited

◆ applyTUNING()

template<class TypeTag >
template<class ModelParametersType >
void Opm::NonlinearSystem< TypeTag >::applyTUNING ( ModelParametersType &  param,
const Tuning &  tuning 
)
protectedinherited

◆ applyTUNINGDP()

template<class TypeTag >
template<class ModelParametersType >
void Opm::NonlinearSystem< TypeTag >::applyTUNINGDP ( ModelParametersType &  param,
const TuningDp &  tuning_dp 
)
protectedinherited

◆ assembleReservoir() [1/2]

template<class TypeTag >
SimulatorReportSingle Opm::NonlinearSystem< TypeTag >::assembleReservoir ( const SimulatorTimerInterface timer)
inherited

◆ assembleReservoir() [2/2]

template<class TypeTag >
template<class WellModelType >
SimulatorReportSingle Opm::NonlinearSystem< TypeTag >::assembleReservoir ( WellModelType &  wellModel)
protectedinherited

◆ beginReportStep()

template<class TypeTag >
void Opm::NonlinearSystem< TypeTag >::beginReportStep ( )
inlineinherited

◆ characteriseCnvPvSplit()

template<class TypeTag >
NonlinearSystemBlackOilReservoir< TypeTag >::CnvPvSplitData Opm::NonlinearSystemBlackOilReservoir< TypeTag >::characteriseCnvPvSplit ( const std::vector< Scalar > &  B_avg,
const double  dt 
)

Compute pore-volume/cell count split among "converged", "relaxed converged", "unconverged" cells based on CNV point measures. Also returns list of cells where CNV is greater than its strict tolerance.

References OPM_BEGIN_PARALLEL_TRY_CATCH, and OPM_END_PARALLEL_TRY_CATCH.

◆ compNames()

template<class TypeTag >
const ComponentName & Opm::NonlinearSystem< TypeTag >::compNames ( ) const
inlineinherited

◆ computeFluidInPlace() [1/2]

template<class TypeTag >
std::vector< std::vector< typename NonlinearSystemBlackOilReservoir< TypeTag >::Scalar > > Opm::NonlinearSystemBlackOilReservoir< TypeTag >::computeFluidInPlace ( const std::vector< int > &  ) const

Should not be called.

◆ computeFluidInPlace() [2/2]

template<class TypeTag >
template<class T >
std::vector< std::vector< Scalar > > Opm::NonlinearSystemBlackOilReservoir< TypeTag >::computeFluidInPlace ( const T &  ,
const std::vector< int > &  fipnum 
) const
inline

◆ convergencePerCell()

template<class TypeTag >
void Opm::NonlinearSystemBlackOilReservoir< TypeTag >::convergencePerCell ( const std::vector< Scalar > &  B_avg,
const double  dt,
const double  tol_cnv,
const double  tol_cnv_energy 
)

Compute the number of Newtons required by each cell in order to satisfy the solution change convergence criteria at the last time step.

References OPM_BEGIN_PARALLEL_TRY_CATCH, and OPM_END_PARALLEL_TRY_CATCH.

◆ convergenceReduction() [1/2]

template<class TypeTag >
std::tuple< typename NonlinearSystemBlackOilReservoir< TypeTag >::Scalar, typename NonlinearSystemBlackOilReservoir< TypeTag >::Scalar > Opm::NonlinearSystemBlackOilReservoir< TypeTag >::convergenceReduction ( Parallel::Communication  comm,
const Scalar  pvSumLocal,
const Scalar  numAquiferPvSumLocal,
std::vector< Scalar > &  R_sum,
std::vector< Scalar > &  maxCoeff,
std::vector< Scalar > &  B_avg 
)

◆ convergenceReduction() [2/2]

template<class TypeTag >
template<class ValueType >
std::tuple< ValueType, ValueType > Opm::NonlinearSystem< TypeTag >::convergenceReduction ( Parallel::Communication  comm,
const ValueType  primaryVolumeLocal,
const ValueType  secondaryVolumeLocal,
std::vector< ValueType > &  sumValues,
std::vector< ValueType > &  maxValues,
std::vector< ValueType > &  averagedValues 
)
protectedinherited

◆ domainAccumulatedReports()

template<class TypeTag >
const std::vector< SimulatorReport > & Opm::NonlinearSystemBlackOilReservoir< TypeTag >::domainAccumulatedReports

return the statistics of local solves accumulated for each domain on this rank

◆ eclState()

template<class TypeTag >
const EclipseState & Opm::NonlinearSystemBlackOilReservoir< TypeTag >::eclState ( ) const
inline

◆ endReportStep()

template<class TypeTag >
void Opm::NonlinearSystem< TypeTag >::endReportStep ( )
inlineinherited

◆ failureReport()

template<class TypeTag >
const SimulatorReportSingle & Opm::NonlinearSystem< TypeTag >::failureReport ( ) const
inlineinherited

◆ getConvergence()

template<class TypeTag >
ConvergenceReport Opm::NonlinearSystemBlackOilReservoir< TypeTag >::getConvergence ( const SimulatorTimerInterface timer,
const int  maxIter,
std::vector< Scalar > &  residual_norms 
)

Compute convergence based on total mass balance (tol_mb) and maximum residual mass balance (tol_cnv).

Parameters
[in]timersimulation timer
[in]maxItermaximum number of iterations
[out]residual_normsCNV residuals by phase

References Opm::SimulatorTimerInterface::currentStepLength(), and Opm::SimulatorTimerInterface::simulationTimeElapsed().

◆ getMaxCoeff()

template<class TypeTag >
template<class FluidState , class Residual >
void Opm::NonlinearSystemBlackOilReservoir< TypeTag >::getMaxCoeff ( const unsigned  cell_idx,
const IntensiveQuantities intQuants,
const FluidState &  fs,
const Residual &  modelResid,
const Scalar  pvValue,
std::vector< Scalar > &  B_avg,
std::vector< Scalar > &  R_sum,
std::vector< Scalar > &  maxCoeff,
std::vector< int > &  maxCoeffCell 
)

◆ getMaxSolutionUpdate()

template<class TypeTag >
NonlinearSystemBlackOilReservoir< TypeTag >::MaxSolutionUpdateData Opm::NonlinearSystemBlackOilReservoir< TypeTag >::getMaxSolutionUpdate ( const std::vector< unsigned > &  ixCells)

◆ getReservoirConvergence()

◆ hasNlddSolver()

template<class TypeTag >
bool Opm::NonlinearSystemBlackOilReservoir< TypeTag >::hasNlddSolver ( ) const
inline

Returns true if an NLDD solver exists.

References Opm::NonlinearSystemBlackOilReservoir< TypeTag >::nlddSolver_.

◆ initialLinearization()

template<class TypeTag >
void Opm::NonlinearSystemBlackOilReservoir< TypeTag >::initialLinearization ( SimulatorReportSingle report,
const int  minIter,
const int  maxIter,
const SimulatorTimerInterface timer 
)
overridevirtual

◆ isParallel()

template<class TypeTag >
bool Opm::NonlinearSystem< TypeTag >::isParallel ( ) const
inlineinherited

◆ linearIterationsLastSolve()

template<class TypeTag >
int Opm::NonlinearSystemBlackOilReservoir< TypeTag >::linearIterationsLastSolve ( ) const
inline

Number of linear iterations used in last call to solveJacobianSystem().

References Opm::NonlinearSystem< TypeTag >::simulator_.

◆ linearSolveSetupTime()

template<class TypeTag >
double & Opm::NonlinearSystemBlackOilReservoir< TypeTag >::linearSolveSetupTime ( )
inline

◆ localAccumulatedReports()

template<class TypeTag >
const SimulatorReport & Opm::NonlinearSystemBlackOilReservoir< TypeTag >::localAccumulatedReports

return the statistics of local solves accumulated for this rank

◆ localConvergenceData()

template<class TypeTag >
std::pair< typename NonlinearSystemBlackOilReservoir< TypeTag >::Scalar, typename NonlinearSystemBlackOilReservoir< TypeTag >::Scalar > Opm::NonlinearSystemBlackOilReservoir< TypeTag >::localConvergenceData ( std::vector< Scalar > &  R_sum,
std::vector< Scalar > &  maxCoeff,
std::vector< Scalar > &  B_avg,
std::vector< int > &  maxCoeffCell 
)

Get reservoir quantities on this process needed for convergence calculations.

Returns
A pair of the local pore volume of interior cells and the pore volumes of the cells associated with a numerical aquifer.

References OPM_BEGIN_PARALLEL_TRY_CATCH, and OPM_END_PARALLEL_TRY_CATCH.

◆ nonlinearIteration()

template<class TypeTag >
template<class NonlinearSolverType >
SimulatorReportSingle Opm::NonlinearSystemBlackOilReservoir< TypeTag >::nonlinearIteration ( const SimulatorTimerInterface timer,
NonlinearSolverType &  nonlinear_solver 
)

Called once per nonlinear iteration. This model will perform a Newton-Raphson update, changing reservoir_state and well_state. It will also use the nonlinear_solver to do relaxation of updates if necessary. The method increases the counter in iterationContext at the end of the method.

Parameters
[in]timersimulation timer
[in]nonlinear_solvernonlinear solver used (for oscillation/relaxation control)

References Opm::SimulatorTimerInterface::currentStepNum(), and Opm::SimulatorTimerInterface::reportStepNum().

Referenced by Opm::NonlinearSystemBlackOilReservoirTPSA< TypeTag >::nonlinearIterationFixedStressTPSA(), and Opm::NonlinearSystemBlackOilReservoirTPSA< TypeTag >::nonlinearIterationLaggedTPSA().

◆ nonlinearIterationNewton()

◆ numPhases()

template<class TypeTag >
int Opm::NonlinearSystem< TypeTag >::numPhases ( ) const
inlineinherited

◆ param()

template<class TypeTag >
const ModelParameters & Opm::NonlinearSystem< TypeTag >::param ( ) const
inlineinherited

◆ popLastConvergenceReport()

template<class TypeTag >
void Opm::NonlinearSystemBlackOilReservoir< TypeTag >::popLastConvergenceReport ( )
inline

Remove the last convergence report entry and residual norms history entry.

References Opm::NonlinearSystem< TypeTag >::popLastStepReport(), and Opm::NonlinearSystem< TypeTag >::residual_norms_history_.

◆ popLastStepReport()

template<class TypeTag >
void Opm::NonlinearSystem< TypeTag >::popLastStepReport ( )
inlineprotectedinherited

◆ prepareSolutionUpdate()

template<class TypeTag >
void Opm::NonlinearSystemBlackOilReservoir< TypeTag >::prepareSolutionUpdate
overridevirtual

Reimplemented from Opm::NonlinearSystem< TypeTag >.

◆ prepareStep()

template<class TypeTag >
SimulatorReportSingle Opm::NonlinearSystemBlackOilReservoir< TypeTag >::prepareStep ( const SimulatorTimerInterface timer)

Called once before each time step.

Parameters
[in]timersimulation timer

References Opm::SimulatorTimerInterface::reportStepNum().

◆ relativeChange()

template<class TypeTag >
NonlinearSystemBlackOilReservoir< TypeTag >::Scalar Opm::NonlinearSystemBlackOilReservoir< TypeTag >::relativeChange

◆ shouldStoreSolutionUpdate()

template<class TypeTag >
bool Opm::NonlinearSystemBlackOilReservoir< TypeTag >::shouldStoreSolutionUpdate
overridevirtual

Get solution update vector as a PrimaryVariable.

Reimplemented from Opm::NonlinearSystem< TypeTag >.

◆ simulator() [1/2]

template<class TypeTag >
Simulator & Opm::NonlinearSystem< TypeTag >::simulator ( )
inlineinherited

◆ simulator() [2/2]

template<class TypeTag >
const Simulator & Opm::NonlinearSystem< TypeTag >::simulator ( ) const
inlineinherited

◆ solveJacobianSystem()

template<class TypeTag >
void Opm::NonlinearSystemBlackOilReservoir< TypeTag >::solveJacobianSystem ( BVector x)

Solve the Jacobian system Jx = r where J is the Jacobian and r is the residual.

◆ stepReports()

template<class TypeTag >
const std::vector< StepReport > & Opm::NonlinearSystem< TypeTag >::stepReports ( ) const
inlineinherited

◆ storeSolutionUpdate()

template<class TypeTag >
void Opm::NonlinearSystemBlackOilReservoir< TypeTag >::storeSolutionUpdate ( const GlobalEqVector dx)
overridevirtual

Reimplemented from Opm::NonlinearSystem< TypeTag >.

◆ terminalOutputEnabled()

template<class TypeTag >
bool Opm::NonlinearSystem< TypeTag >::terminalOutputEnabled ( ) const
inlineinherited

◆ updateSolution()

template<class TypeTag >
void Opm::NonlinearSystem< TypeTag >::updateSolution ( const GlobalEqVector dx)
inherited

◆ updateTUNING()

template<class TypeTag >
void Opm::NonlinearSystem< TypeTag >::updateTUNING ( const Tuning &  tuning)
inherited

◆ updateTUNINGDP()

template<class TypeTag >
void Opm::NonlinearSystem< TypeTag >::updateTUNINGDP ( const TuningDp &  tuning_dp)
inherited

◆ wellModel() [1/2]

template<class TypeTag >
WellModel & Opm::NonlinearSystem< TypeTag >::wellModel ( )
inlineinherited

◆ wellModel() [2/2]

template<class TypeTag >
const WellModel & Opm::NonlinearSystem< TypeTag >::wellModel ( ) const
inlineinherited

◆ writeNonlinearIterationsPerCell()

template<class TypeTag >
void Opm::NonlinearSystemBlackOilReservoir< TypeTag >::writeNonlinearIterationsPerCell ( const std::filesystem::path &  odir) const

Write the number of nonlinear iterations per cell to a file in ResInsight compatible format.

◆ writePartitions()

template<class TypeTag >
void Opm::NonlinearSystemBlackOilReservoir< TypeTag >::writePartitions ( const std::filesystem::path &  odir) const

Member Data Documentation

◆ biofilmVolumeFractionIdx

template<class TypeTag >
constexpr unsigned Opm::NonlinearSystemBlackOilReservoir< TypeTag >::biofilmVolumeFractionIdx = Indices::biofilmVolumeFractionIdx
staticconstexpr

◆ calciteVolumeFractionIdx

template<class TypeTag >
constexpr unsigned Opm::NonlinearSystemBlackOilReservoir< TypeTag >::calciteVolumeFractionIdx = Indices::calciteVolumeFractionIdx
staticconstexpr

◆ compNames_

template<class TypeTag >
ComponentName Opm::NonlinearSystem< TypeTag >::compNames_ {}
protectedinherited

◆ contiBiofilmEqIdx

template<class TypeTag >
constexpr int Opm::NonlinearSystemBlackOilReservoir< TypeTag >::contiBiofilmEqIdx = Indices::contiBiofilmEqIdx
staticconstexpr

◆ contiBrineEqIdx

template<class TypeTag >
constexpr int Opm::NonlinearSystemBlackOilReservoir< TypeTag >::contiBrineEqIdx = Indices::contiBrineEqIdx
staticconstexpr

◆ contiCalciteEqIdx

template<class TypeTag >
constexpr int Opm::NonlinearSystemBlackOilReservoir< TypeTag >::contiCalciteEqIdx = Indices::contiCalciteEqIdx
staticconstexpr

◆ contiEnergyEqIdx

template<class TypeTag >
constexpr int Opm::NonlinearSystemBlackOilReservoir< TypeTag >::contiEnergyEqIdx = Indices::contiEnergyEqIdx
staticconstexpr

◆ contiFoamEqIdx

template<class TypeTag >
constexpr int Opm::NonlinearSystemBlackOilReservoir< TypeTag >::contiFoamEqIdx = Indices::contiFoamEqIdx
staticconstexpr

◆ contiMicrobialEqIdx

template<class TypeTag >
constexpr int Opm::NonlinearSystemBlackOilReservoir< TypeTag >::contiMicrobialEqIdx = Indices::contiMicrobialEqIdx
staticconstexpr

◆ contiOxygenEqIdx

template<class TypeTag >
constexpr int Opm::NonlinearSystemBlackOilReservoir< TypeTag >::contiOxygenEqIdx = Indices::contiOxygenEqIdx
staticconstexpr

◆ contiPolymerEqIdx

template<class TypeTag >
constexpr int Opm::NonlinearSystemBlackOilReservoir< TypeTag >::contiPolymerEqIdx = Indices::contiPolymerEqIdx
staticconstexpr

◆ contiPolymerMWEqIdx

template<class TypeTag >
constexpr int Opm::NonlinearSystemBlackOilReservoir< TypeTag >::contiPolymerMWEqIdx = Indices::contiPolymerMWEqIdx
staticconstexpr

◆ contiSolventEqIdx

template<class TypeTag >
constexpr int Opm::NonlinearSystemBlackOilReservoir< TypeTag >::contiSolventEqIdx = Indices::contiSolventEqIdx
staticconstexpr

◆ contiUreaEqIdx

template<class TypeTag >
constexpr int Opm::NonlinearSystemBlackOilReservoir< TypeTag >::contiUreaEqIdx = Indices::contiUreaEqIdx
staticconstexpr

◆ contiZfracEqIdx

template<class TypeTag >
constexpr int Opm::NonlinearSystemBlackOilReservoir< TypeTag >::contiZfracEqIdx = Indices::contiZfracEqIdx
staticconstexpr

◆ conv_monitor_

template<class TypeTag >
BlackoilModelConvergenceMonitor<Scalar> Opm::NonlinearSystemBlackOilReservoir< TypeTag >::conv_monitor_
protected

◆ convergence_reports_

◆ current_relaxation_

template<class TypeTag >
Scalar Opm::NonlinearSystem< TypeTag >::current_relaxation_
protectedinherited

◆ dx_old_

template<class TypeTag >
GlobalEqVector Opm::NonlinearSystem< TypeTag >::dx_old_
protectedinherited

◆ enableSaltPrecipitation

template<class TypeTag >
constexpr bool Opm::NonlinearSystemBlackOilReservoir< TypeTag >::enableSaltPrecipitation = getPropValue<TypeTag, Properties::EnableSaltPrecipitation>()
staticconstexpr

◆ failureReport_

template<class TypeTag >
SimulatorReportSingle Opm::NonlinearSystem< TypeTag >::failureReport_
protectedinherited

◆ foamConcentrationIdx

template<class TypeTag >
constexpr unsigned Opm::NonlinearSystemBlackOilReservoir< TypeTag >::foamConcentrationIdx = Indices::foamConcentrationIdx
staticconstexpr

◆ global_nc_

template<class TypeTag >
long int Opm::NonlinearSystemBlackOilReservoir< TypeTag >::global_nc_
protected

The number of cells of the global grid.

Referenced by Opm::NonlinearSystemBlackOilReservoir< TypeTag >::NonlinearSystemBlackOilReservoir().

◆ grid_

◆ has_bioeffects_

template<class TypeTag >
constexpr bool Opm::NonlinearSystemBlackOilReservoir< TypeTag >::has_bioeffects_ = getPropValue<TypeTag, Properties::EnableBioeffects>()
staticconstexprprotected

◆ has_brine_

template<class TypeTag >
constexpr bool Opm::NonlinearSystemBlackOilReservoir< TypeTag >::has_brine_ = getPropValue<TypeTag, Properties::EnableBrine>()
staticconstexprprotected

◆ has_energy_

template<class TypeTag >
constexpr bool Opm::NonlinearSystemBlackOilReservoir< TypeTag >::has_energy_ = getPropValue<TypeTag, Properties::EnergyModuleType>() == EnergyModules::FullyImplicitThermal
staticconstexprprotected

◆ has_extbo_

template<class TypeTag >
constexpr bool Opm::NonlinearSystemBlackOilReservoir< TypeTag >::has_extbo_ = getPropValue<TypeTag, Properties::EnableExtbo>()
staticconstexprprotected

◆ has_foam_

template<class TypeTag >
constexpr bool Opm::NonlinearSystemBlackOilReservoir< TypeTag >::has_foam_ = getPropValue<TypeTag, Properties::EnableFoam>()
staticconstexprprotected

◆ has_micp_

template<class TypeTag >
constexpr bool Opm::NonlinearSystemBlackOilReservoir< TypeTag >::has_micp_ = Indices::enableMICP
staticconstexprprotected

◆ has_polymer_

template<class TypeTag >
constexpr bool Opm::NonlinearSystemBlackOilReservoir< TypeTag >::has_polymer_ = getPropValue<TypeTag, Properties::EnablePolymer>()
staticconstexprprotected

◆ has_polymermw_

template<class TypeTag >
constexpr bool Opm::NonlinearSystemBlackOilReservoir< TypeTag >::has_polymermw_ = getPropValue<TypeTag, Properties::EnablePolymerMW>()
staticconstexprprotected

◆ has_solvent_

template<class TypeTag >
constexpr bool Opm::NonlinearSystemBlackOilReservoir< TypeTag >::has_solvent_ = getPropValue<TypeTag, Properties::EnableSolvent>()
staticconstexprprotected

◆ microbialConcentrationIdx

template<class TypeTag >
constexpr unsigned Opm::NonlinearSystemBlackOilReservoir< TypeTag >::microbialConcentrationIdx = Indices::microbialConcentrationIdx
staticconstexpr

◆ nlddSolver_

◆ numEq

template<class TypeTag >
constexpr int Opm::NonlinearSystemBlackOilReservoir< TypeTag >::numEq = Indices::numEq
staticconstexpr

◆ oxygenConcentrationIdx

template<class TypeTag >
constexpr unsigned Opm::NonlinearSystemBlackOilReservoir< TypeTag >::oxygenConcentrationIdx = Indices::oxygenConcentrationIdx
staticconstexpr

◆ param_

◆ polymerConcentrationIdx

template<class TypeTag >
constexpr unsigned Opm::NonlinearSystemBlackOilReservoir< TypeTag >::polymerConcentrationIdx = Indices::polymerConcentrationIdx
staticconstexpr

◆ polymerMoleWeightIdx

template<class TypeTag >
constexpr unsigned Opm::NonlinearSystemBlackOilReservoir< TypeTag >::polymerMoleWeightIdx = Indices::polymerMoleWeightIdx
staticconstexpr

◆ residual_norms_history_

template<class TypeTag >
std::vector<std::vector<Scalar> > Opm::NonlinearSystem< TypeTag >::residual_norms_history_
protectedinherited

◆ saltConcentrationIdx

template<class TypeTag >
constexpr unsigned Opm::NonlinearSystemBlackOilReservoir< TypeTag >::saltConcentrationIdx = Indices::saltConcentrationIdx
staticconstexpr

◆ simulator_

◆ solUpd_

template<class TypeTag >
SolutionVector Opm::NonlinearSystemBlackOilReservoir< TypeTag >::solUpd_
protected

◆ solventSaturationIdx

template<class TypeTag >
constexpr unsigned Opm::NonlinearSystemBlackOilReservoir< TypeTag >::solventSaturationIdx = Indices::solventSaturationIdx
staticconstexpr

◆ temperatureIdx

template<class TypeTag >
constexpr unsigned Opm::NonlinearSystemBlackOilReservoir< TypeTag >::temperatureIdx = Indices::temperatureIdx
staticconstexpr

◆ terminal_output_

template<class TypeTag >
bool Opm::NonlinearSystem< TypeTag >::terminal_output_
protectedinherited

◆ ureaConcentrationIdx

template<class TypeTag >
constexpr unsigned Opm::NonlinearSystemBlackOilReservoir< TypeTag >::ureaConcentrationIdx = Indices::ureaConcentrationIdx
staticconstexpr

◆ well_model_

template<class TypeTag >
WellModel& Opm::NonlinearSystem< TypeTag >::well_model_
protectedinherited

◆ zFractionIdx

template<class TypeTag >
constexpr unsigned Opm::NonlinearSystemBlackOilReservoir< TypeTag >::zFractionIdx = Indices::zFractionIdx
staticconstexpr

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