mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
added writing of reorder iterations for each cell
This commit is contained in:
parent
50ff22141d
commit
5743225be2
@ -52,6 +52,7 @@ namespace Opm
|
|||||||
source_(0),
|
source_(0),
|
||||||
dt_(0.0),
|
dt_(0.0),
|
||||||
saturation_(grid.number_of_cells, -1.0),
|
saturation_(grid.number_of_cells, -1.0),
|
||||||
|
reorder_iterations_(grid.number_of_cells, 0),
|
||||||
fractionalflow_(grid.number_of_cells, -1.0),
|
fractionalflow_(grid.number_of_cells, -1.0),
|
||||||
mob_(2*grid.number_of_cells, -1.0)
|
mob_(2*grid.number_of_cells, -1.0)
|
||||||
#ifdef EXPERIMENT_GAUSS_SEIDEL
|
#ifdef EXPERIMENT_GAUSS_SEIDEL
|
||||||
@ -101,7 +102,7 @@ namespace Opm
|
|||||||
&seq[0], &comp[0], &ncomp,
|
&seq[0], &comp[0], &ncomp,
|
||||||
&ia_downw_[0], &ja_downw_[0]);
|
&ia_downw_[0], &ja_downw_[0]);
|
||||||
#endif
|
#endif
|
||||||
|
std::fill(reorder_iterations_.begin(),reorder_iterations_.end(),0);
|
||||||
reorderAndTransport(grid_, darcyflux);
|
reorderAndTransport(grid_, darcyflux);
|
||||||
toBothSat(saturation_, saturation);
|
toBothSat(saturation_, saturation);
|
||||||
}
|
}
|
||||||
@ -170,9 +171,11 @@ namespace Opm
|
|||||||
// if (std::fabs(r0) < tol_) {
|
// if (std::fabs(r0) < tol_) {
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
int iters_used;
|
int iters_used=0;
|
||||||
// saturation_[cell] = modifiedRegulaFalsi(res, smin_[2*cell], smax_[2*cell], maxit_, tol_, iters_used);
|
// saturation_[cell] = modifiedRegulaFalsi(res, smin_[2*cell], smax_[2*cell], maxit_, tol_, iters_used);
|
||||||
saturation_[cell] = RootFinder::solve(res, saturation_[cell], 0.0, 1.0, maxit_, tol_, iters_used);
|
saturation_[cell] = RootFinder::solve(res, saturation_[cell], 0.0, 1.0, maxit_, tol_, iters_used);
|
||||||
|
// add if it is iteration on an out loop
|
||||||
|
reorder_iterations_[cell] = reorder_iterations_[cell] + iters_used;
|
||||||
fractionalflow_[cell] = fracFlow(saturation_[cell], cell);
|
fractionalflow_[cell] = fracFlow(saturation_[cell], cell);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -544,8 +547,9 @@ namespace Opm
|
|||||||
const int cell = cells[pos];
|
const int cell = cells[pos];
|
||||||
GravityResidual res(*this, cells, pos, gravflux);
|
GravityResidual res(*this, cells, pos, gravflux);
|
||||||
if (std::fabs(res(saturation_[cell])) > tol_) {
|
if (std::fabs(res(saturation_[cell])) > tol_) {
|
||||||
int iters_used;
|
int iters_used=0;
|
||||||
saturation_[cell] = RootFinder::solve(res, smin_[2*cell], smax_[2*cell], maxit_, tol_, iters_used);
|
saturation_[cell] = RootFinder::solve(res, smin_[2*cell], smax_[2*cell], maxit_, tol_, iters_used);
|
||||||
|
reorder_iterations_[cell] = reorder_iterations_[cell] + iters_used;
|
||||||
}
|
}
|
||||||
saturation_[cell] = std::min(std::max(saturation_[cell], smin_[2*cell]), smax_[2*cell]);
|
saturation_[cell] = std::min(std::max(saturation_[cell], smin_[2*cell]), smax_[2*cell]);
|
||||||
mobility(saturation_[cell], cell, &mob_[2*cell]);
|
mobility(saturation_[cell], cell, &mob_[2*cell]);
|
||||||
@ -641,7 +645,6 @@ namespace Opm
|
|||||||
|
|
||||||
toBothSat(saturation_, saturation);
|
toBothSat(saturation_, saturation);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Opm
|
} // namespace Opm
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include <opm/core/transport/reorder/TransportModelInterface.hpp>
|
#include <opm/core/transport/reorder/TransportModelInterface.hpp>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <ostream>
|
||||||
struct UnstructuredGrid;
|
struct UnstructuredGrid;
|
||||||
|
|
||||||
namespace Opm
|
namespace Opm
|
||||||
@ -74,7 +74,8 @@ namespace Opm
|
|||||||
const double* porevolume,
|
const double* porevolume,
|
||||||
const double dt,
|
const double dt,
|
||||||
std::vector<double>& saturation);
|
std::vector<double>& saturation);
|
||||||
|
void reportIterations(std::ostream &os);
|
||||||
|
const std::vector<int>& getReorderIterations(){return reorder_iterations_;};
|
||||||
private:
|
private:
|
||||||
virtual void solveSingleCell(const int cell);
|
virtual void solveSingleCell(const int cell);
|
||||||
virtual void solveMultiCell(const int num_cells, const int* cells);
|
virtual void solveMultiCell(const int num_cells, const int* cells);
|
||||||
@ -83,7 +84,6 @@ namespace Opm
|
|||||||
const int pos,
|
const int pos,
|
||||||
const double* gravflux);
|
const double* gravflux);
|
||||||
int solveGravityColumn(const std::vector<int>& cells);
|
int solveGravityColumn(const std::vector<int>& cells);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const UnstructuredGrid& grid_;
|
const UnstructuredGrid& grid_;
|
||||||
const IncompPropertiesInterface& props_;
|
const IncompPropertiesInterface& props_;
|
||||||
@ -99,6 +99,8 @@ namespace Opm
|
|||||||
double dt_;
|
double dt_;
|
||||||
std::vector<double> saturation_; // one per cell, only water saturation!
|
std::vector<double> saturation_; // one per cell, only water saturation!
|
||||||
std::vector<double> fractionalflow_; // = m[0]/(m[0] + m[1]) per cell
|
std::vector<double> fractionalflow_; // = m[0]/(m[0] + m[1]) per cell
|
||||||
|
std::vector<int> reorder_iterations_;
|
||||||
|
//std::vector<double> reorder_fval_;
|
||||||
// For gravity segregation.
|
// For gravity segregation.
|
||||||
std::vector<double> gravflux_;
|
std::vector<double> gravflux_;
|
||||||
std::vector<double> mob_;
|
std::vector<double> mob_;
|
||||||
|
Loading…
Reference in New Issue
Block a user