Skip to content

Resolve "Negative solute concentrations when pulses pass through soil layer interfaces"

What does this MR do?

Avoid negative solute concentrations in results of Transport model. According to #171 (closed), there are two ways how this issue is tackled:

Solution check

The new method check_solution() of the transport model checks if the solution contains negative values. In the future, this method may be extended to also check other properties of the solution and especially compare both solutions. As there are now multiple criterions for rejecting a solution, the transport model solver loop has been revamped.

For controlling the solution check, two config keys have been created in the new section transport.solutionCheck:

  • negativeConcentration: Sets how to deal with negative concentration values. The option pass omits the check completely. The default value is retry which discards solutions with negative values and repeats the computation with a lower time step.
  • negativeTol: Tolerance for negative values relative to the largest solute concentration on the grid. This defaults to 1e-6.

Linear interpolation of water content grid function

The evaluation policy of the water content grid function container was changed to LinearInterpolation. The effects are less obvious and relate more to numerical accuracy than the obvious issue listed in #171 (closed). See https://ts-gitlab.iup.uni-heidelberg.de/dorie/dorie/issues/171#note_39817 for the full discussion on the matter.

Is there something that needs to be double checked?

  • Do we need some kind of test for this?
  • We should probably document the time step scheme algorithm(s) in the user manual See #174 (closed)

Can this MR be accepted?

  • Implemented fixes for negative solute concentrations
    • Validate solution after computation
    • Use linear interpolation of water content grid function
  • [ ] Added/Updated tests:
  • Added/Updated documentation (see #174 (closed) for follow up)
  • Pipeline passing
  • Squash option set
  • Delete branch option set
  • Added entry to CHANGELOG.md

Assignee: If the Squash option is set, check/update the commit message right before merging!

Related issues

Closes #171 (closed)

Edited by Santiago Ospina De Los Ríos

Merge request reports