fluid systems: make the ParameterCache mechanism work with Evaluation<>
so far, using function evaluation objects instead of primitive floating point scalars only worked for trivial parameter caches which do not store any values (most of the time, this means that the ParameterCache is `NullParameterCache`), or it explicitly did not work (like for `Spe5ParameterCache`). this patch fixes the problem by making the parameter caches of fluid systems template classes which are templated on the type of scalar values. On the flipside, this requires changes to all downstream modules that use fluid systems.
This commit is contained in:
parent
d44dd50cb7
commit
6f9451ba06
@ -297,18 +297,19 @@ void checkFluidSystem()
|
||||
" as the one passed to the checkFluidSystem() function");
|
||||
|
||||
// check whether the parameter cache adheres to the API
|
||||
typedef typename FluidSystem::ParameterCache PC;
|
||||
PC paramCache;
|
||||
typedef typename FluidSystem::template ParameterCache<LhsEval> ParameterCache;
|
||||
|
||||
ParameterCache paramCache;
|
||||
try { paramCache.updateAll(fs); } catch (...) {};
|
||||
try { paramCache.updateAll(fs, /*except=*/PC::None); } catch (...) {};
|
||||
try { paramCache.updateAll(fs, /*except=*/PC::Temperature | PC::Pressure | PC::Composition); } catch (...) {};
|
||||
try { paramCache.updateAll(fs, /*except=*/ParameterCache::None); } catch (...) {};
|
||||
try { paramCache.updateAll(fs, /*except=*/ParameterCache::Temperature | ParameterCache::Pressure | ParameterCache::Composition); } catch (...) {};
|
||||
try { paramCache.updateAllPressures(fs); } catch (...) {};
|
||||
|
||||
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
|
||||
fs.restrictToPhase(static_cast<int>(phaseIdx));
|
||||
try { paramCache.updatePhase(fs, phaseIdx); } catch (...) {};
|
||||
try { paramCache.updatePhase(fs, phaseIdx, /*except=*/PC::None); } catch (...) {};
|
||||
try { paramCache.updatePhase(fs, phaseIdx, /*except=*/PC::Temperature | PC::Pressure | PC::Composition); } catch (...) {};
|
||||
try { paramCache.updatePhase(fs, phaseIdx, /*except=*/ParameterCache::None); } catch (...) {};
|
||||
try { paramCache.updatePhase(fs, phaseIdx, /*except=*/ParameterCache::Temperature | ParameterCache::Pressure | ParameterCache::Composition); } catch (...) {};
|
||||
try { paramCache.updateTemperature(fs, phaseIdx); } catch (...) {};
|
||||
try { paramCache.updatePressure(fs, phaseIdx); } catch (...) {};
|
||||
try { paramCache.updateComposition(fs, phaseIdx); } catch (...) {};
|
||||
|
@ -55,8 +55,6 @@ class CompositionFromFugacities
|
||||
{
|
||||
enum { numComponents = FluidSystem::numComponents };
|
||||
|
||||
typedef typename FluidSystem::ParameterCache ParameterCache;
|
||||
|
||||
public:
|
||||
typedef Dune::FieldVector<Evaluation, numComponents> ComponentVector;
|
||||
|
||||
@ -65,7 +63,6 @@ public:
|
||||
*/
|
||||
template <class FluidState>
|
||||
static void guessInitial(FluidState &fluidState,
|
||||
ParameterCache &/*paramCache*/,
|
||||
unsigned phaseIdx,
|
||||
const ComponentVector &/*fugVec*/)
|
||||
{
|
||||
@ -89,7 +86,7 @@ public:
|
||||
*/
|
||||
template <class FluidState>
|
||||
static void solve(FluidState &fluidState,
|
||||
ParameterCache ¶mCache,
|
||||
typename FluidSystem::template ParameterCache<typename FluidState::Scalar>& paramCache,
|
||||
unsigned phaseIdx,
|
||||
const ComponentVector &targetFug)
|
||||
{
|
||||
@ -195,7 +192,7 @@ protected:
|
||||
// independent of the phase's composition.
|
||||
template <class FluidState>
|
||||
static void solveIdealMix_(FluidState &fluidState,
|
||||
ParameterCache ¶mCache,
|
||||
typename FluidSystem::template ParameterCache<typename FluidState::Scalar>& paramCache,
|
||||
unsigned phaseIdx,
|
||||
const ComponentVector &fugacities)
|
||||
{
|
||||
@ -223,7 +220,7 @@ protected:
|
||||
static Scalar linearize_(Dune::FieldMatrix<Evaluation, numComponents, numComponents> &J,
|
||||
Dune::FieldVector<Evaluation, numComponents> &defect,
|
||||
FluidState &fluidState,
|
||||
ParameterCache ¶mCache,
|
||||
typename FluidSystem::template ParameterCache<typename FluidState::Scalar>& paramCache,
|
||||
unsigned phaseIdx,
|
||||
const ComponentVector &targetFug)
|
||||
{
|
||||
@ -295,7 +292,7 @@ protected:
|
||||
|
||||
template <class FluidState>
|
||||
static Scalar update_(FluidState &fluidState,
|
||||
ParameterCache ¶mCache,
|
||||
typename FluidSystem::template ParameterCache<typename FluidState::Scalar>& paramCache,
|
||||
Dune::FieldVector<Evaluation, numComponents> &x,
|
||||
Dune::FieldVector<Evaluation, numComponents> &/*b*/,
|
||||
unsigned phaseIdx,
|
||||
|
@ -105,9 +105,9 @@ public:
|
||||
* enthalpy/internal energy of each phase
|
||||
* should also be set.
|
||||
*/
|
||||
template <class FluidState, class ParameterCache>
|
||||
template <class FluidState>
|
||||
static void solve(FluidState &fluidState,
|
||||
ParameterCache ¶mCache,
|
||||
typename FluidSystem::template ParameterCache<typename FluidState::Scalar> ¶mCache,
|
||||
unsigned refPhaseIdx,
|
||||
bool setViscosity,
|
||||
bool setEnthalpy)
|
||||
|
@ -74,7 +74,6 @@ class ImmiscibleFlash
|
||||
"Immiscibility assumes that the number of phases"
|
||||
" is equal to the number of components");
|
||||
|
||||
typedef typename FluidSystem::ParameterCache ParameterCache;
|
||||
|
||||
static const int numEq = numPhases;
|
||||
|
||||
@ -87,16 +86,10 @@ public:
|
||||
/*!
|
||||
* \brief Guess initial values for all quantities.
|
||||
*/
|
||||
template <class FluidState>
|
||||
template <class FluidState, class Evaluation = typename FluidState::Scalar>
|
||||
static void guessInitial(FluidState &fluidState,
|
||||
ParameterCache &/*paramCache*/,
|
||||
const ComponentVector &globalMolarities)
|
||||
const Dune::FieldVector<Evaluation, numComponents>& /*globalMolarities*/)
|
||||
{
|
||||
// the sum of all molarities
|
||||
Scalar sumMoles = 0;
|
||||
for (unsigned compIdx = 0; compIdx < numComponents; ++compIdx)
|
||||
sumMoles += globalMolarities[compIdx];
|
||||
|
||||
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
|
||||
// pressure. use atmospheric pressure as initial guess
|
||||
fluidState.setPressure(phaseIdx, 2e5);
|
||||
@ -114,12 +107,14 @@ public:
|
||||
*/
|
||||
template <class MaterialLaw, class FluidState>
|
||||
static void solve(FluidState &fluidState,
|
||||
ParameterCache ¶mCache,
|
||||
const typename MaterialLaw::Params &matParams,
|
||||
const ComponentVector &globalMolarities)
|
||||
typename FluidSystem::template ParameterCache<typename FluidState::Scalar>& paramCache,
|
||||
const Dune::FieldVector<typename FluidState::Scalar, numComponents>& globalMolarities)
|
||||
{
|
||||
Dune::FMatrixPrecision<Scalar>::set_singular_limit(1e-25);
|
||||
|
||||
paramCache.updateAll(fluidState);
|
||||
|
||||
/////////////////////////
|
||||
// Check if all fluid phases are incompressible
|
||||
/////////////////////////
|
||||
@ -132,7 +127,6 @@ public:
|
||||
};
|
||||
|
||||
if (allIncompressible) {
|
||||
paramCache.updateAll(fluidState);
|
||||
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
|
||||
Scalar rho = FluidSystem::density(fluidState, paramCache, phaseIdx);
|
||||
fluidState.setDensity(phaseIdx, rho);
|
||||
@ -159,12 +153,12 @@ public:
|
||||
Valgrind::SetUndefined(deltaX);
|
||||
Valgrind::SetUndefined(b);
|
||||
|
||||
completeFluidState_<MaterialLaw>(fluidState, paramCache, matParams);
|
||||
completeFluidState_<MaterialLaw>(fluidState, matParams, paramCache);
|
||||
|
||||
const int nMax = 50; // <- maximum number of newton iterations
|
||||
for (int nIdx = 0; nIdx < nMax; ++nIdx) {
|
||||
// calculate Jacobian matrix and right hand side
|
||||
linearize_<MaterialLaw>(J, b, fluidState, paramCache, matParams, globalMolarities);
|
||||
linearize_<MaterialLaw>(J, b, fluidState, matParams, paramCache, globalMolarities);
|
||||
Valgrind::CheckDefined(J);
|
||||
Valgrind::CheckDefined(b);
|
||||
|
||||
@ -205,7 +199,7 @@ public:
|
||||
*/
|
||||
|
||||
// update the fluid quantities.
|
||||
Scalar relError = update_<MaterialLaw>(fluidState, paramCache, matParams, deltaX);
|
||||
Scalar relError = update_<MaterialLaw>(fluidState, matParams, paramCache, deltaX);
|
||||
|
||||
if (relError < 1e-9)
|
||||
return;
|
||||
@ -260,12 +254,13 @@ protected:
|
||||
static void linearize_(Matrix &J,
|
||||
Vector &b,
|
||||
FluidState &fluidState,
|
||||
ParameterCache ¶mCache,
|
||||
const typename MaterialLaw::Params &matParams,
|
||||
typename FluidSystem::template ParameterCache<typename FluidState::Scalar>& paramCache,
|
||||
const ComponentVector &globalMolarities)
|
||||
{
|
||||
// copy the undisturbed fluid state and parameter cache
|
||||
FluidState origFluidState(fluidState);
|
||||
ParameterCache origParamCache(paramCache);
|
||||
auto origParamCache(paramCache);
|
||||
|
||||
Vector tmp;
|
||||
|
||||
@ -287,7 +282,7 @@ protected:
|
||||
// deviate the mole fraction of the i-th component
|
||||
Scalar xI = getQuantity_(fluidState, pvIdx);
|
||||
const Scalar eps = 1e-10/quantityWeight_(fluidState, pvIdx);
|
||||
setQuantity_<MaterialLaw>(fluidState, paramCache, matParams, pvIdx, xI + eps);
|
||||
setQuantity_<MaterialLaw>(fluidState, matParams, paramCache, pvIdx, xI + eps);
|
||||
assert(std::abs(getQuantity_(fluidState, pvIdx) - (xI + eps))
|
||||
<= std::max<Scalar>(1.0, std::abs(xI))*std::numeric_limits<Scalar>::epsilon()*100);
|
||||
|
||||
@ -324,11 +319,11 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
template <class MaterialLaw, class FluidState>
|
||||
static Scalar update_(FluidState &fluidState,
|
||||
ParameterCache ¶mCache,
|
||||
const typename MaterialLaw::Params &matParams,
|
||||
const Vector &deltaX)
|
||||
template <class MaterialLaw, class FlashFluidState, class EvalVector>
|
||||
static Scalar update_(FlashFluidState& fluidState,
|
||||
const typename MaterialLaw::Params& matParams,
|
||||
typename FluidSystem::template ParameterCache<typename FlashFluidState::Scalar>& paramCache,
|
||||
const EvalVector& deltaX)
|
||||
{
|
||||
Scalar relError = 0;
|
||||
for (unsigned pvIdx = 0; pvIdx < numEq; ++ pvIdx) {
|
||||
@ -352,16 +347,18 @@ protected:
|
||||
setQuantityRaw_(fluidState, pvIdx, tmp - delta);
|
||||
}
|
||||
|
||||
completeFluidState_<MaterialLaw>(fluidState, paramCache, matParams);
|
||||
completeFluidState_<MaterialLaw>(fluidState, matParams, paramCache);
|
||||
|
||||
return relError;
|
||||
}
|
||||
|
||||
template <class MaterialLaw, class FluidState>
|
||||
static void completeFluidState_(FluidState &fluidState,
|
||||
ParameterCache ¶mCache,
|
||||
const typename MaterialLaw::Params &matParams)
|
||||
const typename MaterialLaw::Params &matParams,
|
||||
typename FluidSystem::template ParameterCache<typename FluidState::Scalar>& paramCache)
|
||||
{
|
||||
typedef typename FluidSystem::template ParameterCache<typename FluidState::Scalar> ParamCache;
|
||||
|
||||
// calculate the saturation of the last phase as a function of
|
||||
// the other saturations
|
||||
Scalar sumSat = 0.0;
|
||||
@ -393,7 +390,7 @@ protected:
|
||||
+ (pC[phaseIdx] - pC[0]));
|
||||
|
||||
// update the parameter cache
|
||||
paramCache.updateAll(fluidState, /*except=*/ParameterCache::Temperature|ParameterCache::Composition);
|
||||
paramCache.updateAll(fluidState, /*except=*/ParamCache::Temperature|ParamCache::Composition);
|
||||
|
||||
// update all densities
|
||||
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
|
||||
@ -430,8 +427,8 @@ protected:
|
||||
// set a quantity in the fluid state
|
||||
template <class MaterialLaw, class FluidState>
|
||||
static void setQuantity_(FluidState &fs,
|
||||
ParameterCache ¶mCache,
|
||||
const typename MaterialLaw::Params &matParams,
|
||||
typename FluidSystem::template ParameterCache<typename FluidState::Scalar>& paramCache,
|
||||
unsigned pvIdx,
|
||||
Scalar value)
|
||||
{
|
||||
@ -445,6 +442,8 @@ protected:
|
||||
// pressure does not depend on absolute pressure.
|
||||
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
|
||||
fs.setPressure(phaseIdx, fs.pressure(phaseIdx) + delta);
|
||||
|
||||
// update the parameter cache
|
||||
paramCache.updateAllPressures(fs);
|
||||
|
||||
// update all densities
|
||||
@ -473,6 +472,8 @@ protected:
|
||||
fs.setPressure(phaseIdx,
|
||||
fs.pressure(0)
|
||||
+ (pC[phaseIdx] - pC[0]));
|
||||
|
||||
// update the parameter cache
|
||||
paramCache.updateAllPressures(fs);
|
||||
|
||||
// update all densities
|
||||
|
@ -88,8 +88,6 @@ class NcpFlash
|
||||
enum { numPhases = FluidSystem::numPhases };
|
||||
enum { numComponents = FluidSystem::numComponents };
|
||||
|
||||
typedef typename FluidSystem::ParameterCache ParameterCache;
|
||||
|
||||
static const int numEq = numPhases*(numComponents + 1);
|
||||
|
||||
public:
|
||||
@ -98,7 +96,6 @@ public:
|
||||
*/
|
||||
template <class FluidState, class Evaluation = typename FluidState::Scalar>
|
||||
static void guessInitial(FluidState &fluidState,
|
||||
ParameterCache ¶mCache,
|
||||
const Dune::FieldVector<Evaluation, numComponents>& globalMolarities)
|
||||
{
|
||||
// the sum of all molarities
|
||||
@ -121,6 +118,7 @@ public:
|
||||
}
|
||||
|
||||
// set the fugacity coefficients of all components in all phases
|
||||
typename FluidSystem::template ParameterCache<Evaluation> paramCache;
|
||||
paramCache.updateAll(fluidState);
|
||||
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
|
||||
for (unsigned compIdx = 0; compIdx < numComponents; ++ compIdx) {
|
||||
@ -139,8 +137,8 @@ public:
|
||||
*/
|
||||
template <class MaterialLaw, class FluidState>
|
||||
static void solve(FluidState &fluidState,
|
||||
ParameterCache ¶mCache,
|
||||
const typename MaterialLaw::Params &matParams,
|
||||
typename FluidSystem::template ParameterCache<typename FluidState::Scalar>& paramCache,
|
||||
const Dune::FieldVector<typename FluidState::Scalar, numComponents>& globalMolarities,
|
||||
Scalar tolerance = -1.0)
|
||||
{
|
||||
@ -265,15 +263,12 @@ public:
|
||||
const ComponentVector &globalMolarities,
|
||||
Scalar tolerance = 0.0)
|
||||
{
|
||||
ParameterCache paramCache;
|
||||
paramCache.updateAll(fluidState);
|
||||
|
||||
typedef NullMaterialTraits<Scalar, numPhases> MaterialTraits;
|
||||
typedef NullMaterial<MaterialTraits> MaterialLaw;
|
||||
typedef typename MaterialLaw::Params MaterialLawParams;
|
||||
|
||||
MaterialLawParams matParams;
|
||||
solve<MaterialLaw>(fluidState, paramCache, matParams, globalMolarities, tolerance);
|
||||
solve<MaterialLaw>(fluidState, matParams, globalMolarities, tolerance);
|
||||
}
|
||||
|
||||
|
||||
@ -331,14 +326,14 @@ protected:
|
||||
static void linearize_(Matrix &J,
|
||||
Vector &b,
|
||||
FluidState &fluidState,
|
||||
ParameterCache ¶mCache,
|
||||
typename FluidSystem::template ParameterCache<typename FluidState::Scalar>& paramCache,
|
||||
const typename MaterialLaw::Params &matParams,
|
||||
const ComponentVector &globalMolarities)
|
||||
{
|
||||
typedef typename FluidState::Scalar Evaluation;
|
||||
|
||||
FluidState origFluidState(fluidState);
|
||||
ParameterCache origParamCache(paramCache);
|
||||
auto origParamCache(paramCache);
|
||||
|
||||
Vector tmp;
|
||||
|
||||
@ -444,7 +439,7 @@ protected:
|
||||
|
||||
template <class MaterialLaw, class FluidState, class Vector>
|
||||
static Scalar update_(FluidState &fluidState,
|
||||
ParameterCache ¶mCache,
|
||||
typename FluidSystem::template ParameterCache<typename FluidState::Scalar>& paramCache,
|
||||
const typename MaterialLaw::Params &matParams,
|
||||
const Vector &deltaX)
|
||||
{
|
||||
@ -522,10 +517,11 @@ protected:
|
||||
|
||||
template <class MaterialLaw, class FluidState>
|
||||
static void completeFluidState_(FluidState &fluidState,
|
||||
ParameterCache ¶mCache,
|
||||
typename FluidSystem::template ParameterCache<typename FluidState::Scalar>& paramCache,
|
||||
const typename MaterialLaw::Params &matParams)
|
||||
{
|
||||
typedef typename FluidState::Scalar Evaluation;
|
||||
typedef typename FluidSystem::template ParameterCache<Evaluation> ParameterCache;
|
||||
|
||||
// calculate the saturation of the last phase as a function of
|
||||
// the other saturations
|
||||
@ -596,7 +592,7 @@ protected:
|
||||
// set a quantity in the fluid state
|
||||
template <class MaterialLaw, class FluidState>
|
||||
static void setQuantity_(FluidState &fluidState,
|
||||
ParameterCache ¶mCache,
|
||||
typename FluidSystem::template ParameterCache<typename FluidState::Scalar>& paramCache,
|
||||
const typename MaterialLaw::Params &matParams,
|
||||
unsigned pvIdx,
|
||||
const typename FluidState::Scalar& value)
|
||||
|
@ -51,12 +51,14 @@ public:
|
||||
/*!
|
||||
* \brief The type of the fluid system's parameter cache
|
||||
*
|
||||
* The parameter cache can be used to avoid re-calculating
|
||||
* expensive parameters for multiple quantities. Be aware that
|
||||
* what the parameter cache actually does is specific for each
|
||||
* fluid system and that it is opaque outside the fluid system.
|
||||
* The parameter cache can be used to avoid re-calculating expensive parameters for
|
||||
* multiple quantities. Be aware that what the parameter cache actually does is
|
||||
* specific for each fluid system and that it is opaque outside the fluid system.
|
||||
*/
|
||||
typedef NullParameterCache ParameterCache;
|
||||
template <class Evaluation>
|
||||
struct ParameterCache {
|
||||
ParameterCache() = delete; // derived fluid systems must specify this class!
|
||||
};
|
||||
|
||||
//! Number of chemical species in the fluid system
|
||||
static const int numComponents = -1000;
|
||||
@ -167,9 +169,9 @@ public:
|
||||
* \copydoc Doxygen::fluidSystemBaseParams
|
||||
* \copydoc Doxygen::phaseIdxParam
|
||||
*/
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParameterCache = NullParameterCache>
|
||||
static LhsEval density(const FluidState &/*fluidState*/,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCache>
|
||||
static LhsEval density(const FluidState& /*fluidState*/,
|
||||
const ParamCache& /*paramCache*/,
|
||||
unsigned /*phaseIdx*/)
|
||||
{
|
||||
OPM_THROW(std::runtime_error,
|
||||
@ -190,9 +192,9 @@ public:
|
||||
* \copydoc Doxygen::phaseIdxParam
|
||||
* \copydoc Doxygen::compIdxParam
|
||||
*/
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParameterCache = NullParameterCache>
|
||||
static LhsEval fugacityCoefficient(const FluidState &/*fluidState*/,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCache>
|
||||
static LhsEval fugacityCoefficient(const FluidState& /*fluidState*/,
|
||||
ParamCache& /*paramCache*/,
|
||||
unsigned /*phaseIdx*/,
|
||||
unsigned /*compIdx*/)
|
||||
{
|
||||
@ -205,9 +207,9 @@ public:
|
||||
* \copydoc Doxygen::fluidSystemBaseParams
|
||||
* \copydoc Doxygen::phaseIdxParam
|
||||
*/
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParameterCache = NullParameterCache>
|
||||
static LhsEval viscosity(const FluidState &/*fluidState*/,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCache>
|
||||
static LhsEval viscosity(const FluidState& /*fluidState*/,
|
||||
ParamCache& /*paramCache*/,
|
||||
unsigned /*phaseIdx*/)
|
||||
{
|
||||
OPM_THROW(std::runtime_error, "Not implemented: The fluid system '" << Opm::className<Implementation>() << "' does not provide a viscosity() method!");
|
||||
@ -230,9 +232,9 @@ public:
|
||||
* \copydoc Doxygen::phaseIdxParam
|
||||
* \copydoc Doxygen::compIdxParam
|
||||
*/
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParameterCache = NullParameterCache>
|
||||
static LhsEval diffusionCoefficient(const FluidState &/*fluidState*/,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCache>
|
||||
static LhsEval diffusionCoefficient(const FluidState& /*fluidState*/,
|
||||
ParamCache& /*paramCache*/,
|
||||
unsigned /*phaseIdx*/,
|
||||
unsigned /*compIdx*/)
|
||||
{
|
||||
@ -246,9 +248,9 @@ public:
|
||||
* \copydoc Doxygen::fluidSystemBaseParams
|
||||
* \copydoc Doxygen::phaseIdxParam
|
||||
*/
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParameterCache = NullParameterCache>
|
||||
static LhsEval enthalpy(const FluidState &/*fluidState*/,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCache>
|
||||
static LhsEval enthalpy(const FluidState& /*fluidState*/,
|
||||
ParamCache& /*paramCache*/,
|
||||
unsigned /*phaseIdx*/)
|
||||
{
|
||||
OPM_THROW(std::runtime_error, "Not implemented: The fluid system '" << Opm::className<Implementation>() << "' does not provide an enthalpy() method!");
|
||||
@ -260,9 +262,9 @@ public:
|
||||
* \copydoc Doxygen::fluidSystemBaseParams
|
||||
* \copydoc Doxygen::phaseIdxParam
|
||||
*/
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParameterCache = NullParameterCache>
|
||||
static LhsEval thermalConductivity(const FluidState &/*fluidState*/,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCache>
|
||||
static LhsEval thermalConductivity(const FluidState& /*fluidState*/,
|
||||
ParamCache& /*paramCache*/,
|
||||
unsigned /*phaseIdx*/)
|
||||
{
|
||||
OPM_THROW(std::runtime_error, "Not implemented: The fluid system '" << Opm::className<Implementation>() << "' does not provide a thermalConductivity() method!");
|
||||
@ -274,9 +276,9 @@ public:
|
||||
* \copydoc Doxygen::fluidSystemBaseParams
|
||||
* \copydoc Doxygen::phaseIdxParam
|
||||
*/
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParameterCache = NullParameterCache>
|
||||
static LhsEval heatCapacity(const FluidState &/*fluidState*/,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCache>
|
||||
static LhsEval heatCapacity(const FluidState& /*fluidState*/,
|
||||
ParamCache& /*paramCache*/,
|
||||
unsigned /*phaseIdx*/)
|
||||
{
|
||||
OPM_THROW(std::runtime_error, "Not implemented: The fluid system '" << Opm::className<Implementation>() << "' does not provide a heatCapacity() method!");
|
||||
|
@ -113,7 +113,8 @@ public:
|
||||
typedef Opm::WaterPvtMultiplexer<Scalar> WaterPvt;
|
||||
|
||||
//! \copydoc BaseFluidSystem::ParameterCache
|
||||
class ParameterCache : public Opm::NullParameterCache
|
||||
template <class Evaluation>
|
||||
struct ParameterCache : public Opm::NullParameterCache<Evaluation>
|
||||
{
|
||||
public:
|
||||
ParameterCache(int /*regionIdx*/=0)
|
||||
@ -396,24 +397,24 @@ public:
|
||||
* thermodynamic quantities (generic version, only isothermal)
|
||||
****************************************/
|
||||
//! \copydoc BaseFluidSystem::density
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval density(const FluidState &fluidState,
|
||||
ParameterCache ¶mCache,
|
||||
const ParameterCache<ParamCacheEval> ¶mCache,
|
||||
unsigned phaseIdx)
|
||||
{ return density<FluidState, LhsEval>(fluidState, phaseIdx, paramCache.regionIndex()); }
|
||||
|
||||
//! \copydoc BaseFluidSystem::fugacityCoefficient
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval fugacityCoefficient(const FluidState &fluidState,
|
||||
const ParameterCache ¶mCache,
|
||||
const ParameterCache<ParamCacheEval> ¶mCache,
|
||||
unsigned phaseIdx,
|
||||
unsigned compIdx)
|
||||
{ return fugacityCoefficient<FluidState, LhsEval>(fluidState, phaseIdx, compIdx, paramCache.regionIndex()); }
|
||||
|
||||
//! \copydoc BaseFluidSystem::viscosity
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval viscosity(const FluidState &fluidState,
|
||||
const ParameterCache ¶mCache,
|
||||
const ParameterCache<ParamCacheEval> ¶mCache,
|
||||
unsigned phaseIdx)
|
||||
{ return viscosity<FluidState, LhsEval>(fluidState, phaseIdx, paramCache.regionIndex()); }
|
||||
|
||||
|
@ -69,12 +69,13 @@ class BrineCO2
|
||||
typedef H2O_Tabulated H2O;
|
||||
|
||||
public:
|
||||
template <class Evaluation>
|
||||
struct ParameterCache : public Opm::NullParameterCache<Evaluation>
|
||||
{};
|
||||
|
||||
//! The binary coefficients for brine and CO2 used by this fluid system
|
||||
typedef Opm::BinaryCoeff::Brine_CO2<Scalar, CO2Tables> BinaryCoeffBrineCO2;
|
||||
|
||||
//! \copydoc BaseFluidSystem::ParameterCache
|
||||
typedef Opm::NullParameterCache ParameterCache;
|
||||
|
||||
/****************************************
|
||||
* Fluid phase related static parameters
|
||||
****************************************/
|
||||
@ -228,9 +229,9 @@ public:
|
||||
/*!
|
||||
* \copydoc BaseFluidSystem::density
|
||||
*/
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval density(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||
@ -282,9 +283,9 @@ public:
|
||||
/*!
|
||||
* \copydoc BaseFluidSystem::viscosity
|
||||
*/
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval viscosity(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||
@ -311,9 +312,9 @@ public:
|
||||
/*!
|
||||
* \copydoc BaseFluidSystem::fugacityCoefficient
|
||||
*/
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval fugacityCoefficient(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx,
|
||||
unsigned compIdx)
|
||||
{
|
||||
@ -368,9 +369,9 @@ public:
|
||||
/*!
|
||||
* \copydoc BaseFluidSystem::diffusionCoefficient
|
||||
*/
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval diffusionCoefficient(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx,
|
||||
unsigned /*compIdx*/)
|
||||
{
|
||||
@ -388,9 +389,9 @@ public:
|
||||
/*!
|
||||
* \copydoc BaseFluidSystem::enthalpy
|
||||
*/
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval enthalpy(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||
@ -425,9 +426,9 @@ public:
|
||||
/*!
|
||||
* \copydoc BaseFluidSystem::thermalConductivity
|
||||
*/
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval thermalConductivity(const FluidState &/*fluidState*/,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef MathToolbox<LhsEval> LhsToolbox;
|
||||
@ -452,9 +453,9 @@ public:
|
||||
* \param phaseIdx The index of the fluid phase to consider
|
||||
* \tparam FluidState the fluid state class
|
||||
*/
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval heatCapacity(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||
|
@ -67,8 +67,9 @@ class H2OAir
|
||||
typedef Opm::IdealGas<Scalar> IdealGas;
|
||||
|
||||
public:
|
||||
//! \copydoc BaseFluidSystem::ParameterCache
|
||||
typedef NullParameterCache ParameterCache;
|
||||
template <class Evaluation>
|
||||
struct ParameterCache : public Opm::NullParameterCache<Evaluation>
|
||||
{};
|
||||
|
||||
//! The type of the water component used for this fluid system
|
||||
typedef H2Otype H2O;
|
||||
@ -253,9 +254,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::density
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval density(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef Opm::MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||
@ -319,9 +320,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::viscosity
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval viscosity(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef Opm::MathToolbox<LhsEval> LhsToolbox;
|
||||
@ -388,9 +389,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::fugacityCoefficient
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval fugacityCoefficient(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx,
|
||||
unsigned compIdx)
|
||||
{
|
||||
@ -414,9 +415,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::diffusionCoefficient
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval binaryDiffusionCoefficient(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx,
|
||||
unsigned /*compIdx*/)
|
||||
{
|
||||
@ -433,9 +434,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::enthalpy
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval enthalpy(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef Opm::MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||
@ -467,9 +468,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::thermalConductivity
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval thermalConductivity(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||
|
@ -63,8 +63,9 @@ class H2OAirMesitylene
|
||||
typedef Opm::TabulatedComponent<Scalar, IapwsH2O, /*alongVaporPressure=*/false> TabulatedH2O;
|
||||
|
||||
public:
|
||||
//! \copydoc BaseFluidSystem::ParameterCache
|
||||
typedef NullParameterCache ParameterCache;
|
||||
template <class Evaluation>
|
||||
struct ParameterCache : public Opm::NullParameterCache<Evaluation>
|
||||
{};
|
||||
|
||||
//! The type of the mesithylene/napl component
|
||||
typedef Opm::Mesitylene<Scalar> NAPL;
|
||||
@ -197,9 +198,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::density
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval density(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef Opm::MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||
@ -244,9 +245,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::viscosity
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval viscosity(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef Opm::MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||
@ -308,9 +309,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::diffusionCoefficient
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval diffusionCoefficient(const FluidState &/*fluidState*/,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned /*phaseIdx*/,
|
||||
unsigned /*compIdx*/)
|
||||
{
|
||||
@ -369,9 +370,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::fugacityCoefficient
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval fugacityCoefficient(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx,
|
||||
unsigned compIdx)
|
||||
{
|
||||
@ -418,9 +419,9 @@ public:
|
||||
|
||||
|
||||
//! \copydoc BaseFluidSystem::enthalpy
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval enthalpy(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef Opm::MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||
@ -447,9 +448,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::thermalConductivity
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval thermalConductivity(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef Opm::MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||
|
@ -56,8 +56,9 @@ class H2OAirXylene
|
||||
typedef BaseFluidSystem<Scalar, ThisType> Base;
|
||||
|
||||
public:
|
||||
//! \copydoc BaseFluidSystem::ParameterCache
|
||||
typedef NullParameterCache ParameterCache;
|
||||
template <class Evaluation>
|
||||
struct ParameterCache : public Opm::NullParameterCache<Evaluation>
|
||||
{};
|
||||
|
||||
//! The type of the water component
|
||||
typedef Opm::H2O<Scalar> H2O;
|
||||
@ -164,9 +165,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::density
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval density(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef Opm::MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||
@ -207,9 +208,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::viscosity
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval viscosity(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef Opm::MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||
@ -271,9 +272,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::diffusionCoefficient
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval diffusionCoefficient(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx,
|
||||
unsigned compIdx)
|
||||
{
|
||||
@ -325,9 +326,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::fugacityCoefficient
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval fugacityCoefficient(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx,
|
||||
unsigned compIdx)
|
||||
{
|
||||
@ -370,9 +371,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::enthalpy
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval enthalpy(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef Opm::MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||
|
@ -67,7 +67,8 @@ class H2ON2
|
||||
|
||||
public:
|
||||
//! \copydoc BaseFluidSystem::ParameterCache
|
||||
typedef NullParameterCache ParameterCache;
|
||||
template <class Evaluation>
|
||||
using ParameterCache = NullParameterCache<Evaluation>;
|
||||
|
||||
/****************************************
|
||||
* Fluid phase related static parameters
|
||||
@ -264,9 +265,9 @@ public:
|
||||
* of a multiphase multicomponent model for PEMFC - Technical report: IRTG-NUPUS",
|
||||
* University of Stuttgart, 2008
|
||||
*/
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval density(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
assert(0 <= phaseIdx && phaseIdx < numPhases);
|
||||
@ -321,9 +322,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::viscosity
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval viscosity(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
assert(0 <= phaseIdx && phaseIdx < numPhases);
|
||||
@ -382,9 +383,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::fugacityCoefficient
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval fugacityCoefficient(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx,
|
||||
unsigned compIdx)
|
||||
{
|
||||
@ -411,9 +412,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::diffusionCoefficient
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval diffusionCoefficient(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx,
|
||||
unsigned /*compIdx*/)
|
||||
|
||||
@ -433,9 +434,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::enthalpy
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval enthalpy(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef Opm::MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||
@ -467,9 +468,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::thermalConductivity
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval thermalConductivity(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
assert(0 <= phaseIdx && phaseIdx < numPhases);
|
||||
@ -502,9 +503,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::heatCapacity
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval heatCapacity(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef Opm::MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||
|
@ -67,7 +67,9 @@ class H2ON2LiquidPhase
|
||||
|
||||
public:
|
||||
//! \copydoc BaseFluidSystem::ParameterCache
|
||||
typedef NullParameterCache ParameterCache;
|
||||
template <class Evaluation>
|
||||
struct ParameterCache : public Opm::NullParameterCache<Evaluation>
|
||||
{};
|
||||
|
||||
/****************************************
|
||||
* Fluid phase related static parameters
|
||||
@ -248,9 +250,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::density
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval density(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef Opm::MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||
@ -285,9 +287,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::viscosity
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval viscosity(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef Opm::MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||
@ -302,9 +304,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::fugacityCoefficient
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval fugacityCoefficient(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx,
|
||||
unsigned compIdx)
|
||||
{
|
||||
@ -322,9 +324,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::diffusionCoefficient
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval diffusionCoefficient(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx,
|
||||
unsigned /*compIdx*/)
|
||||
|
||||
@ -340,9 +342,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::enthalpy
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval enthalpy(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef Opm::MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||
@ -359,9 +361,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::thermalConductivity
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval thermalConductivity(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
const unsigned phaseIdx)
|
||||
{
|
||||
typedef Opm::MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||
@ -378,9 +380,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::heatCapacity
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval heatCapacity(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef Opm::MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||
|
@ -35,7 +35,8 @@ namespace Opm {
|
||||
* \ingroup Fluidsystems
|
||||
* \brief A parameter cache which does nothing
|
||||
*/
|
||||
class NullParameterCache : public ParameterCacheBase<NullParameterCache>
|
||||
template <class Evaluation>
|
||||
class NullParameterCache : public ParameterCacheBase<NullParameterCache<Evaluation> >
|
||||
{
|
||||
public:
|
||||
NullParameterCache()
|
||||
|
@ -63,7 +63,9 @@ class SinglePhase
|
||||
|
||||
public:
|
||||
//! \copydoc BaseFluidSystem::ParameterCache
|
||||
typedef NullParameterCache ParameterCache;
|
||||
template <class Evaluation>
|
||||
struct ParameterCache : public Opm::NullParameterCache<Evaluation>
|
||||
{};
|
||||
|
||||
/****************************************
|
||||
* Fluid phase related static parameters
|
||||
@ -183,9 +185,9 @@ public:
|
||||
{ }
|
||||
|
||||
//! \copydoc BaseFluidSystem::density
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval density(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef Opm::MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||
@ -198,9 +200,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::viscosity
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval viscosity(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef Opm::MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||
@ -213,9 +215,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::fugacityCoefficient
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval fugacityCoefficient(const FluidState &/*fluidState*/,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx,
|
||||
unsigned compIdx)
|
||||
{
|
||||
@ -232,9 +234,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::enthalpy
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval enthalpy(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef Opm::MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||
@ -247,9 +249,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::thermalConductivity
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval thermalConductivity(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef Opm::MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||
@ -262,9 +264,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::heatCapacity
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval heatCapacity(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef Opm::MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||
|
@ -64,7 +64,9 @@ class Spe5
|
||||
|
||||
public:
|
||||
//! \copydoc BaseFluidSystem::ParameterCache
|
||||
typedef Opm::Spe5ParameterCache<Scalar, ThisType> ParameterCache;
|
||||
template <class Evaluation>
|
||||
struct ParameterCache : public Opm::Spe5ParameterCache<Evaluation, ThisType>
|
||||
{};
|
||||
|
||||
/****************************************
|
||||
* Fluid phase parameters
|
||||
@ -356,27 +358,23 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::density
|
||||
template <class FluidState, class Evaluation = Scalar>
|
||||
static Scalar density(const FluidState &fluidState,
|
||||
const ParameterCache ¶mCache,
|
||||
unsigned phaseIdx)
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval density(const FluidState &fluidState,
|
||||
const ParameterCache<ParamCacheEval> ¶mCache,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
assert(0 <= phaseIdx && phaseIdx < numPhases);
|
||||
static_assert(std::is_same<Evaluation, Scalar>::value,
|
||||
"The SPE-5 fluid system is currently only implemented for the scalar case.");
|
||||
|
||||
return fluidState.averageMolarMass(phaseIdx)/paramCache.molarVolume(phaseIdx);
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::viscosity
|
||||
template <class FluidState, class Evaluation = Scalar>
|
||||
static Scalar viscosity(const FluidState &/*fluidState*/,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval viscosity(const FluidState &/*fluidState*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
assert(0 <= phaseIdx && phaseIdx <= numPhases);
|
||||
static_assert(std::is_same<Evaluation, Scalar>::value,
|
||||
"The SPE-5 fluid system is currently only implemented for the scalar case.");
|
||||
|
||||
if (phaseIdx == gasPhaseIdx) {
|
||||
// given by SPE-5 in table on page 64. we use a constant
|
||||
@ -395,16 +393,14 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::fugacityCoefficient
|
||||
template <class FluidState, class Evaluation = Scalar>
|
||||
static Scalar fugacityCoefficient(const FluidState &fluidState,
|
||||
const ParameterCache ¶mCache,
|
||||
unsigned phaseIdx,
|
||||
unsigned compIdx)
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval fugacityCoefficient(const FluidState &fluidState,
|
||||
const ParameterCache<ParamCacheEval> ¶mCache,
|
||||
unsigned phaseIdx,
|
||||
unsigned compIdx)
|
||||
{
|
||||
assert(0 <= phaseIdx && phaseIdx <= numPhases);
|
||||
assert(0 <= compIdx && compIdx <= numComponents);
|
||||
static_assert(std::is_same<Evaluation, Scalar>::value,
|
||||
"The SPE-5 fluid system is currently only implemented for the scalar case.");
|
||||
|
||||
if (phaseIdx == oilPhaseIdx || phaseIdx == gasPhaseIdx)
|
||||
return PengRobinsonMixture::computeFugacityCoefficient(fluidState,
|
||||
@ -420,7 +416,8 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
static Scalar henryCoeffWater_(unsigned compIdx, Scalar temperature)
|
||||
template <class LhsEval>
|
||||
static LhsEval henryCoeffWater_(unsigned compIdx, const LhsEval& temperature)
|
||||
{
|
||||
// use henry's law for the solutes and the vapor pressure for
|
||||
// the solvent.
|
||||
|
@ -63,9 +63,11 @@ class TwoPhaseImmiscible
|
||||
|
||||
typedef TwoPhaseImmiscible<Scalar, WettingPhase, NonwettingPhase> ThisType;
|
||||
typedef BaseFluidSystem<Scalar, ThisType> Base;
|
||||
|
||||
public:
|
||||
//! \copydoc BaseFluidSystem::ParameterCache
|
||||
typedef NullParameterCache ParameterCache;
|
||||
template <class Evaluation>
|
||||
struct ParameterCache : public Opm::NullParameterCache<Evaluation>
|
||||
{};
|
||||
|
||||
/****************************************
|
||||
* Fluid phase related static parameters
|
||||
@ -219,9 +221,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::density
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval density(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||
@ -236,9 +238,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::viscosity
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval viscosity(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||
@ -253,9 +255,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::fugacityCoefficient
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval fugacityCoefficient(const FluidState &/*fluidState*/,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx,
|
||||
unsigned compIdx)
|
||||
{
|
||||
@ -274,9 +276,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::enthalpy
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval enthalpy(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||
@ -291,9 +293,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::thermalConductivity
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval thermalConductivity(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||
@ -308,9 +310,9 @@ public:
|
||||
}
|
||||
|
||||
//! \copydoc BaseFluidSystem::heatCapacity
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
|
||||
static LhsEval heatCapacity(const FluidState &fluidState,
|
||||
const ParameterCache &/*paramCache*/,
|
||||
const ParameterCache<ParamCacheEval> &/*paramCache*/,
|
||||
unsigned phaseIdx)
|
||||
{
|
||||
typedef MathToolbox<typename FluidState::Scalar> FsToolbox;
|
||||
|
@ -108,9 +108,9 @@ void checkImmiscibleFlash(const FluidState &fsRef,
|
||||
fsFlash.setTemperature(fsRef.temperature(/*phaseIdx=*/0));
|
||||
|
||||
// run the flash calculation
|
||||
typename FluidSystem::ParameterCache paramCache;
|
||||
ImmiscibleFlash::guessInitial(fsFlash, paramCache, globalMolarities);
|
||||
ImmiscibleFlash::template solve<MaterialLaw>(fsFlash, paramCache, matParams, globalMolarities);
|
||||
ImmiscibleFlash::guessInitial(fsFlash, globalMolarities);
|
||||
typename FluidSystem::template ParameterCache<typename FluidState::Scalar> paramCache;
|
||||
ImmiscibleFlash::template solve<MaterialLaw>(fsFlash, matParams, paramCache, globalMolarities);
|
||||
|
||||
// compare the "flashed" fluid state with the reference one
|
||||
checkSame<Scalar>(fsRef, fsFlash);
|
||||
@ -138,7 +138,7 @@ void completeReferenceFluidState(FluidState &fs,
|
||||
+ (pC[otherPhaseIdx] - pC[refPhaseIdx]));
|
||||
|
||||
// set all phase densities
|
||||
typename FluidSystem::ParameterCache paramCache;
|
||||
typename FluidSystem::template ParameterCache<typename FluidState::Scalar> paramCache;
|
||||
paramCache.updateAll(fs);
|
||||
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
|
||||
Scalar rho = FluidSystem::density(fs, paramCache, phaseIdx);
|
||||
|
@ -90,6 +90,7 @@ void checkNcpFlash(const FluidState &fsRef,
|
||||
enum { numPhases = FluidSystem::numPhases };
|
||||
enum { numComponents = FluidSystem::numComponents };
|
||||
typedef Dune::FieldVector<Scalar, numComponents> ComponentVector;
|
||||
typedef typename FluidSystem::template ParameterCache<typename FluidState::Scalar> ParameterCache;
|
||||
|
||||
// calculate the total amount of stuff in the reference fluid
|
||||
// phase
|
||||
@ -108,9 +109,10 @@ void checkNcpFlash(const FluidState &fsRef,
|
||||
fsFlash.setTemperature(fsRef.temperature(/*phaseIdx=*/0));
|
||||
|
||||
// run the flash calculation
|
||||
typename FluidSystem::ParameterCache paramCache;
|
||||
NcpFlash::guessInitial(fsFlash, paramCache, globalMolarities);
|
||||
NcpFlash::template solve<MaterialLaw>(fsFlash, paramCache, matParams, globalMolarities);
|
||||
ParameterCache paramCache;
|
||||
paramCache.updateAll(fsFlash);
|
||||
NcpFlash::guessInitial(fsFlash, globalMolarities);
|
||||
NcpFlash::template solve<MaterialLaw>(fsFlash, matParams, paramCache, globalMolarities);
|
||||
|
||||
// compare the "flashed" fluid state with the reference one
|
||||
checkSame<Scalar>(fsRef, fsFlash);
|
||||
@ -141,7 +143,7 @@ void completeReferenceFluidState(FluidState &fs,
|
||||
|
||||
// make the fluid state consistent with local thermodynamic
|
||||
// equilibrium
|
||||
typename FluidSystem::ParameterCache paramCache;
|
||||
typename FluidSystem::template ParameterCache<typename FluidState::Scalar> paramCache;
|
||||
ComputeFromReferencePhase::solve(fs,
|
||||
paramCache,
|
||||
refPhaseIdx,
|
||||
@ -251,7 +253,7 @@ inline void testAll()
|
||||
fsRef.setPressure(liquidPhaseIdx, 1e6);
|
||||
fsRef.setPressure(gasPhaseIdx, 1e6);
|
||||
|
||||
typename FluidSystem::ParameterCache paramCache;
|
||||
typename FluidSystem::template ParameterCache<Scalar> paramCache;
|
||||
typedef Opm::MiscibleMultiPhaseComposition<Scalar, FluidSystem> MiscibleMultiPhaseComposition;
|
||||
MiscibleMultiPhaseComposition::solve(fsRef, paramCache,
|
||||
/*setViscosity=*/false,
|
||||
|
@ -59,7 +59,7 @@ void createSurfaceGasFluidSystem(FluidState &gasFluidState)
|
||||
gasFluidState.setMoleFraction(gasPhaseIdx, FluidSystem::C20Idx, 0.00);
|
||||
|
||||
// gas density
|
||||
typename FluidSystem::ParameterCache paramCache;
|
||||
typename FluidSystem::template ParameterCache<typename FluidState::Scalar> paramCache;
|
||||
paramCache.updatePhase(gasFluidState, gasPhaseIdx);
|
||||
gasFluidState.setDensity(gasPhaseIdx,
|
||||
FluidSystem::density(gasFluidState, paramCache, gasPhaseIdx));
|
||||
@ -210,7 +210,7 @@ Scalar bringOilToSurface(FluidState &surfaceFluidState, Scalar alpha, const Flui
|
||||
surfaceFluidState.setSaturation(gasPhaseIdx, 1.0 - surfaceFluidState.saturation(oilPhaseIdx));
|
||||
}
|
||||
|
||||
typename FluidSystem::ParameterCache paramCache;
|
||||
typename FluidSystem::template ParameterCache<Scalar> paramCache;
|
||||
paramCache.updateAll(surfaceFluidState);
|
||||
|
||||
// increase volume until we are at surface pressure. use the
|
||||
@ -224,7 +224,7 @@ Scalar bringOilToSurface(FluidState &surfaceFluidState, Scalar alpha, const Flui
|
||||
// calculate the deviation from the standard pressure
|
||||
tmpMolarities = molarities;
|
||||
tmpMolarities /= alpha;
|
||||
Flash::template solve<MaterialLaw>(surfaceFluidState, paramCache, matParams, tmpMolarities);
|
||||
Flash::template solve<MaterialLaw>(surfaceFluidState, matParams, paramCache, tmpMolarities);
|
||||
Scalar f = surfaceFluidState.pressure(gasPhaseIdx) - refPressure;
|
||||
|
||||
// calculate the derivative of the deviation from the standard
|
||||
@ -232,7 +232,7 @@ Scalar bringOilToSurface(FluidState &surfaceFluidState, Scalar alpha, const Flui
|
||||
Scalar eps = alpha*1e-10;
|
||||
tmpMolarities = molarities;
|
||||
tmpMolarities /= alpha + eps;
|
||||
Flash::template solve<MaterialLaw>(surfaceFluidState, paramCache, matParams, tmpMolarities);
|
||||
Flash::template solve<MaterialLaw>(surfaceFluidState, matParams, paramCache, tmpMolarities);
|
||||
Scalar fStar = surfaceFluidState.pressure(gasPhaseIdx) - refPressure;
|
||||
Scalar fPrime = (fStar - f)/eps;
|
||||
|
||||
@ -247,7 +247,7 @@ Scalar bringOilToSurface(FluidState &surfaceFluidState, Scalar alpha, const Flui
|
||||
// calculate the final result
|
||||
tmpMolarities = molarities;
|
||||
tmpMolarities /= alpha;
|
||||
Flash::template solve<MaterialLaw>(surfaceFluidState, paramCache, matParams, tmpMolarities);
|
||||
Flash::template solve<MaterialLaw>(surfaceFluidState, matParams, paramCache, tmpMolarities);
|
||||
return alpha;
|
||||
}
|
||||
|
||||
@ -316,7 +316,7 @@ inline void testAll()
|
||||
typedef Opm::LinearMaterial<MaterialTraits> MaterialLaw;
|
||||
typedef typename MaterialLaw::Params MaterialLawParams;
|
||||
|
||||
typedef typename FluidSystem::ParameterCache ParameterCache;
|
||||
typedef typename FluidSystem::template ParameterCache<Scalar> ParameterCache;
|
||||
|
||||
////////////
|
||||
// Initialize the fluid system and create the capillary pressure
|
||||
@ -400,8 +400,8 @@ inline void testAll()
|
||||
|
||||
FluidState flashFluidState, surfaceFluidState;
|
||||
flashFluidState.assign(fluidState);
|
||||
//Flash::guessInitial(flashFluidState, paramCache, totalMolarities);
|
||||
Flash::template solve<MaterialLaw>(flashFluidState, paramCache, matParams, totalMolarities);
|
||||
//Flash::guessInitial(flashFluidState, totalMolarities);
|
||||
Flash::template solve<MaterialLaw>(flashFluidState, matParams, paramCache, totalMolarities);
|
||||
|
||||
Scalar surfaceAlpha = 1;
|
||||
surfaceAlpha = bringOilToSurface<Scalar, FluidSystem>(surfaceFluidState, surfaceAlpha, flashFluidState, /*guessInitial=*/true);
|
||||
@ -424,7 +424,7 @@ inline void testAll()
|
||||
curTotalMolarities /= alpha;
|
||||
|
||||
// "flash" the modified reservoir oil
|
||||
Flash::template solve<MaterialLaw>(flashFluidState, paramCache, matParams, curTotalMolarities);
|
||||
Flash::template solve<MaterialLaw>(flashFluidState, matParams, paramCache, curTotalMolarities);
|
||||
|
||||
surfaceAlpha = bringOilToSurface<Scalar, FluidSystem>(surfaceFluidState,
|
||||
surfaceAlpha,
|
||||
|
Loading…
Reference in New Issue
Block a user