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

#include <MultisegmentWellPrimaryVariables.hpp>

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

Public Types

using Scalar = typename FluidSystem::Scalar
 
using EvalWell = DenseAd::Evaluation< double, Indices::numEq+numWellEq >
 
using Equations = MultisegmentWellEquations< Scalar, numWellEq, Indices::numEq >
 
using BVectorWell = typename Equations::BVectorWell
 

Public Member Functions

 MultisegmentWellPrimaryVariables (const WellInterfaceIndices< FluidSystem, Indices > &well)
 
void resize (const int numSegments)
 Resize values and evaluations. More...
 
void init ()
 Initialize evaluations from values. More...
 
void update (const WellState< Scalar > &well_state, const bool stop_or_zero_rate_target)
 Copy values from well state. More...
 
void updateNewton (const BVectorWell &dwells, const double relaxation_factor, const double DFLimit, const bool stop_or_zero_rate_target, const double max_pressure_change)
 Update values from newton update vector. More...
 
void copyToWellState (const MultisegmentWellGeneric< Scalar > &mswell, const double rho, const bool stop_or_zero_rate_target, WellState< Scalar > &well_state, const SummaryState &summary_state, DeferredLogger &deferred_logger) const
 Copy values to well state. More...
 
EvalWell volumeFractionScaled (const int seg, const int compIdx) const
 Returns scaled volume fraction for a component in a segment. More...
 
EvalWell surfaceVolumeFraction (const int seg, const int compIdx) const
 Returns surface volume fraction for a component in a segment. More...
 
EvalWell getSegmentRateUpwinding (const int seg, const int seg_upwind, const std::size_t comp_idx) const
 Returns upwinding rate for a component in a segment. More...
 
EvalWell getBhp () const
 Get bottomhole pressure. More...
 
EvalWell getSegmentPressure (const int seg) const
 Get pressure for a segment. More...
 
EvalWell getSegmentRate (const int seg, const int comp_idx) const
 Get rate for a component in a segment. More...
 
EvalWell getQs (const int comp_idx) const
 Returns scaled rate for a component. More...
 
EvalWell getWQTotal () const
 Get WQTotal. More...
 
const std::array< EvalWell, numWellEq > & eval (const int idx) const
 Returns a const ref to an array of evaluations. More...
 
const std::array< Scalar, numWellEq > & value (const int idx) const
 Returns a value array. More...
 
void setValue (const int idx, const std::array< Scalar, numWellEq > &val)
 Set a value array. Note that this does not also set the corresponding evaluation. More...
 
void outputLowLimitPressureSegments (DeferredLogger &deferred_logger) const
 output the segments with pressure close to lower pressure limit for debugging purpose More...
 

Static Public Attributes

static constexpr bool has_water = (Indices::waterSwitchIdx >= 0)
 
static constexpr bool has_gas = (Indices::compositionSwitchIdx >= 0)
 
static constexpr bool has_oil = (Indices::numPhases - has_gas - has_water) > 0
 
static constexpr bool has_wfrac_variable = has_water && Indices::numPhases > 1
 
static constexpr bool has_gfrac_variable = has_gas && has_oil
 
static constexpr int WQTotal = 0
 
static constexpr int WFrac = has_wfrac_variable ? 1 : -1000
 
static constexpr int GFrac = has_gfrac_variable ? has_wfrac_variable + 1 : -1000
 
static constexpr int SPres = has_wfrac_variable + has_gfrac_variable + 1
 
static constexpr int numWellEq = Indices::numPhases + 1
 

Member Typedef Documentation

◆ BVectorWell

template<class FluidSystem , class Indices >
using Opm::MultisegmentWellPrimaryVariables< FluidSystem, Indices >::BVectorWell = typename Equations::BVectorWell

◆ Equations

template<class FluidSystem , class Indices >
using Opm::MultisegmentWellPrimaryVariables< FluidSystem, Indices >::Equations = MultisegmentWellEquations<Scalar,numWellEq,Indices::numEq>

◆ EvalWell

template<class FluidSystem , class Indices >
using Opm::MultisegmentWellPrimaryVariables< FluidSystem, Indices >::EvalWell = DenseAd::Evaluation<double, Indices::numEq + numWellEq>

◆ Scalar

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

Constructor & Destructor Documentation

◆ MultisegmentWellPrimaryVariables()

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

Member Function Documentation

◆ copyToWellState()

template<class FluidSystem , class Indices >
void Opm::MultisegmentWellPrimaryVariables< FluidSystem, Indices >::copyToWellState ( const MultisegmentWellGeneric< Scalar > &  mswell,
const double  rho,
const bool  stop_or_zero_rate_target,
WellState< Scalar > &  well_state,
const SummaryState &  summary_state,
DeferredLogger deferred_logger 
) const

Copy values to well state.

◆ eval()

template<class FluidSystem , class Indices >
const std::array< EvalWell, numWellEq > & Opm::MultisegmentWellPrimaryVariables< FluidSystem, Indices >::eval ( const int  idx) const
inline

Returns a const ref to an array of evaluations.

