Adapt to changed computePorevolume() interface.

This commit is contained in:
Atgeirr Flø Rasmussen
2012-05-14 21:53:36 +02:00
parent cc2010c1d4
commit 26fc6a335a

View File

@@ -136,6 +136,8 @@ static void outputWellReport(const Opm::WellReport& wellreport,
int int
main(int argc, char** argv) main(int argc, char** argv)
{ {
using namespace Opm;
std::cout << "\n================ Test program for weakly compressible two-phase flow ===============\n\n"; std::cout << "\n================ Test program for weakly compressible two-phase flow ===============\n\n";
Opm::parameter::ParameterGroup param(argc, argv, false); Opm::parameter::ParameterGroup param(argc, argv, false);
std::cout << "--------------- Reading parameters ---------------" << std::endl; std::cout << "--------------- Reading parameters ---------------" << std::endl;
@@ -230,7 +232,7 @@ main(int argc, char** argv)
// Warn if gravity but no density difference. // Warn if gravity but no density difference.
bool use_gravity = (gravity[0] != 0.0 || gravity[1] != 0.0 || gravity[2] != 0.0); bool use_gravity = (gravity[0] != 0.0 || gravity[1] != 0.0 || gravity[2] != 0.0);
if (use_gravity) { if (use_gravity) {
if (props->density()[0] == props->density()[1]) { if (props->surfaceDensity()[0] == props->surfaceDensity()[1]) {
std::cout << "**** Warning: nonzero gravity, but zero density difference." << std::endl; std::cout << "**** Warning: nonzero gravity, but zero density difference." << std::endl;
} }
} }
@@ -268,9 +270,9 @@ main(int argc, char** argv)
// Extra rock init. // Extra rock init.
std::vector<double> porevol; std::vector<double> porevol;
if (rock_comp->isActive()) { if (rock_comp->isActive()) {
computePorevolume(*grid->c_grid(), *props, *rock_comp, state.pressure(), porevol); computePorevolume(*grid->c_grid(), props->porosity(), *rock_comp, state.pressure(), porevol);
} else { } else {
computePorevolume(*grid->c_grid(), *props, porevol); computePorevolume(*grid->c_grid(), props->porosity(), porevol);
} }
double tot_porevol_init = std::accumulate(porevol.begin(), porevol.end(), 0.0); double tot_porevol_init = std::accumulate(porevol.begin(), porevol.end(), 0.0);
@@ -398,7 +400,7 @@ main(int argc, char** argv)
rc.resize(num_cells); rc.resize(num_cells);
std::vector<double> initial_pressure = state.pressure(); std::vector<double> initial_pressure = state.pressure();
std::vector<double> initial_porevolume(num_cells); std::vector<double> initial_porevolume(num_cells);
computePorevolume(*grid->c_grid(), *props, *rock_comp, initial_pressure, initial_porevolume); computePorevolume(*grid->c_grid(), props->porosity(), *rock_comp, initial_pressure, initial_porevolume);
std::vector<double> pressure_increment(num_cells + num_wells); std::vector<double> pressure_increment(num_cells + num_wells);
std::vector<double> prev_pressure(num_cells + num_wells); std::vector<double> prev_pressure(num_cells + num_wells);
for (int iter = 0; iter < nl_pressure_maxiter; ++iter) { for (int iter = 0; iter < nl_pressure_maxiter; ++iter) {
@@ -406,7 +408,7 @@ main(int argc, char** argv)
for (int cell = 0; cell < num_cells; ++cell) { for (int cell = 0; cell < num_cells; ++cell) {
rc[cell] = rock_comp->rockComp(state.pressure()[cell]); rc[cell] = rock_comp->rockComp(state.pressure()[cell]);
} }
computePorevolume(*grid->c_grid(), *props, *rock_comp, state.pressure(), porevol); computePorevolume(*grid->c_grid(), props->porosity(), *rock_comp, state.pressure(), porevol);
std::copy(state.pressure().begin(), state.pressure().end(), prev_pressure.begin()); std::copy(state.pressure().begin(), state.pressure().end(), prev_pressure.begin());
std::copy(well_bhp.begin(), well_bhp.end(), prev_pressure.begin() + num_cells); std::copy(well_bhp.begin(), well_bhp.end(), prev_pressure.begin() + num_cells);
// prev_pressure = state.pressure(); // prev_pressure = state.pressure();