Use the start-of-timestep pore volume in transport solver.

This is to improve consistency with other solvers, and relates
to the expression that is converted into a finite difference when
discretising:
  (phi s) - (phi s)^0 = phi^0(s - s^0) + (phi - phi^0)s
                        ^^^^^
The above marks the spot where we now use phi^0 instead of phi.
This commit is contained in:
Atgeirr Flø Rasmussen 2012-08-23 14:58:32 +02:00
parent cf3511663c
commit def904c6d6

View File

@ -335,7 +335,7 @@ namespace Opm
computePorevolume(grid_, props_.porosity(), porevol);
}
const double tot_porevol_init = std::accumulate(porevol.begin(), porevol.end(), 0.0);
std::vector<double> initial_porevol = porevol;
// Main simulation loop.
Opm::time::StopWatch pressure_timer;
@ -452,6 +452,7 @@ namespace Opm
// Update pore volumes if rock is compressible.
if (rock_comp_ && rock_comp_->isActive()) {
initial_porevol = porevol;
computePorevolume(grid_, props_.porosity(), *rock_comp_, state.pressure(), porevol);
}
@ -467,11 +468,11 @@ namespace Opm
std::cout << "Making " << num_transport_substeps_ << " transport substeps." << std::endl;
}
for (int tr_substep = 0; tr_substep < num_transport_substeps_; ++tr_substep) {
tsolver_.solve(&state.faceflux()[0], &porevol[0], &transport_src[0],
tsolver_.solve(&state.faceflux()[0], &initial_porevol[0], &transport_src[0],
stepsize, state.saturation());
Opm::computeInjectedProduced(props_, state.saturation(), transport_src, stepsize, injected, produced);
if (use_segregation_split_) {
tsolver_.solveGravity(columns_, &porevol[0], stepsize, state.saturation());
tsolver_.solveGravity(columns_, &initial_porevol[0], stepsize, state.saturation());
}
}
transport_timer.stop();