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:
Atgeirr Flø Rasmussen 2014-06-23 14:03:49 +02:00
parent 631498bd06
commit 41887508ea
2 changed files with 4 additions and 1 deletions

View File

@ -59,6 +59,8 @@ namespace Opm
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_limiter_ = param.getDefault("use_limiter", use_limiter_);
if (use_limiter_) {
@ -305,7 +307,7 @@ namespace Opm
}
// 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_);
double tr_sum = 0.0;
for (int tr = 0; tr < num_tracers_; ++tr) {

View File

@ -150,6 +150,7 @@ namespace Opm
int num_tracers_;
enum { NoTracerHead = -1 };
std::vector<int> tracerhead_by_cell_;
bool tracers_ensure_unity_;
// Used by solveSingleCell().
std::vector<double> rhs_; // single-cell right-hand-sides
std::vector<double> jac_; // single-cell jacobian