Delft3D FLOW Tracer Negative Concentration - D-Flow Flexible Mesh - Delft3D
intro story D-Flow FM
D-Flow Flexible Mesh
D-Flow Flexible Mesh (D-Flow FM) is the new software engine for hydrodynamical simulations on unstructured grids in 1D-2D-3D. Together with the familiar curvilinear meshes from Delft3D 4, the unstructured grid can consist of triangles, pentagons (etc.) and 1D channel networks, all in one single mesh. It combines proven technology from the hydrodynamic engines of Delft3D 4 and SOBEK 2 and adds flexible administration, resulting in:
An overview of the current developments can be found here.
The D-Flow FM - team would be delighted if you would participate in discussions on the generation of meshes, the specification of boundary conditions, the running of computations, and all kinds of other relevant topics. Feel free to share your smart questions and/or brilliant solutions!
Delft3D FLOW Tracer Negative Concentration
I am running project that involves setting initial concentration of an inert tracer and let it disperse through tidal flushing in FLOW.
No discharge of tracer was involved and the boundary conditions were set to constant zero.
A couple of observation points were set in area where a unit concentration of the inert tracer was set in the initial condition (using QUICKIN).
For short period of time, time series at these observation points drop below zero well after the model is stabilized (i.e. no more warning signal about "Velocity change too high" after 30 timesteps ).
The model was built using 1 min timestep but the problem still persist even if I reduce the timestep to 0.02 min (1.2 s) so I expect that is not a problem with courant number.
Did anyone encounter something like this previously? Any advice?
In principle, negative concentrations should not appear. I can imagine that negligible small negative values may appear in complex situations or when you are running in parallel, running online with Delft3D-WAVE or using DomainDecomposition.
Can you describe in more detail what processes/tools are switched on and what the typical relative error is? If you think that something is going wrong, please zip your model input files and attach it to a post on this forum. Ideally, you start by isolating the problem in an as simple as possible testcase that shows the problem.
The model was run on Delft3D FLOW only with a single domain.
You are right that the negative values are small (initial tracer concentration = 1, negative concentration ~= >0.01).
And the results seem reasonable except for the fact that the curve sometimes goes slightly below zero.
Only Salinity (constant stratified boundary), Temperature (Excess Temperature mode, constant stratified boundary), Pollutants and tracer (3 types of tracers) and Wind (uniform constant wind field) were activated for the runs.
By "negligible small negative values may appear in complex situations or when you are running in parallel, running online with Delft3D-WAVE or using DomainDecomposition", do you mean running multiple standalone models at the same time or other sort of coupling between other models?
Indeed I had 14 separate Delft3D FLOW models running on the same machine.
Did you mean that would slightly affect the model performance?
I will follow your suggestion and try to debug it on my own first.
Will update the status later this week.
Concentrations of -0.01 are not negligible compared to 1.0
Multiple standalone models, ran at the same time, do not interfere with each other. I can't imagine that this is causing the problem.
Are there messages in your tri-diag file indicating that the model is on the edge of being stable?
Do the negative concentrations only appear locally? And if so, are the grid sizes there relatively small? Are the velocities there relatively high?
I'm still interested in your model input in case you don't find the cause of this problem.
I am entering the conversation since I am having a somewhat similar problem. The list of evidence I find:
- parallel computation in complex geometry, 3D.
- I see small (few percent), negative concentrations of pollutants, when I look at vertical profiles of concentration in the map files.
- No warnings in the diag files about negative concentrations, but warnings about Courant number
- Courant number warnings disappear if I run the simulation on a single CPU, but the negative concentrations in the map file remain there.
- Negative concentrations tend to appear deeper in the water column, where vertical resolution is lower.
- I increased vertical resolution and vertical diffusivity, partially solving the problem (e.g. I was getting warnings in the diag files too beforehand, and also the regions with negative concentration are smaller).
Recently we have looked at your problem and we solved it. There were two issues:
1) You observe negative concentrations in a tracer. Your model has steep gradients in the vertical. Due to our central discretization scheme for vertical advection small negative concentrations can occur.***) To suppress this, we have implemented a vertical Forester filter. However, that filter is only applied to salinity and temperature and not to tracers. We changed the Delft3D-FLOW open source code (see Revision 6562 of September 16th), so that the vertical Forester filter is now also used for tracers.
2) As my colleague Adri Mourits already stated, the horizontal Forester applies a lower limit of -0.01. This means that small negative concentrations are still possible. If you change subroutine FORFIL.F90 and replace the lower limit of -0.01 into 0.0, then negative concentrations will now longer appear. Noted that this will come at the cost of extra computation time, because more Forester iterations might be needed. For your lake of Geneva model this effect wasn't noticeable.
If you use our most recent version and change the code according to 2), then negative concentrations will not appear anymore.
***) There are numerical schemes that do not produce negative concentrations. However, these schemes are much more diffusive and probably even inaccurate for our applications in 3D with stratification.
With kind regards,
Erik de Goede
I just encountered the same problem with negative concentrations in my tracer computations. In my particular case the problem I see is due to my tiny concentrations in the micrograms/l region. Which in turn means, that the vertical forester filter checking for negative concentrations greater than -0.01 will not affect my calculations since my negative concentrations are "small" with only -1e-6. Unfortunately this results in 200% errors sometimes.
The option with changing the source code sounds like a good fix but raising computation times does not, since it already is a quite involved big model taking quite long to compute, so now I am wondering what changing the exponent of my concentrations will do to the results. Obviously in real life changing concentrations from microgram to kilogram would have a major impact on the density, but as far as I can tell, the tracer in the model computations does not affect the density of the water parcel, correct? So there should be no difference in the model computations if I just scratch out a few zeros in my input concentrations from lets say 2 microgram/l to 2 kg/l.
Could I do that, or would I end up with totaly wrong results appart from the wrong exponent of the concentrations, whcih I could easily fix after?
Any tip on this would be highly appreciated!
Tracers are modelled to have no influence on the density; only salinity, temperature and sediments do (optionally). So you can multiply your tracer with a factor (e.g. 1000000) to use the Forester filter properly, and when interpreting the results scale the tracer back to the correct level.
thanks for the clarification, I already started a run using "high" concentrations and this resulted in new but somewhat related issues.
a) (I believe due to diffusion) concentrations still are very small at places, hence I get negative concentrations anyway, which will probably always happen, since i start with zero background concentration and have an input at the very edge of one side of my model domain...so I might have to go the route of adjusting the code to overcome this
b) the model creates more particles. My domain is a reservoir with a river inflow. I input my pollutant via the river stream with concentrationsvalues of about 80. And further downstream where I expect everything to be diluted (river about 2m deep, Reservoir about 30m deep and much wider) i see concentrations of 400 and more, how did that happen and how could i fix this?
The second issue only was visible in a 2D case i calculated to quickly test some parameter variations (i buildt a 3D version with 15 z-layers), there are no visible "artificial" increases in concentrations in my 3D case, but now I am afraid that the same error might also happen in the 3D case but maybe not so pronounced, that I cannot tell in those results.
Any ideas and input would be much appreciated.
If you start with a concentration of 80, and there are no sources with a higher concentration, then 400 should not appear.
Did you try with a recent Delft3D version?
Can you zip your complete set of input files (preferably reduced into a simple testcase showing the problem) and attach that to a post on this forum?
my version might not be the newest. We work with FLOW2D3D Version 6.01.07.4015.
Can I send the files as a private message?