mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-23 07:53:29 -06:00
Add tracers_ensure_unity parameter.
When this boolean parameter is true (the default), tracer solutions will be normalized so that the tracer averages will sum to one in each cell. This behaviour is the same as before, the change is that it can now be turned off.
This commit is contained in:
parent
631498bd06
commit
41887508ea
@ -59,6 +59,8 @@ namespace Opm
|
|||||||
basis_func_.reset(new DGBasisBoundedTotalDegree(grid_, dg_degree));
|
basis_func_.reset(new DGBasisBoundedTotalDegree(grid_, dg_degree));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tracers_ensure_unity_ = param.getDefault("tracers_ensure_unity", true);
|
||||||
|
|
||||||
use_cvi_ = param.getDefault("use_cvi", use_cvi_);
|
use_cvi_ = param.getDefault("use_cvi", use_cvi_);
|
||||||
use_limiter_ = param.getDefault("use_limiter", use_limiter_);
|
use_limiter_ = param.getDefault("use_limiter", use_limiter_);
|
||||||
if (use_limiter_) {
|
if (use_limiter_) {
|
||||||
@ -305,7 +307,7 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Ensure that tracer averages sum to 1.
|
// Ensure that tracer averages sum to 1.
|
||||||
if (num_tracers_ && tracerhead_by_cell_[cell] == NoTracerHead) {
|
if (num_tracers_ && tracers_ensure_unity_ && tracerhead_by_cell_[cell] == NoTracerHead) {
|
||||||
std::vector<double> tr_aver(num_tracers_);
|
std::vector<double> tr_aver(num_tracers_);
|
||||||
double tr_sum = 0.0;
|
double tr_sum = 0.0;
|
||||||
for (int tr = 0; tr < num_tracers_; ++tr) {
|
for (int tr = 0; tr < num_tracers_; ++tr) {
|
||||||
|
@ -150,6 +150,7 @@ namespace Opm
|
|||||||
int num_tracers_;
|
int num_tracers_;
|
||||||
enum { NoTracerHead = -1 };
|
enum { NoTracerHead = -1 };
|
||||||
std::vector<int> tracerhead_by_cell_;
|
std::vector<int> tracerhead_by_cell_;
|
||||||
|
bool tracers_ensure_unity_;
|
||||||
// Used by solveSingleCell().
|
// Used by solveSingleCell().
|
||||||
std::vector<double> rhs_; // single-cell right-hand-sides
|
std::vector<double> rhs_; // single-cell right-hand-sides
|
||||||
std::vector<double> jac_; // single-cell jacobian
|
std::vector<double> jac_; // single-cell jacobian
|
||||||
|
Loading…
Reference in New Issue
Block a user