Opm::NonlinearSystemCompositional< TypeTag > Class Template Reference

#include <NonlinearSystemCompositional.hpp>

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

Public Types

using ParentType = NonlinearSystem< TypeTag >
 
using Simulator = typename ParentType::Simulator
 
using Grid = typename ParentType::Grid
 
using FluidSystem = typename ParentType::FluidSystem
 
using Indices = typename ParentType::Indices
 
using Scalar = typename ParentType::Scalar
 
using ComponentName = typename ParentType::ComponentName
 
using SparseMatrixAdapter = GetPropType< TypeTag, Properties::SparseMatrixAdapter >
 
using ModelParameters = BlackoilModelParameters< Scalar >
 
using VectorBlockType = Dune::FieldVector< Scalar, numEq >
 
using BVector = Dune::BlockVector< VectorBlockType >
 
using GlobalEqVector = GetPropType< TypeTag, Properties::GlobalEqVector >
 
using WellModel = GetPropType< TypeTag, Properties::WellModel >
 

Public Member Functions

 NonlinearSystemCompositional (Simulator &simulator, const ModelParameters &param, CompWellModel< TypeTag > &wellModel, bool terminalOutput)
 
SimulatorReportSingle prepareStep (const SimulatorTimerInterface &timer)
 
void initialLinearization (SimulatorReportSingle &report, int minIter, int maxIter, const SimulatorTimerInterface &timer) override
 
template<class NonlinearSolverType >
SimulatorReportSingle nonlinearIteration (const SimulatorTimerInterface &timer, NonlinearSolverType &nonlinearSolver)
 
template<class NonlinearSolverType >
SimulatorReportSingle nonlinearIterationNewton (const SimulatorTimerInterface &timer, NonlinearSolverType &nonlinearSolver)
 
Scalar relativeChange () const
 
int linearIterationsLastSolve () const
 
void solveJacobianSystem (BVector &x)
 
bool hasNlddSolver () const
 
const SimulatorReportlocalAccumulatedReports () const
 
const std::vector< SimulatorReport > & domainAccumulatedReports () const
 
void writeNonlinearIterationsPerCell (const std::filesystem::path &) const
 
template<class T >
std::vector< std::vector< Scalar > > computeFluidInPlace (const T &, const std::vector< int > &fipnum) const
 
std::vector< std::vector< Scalar > > computeFluidInPlace (const std::vector< int > &) const
 
void writePartitions (const std::filesystem::path &) const
 
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 int numEq = Indices::numEq
 

Protected Member Functions

template<class WellModelType >
SimulatorReportSingle assembleReservoir (WellModelType &wellModel)
 
virtual bool shouldStoreSolutionUpdate () const
 
virtual void prepareSolutionUpdate ()
 
virtual void storeSolutionUpdate (const GlobalEqVector &)
 
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

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_
 

Member Typedef Documentation

◆ BVector

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

◆ ComponentName

template<class TypeTag >
using Opm::NonlinearSystemCompositional< TypeTag >::ComponentName = typename ParentType::ComponentName

◆ FluidSystem

template<class TypeTag >
using Opm::NonlinearSystemCompositional< TypeTag >::FluidSystem = typename ParentType::FluidSystem

◆ GlobalEqVector

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

◆ Grid

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

◆ Indices

template<class TypeTag >
using Opm::NonlinearSystemCompositional< TypeTag >::Indices = typename ParentType::Indices

◆ ModelParameters

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

◆ ParentType

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

◆ Scalar

template<class TypeTag >
using Opm::NonlinearSystemCompositional< TypeTag >::Scalar = typename ParentType::Scalar

◆ Simulator

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

◆ SparseMatrixAdapter

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

◆ VectorBlockType

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

◆ WellModel

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

Constructor & Destructor Documentation

◆ NonlinearSystemCompositional()

template<class TypeTag >
Opm::NonlinearSystemCompositional< TypeTag >::NonlinearSystemCompositional ( Simulator simulator,
const ModelParameters param,
CompWellModel< TypeTag > &  wellModel,
bool  terminalOutput 
)

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

◆ compNames()

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

◆ computeFluidInPlace() [1/2]

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

◆ computeFluidInPlace() [2/2]

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

◆ convergenceReduction()

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::NonlinearSystemCompositional< TypeTag >::domainAccumulatedReports ( ) const
inline

◆ endReportStep()

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

◆ failureReport()

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

◆ hasNlddSolver()

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

◆ initialLinearization()

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

◆ isParallel()

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

◆ linearIterationsLastSolve()

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

◆ localAccumulatedReports()

template<class TypeTag >
const SimulatorReport & Opm::NonlinearSystemCompositional< TypeTag >::localAccumulatedReports ( ) const
inline

◆ nonlinearIteration()

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

◆ nonlinearIterationNewton()

◆ numPhases()

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

◆ param()

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

◆ popLastStepReport()

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

◆ prepareSolutionUpdate()

template<class TypeTag >
virtual void Opm::NonlinearSystem< TypeTag >::prepareSolutionUpdate ( )
inlineprotectedvirtualinherited

◆ prepareStep()

◆ relativeChange()

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

◆ shouldStoreSolutionUpdate()

template<class TypeTag >
virtual bool Opm::NonlinearSystem< TypeTag >::shouldStoreSolutionUpdate ( ) const
inlineprotectedvirtualinherited

◆ 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::NonlinearSystemCompositional< TypeTag >::solveJacobianSystem ( BVector x)

◆ stepReports()

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

◆ storeSolutionUpdate()

template<class TypeTag >
virtual void Opm::NonlinearSystem< TypeTag >::storeSolutionUpdate ( const GlobalEqVector )
inlineprotectedvirtualinherited

◆ 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::NonlinearSystemCompositional< TypeTag >::writeNonlinearIterationsPerCell ( const std::filesystem::path &  ) const
inline

◆ writePartitions()

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

Member Data Documentation

◆ compNames_

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

◆ 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

◆ failureReport_

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

◆ grid_

◆ numEq

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

◆ param_

◆ residual_norms_history_

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

◆ simulator_

◆ terminal_output_

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

◆ well_model_

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

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