26 #ifndef EWOMS_NCP_RATE_VECTOR_HH
27 #define EWOMS_NCP_RATE_VECTOR_HH
31 #include <opm/material/common/Valgrind.hpp>
32 #include <opm/material/constraintsolvers/NcpFlash.hpp>
34 #include <dune/common/fvector.hh>
45 template <
class TypeTag>
47 :
public Dune::FieldVector<typename GET_PROP_TYPE(TypeTag, Evaluation),
48 GET_PROP_VALUE(TypeTag, NumEq)>
51 typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
52 typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
53 typedef Dune::FieldVector<Evaluation, numEq> ParentType;
54 typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
55 typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
57 enum { conti0EqIdx = Indices::conti0EqIdx };
63 typedef Opm::MathToolbox<Evaluation> Toolbox;
67 { Valgrind::SetUndefined(*
this); }
90 ParentType molarRate(value);
91 for (
int compIdx = 0; compIdx < numComponents; ++compIdx)
92 molarRate[conti0EqIdx + compIdx] /= FluidSystem::molarMass(compIdx);
102 { ParentType::operator=(value); }
107 template <
class RhsEval>
109 { EnergyModule::setEnthalpyRate(*
this, rate); }
114 template <
class Flu
idState,
class RhsEval>
118 for (
int compIdx = 0; compIdx < numComponents; ++compIdx)
119 (*
this)[conti0EqIdx + compIdx] = fluidState.molarity(phaseIdx, compIdx) * volume;
121 EnergyModule::setEnthalpyRate(*
this, fluidState, phaseIdx, volume);
122 Valgrind::CheckDefined(*
this);
128 template <
class RhsEval>
131 for (
unsigned i=0; i < this->size(); ++i)
141 for (
unsigned i=0; i < this->size(); ++i)
142 (*
this)[i] = other[i];
NcpRateVector(const Evaluation &value)
Definition: ncpratevector.hh:72
#define GET_PROP_VALUE(TypeTag, PropTagName)
Access the value attribute of a property for a type tag.
Definition: propertysystem.hh:468
void setEnthalpyRate(const RhsEval &rate)
Set an enthalpy rate [J/As] where .
Definition: ncpratevector.hh:108
NcpRateVector(const NcpRateVector &value)
Default constructor.
Definition: ncpratevector.hh:80
void setMolarRate(const ParentType &value)
Set a molar rate of the conservation quantities.
Definition: ncpratevector.hh:101
void setMassRate(const ParentType &value)
Set a mass rate of the conservation quantities.
Definition: ncpratevector.hh:87
Implements a vector representing mass, molar or volumetric rates.
Definition: ncpratevector.hh:46
Provides the auxiliary methods required for consideration of the energy equation. ...
Definition: energymodule.hh:54
The primary variable and equation indices for the compositional multi-phase NCP model.
Definition: baseauxiliarymodule.hh:35
NcpRateVector()
Definition: ncpratevector.hh:66
NcpRateVector & operator=(const NcpRateVector &other)
Assignment operator from another rate vector.
Definition: ncpratevector.hh:139
NcpRateVector & operator=(const RhsEval &value)
Assignment operator from a scalar or a function evaluation.
Definition: ncpratevector.hh:129
void setVolumetricRate(const FluidState &fluidState, int phaseIdx, const RhsEval &volume)
Set a volumetric rate of a phase.
Definition: ncpratevector.hh:115