Opm::StandardWellPrimaryVariables< FluidSystem, Indices > Class Template Reference

Class holding primary variables for StandardWell. More...

#include <StandardWellPrimaryVariables.hpp>

Inheritance diagram for Opm::StandardWellPrimaryVariables< FluidSystem, Indices >:
Inheritance graph

Public Types

using Scalar = typename FluidSystem::Scalar
 
using EvalWell = DenseAd::DynamicEvaluation< Scalar, numStaticWellEq+Indices::numEq+1 >
 Evaluation for the well equations. More...
 
using BVectorWell = typename StandardWellEquations< Scalar, Indices::numEq >::BVectorWell
 

Public Member Functions

 StandardWellPrimaryVariables (const WellInterfaceIndices< FluidSystem, Indices > &well)
 Constructor initializes reference to well interface. More...
 
void init ()
 Initialize evaluations from values. More...
 
void resize (const int numWellEq)
 Resize values and evaluations. More...
 
int numWellEq () const
 Returns number of well equations. More...
 
void update (const WellState< Scalar > &well_state, const bool stop_or_zero_rate_target, DeferredLogger &deferred_logger)
 Copy values from well state. More...
 
void updatePolyMW (const WellState< Scalar > &well_state)
 Copy polymer molecular weigt values from well state. More...
 
void updateNewton (const BVectorWell &dwells, const bool stop_or_zero_rate_target, const double dFLimit, const double dBHPLimit, DeferredLogger &deferred_logger)
 Update values from newton update vector. More...
 
void updateNewtonPolyMW (const BVectorWell &dwells)
 Update polymer molecular weight values from newton update vector. More...
 
void checkFinite (DeferredLogger &deferred_logger) const
 Check that all values are finite. More...
 
void copyToWellState (WellState< Scalar > &well_state, DeferredLogger &deferred_logger) const
 Copy values to well state. More...
 
void copyToWellStatePolyMW (WellState< Scalar > &well_state) const
 Copy polymer molecular weight values to well state. More...
 
EvalWell volumeFractionScaled (const int compIdx) const
 Returns scaled volume fraction for a component. More...
 
EvalWell surfaceVolumeFraction (const int compIdx) const
 Returns surface volume fraction for a component. More...
 
EvalWell getQs (const int compIdx) const
 Returns scaled rate for a component. More...
 
Scalar value (const int idx) const
 Returns a value. More...
 
const EvalWelleval (const int idx) const
 Returns a const ref to an evaluation. More...
 
void setValue (const int idx, const Scalar val)
 Set a value. Note that this does not also set the corresponding evaluation. More...
 

Static Public Attributes

static constexpr int numWellConservationEq = Indices::numPhases + Indices::numSolvents
 Number of the conservation equations. More...
 
static constexpr int numStaticWellEq = numWellConservationEq + numWellControlEq
 Number of the well equations that will always be used. More...
 
static constexpr int WQTotal = 0
 The index for the weighted total rate. More...
 
static constexpr int Bhp = numStaticWellEq - numWellControlEq
 The index for Bhp in primary variables and the index of well control equation. More...
 
static constexpr bool has_wfrac_variable = Indices::waterEnabled && Indices::oilEnabled
 
static constexpr bool has_gfrac_variable = Indices::gasEnabled && Indices::numPhases > 1
 
static constexpr int WFrac = has_wfrac_variable ? 1 : -1000
 
static constexpr int GFrac = has_gfrac_variable ? has_wfrac_variable + 1 : -1000
 
static constexpr int SFrac = !Indices::enableSolvent ? -1000 : has_wfrac_variable+has_gfrac_variable+1
 

Static Protected Attributes

static constexpr int numWellControlEq = 1
 Number of the well control equations. More...
 

Detailed Description

template<class FluidSystem, class Indices>
class Opm::StandardWellPrimaryVariables< FluidSystem, Indices >

Class holding primary variables for StandardWell.

Member Typedef Documentation

