Merge pull request #51 from andlaus/blackoil_fixes

Blackoil fixes
This commit is contained in:
Andreas Lauser 2015-09-01 16:07:00 +02:00
commit 327c8a306d
2 changed files with 14 additions and 13 deletions

View File

@ -87,10 +87,10 @@ public:
//! \copydoc BaseFluidSystem::numPhases
static const int numPhases = 3;
//! Index of the oil phase
static const int oilPhaseIdx = 0;
//! Index of the water phase
static const int waterPhaseIdx = 1;
static const int waterPhaseIdx = 0;
//! Index of the oil phase
static const int oilPhaseIdx = 1;
//! Index of the gas phase
static const int gasPhaseIdx = 2;
@ -220,7 +220,7 @@ public:
//! \copydoc BaseFluidSystem::phaseName
static const char *phaseName(const int phaseIdx)
{
static const char *name[] = { "oil", "water", "gas" };
static const char *name[] = { "water", "oil", "gas" };
assert(0 <= phaseIdx && phaseIdx < numPhases + 1);
return name[phaseIdx];
@ -250,7 +250,7 @@ public:
//! \copydoc BaseFluidSystem::componentName
static const char *componentName(int compIdx)
{
static const char *name[] = { "O", "W", "G" };
static const char *name[] = { "Oil", "Water", "Gas" };
assert(0 <= compIdx && compIdx < numComponents);
return name[compIdx];

View File

@ -344,8 +344,8 @@ private:
{
const LhsEval& Rv =
XgO/(1 - XgO)
* (BlackOilFluidSystem::referenceDensity(oilPhaseIdx, regionIdx)
/ BlackOilFluidSystem::referenceDensity(gasPhaseIdx, regionIdx));
* (BlackOilFluidSystem::referenceDensity(gasPhaseIdx, regionIdx)
/ BlackOilFluidSystem::referenceDensity(oilPhaseIdx, regionIdx));
const LhsEval& invBg = inverseGasB_[regionIdx].eval(pressure, Rv, /*extrapolate=*/true);
const LhsEval& invMugBg = inverseGasBMu_[regionIdx].eval(pressure, Rv, /*extrapolate=*/true);
@ -366,15 +366,16 @@ private:
Scalar rhogRef = BlackOilFluidSystem::referenceDensity(gasPhaseIdx, regionIdx);
const LhsEval& Bg = formationVolumeFactor_(regionIdx, temperature, pressure, XgO);
LhsEval rhoo = rhooRef/Bg;
LhsEval rhog = rhogRef/Bg;
// the oil formation volume factor just represents the partial density of the gas
// component in the gas phase. to get the total density of the phase, we have to
// add the partial density of the oil component.
const LhsEval& Rv = XgO/(1 - XgO) * (rhooRef/rhogRef);
rhoo += (rhogRef*Rv)/Bg;
const LhsEval& Rv = XgO/(1 - XgO) * (rhogRef/rhooRef);
rhog += (rhogRef*Rv)/Bg;
return rhoo;
return rhog;
}
/*!
@ -388,8 +389,8 @@ private:
{
const LhsEval& Rv =
XgO/(1-XgO)
*BlackOilFluidSystem::referenceDensity(oilPhaseIdx, regionIdx)
/BlackOilFluidSystem::referenceDensity(gasPhaseIdx, regionIdx);
*(BlackOilFluidSystem::referenceDensity(gasPhaseIdx, regionIdx)
/BlackOilFluidSystem::referenceDensity(oilPhaseIdx, regionIdx));
return 1.0 / inverseGasB_[regionIdx].eval(pressure, Rv, /*extrapolate=*/true);
}