Merge pull request #555 from totto82/residualSaturations

Add methods for critial gas and gas in oil saturations
This commit is contained in:
Atgeirr Flø Rasmussen
2015-12-11 13:08:54 +01:00
5 changed files with 88 additions and 4 deletions
+39
View File
@@ -928,5 +928,44 @@ BlackoilPropsAdFromDeck::BlackoilPropsAdFromDeck(const BlackoilPropsAdFromDeck&
}
/// Obtain the scaled critical oil in gas saturation values.
/// \param[in] cells Array of cell indices.
/// \return Array of critical oil in gas saturaion values.
V BlackoilPropsAdFromDeck::scaledCriticalOilinGasSaturations(const Cells& cells) const {
assert(phaseUsage_.phase_used[BlackoilPhases::Gas]);
assert(phaseUsage_.phase_used[BlackoilPhases::Oil]);
const int n = cells.size();
V sogcr = V::Zero(n);
const MaterialLawManager& materialLawManager = satprops_->materialLawManager();
for (int i = 0; i < n; ++i) {
const auto& scaledDrainageInfo =
materialLawManager.oilWaterScaledEpsInfoDrainage(cells[i]);
sogcr[i] = scaledDrainageInfo.Sogcr;
}
return sogcr;
}
/// Obtain the scaled critical gas saturation values.
/// \param[in] cells Array of cell indices.
/// \return Array of scaled critical gas saturaion values.
V BlackoilPropsAdFromDeck::scaledCriticalGasSaturations(const Cells& cells) const {
assert(phaseUsage_.phase_used[BlackoilPhases::Gas]);
const int n = cells.size();
V sgcr = V::Zero(n);
const MaterialLawManager& materialLawManager = satprops_->materialLawManager();
for (int i = 0; i < n; ++i) {
const auto& scaledDrainageInfo =
materialLawManager.oilWaterScaledEpsInfoDrainage(cells[i]);
sgcr[i] = scaledDrainageInfo.Sgcr;
}
return sgcr;
}
} // namespace Opm
+10
View File
@@ -360,6 +360,16 @@ namespace Opm
void setSwatInitScaling(const std::vector<double>& saturation,
const std::vector<double>& pc);
/// Obtain the scaled critical oil in gas saturation values.
/// \param[in] cells Array of cell indices.
/// \return Array of critical oil in gas saturaion values.
V scaledCriticalOilinGasSaturations(const Cells& cells) const;
/// Obtain the scaled critical gas saturation values.
/// \param[in] cells Array of cell indices.
/// \return Array of scaled critical gas saturaion values.
V scaledCriticalGasSaturations(const Cells& cells) const;
private:
/// Initializes the properties.
+13
View File
@@ -253,6 +253,19 @@ namespace Opm
/// Update for max oil saturation.
virtual
void updateSatOilMax(const std::vector<double>& saturation) = 0;
/// Obtain the scaled critical oil in gas saturation values.
/// \param[in] cells Array of cell indices.
/// \return Array of critical oil in gas saturaion values.
virtual
V scaledCriticalOilinGasSaturations(const Cells& cells) const = 0;
/// Obtain the scaled critical gas saturation values.
/// \param[in] cells Array of cell indices.
/// \return Array of scaled critical gas saturaion values.
virtual
V scaledCriticalGasSaturations(const Cells& cells) const = 0;
};
} // namespace Opm
+13 -4
View File
@@ -55,13 +55,22 @@ PVDG
/
SWOF
0 0 1 0
1 1 0 0
0.12 0 1 0
0.15 0 1 0
0.17 0.01 1 0
0.2 0.5 0.5 0
0.96 0.9 0.1 0
0.98 0.95 0 0
1 1 0 0
/
SGOF
0 0 1 0
1 1 0 0
0 0 1.0 0
0.02 0 1.0 0
0.05 0.1 0.9 0
0.86 0.9 0.1 0
0.87 0.95 0 0
0.88 1.0 0 0
/
DENSITY
+13
View File
@@ -200,3 +200,16 @@ BOOST_FIXTURE_TEST_CASE(ViscosityAD, TestFixture<SetupSimple>)
BOOST_CHECK_EQUAL(AmuWat.value()[0], VmuWat[i]);
}
}
BOOST_FIXTURE_TEST_CASE(criticalSaturations, TestFixture<SetupSimple>)
{
const Opm::BlackoilPropsAdFromDeck::Cells cells(10, 0);
typedef Opm::BlackoilPropsAdFromDeck::V V;
V sgcr = boprops_ad.scaledCriticalGasSaturations(cells);
V sogcr = boprops_ad.scaledCriticalOilinGasSaturations(cells);
BOOST_CHECK_EQUAL(sgcr[0], 0.02);
BOOST_CHECK_EQUAL(sogcr[0], 0.13);
}