mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge remote-tracking branch 'upstream/master'
Conflicts: opm/core/simulator/SimulatorIncompTwophase.cpp
This commit is contained in:
commit
3dfb2eb29b
@ -52,6 +52,7 @@ namespace Opm
|
||||
source_(0),
|
||||
dt_(0.0),
|
||||
saturation_(grid.number_of_cells, -1.0),
|
||||
reorder_iterations_(grid.number_of_cells, 0),
|
||||
fractionalflow_(grid.number_of_cells, -1.0),
|
||||
mob_(2*grid.number_of_cells, -1.0)
|
||||
#ifdef EXPERIMENT_GAUSS_SEIDEL
|
||||
@ -101,7 +102,7 @@ namespace Opm
|
||||
&seq[0], &comp[0], &ncomp,
|
||||
&ia_downw_[0], &ja_downw_[0]);
|
||||
#endif
|
||||
|
||||
std::fill(reorder_iterations_.begin(),reorder_iterations_.end(),0);
|
||||
reorderAndTransport(grid_, darcyflux);
|
||||
toBothSat(saturation_, saturation);
|
||||
}
|
||||
@ -170,9 +171,11 @@ namespace Opm
|
||||
// if (std::fabs(r0) < tol_) {
|
||||
// return;
|
||||
// }
|
||||
int iters_used;
|
||||
int iters_used = 0;
|
||||
// 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);
|
||||
// add if it is iteration on an out loop
|
||||
reorder_iterations_[cell] = reorder_iterations_[cell] + iters_used;
|
||||
fractionalflow_[cell] = fracFlow(saturation_[cell], cell);
|
||||
}
|
||||
|
||||
@ -544,8 +547,9 @@ namespace Opm
|
||||
const int cell = cells[pos];
|
||||
GravityResidual res(*this, cells, pos, gravflux);
|
||||
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);
|
||||
reorder_iterations_[cell] = reorder_iterations_[cell] + iters_used;
|
||||
}
|
||||
saturation_[cell] = std::min(std::max(saturation_[cell], smin_[2*cell]), smax_[2*cell]);
|
||||
mobility(saturation_[cell], cell, &mob_[2*cell]);
|
||||
@ -641,7 +645,10 @@ namespace Opm
|
||||
|
||||
toBothSat(saturation_, saturation);
|
||||
}
|
||||
|
||||
void TransportModelTwophase::getReorderIterations()
|
||||
{
|
||||
return reorder_iterations_;
|
||||
};
|
||||
} // namespace Opm
|
||||
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include <opm/core/transport/reorder/TransportModelInterface.hpp>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
#include <ostream>
|
||||
struct UnstructuredGrid;
|
||||
|
||||
namespace Opm
|
||||
@ -74,7 +74,10 @@ namespace Opm
|
||||
const double* porevolume,
|
||||
const double dt,
|
||||
std::vector<double>& saturation);
|
||||
|
||||
//// Return reorder iterations
|
||||
////
|
||||
//// \param[out] vector of iteration per cell
|
||||
const std::vector<int>& getReorderIterations(){return reorder_iterations_;};
|
||||
private:
|
||||
virtual void solveSingleCell(const int cell);
|
||||
virtual void solveMultiCell(const int num_cells, const int* cells);
|
||||
@ -83,8 +86,7 @@ namespace Opm
|
||||
const int pos,
|
||||
const double* gravflux);
|
||||
int solveGravityColumn(const std::vector<int>& cells);
|
||||
|
||||
private:
|
||||
private:
|
||||
const UnstructuredGrid& grid_;
|
||||
const IncompPropertiesInterface& props_;
|
||||
const double* visc_;
|
||||
@ -99,6 +101,8 @@ namespace Opm
|
||||
double dt_;
|
||||
std::vector<double> saturation_; // one per cell, only water saturation!
|
||||
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.
|
||||
std::vector<double> gravflux_;
|
||||
std::vector<double> mob_;
|
||||
|
Loading…
Reference in New Issue
Block a user