◆ BVectorWell

template<class FluidSystem , class Indices >
using Opm::StandardWellPrimaryVariables< FluidSystem, Indices >::BVectorWell = typename StandardWellEquations<Scalar,Indices::numEq>::BVectorWell

◆ EvalWell

template<class FluidSystem , class Indices >
using Opm::StandardWellPrimaryVariables< FluidSystem, Indices >::EvalWell = DenseAd::DynamicEvaluation<Scalar, numStaticWellEq + Indices::numEq + 1>

Evaluation for the well equations.

◆ Scalar

template<class FluidSystem , class Indices >
using Opm::StandardWellPrimaryVariables< FluidSystem, Indices >::Scalar = typename FluidSystem::Scalar

Constructor & Destructor Documentation

◆ StandardWellPrimaryVariables()

template<class FluidSystem , class Indices >
Opm::StandardWellPrimaryVariables< FluidSystem, Indices >::StandardWellPrimaryVariables ( const WellInterfaceIndices< FluidSystem, Indices > &  well)
inline

Constructor initializes reference to well interface.

Member Function Documentation

◆ checkFinite()

template<class FluidSystem , class Indices >
void Opm::StandardWellPrimaryVariables< FluidSystem, Indices >::checkFinite ( DeferredLogger deferred_logger) const

Check that all values are finite.

◆ copyToWellState()

template<class FluidSystem , class Indices >
void Opm::StandardWellPrimaryVariables< FluidSystem, Indices >::copyToWellState ( WellState< Scalar > &  well_state,
DeferredLogger deferred_logger 
) const

Copy values to well state.

◆ copyToWellStatePolyMW()

template<class FluidSystem , class Indices >
void Opm::StandardWellPrimaryVariables< FluidSystem, Indices >::copyToWellStatePolyMW ( WellState< Scalar > &  well_state) const

Copy polymer molecular weight values to well state.

◆ eval()

template<class FluidSystem , class Indices >
const EvalWell & Opm::StandardWellPrimaryVariables< FluidSystem, Indices >::eval ( const int  idx) const
inline

Returns a const ref to an evaluation.

◆ getQs()

template<class FluidSystem , class Indices >
EvalWell Opm::StandardWellPrimaryVariables< FluidSystem, Indices >::getQs ( const int  compIdx) const

Returns scaled rate for a component.

Referenced by Opm::StandardWell< TypeTag >::computeWellPotentialsImplicit().

◆ init()

template<class FluidSystem , class Indices >
void Opm::StandardWellPrimaryVariables< FluidSystem, Indices >::init ( )

Initialize evaluations from values.

◆ numWellEq()

template<class FluidSystem , class Indices >
int Opm::StandardWellPrimaryVariables< FluidSystem, Indices >::numWellEq ( ) const
inline

Returns number of well equations.

◆ resize()

template<class FluidSystem , class Indices >
void Opm::StandardWellPrimaryVariables< FluidSystem, Indices >::resize ( const int  numWellEq)

Resize values and evaluations.

◆ setValue()

template<class FluidSystem , class Indices >
void Opm::StandardWellPrimaryVariables< FluidSystem, Indices >::setValue ( const int  idx,
const Scalar  val 
)
inline

Set a value. Note that this does not also set the corresponding evaluation.

◆ surfaceVolumeFraction()

template<class FluidSystem , class Indices >
EvalWell Opm::StandardWellPrimaryVariables< FluidSystem, Indices >::surfaceVolumeFraction ( const int  compIdx) const

Returns surface volume fraction for a component.

◆ update()

template<class FluidSystem , class Indices >
void Opm::StandardWellPrimaryVariables< FluidSystem, Indices >::update ( const WellState< Scalar > &  well_state,
const bool  stop_or_zero_rate_target,
DeferredLogger deferred_logger 
)

Copy values from well state.

◆ updateNewton()

