SWATINIT: Initialisation and capillary pressure scaling.

This commit is contained in:
osae
2014-06-10 14:02:22 +02:00
parent 45e35178bb
commit a9138ef574
10 changed files with 141 additions and 18 deletions

View File

@@ -239,5 +239,16 @@ namespace Opm
}
/// Update capillary pressure scaling according to pressure diff. and initial water saturation.
/// \param[in] cell Cell index.
/// \param[in] pcow P_oil - P_water.
/// \param[in/out] swat Water saturation. / Possibly modified Water saturation.
void BlackoilPropertiesBasic::swatInitScaling(const int cell,
const double pcow,
double & swat)
{
OPM_THROW(std::runtime_error, "BlackoilPropertiesBasic::swatInitScaling() -- not implemented.");
}
} // namespace Opm

View File

@@ -163,9 +163,9 @@ namespace Opm
double* dpcds) const;
/// Obtain the range of allowable saturation values.
/// In cell cells[i], saturation of phase p is allowed to be
/// in the interval [smin[i*P + p], smax[i*P + p]].
/// Obtain the range of allowable saturation values.
/// In cell cells[i], saturation of phase p is allowed to be
/// in the interval [smin[i*P + p], smax[i*P + p]].
/// \param[in] n Number of data points.
/// \param[in] cells Array of n cell indices.
/// \param[out] smin Array of nP minimum s values, array must be valid before calling.
@@ -175,6 +175,16 @@ namespace Opm
double* smin,
double* smax) const;
/// Update capillary pressure scaling according to pressure diff. and initial water saturation.
/// \param[in] cell Cell index.
/// \param[in] pcow P_oil - P_water.
/// \param[in/out] swat Water saturation. / Possibly modified Water saturation.
virtual void swatInitScaling(const int cell,
const double pcow,
double & swat);
private:
RockBasic rock_;
PvtPropertiesBasic pvt_;

View File

@@ -303,7 +303,18 @@ namespace Opm
{
satprops_->satRange(n, cells, smin, smax);
}
/// Update capillary pressure scaling according to pressure diff. and initial water saturation.
/// \param[in] cell Cell index.
/// \param[in] pcow P_oil - P_water.
/// \param[in/out] swat Water saturation. / Possibly modified Water saturation.
void BlackoilPropertiesFromDeck::swatInitScaling(const int cell,
const double pcow,
double & swat)
{
satprops_->swatInitScaling(cell, pcow, swat);
}
} // namespace Opm

View File

@@ -215,6 +215,15 @@ namespace Opm
const int* cells,
double* smin,
double* smax) const;
/// Update capillary pressure scaling according to pressure diff. and initial water saturation.
/// \param[in] cell Cell index.
/// \param[in] pcow P_oil - P_water.
/// \param[in/out] swat Water saturation. / Possibly modified Water saturation.
virtual void swatInitScaling(const int cell,
const double pcow,
double & swat);
private:
int getTableIndex_(const int* pvtTableIdx, int cellIdx) const

View File

@@ -160,6 +160,16 @@ namespace Opm
const int* cells,
double* smin,
double* smax) const = 0;
/// Update capillary pressure scaling according to pressure diff. and initial water saturation.
/// \param[in] cell Cell index.
/// \param[in] pcow P_oil - P_water.
/// \param[in/out] swat Water saturation. / Possibly modified Water saturation.
virtual void swatInitScaling(const int cell,
const double pcow,
double & swat) = 0;
};

View File

@@ -124,7 +124,7 @@ namespace Opm
const int* cells,
double* smin,
double* smax) const;
/// Update saturation state for the hysteresis tracking
/// \param[in] n Number of data points.
/// \param[in] s Array of nP saturation values.
@@ -132,6 +132,14 @@ namespace Opm
const int* cells,
const double* s);
/// Update capillary pressure scaling according to pressure diff. and initial water saturation.
/// \param[in] cell Cell index.
/// \param[in] pcow P_oil - P_water.
/// \param[in/out] swat Water saturation. / Possibly modified Water saturation.
void swatInitScaling(const int cell,
const double pcow,
double & swat);
private:
PhaseUsage phase_usage_;
std::vector<SatFuncSet> satfuncset_;

View File

@@ -412,6 +412,39 @@ namespace Opm
}
}
/// Update capillary pressure scaling according to pressure diff. and initial water saturation.
/// \param[in] cell Cell index.
/// \param[in] pcow P_oil - P_water.
/// \param[in/out] swat Water saturation. / Possibly modified Water saturation.
template <class SatFuncSet>
void SaturationPropsFromDeck<SatFuncSet>::swatInitScaling(const int cell,
const double pcow,
double & swat)
{
if (phase_usage_.phase_used[Aqua]) {
// TODO: Mixed wettability systems - see ecl kw OPTIONS switch 74
if (swat <= eps_transf_[cell].wat.smin) {
swat = eps_transf_[cell].wat.smin;
} else if (pcow < 1.0e-8) {
swat = eps_transf_[cell].wat.smax;
} else {
const int wpos = phase_usage_.phase_pos[BlackoilPhases::Aqua];
const int np = phase_usage_.num_phases;
double s[np];
s[wpos] = swat;
double pc[np];
funcForCell(cell).evalPc(s, pc, &(eps_transf_[cell]));
if (pc[wpos] > 1.0e-8) {
eps_transf_[cell].wat.pcFactor *= pcow/pc[wpos];
}
}
} else {
OPM_THROW(std::runtime_error, "swatInitScaling: no water phase! ");
}
}
// Map the cell number to the correct function set.
template <class SatFuncSet>
const typename SaturationPropsFromDeck<SatFuncSet>::Funcs&

View File

@@ -80,7 +80,14 @@ namespace Opm
virtual void updateSatHyst(const int n,
const int* cells,
const double* s) = 0;
/// Update capillary pressure scaling according to pressure diff. and initial water saturation.
/// \param[in] cell Cell index.
/// \param[in] pcow P_oil - P_water.
/// \param[in/out] swat Water saturation. / Possibly modified Water saturation.
virtual void swatInitScaling(const int cell,
const double pcow,
double & swat) = 0;
};