Make all codes use the same linear interpolation routines.
This commit is contained in:
1 parent
dcf88207e3
commit
a8097317a5
6 files changed
+44
-54
No files matched your search
@@ -37,8 +37,8 @@
|
||||
namespace Opm
|
||||
{
|
||||
|
||||
using Opm::linearInterpolationExtrap;
|
||||
using Opm::linearInterpolDerivative;
|
||||
using Opm::linearInterpolation;
|
||||
using Opm::linearInterpolationDerivative;
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Member functions
|
||||
@@ -184,7 +184,7 @@ namespace Opm
|
||||
// To handle no-gas case.
|
||||
return 0.0;
|
||||
}
|
||||
double satR = linearInterpolationExtrap(saturated_gas_table_[0],
|
||||
double satR = linearInterpolation(saturated_gas_table_[0],
|
||||
saturated_gas_table_[3], press);
|
||||
double maxR = surfvol[phase_pos_[Liquid]]/surfvol[phase_pos_[Vapour]];
|
||||
if (satR < maxR ) {
|
||||
@@ -205,13 +205,13 @@ namespace Opm
|
||||
dRdpval = 0.0;
|
||||
return;
|
||||
}
|
||||
double satR = linearInterpolationExtrap(saturated_gas_table_[0],
|
||||
double satR = linearInterpolation(saturated_gas_table_[0],
|
||||
saturated_gas_table_[3], press);
|
||||
double maxR = surfvol[phase_pos_[Liquid]]/surfvol[phase_pos_[Vapour]];
|
||||
if (satR < maxR ) {
|
||||
// Saturated case
|
||||
Rval = satR;
|
||||
dRdpval = linearInterpolDerivative(saturated_gas_table_[0],
|
||||
dRdpval = linearInterpolationDerivative(saturated_gas_table_[0],
|
||||
saturated_gas_table_[3],
|
||||
press);
|
||||
} else {
|
||||
@@ -227,13 +227,13 @@ namespace Opm
|
||||
const bool deriv) const
|
||||
{
|
||||
int section;
|
||||
double Rval = linearInterpolationExtrap(saturated_gas_table_[0],
|
||||
double Rval = linearInterpolation(saturated_gas_table_[0],
|
||||
saturated_gas_table_[3], press,
|
||||
section);
|
||||
double maxR = surfvol[phase_pos_[Liquid]]/surfvol[phase_pos_[Vapour]];
|
||||
if (deriv) {
|
||||
if (Rval < maxR ) { // Saturated case
|
||||
return linearInterpolDerivative(saturated_gas_table_[0],
|
||||
return linearInterpolationDerivative(saturated_gas_table_[0],
|
||||
saturated_gas_table_[item],
|
||||
press);
|
||||
} else { // Undersaturated case
|
||||
@@ -246,11 +246,11 @@ namespace Opm
|
||||
return val;
|
||||
}
|
||||
double val1 =
|
||||
linearInterpolationExtrap(undersat_gas_tables_[is][0],
|
||||
linearInterpolation(undersat_gas_tables_[is][0],
|
||||
undersat_gas_tables_[is][item],
|
||||
maxR);
|
||||
double val2 =
|
||||
linearInterpolationExtrap(undersat_gas_tables_[is+1][0],
|
||||
linearInterpolation(undersat_gas_tables_[is+1][0],
|
||||
undersat_gas_tables_[is+1][item],
|
||||
maxR);
|
||||
double val = (val2 - val1)/
|
||||
@@ -259,14 +259,14 @@ namespace Opm
|
||||
}
|
||||
} else {
|
||||
if (Rval < maxR ) { // Saturated case
|
||||
return linearInterpolationExtrap(saturated_gas_table_[0],
|
||||
return linearInterpolation(saturated_gas_table_[0],
|
||||
saturated_gas_table_[item],
|
||||
press);
|
||||
} else { // Undersaturated case
|
||||
int is = section;
|
||||
// Extrapolate from first table section
|
||||
if (is == 0 && press < saturated_gas_table_[0][0]) {
|
||||
return linearInterpolationExtrap(undersat_gas_tables_[0][0],
|
||||
return linearInterpolation(undersat_gas_tables_[0][0],
|
||||
undersat_gas_tables_[0][item],
|
||||
maxR);
|
||||
}
|
||||
@@ -274,7 +274,7 @@ namespace Opm
|
||||
// Extrapolate from last table section
|
||||
int ltp = saturated_gas_table_[0].size() - 1;
|
||||
if (is+1 == ltp && press > saturated_gas_table_[0][ltp]) {
|
||||
return linearInterpolationExtrap(undersat_gas_tables_[ltp][0],
|
||||
return linearInterpolation(undersat_gas_tables_[ltp][0],
|
||||
undersat_gas_tables_[ltp][item],
|
||||
maxR);
|
||||
}
|
||||
@@ -290,11 +290,11 @@ namespace Opm
|
||||
return val;
|
||||
}
|
||||
double val1 =
|
||||
linearInterpolationExtrap(undersat_gas_tables_[is][0],
|
||||
linearInterpolation(undersat_gas_tables_[is][0],
|
||||
undersat_gas_tables_[is][item],
|
||||
maxR);
|
||||
double val2 =
|
||||
linearInterpolationExtrap(undersat_gas_tables_[is+1][0],
|
||||
linearInterpolation(undersat_gas_tables_[is+1][0],
|
||||
undersat_gas_tables_[is+1][item],
|
||||
maxR);
|
||||
double val = val1 + w*(val2 - val1);
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
namespace Opm
|
||||
{
|
||||
|
||||
using Opm::linearInterpolationExtrap;
|
||||
using Opm::linearInterpolDerivative;
|
||||
using Opm::linearInterpolation;
|
||||
using Opm::linearInterpolationDerivative;
|
||||
using Opm::tableIndex;
|
||||
|
||||
|
||||
@@ -254,7 +254,7 @@ namespace Opm
|
||||
if (surfvol[phase_pos_[Vapour]] == 0.0) {
|
||||
return 0.0;
|
||||
}
|
||||
double Rval = linearInterpolationExtrap(saturated_oil_table_[0],
|
||||
double Rval = linearInterpolation(saturated_oil_table_[0],
|
||||
saturated_oil_table_[3], press);
|
||||
double maxR = surfvol[phase_pos_[Vapour]]/surfvol[phase_pos_[Liquid]];
|
||||
if (Rval < maxR ) { // Saturated case
|
||||
@@ -272,12 +272,12 @@ namespace Opm
|
||||
dRdpval = 0.0;
|
||||
return;
|
||||
}
|
||||
Rval = linearInterpolationExtrap(saturated_oil_table_[0],
|
||||
Rval = linearInterpolation(saturated_oil_table_[0],
|
||||
saturated_oil_table_[3], press);
|
||||
double maxR = surfvol[phase_pos_[Vapour]]/surfvol[phase_pos_[Liquid]];
|
||||
if (Rval < maxR ) {
|
||||
// Saturated case
|
||||
dRdpval = linearInterpolDerivative(saturated_oil_table_[0],
|
||||
dRdpval = linearInterpolationDerivative(saturated_oil_table_[0],
|
||||
saturated_oil_table_[3],
|
||||
press);
|
||||
} else {
|
||||
@@ -294,13 +294,13 @@ namespace Opm
|
||||
const bool deriv) const
|
||||
{
|
||||
int section;
|
||||
double Rval = linearInterpolationExtrap(saturated_oil_table_[0],
|
||||
double Rval = linearInterpolation(saturated_oil_table_[0],
|
||||
saturated_oil_table_[3],
|
||||
press, section);
|
||||
double maxR = (surfvol[phase_pos_[Liquid]] == 0.0) ? 0.0 : surfvol[phase_pos_[Vapour]]/surfvol[phase_pos_[Liquid]];
|
||||
if (deriv) {
|
||||
if (Rval < maxR ) { // Saturated case
|
||||
return linearInterpolDerivative(saturated_oil_table_[0],
|
||||
return linearInterpolationDerivative(saturated_oil_table_[0],
|
||||
saturated_oil_table_[item],
|
||||
press);
|
||||
} else { // Undersaturated case
|
||||
@@ -310,11 +310,11 @@ namespace Opm
|
||||
ASSERT(undersat_oil_tables_[is][0].size() >= 2);
|
||||
ASSERT(undersat_oil_tables_[is+1][0].size() >= 2);
|
||||
double val1 =
|
||||
linearInterpolDerivative(undersat_oil_tables_[is][0],
|
||||
linearInterpolationDerivative(undersat_oil_tables_[is][0],
|
||||
undersat_oil_tables_[is][item],
|
||||
press);
|
||||
double val2 =
|
||||
linearInterpolDerivative(undersat_oil_tables_[is+1][0],
|
||||
linearInterpolationDerivative(undersat_oil_tables_[is+1][0],
|
||||
undersat_oil_tables_[is+1][item],
|
||||
press);
|
||||
double val = val1 + w*(val2 - val1);
|
||||
@@ -322,7 +322,7 @@ namespace Opm
|
||||
}
|
||||
} else {
|
||||
if (Rval < maxR ) { // Saturated case
|
||||
return linearInterpolationExtrap(saturated_oil_table_[0],
|
||||
return linearInterpolation(saturated_oil_table_[0],
|
||||
saturated_oil_table_[item],
|
||||
press);
|
||||
} else { // Undersaturated case
|
||||
@@ -333,11 +333,11 @@ namespace Opm
|
||||
ASSERT(undersat_oil_tables_[is][0].size() >= 2);
|
||||
ASSERT(undersat_oil_tables_[is+1][0].size() >= 2);
|
||||
double val1 =
|
||||
linearInterpolationExtrap(undersat_oil_tables_[is][0],
|
||||
linearInterpolation(undersat_oil_tables_[is][0],
|
||||
undersat_oil_tables_[is][item],
|
||||
press);
|
||||
double val2 =
|
||||
linearInterpolationExtrap(undersat_oil_tables_[is+1][0],
|
||||
linearInterpolation(undersat_oil_tables_[is+1][0],
|
||||
undersat_oil_tables_[is+1][item],
|
||||
press);
|
||||
double val = val1 + w*(val2 - val1);
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace Opm
|
||||
return (1.0 + cpnorm + 0.5*cpnorm*cpnorm);
|
||||
} else {
|
||||
// return Opm::linearInterpolation(p_, poromult_, pressure);
|
||||
return Opm::linearInterpolationExtrap(p_, poromult_, pressure);
|
||||
return Opm::linearInterpolation(p_, poromult_, pressure);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,8 +81,8 @@ namespace Opm
|
||||
} else {
|
||||
//const double poromult = Opm::linearInterpolation(p_, poromult_, pressure);
|
||||
//const double dporomultdp = Opm::linearInterpolationDerivative(p_, poromult_, pressure);
|
||||
const double poromult = Opm::linearInterpolationExtrap(p_, poromult_, pressure);
|
||||
const double dporomultdp = Opm::linearInterpolationDerivativeExtrap(p_, poromult_, pressure);
|
||||
const double poromult = Opm::linearInterpolation(p_, poromult_, pressure);
|
||||
const double dporomultdp = Opm::linearInterpolationDerivative(p_, poromult_, pressure);
|
||||
|
||||
return dporomultdp/poromult;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user