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:
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
negativeConcentration: Sets how to deal with negative concentration values. The option
passomits the check completely. The default value is
retrywhich 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 #171 (comment 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 manualSee #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
Assignee: If the Squash option is set, check/update the commit message right before merging!
Closes #171 (closed)