Fix initialization bug.

This commit is contained in:
Xavier Raynaud 2012-08-20 15:18:24 +02:00
parent f15a6e03f0
commit 9e480cd997
2 changed files with 3 additions and 10 deletions

View File

@ -228,16 +228,8 @@ main(int argc, char** argv)
}
}
bool use_segregation_split = false;
bool use_column_solver = false;
bool use_gauss_seidel_gravity = false;
if (use_gravity) {
use_segregation_split = param.getDefault("use_segregation_split", use_segregation_split);
if (use_segregation_split) {
use_column_solver = param.getDefault("use_column_solver", use_column_solver);
if (use_column_solver) {
use_gauss_seidel_gravity = param.getDefault("use_gauss_seidel_gravity", use_gauss_seidel_gravity);
}
}
}
// Source-related variables init.
@ -287,13 +279,13 @@ main(int argc, char** argv)
const double nl_tolerance = param.getDefault("nl_tolerance", 1e-9);
const int nl_maxiter = param.getDefault("nl_maxiter", 30);
Opm::TransportModelCompressibleTwophase reorder_model(*grid->c_grid(), *props, nl_tolerance, nl_maxiter);
if (use_gauss_seidel_gravity) {
if (use_segregation_split) {
reorder_model.initGravity();
}
// Column-based gravity segregation solver.
std::vector<std::vector<int> > columns;
if (use_column_solver) {
if (use_segregation_split) {
Opm::extractColumn(*grid->c_grid(), columns);
}

View File

@ -381,6 +381,7 @@ namespace Opm
std::vector<double> htrans(grid_.cell_facepos[grid_.number_of_cells]);
const int nf = grid_.number_of_faces;
trans_.resize(nf);
gravflux_.resize(nf);
tpfa_htrans_compute(const_cast<UnstructuredGrid*>(&grid_), props_.permeability(), &htrans[0]);
tpfa_trans_compute(const_cast<UnstructuredGrid*>(&grid_), &htrans[0], &trans_[0]);
}