template<class FluidSystem , class Indices >
void Opm::StandardWellPrimaryVariables< FluidSystem, Indices >::updateNewton ( const BVectorWell dwells,
const bool  stop_or_zero_rate_target,
const double  dFLimit,
const double  dBHPLimit,
DeferredLogger deferred_logger 
)

Update values from newton update vector.

◆ updateNewtonPolyMW()

template<class FluidSystem , class Indices >
void Opm::StandardWellPrimaryVariables< FluidSystem, Indices >::updateNewtonPolyMW ( const BVectorWell dwells)

Update polymer molecular weight values from newton update vector.

◆ updatePolyMW()

template<class FluidSystem , class Indices >
void Opm::StandardWellPrimaryVariables< FluidSystem, Indices >::updatePolyMW ( const WellState< Scalar > &  well_state)

Copy polymer molecular weigt values from well state.

◆ value()

template<class FluidSystem , class Indices >
Scalar Opm::StandardWellPrimaryVariables< FluidSystem, Indices >::value ( const int  idx) const
inline

Returns a value.

◆ volumeFractionScaled()

template<class FluidSystem , class Indices >
EvalWell Opm::StandardWellPrimaryVariables< FluidSystem, Indices >::volumeFractionScaled ( const int  compIdx) const

Returns scaled volume fraction for a component.

Member Data Documentation

◆ Bhp

template<class FluidSystem , class Indices >
constexpr int Opm::StandardWellPrimaryVariables< FluidSystem, Indices >::Bhp = numStaticWellEq - numWellControlEq
staticconstexpr

The index for Bhp in primary variables and the index of well control equation.

They both will be the last one in their respective system.

◆ GFrac

template<class FluidSystem , class Indices >
constexpr int Opm::StandardWellPrimaryVariables< FluidSystem, Indices >::GFrac = has_gfrac_variable ? has_wfrac_variable + 1 : -1000
staticconstexpr

◆ has_gfrac_variable

template<class FluidSystem , class Indices >
constexpr bool Opm::StandardWellPrimaryVariables< FluidSystem, Indices >::has_gfrac_variable = Indices::gasEnabled && Indices::numPhases > 1
staticconstexpr

◆ has_wfrac_variable

template<class FluidSystem , class Indices >
constexpr bool Opm::StandardWellPrimaryVariables< FluidSystem, Indices >::has_wfrac_variable = Indices::waterEnabled && Indices::oilEnabled
staticconstexpr

◆ numStaticWellEq

template<class FluidSystem , class Indices >
constexpr int Opm::StandardWellPrimaryVariables< FluidSystem, Indices >::numStaticWellEq = numWellConservationEq + numWellControlEq
staticconstexpr

Number of the well equations that will always be used.

Based on the solution strategy, there might be other well equations be introduced.

◆ numWellConservationEq

template<class FluidSystem , class Indices >
constexpr int Opm::StandardWellPrimaryVariables< FluidSystem, Indices >::numWellConservationEq = Indices::numPhases + Indices::numSolvents
staticconstexpr

Number of the conservation equations.

◆ numWellControlEq

template<class FluidSystem , class Indices >
constexpr int Opm::StandardWellPrimaryVariables< FluidSystem, Indices >::numWellControlEq = 1
staticconstexprprotected

Number of the well control equations.

◆ SFrac

template<class FluidSystem , class Indices >
constexpr int Opm::StandardWellPrimaryVariables< FluidSystem, Indices >::SFrac = !Indices::enableSolvent ? -1000 : has_wfrac_variable+has_gfrac_variable+1
staticconstexpr

◆ WFrac

template<class FluidSystem , class Indices >
constexpr int Opm::StandardWellPrimaryVariables< FluidSystem, Indices >::WFrac = has_wfrac_variable ? 1 : -1000
staticconstexpr

◆ WQTotal

template<class FluidSystem , class Indices >
constexpr int Opm::StandardWellPrimaryVariables< FluidSystem, Indices >::WQTotal = 0
staticconstexpr

The index for the weighted total rate.


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