moved the viscositymodels to a separate folder alongside the fluidsystem, in principle there are two viscositymodels: the standard LBC and the modified LBC. However, there might me some discrepancy between LBC and LBCjulia - this needs to be sorted out before we split this file into two (or three) separte method files

This commit is contained in:
Trine Mykkeltvedt 2022-06-23 09:22:26 +02:00
parent 14a5a37249
commit 647efce497
4 changed files with 13 additions and 23 deletions

View File

@ -7,7 +7,7 @@
#include <opm/material/components/Brine.hpp>
#include <opm/material/fluidsystems/PTFlashParameterCache.hpp>
#include <opm/material/fluidsystems/chifluid/LBCviscosity.hpp>
#include <opm/material/viscositymodels/LBCviscosity.hpp>
namespace Opm {
/*!
@ -87,7 +87,6 @@ namespace Opm {
switch (compIdx) {
case Comp0Idx: return Comp0::criticalVolume();
case Comp1Idx: return Comp1::criticalVolume();
// case Comp2Idx: return Comp2::criticalVolume();
default: throw std::runtime_error("Illegal component index for criticalVolume");
}
}
@ -98,7 +97,6 @@ namespace Opm {
switch (compIdx) {
case Comp0Idx: return Comp0::molarMass();
case Comp1Idx: return Comp1::molarMass();
// case Comp2Idx: return Comp2::molarMass();
default: throw std::runtime_error("Illegal component index for molarMass");
}
}
@ -128,7 +126,6 @@ namespace Opm {
static const char* name[] = {
Comp0::name(),
Comp1::name(),
// Comp2::name(),
};
assert(0 <= compIdx && compIdx < 3);
@ -146,26 +143,27 @@ namespace Opm {
LhsEval dens;
if (phaseIdx == oilPhaseIdx || phaseIdx == gasPhaseIdx) {
// paramCache.updatePhase(fluidState, phaseIdx);
dens = fluidState.averageMolarMass(phaseIdx) / paramCache.molarVolume(phaseIdx);
}
return dens;
}
//! \copydoc BaseFluidSystem::viscosity
/*!
* \copydoc BaseFluidSystem::viscosity
*/
template <class FluidState, class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
static LhsEval viscosity(const FluidState& fluidState,
const ParameterCache<ParamCacheEval>& paramCache,
unsigned phaseIdx)
{
// Use LBC method to calculate viscosity
// LhsEval mu = LBCviscosity::LBCmod(fluidState, paramCache, phaseIdx);
// LhsEval mu = LBCviscosity::LBC(fluidState, paramCache, phaseIdx);
LhsEval mu;
mu = LBCviscosity::LBCmod(fluidState, paramCache, phaseIdx);
// mu = LBCviscosity::LBCmod(fluidState, paramCache, phaseIdx);
// mu = LBCviscosity::LBC(fluidState, paramCache, phaseIdx);
mu = LBCviscosity::LBCJulia(fluidState, paramCache, phaseIdx);
// LhsEval mu = LBCviscosity::LBCJulia(fluidState, paramCache, phaseIdx);
return mu;
}
@ -180,11 +178,8 @@ namespace Opm {
assert(0 <= phaseIdx && phaseIdx < numPhases);
assert(0 <= compIdx && compIdx < numComponents);
// TODO: here the derivatives for the phi are dropped. Should we keep the derivatives against the pressure
// and temperature?
LhsEval phi = PengRobinsonMixture::computeFugacityCoefficient(fluidState, paramCache, phaseIdx, compIdx);
//Scalar phi = Opm::getValue(
// PengRobinsonMixture::computeFugacityCoefficient(fluidState, paramCache, phaseIdx, compIdx));
return phi;
}

View File

@ -29,9 +29,7 @@
#include <cassert>
#include <opm/material/components/H2O.hpp>
#include <opm/material/fluidsystems/ParameterCacheBase.hpp>
#include <opm/material/eos/PengRobinson.hpp>
#include <opm/material/eos/PengRobinsonParamsMixture.hpp>

View File

@ -9,7 +9,7 @@
// TODO: this is something else need to check
#include <opm/material/fluidsystems/PTFlashParameterCache.hpp>
#include <opm/material/fluidsystems/chifluid/LBCviscosity.hpp>
#include <opm/material/viscositymodels/LBCviscosity.hpp>
namespace Opm {
/*!
@ -170,13 +170,10 @@ namespace Opm {
unsigned phaseIdx)
{
// Use LBC method to calculate viscosity
// LhsEval mu = LBCviscosity::LBCmod(fluidState, paramCache, phaseIdx);
// LhsEval mu = LBCviscosity::LBC(fluidState, paramCache, phaseIdx);
LhsEval mu;
mu = LBCviscosity::LBCmod(fluidState, paramCache, phaseIdx);
// LhsEval mu = LBCviscosity::LBCJulia(fluidState, paramCache, phaseIdx);
return mu;
// mu = LBCviscosity::LBCmod(fluidState, paramCache, phaseIdx);
//mu = LBCviscosity::LBC(fluidState, paramCache, phaseIdx);
mu = LBCviscosity::LBCJulia(fluidState, paramCache, phaseIdx);
}