opm-common
Loading...
Searching...
No Matches
Opm::FluidStateExplicitCompositionModule< ValueType, FluidSystem, Implementation > Class Template Reference

Module for the modular fluid state which stores the phase compositions explicitly in terms of mole fractions. More...

#include <FluidStateCompositionModules.hpp>

Public Member Functions

const ValueType & moleFraction (unsigned phaseIdx, unsigned compIdx) const
 The mole fraction of a component in a phase [].
const ValueType & moleFraction (unsigned compIdx) const
 The total mole fraction of a component [].
ValueType massFraction (unsigned phaseIdx, unsigned compIdx) const
 The mass fraction of a component in a phase [].
const ValueType & averageMolarMass (unsigned phaseIdx) const
 The mean molar mass of a fluid phase [kg/mol].
ValueType molarity (unsigned phaseIdx, unsigned compIdx) const
 The concentration of a component in a phase [mol/m^3].
void setMoleFraction (unsigned phaseIdx, unsigned compIdx, const ValueType &value)
 Set the mole fraction of a component in a phase [] and update the average molar mass [kg/mol] according to the current composition of the phase.
void setMoleFraction (unsigned compIdx, const ValueType &value)
 Set the total mole fraction of a component.
void setCompressFactor (unsigned phaseIdx, const ValueType &value)
ValueType compressFactor (unsigned phaseIdx) const
template<class FluidState>
void assign (const FluidState &fs)
 Retrieve all parameters from an arbitrary fluid state.
void checkDefined () const
 Make sure that all attributes are defined.
const ValueType & K (unsigned compIdx) const
void setKvalue (unsigned compIdx, const ValueType &value)
 Set the K value of a component [-].
const ValueType & L () const
 The L value of a composition [-].
void setLvalue (const ValueType &value)
 Set the L value [-].
ValueType wilsonK_ (unsigned compIdx) const
 Wilson formula to calculate K.

Protected Member Functions

const Implementation & asImp_ () const

Protected Attributes

std::array< std::array< ValueType, numComponents >, numPhases > moleFraction_ {}
std::array< ValueType, numPhases > averageMolarMass_ {}
std::array< ValueType, numPhases > sumMoleFractions_ {}
std::array< ValueType, numComponents > totalModelFractions_ {}
std::array< ValueType, numPhases > Z_ {}
std::array< ValueType, numComponents > K_ {}
ValueType L_ {}

Detailed Description

template<class ValueType, class FluidSystem, class Implementation>
class Opm::FluidStateExplicitCompositionModule< ValueType, FluidSystem, Implementation >

Module for the modular fluid state which stores the phase compositions explicitly in terms of mole fractions.

Member Function Documentation

◆ averageMolarMass()

template<class ValueType, class FluidSystem, class Implementation>
const ValueType & Opm::FluidStateExplicitCompositionModule< ValueType, FluidSystem, Implementation >::averageMolarMass ( unsigned phaseIdx) const
inline

The mean molar mass of a fluid phase [kg/mol].

The average molar mass is the mean mass of one mole of the fluid at current composition. It is defined as the sum of the component's molar masses weighted by the current mole fraction:

\‍[ \bar M_\alpha = \sum_\kappa M^\kappa x_\alpha^\kappa \‍]

◆ checkDefined()

template<class ValueType, class FluidSystem, class Implementation>
void Opm::FluidStateExplicitCompositionModule< ValueType, FluidSystem, Implementation >::checkDefined ( ) const
inline

Make sure that all attributes are defined.

This method does not do anything if the program is not run under valgrind. If it is, then valgrind will print an error message if some attributes of the object have not been properly defined.

◆ molarity()

template<class ValueType, class FluidSystem, class Implementation>
ValueType Opm::FluidStateExplicitCompositionModule< ValueType, FluidSystem, Implementation >::molarity ( unsigned phaseIdx,
unsigned compIdx ) const
inline

The concentration of a component in a phase [mol/m^3].

This quantity is often called "molar concentration" or just "concentration", but there are many other (though less common) measures for concentration.

http://en.wikipedia.org/wiki/Concentration


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