Added AdHocProps and changed defaults to reproduce matlab case, bugfix.

This commit is contained in:
Atgeirr Flø Rasmussen 2012-02-09 09:39:43 +01:00
parent 094ede0855
commit 4a5c3d704d

View File

@ -26,6 +26,7 @@
#include <opm/core/pressure/tpfa/trans_tpfa.h>
#include <opm/core/utility/cart_grid.h>
#include <opm/core/utility/linearInterpolation.hpp>
#include <opm/core/utility/ErrorMacros.hpp>
#include <opm/core/utility/StopWatch.hpp>
#include <opm/core/utility/Units.hpp>
@ -60,7 +61,58 @@
class AdHocProps : public Opm::IncompPropertiesBasic
{
public:
AdHocProps(const Opm::parameter::ParameterGroup& param, int dim, int num_cells)
: Opm::IncompPropertiesBasic(param, dim, num_cells)
{
ASSERT(numPhases() == 2);
sw_.resize(3);
sw_[0] = 0.2;
sw_[1] = 0.7;
sw_[2] = 1.0;
krw_.resize(3);
krw_[0] = 0.0;
krw_[1] = 0.7;
krw_[2] = 1.0;
so_.resize(2);
so_[0] = 0.3;
so_[1] = 0.8;
kro_.resize(2);
kro_[0] = 0.0;
kro_[1] = 1.0;
}
virtual void relperm(const int n,
const double* s,
const int* /*cells*/,
double* kr,
double* dkrds) const
{
ASSERT(dkrds == 0);
for (int i = 0; i < n; ++i) {
kr[2*i] = krw(s[2*i]);
kr[2*i+1] = kro(s[2*i+1]);
}
}
private:
double krw(double s) const
{
return Opm::linearInterpolation(sw_, krw_, s);
}
double kro(double s) const
{
return Opm::linearInterpolation(so_, kro_, s);
}
std::vector<double> sw_;
std::vector<double> krw_;
std::vector<double> so_;
std::vector<double> kro_;
};
class ReservoirState
@ -111,9 +163,9 @@ private:
double polymerInflowAtTime(double time)
{
if (time >= 300.0*Opm::unit::day && time < 800.0*Opm::unit::day) {
return 5.0;
return 5.0;
} else {
return 0.0;
return 0.0;
}
}
@ -203,7 +255,8 @@ main(int argc, char** argv)
const int dz = param.getDefault("dz", 1.0);
grid.reset(new Opm::Grid(nx, ny, nz, dx, dy, dz));
// Rock and fluid init.
props.reset(new Opm::IncompPropertiesBasic(param, grid->c_grid()->dimensions, grid->c_grid()->number_of_cells));
// props.reset(new Opm::IncompPropertiesBasic(param, grid->c_grid()->dimensions, grid->c_grid()->number_of_cells));
props.reset(new AdHocProps(param, grid->c_grid()->dimensions, grid->c_grid()->number_of_cells));
// Setting polydata defaults to mimic a simple example case.
polydata.c_max_limit = param.getDefault("c_max_limit", 5.0);
polydata.omega = param.getDefault("omega", 1.0);
@ -211,7 +264,7 @@ main(int argc, char** argv)
polydata.dps = param.getDefault("dead_pore_space", 0.15);
polydata.c_vals_visc.resize(2);
polydata.c_vals_visc[0] = 0.0;
polydata.c_vals_visc[0] = 7.0;
polydata.c_vals_visc[1] = 7.0;
polydata.visc_mult_vals.resize(2);
polydata.visc_mult_vals[0] = 1.0;
// polydata.visc_mult_vals[1] = param.getDefault("c_max_viscmult", 30.0);