Fixed renormalization conditions.

This commit is contained in:
Atgeirr Flø Rasmussen 2012-08-23 14:05:28 +02:00
parent 70d33843e4
commit 4cdb2a43a3

View File

@ -17,7 +17,6 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>. along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/ */
#if HAVE_CONFIG_H #if HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif // HAVE_CONFIG_H #endif // HAVE_CONFIG_H
@ -153,7 +152,7 @@ namespace Opm
catch (...) { catch (...) {
THROW("Creating directories failed: " << fpath); THROW("Creating directories failed: " << fpath);
} }
vtkfilename << "/" << std::setw(3) << std::setfill('0') << step << ".vtu"; vtkfilename << "/output-" << std::setw(3) << std::setfill('0') << step << ".vtu";
std::ofstream vtkfile(vtkfilename.str().c_str()); std::ofstream vtkfile(vtkfilename.str().c_str());
if (!vtkfile) { if (!vtkfile) {
THROW("Failed to open " << vtkfilename.str()); THROW("Failed to open " << vtkfilename.str());
@ -228,36 +227,6 @@ namespace Opm
} }
static bool allNeumannBCs(const FlowBoundaryConditions* bcs)
{
if (bcs == NULL) {
return true;
} else {
return std::find(bcs->type, bcs->type + bcs->nbc, BC_PRESSURE)
== bcs->type + bcs->nbc;
}
}
static bool allRateWells(const Wells* wells)
{
if (wells == NULL) {
return true;
}
const int nw = wells->number_of_wells;
for (int w = 0; w < nw; ++w) {
const WellControls* wc = wells->ctrls[w];
if (wc->current >= 0) {
if (wc->type[wc->current] == BHP) {
return false;
}
}
}
return true;
}
// \TODO: make CompressibleTpfa take src and bcs. // \TODO: make CompressibleTpfa take src and bcs.
SimulatorCompressibleTwophase::Impl::Impl(const parameter::ParameterGroup& param, SimulatorCompressibleTwophase::Impl::Impl(const parameter::ParameterGroup& param,
@ -402,12 +371,12 @@ namespace Opm
std::vector<double> initial_pressure = state.pressure(); std::vector<double> initial_pressure = state.pressure();
psolver_.solve(timer.currentStepLength(), state, well_state); psolver_.solve(timer.currentStepLength(), state, well_state);
// Renormalize pressure if rock is incompressible, and // Renormalize pressure if both fluids and rock are
// there are no pressure conditions (bcs or wells). // incompressible, and there are no pressure
// It is deemed sufficient for now to renormalize // conditions (bcs or wells). It is deemed sufficient
// using geometric volume instead of pore volume. // for now to renormalize using geometric volume
if ((rock_comp_ == NULL || !rock_comp_->isActive()) // instead of pore volume.
&& allNeumannBCs(bcs_) && allRateWells(wells_)) { if (psolver_.singularPressure()) {
// Compute average pressures of previous and last // Compute average pressures of previous and last
// step, and total volume. // step, and total volume.
double av_prev_press = 0.0; double av_prev_press = 0.0;