◆ getBhp()

template<class FluidSystem , class Indices >
EvalWell Opm::MultisegmentWellPrimaryVariables< FluidSystem, Indices >::getBhp ( ) const

Get bottomhole pressure.

◆ getQs()

template<class FluidSystem , class Indices >
EvalWell Opm::MultisegmentWellPrimaryVariables< FluidSystem, Indices >::getQs ( const int  comp_idx) const

◆ getSegmentPressure()

template<class FluidSystem , class Indices >
EvalWell Opm::MultisegmentWellPrimaryVariables< FluidSystem, Indices >::getSegmentPressure ( const int  seg) const

Get pressure for a segment.

◆ getSegmentRate()

template<class FluidSystem , class Indices >
EvalWell Opm::MultisegmentWellPrimaryVariables< FluidSystem, Indices >::getSegmentRate ( const int  seg,
const int  comp_idx 
) const

Get rate for a component in a segment.

◆ getSegmentRateUpwinding()

template<class FluidSystem , class Indices >
EvalWell Opm::MultisegmentWellPrimaryVariables< FluidSystem, Indices >::getSegmentRateUpwinding ( const int  seg,
const int  seg_upwind,
const std::size_t  comp_idx 
) const

Returns upwinding rate for a component in a segment.

◆ getWQTotal()

template<class FluidSystem , class Indices >
EvalWell Opm::MultisegmentWellPrimaryVariables< FluidSystem, Indices >::getWQTotal ( ) const

Get WQTotal.

◆ init()

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

Initialize evaluations from values.

◆ outputLowLimitPressureSegments()

template<class FluidSystem , class Indices >
void Opm::MultisegmentWellPrimaryVariables< FluidSystem, Indices >::outputLowLimitPressureSegments ( DeferredLogger deferred_logger) const

output the segments with pressure close to lower pressure limit for debugging purpose

◆ resize()

template<class FluidSystem , class Indices >
void Opm::MultisegmentWellPrimaryVariables< FluidSystem, Indices >::resize ( const int  numSegments)

Resize values and evaluations.

◆ setValue()

template<class FluidSystem , class Indices >
void Opm::MultisegmentWellPrimaryVariables< FluidSystem, Indices >::setValue ( const int  idx,
const std::array< Scalar, numWellEq > &  val 
)
inline

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

◆ surfaceVolumeFraction()

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

Returns surface volume fraction for a component in a segment.

basically Q_p / \sigma_p Q_p

◆ update()

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

Copy values from well state.

◆ updateNewton()

template<class FluidSystem , class Indices >
void Opm::MultisegmentWellPrimaryVariables< FluidSystem, Indices >::updateNewton ( const BVectorWell dwells,
const double  relaxation_factor,
const double  DFLimit,
const bool  stop_or_zero_rate_target,
const double  max_pressure_change 
)

Update values from newton update vector.

◆ value()

template<class FluidSystem , class Indices >
const std::array< Scalar, numWellEq > & Opm::MultisegmentWellPrimaryVariables< FluidSystem, Indices >::value ( const int  idx) const
inline

Returns a value array.

◆ volumeFractionScaled()

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

Returns scaled volume fraction for a component in a segment.

F_p / g_p, the basic usage of this value is because Q_p = G_t * F_p / G_p

Member Data Documentation

◆ GFrac

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

◆ has_gas

template<class FluidSystem , class Indices >
constexpr bool Opm::MultisegmentWellPrimaryVariables< FluidSystem, Indices >::has_gas = (Indices::compositionSwitchIdx >= 0)
staticconstexpr

◆ has_gfrac_variable

template<class FluidSystem , class Indices >
constexpr bool Opm::MultisegmentWellPrimaryVariables< FluidSystem, Indices >::has_gfrac_variable = has_gas && has_oil
staticconstexpr

◆ has_oil

template<class FluidSystem , class Indices >
constexpr bool Opm::MultisegmentWellPrimaryVariables< FluidSystem, Indices >::has_oil = (Indices::numPhases - has_gas - has_water) > 0
staticconstexpr

◆ has_water

template<class FluidSystem , class Indices >
constexpr bool Opm::MultisegmentWellPrimaryVariables< FluidSystem, Indices >::has_water = (Indices::waterSwitchIdx >= 0)
staticconstexpr

◆ has_wfrac_variable

template<class FluidSystem , class Indices >
constexpr bool Opm::MultisegmentWellPrimaryVariables< FluidSystem, Indices >::has_wfrac_variable = has_water && Indices::numPhases > 1
staticconstexpr

◆ numWellEq

template<class FluidSystem , class Indices >
constexpr int Opm::MultisegmentWellPrimaryVariables< FluidSystem, Indices >::numWellEq = Indices::numPhases + 1
staticconstexpr

◆ SPres

template<class FluidSystem , class Indices >
constexpr int Opm::MultisegmentWellPrimaryVariables< FluidSystem, Indices >::SPres = has_wfrac_variable + has_gfrac_variable + 1
staticconstexpr

◆ WFrac

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

◆ WQTotal

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

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