Denitrification - Delwaq - Delft3D
- Home Page: Activity map.
intro story DELWAQ
DELWAQ is the engine of the D-Water Quality and D-Ecology programmes of the Delft3D suite. It is based on a rich library from which relevant substances and processes can be selected to quickly put water and sediment quality models together.
The processes library covers many aspects of water quality and ecology, from basic tracers, dissolved oxygen, nutrients, organic matter, inorganic suspended matter, heavy metals, bacteria and organic micro-pollutants, to complex algae and macrophyte dynamics. High performance solvers enable the simulation of long periods, often required to capture the full cycles of the processes being modelled.
The finite volume approach underlying DELWAQ allows it to be coupled to both the structured grid hydrodynamics of the current Delft3D-FLOW engine and the upcoming D-Flow Flexible Mesh engine (1D-2D-3D) of the Delft3D Flexible Mesh Suite (or even other models such as TELEMAC).
'DELWAQ in open source' is our invitation to all leading experts to collaborate in further development and research in the field of water quality, ecology and morphology using Delft3D. Feel free to post your DELWAQ related questions or comments in this dedicated forum space. If you are new to DELWAQ, the tutorial (in the user manual) is a good place to start. A list of DELWAQ related publications is available here.
** PLEASE TAG YOUR POST! **
I have a question regarding denitrification and the fluxes the denitrification process produces in Delwaq.
I have a water column model and denitrification is activated. Having a closer look into the resulting balance files, I see that the denitrification process produces a positive OXY flux. Per 1 mol of reduced NO3-N, 1.25 mol of O2 seem to be produced. I have attached an extract of the balance file below this text.
I looked up the denitrification reaction in some textbooks but I couldn't find that oxygen was produced during denitrification.
So, I wonder if I have the complete reaction equations in my books and where the oxygen flux due to the denitrification process in Delwaq is coming from.
I would be very happy if you could help me with that.
>>>>>>>> extract from -bal.prn file <<<<<<<<<<<<<<<<<<<<<
Substance OXY Sources/Inflows Sinks/Outflows
OXY _Storage 0.00000E+00 -0.68577E+00
OXY _All Bo+Lo 0.00000E+00 0.00000E+00
OXY _Internal transport 0.71421E+04 -0.71437E+04
OXY _dDenitWat 0.10396E+01 0.00000E+00
OXY _dNitrif 0.00000E+00 -0.95190E-01
OXY _dREAROXY 0.00000E+00 -0.89398E+00
OXY _dPPGreen 0.56831E+01 0.00000E+00
OXY _dPPDiat 0.83287E+01 0.00000E+00
OXY _dcPPGreeN 0.00000E+00 0.00000E+00
OXY _dcPPDiat 0.00000E+00 0.00000E+00
OXY _dNO3Upt 0.49190E+00 0.00000E+00
OXY _dOxCon 0.00000E+00 -0.12247E+02
SUM OF ALL TERMS 0.71577E+04 -0.71577E+04
Substance NH4 Sources/Inflows Sinks/Outflows
NH4 _Storage 0.00000E+00 -0.70558E-02
NH4 _All Bo+Lo 0.00000E+00 0.00000E+00
NH4 _Internal transport 0.86543E+01 -0.86699E+01
NH4 _dNitrif 0.00000E+00 -0.20825E-01
NH4 _dMinPON1 0.42485E+00 0.00000E+00
NH4 _dMinPON2 0.36923E-01 0.00000E+00
NH4 _dMinDON 0.95806E-01 0.00000E+00
NH4 _dNH4Upt 0.00000E+00 -0.83701E+00
NH4 _dNH4Aut 0.32291E+00 0.00000E+00
SUM OF ALL TERMS 0.95348E+01 -0.95348E+01
Substance NO3 Sources/Inflows Sinks/Outflows
NO3 _Storage 0.00000E+00 -0.16951E+01
NO3 _All Bo+Lo 0.00000E+00 0.00000E+00
NO3 _Internal transport 0.12865E+04 -0.12844E+04
NO3 _dDenitWat 0.00000E+00 -0.36388E+00
NO3 _dNitrif 0.20825E-01 0.00000E+00
NO3 _dNO3Upt 0.00000E+00 -0.10761E+00
NO3 _dNiDen 0.00000E+00 0.00000E+00
SUM OF ALL TERMS 0.12865E+04 -0.12865E+04
The overall denitrification reaction equation is:
4 NO3- + 4 H3O+ =>2 N2+ 5 O2+ 6 H2O
Denitrification ultimately removes nitrate from the water phase and produces elemental nitrogen and oxygen (2.857 gO2.gN-1).
The oxygen in nitrate used to oxidise organic matter is accounted for in the model using this stoichiometric constant.
In your example, 0.36388E+00 * 2.857 = 0.10396E+01.
Hope that helps,
I could have given a bit more details about the stoichiometry computation:
- 4 mols of NO3, with 14gN/mol = 56 gN,
- 5 mols of O2, with 32 gO2/mol = 160 gO2,
and 160 gO2 divided by 56 gN gives you the 2.857 gO2/gN.
Denitrification therefore produces 2.857 gram of O2 per gram of nitrogen.
thank you for your answer. The way you describe the overall equation fits to the Delwaq results I obtain.
However, I don't find this reaction in the literature I have . There, the denitrification equation looks like
CH2O + NO3- + 2H+ -> CO2 + 0.5 N2 + 2H2O , or similar.
Maybe you can give a literature reference for the reaction you described?
Thanks a lot,
sorry for my late reply, but we are here both talking about the same reaction. With correct stoichiometry, it yields:
5 CH2O + 4 NO3- + 4 H3O+ -> 2 N2 + 5 CO2 + 11 H2O
The process delivers 2.857 gO2/gN (see calculation above), which are instantly consumed for the oxidation of organic matter.
Consequently, you can also compute that the process consumes 0.933 gN/gC (4 * 14 gN/mol / 5 * 12 gC/mol).
Hope that clarifies everything,
At first, I thought your confusion came from the value reported in the balances. After reading the thread again, I realized that you might be confused by the conceptual use of the process library, rather than by its output numbers. So here is some (hopefully useful) additional information.
Flux-wise, denitrification can be seen as:
- microbial respiration, converting organic carbon (CH2O) into carbon dioxide (CO2),
- nitrate reduction, converting nitrates (NO3) into elemental nitrogen (N2).
- increase of alkalinity, converting H+ into H2O.
In Delwaq, the fluxes are computed separately. Flux of line 1 is handled by processes DECFAST/DECSLOW (decomposition of detritus). Fluxes of lines 2 and 3 are handled by the process DENWAT_NO3 (denitrification NO3 in the water column). Additionally, the flux resulting from the consumption of electron acceptors is separately computed by the process CONSELAC.
This allows for more degrees of freedom when setting up a model. For instance, if your model contains only NO3 as a state variable, DENWAT_NO3 is the only process needed. If your state variables are POC, NO3, and O2, then the processes DECFAST/DECSLOW, DENWAT_NO3, and CONSELAC are all required to model the effects of denitrification on your state variables.
I can only encourage you to look into the user manuals to see which fluxes are affected by which process. If you use the GUI, state variables for each process can be identified since they don't have a default value. And of course, feel free to ask any questions here on the forums.
thank you for your detailed description.
You are right, I was wondering about the resulting oxygen flux itself, rather than its magnitude.
If I understand you right, the increase in oxygen (which is reported in the balance file) is completely used to remineralize organic matter and does, at the end, not increase the oxygen concentration.
I think you understood me incorrectly, since DENWAT_NO3 is indeed producing a positive oxygen flux, which is reported in your mass balance, and will therefore increase the oxygen concentration.
Long story short, the solution is to NOT use DENWAT_NO3 in your setup. What is computed by DENWAT_NO3 is fully covered by the process CONSELAC (consumption of electron acceptors), in a more robust and generic way. I'll confirm that in the upcoming days with our uppermost specialist who designed the subroutine CONSELAC, and update the post with a detailed explanation on why. But it appears that DENWAT_NO3 has become obsolete for setups in Delwaq version 5.0 and above, and might even be removed from future releases.
In the meantime, could you maybe post here the list of substances, processes and parameters that you're using for your current setup of denitrification? This would help me to illustrate what happened.
I'll copy the listing I find in the *.inp - file, ok?
Hope, it helps.
These are the substances:
19 0 ; number of active and inactive substances
; Index Name
... and these are the parameters and processes :
; 125 - number of constants
; 'MaxIterations' - has missing value or model not suited
Many thanks for the information you posted.
Although denitrification can be formulated as "one" reaction, it was numerically decoupled into:
(1) 4 NO3- + 4 H3O+ =>2 N2+ 5 O2+ 6 H2O
(2) 2 CH2O + 2 O2 -> 2 CO2 + 2 H2O
Yielding to the overall formulation:
(3) 5 CH2O + 4 NO3- + 4 H3O+ -> 2 N2 + 5 CO2 + 11 H2O
Originally, fluxes from equation (2) (=respiration) were already coded in a process called WM_DETRITUS. Thus, fluxes from equation (1) were coded to make use of equation (2) to compute the fluxes from equation (3) (=denitrification). Arguably, and maybe abusively, the process dealing with equation (1) was called DENWAT_NO3.
Conceptually, nitrate is converted to "oxygen-equivalents" (for lack of a better word), and the oxygen formed is immediately fuelling the organic matter mineralization (assuming DetC is never limiting if I'm not mistaken). Numerically, it looks "as if" nitrates were consumed to mineralize organic matter, i.e. what you would expect from denitrification.
Because of this decoupling, however, a positive oxygen flux is reported in the balance file for DENWAT_NO3 (dDenitWat OXY= 0.10396E+01); this is also mentioned in the Processes Technical Reference Manual (section 6-66). The flux resulting from oxygen respiration reported in the balance file (dOxCon OXY = -0.12247E+02) is reduced by this exact amount to account for this "trick".
That should answer your original question, I hope.
With your question, you have actually pointed out something else to our attention: instead of using DENWAT_NO3 to model denitrification, the process CONSELAC should now be used in combination with DECFAST. DENWAT_NO3 has actually become obsolete (except maybe in some very specific cases), and might be removed from future releases.
Before Delwaq became open-source, the consumption of electron acceptors used for organic matter mineralization has been standardized in a single process called CONSELAC (section 9-3 of the same manual), and the decay of organic matter restructured in three processes called DECFAST, DECMED and DECSLOW (replacing WM_DETRITUS and DENWAT_NO3). CONSELAC can be used for water and sediment variables, and it takes care of the successive electron acceptors used for respiration, starting from oxygen all the way down to methane (pretty neat, right?). This process therefore computes the mineralization fluxes oxidized by the various electron acceptors.
CONSELAC and DECFAST do not, however, produce the exact same fluxes than WM_DETRITUS and DENWAT_NO3 use to produce. To ensure backward compatibility, the latter processes can still be turned on, and several switches have been introduced to ensure similar results. These extra parameters are automatically switched on when reading an "old" input file; however, they are not when reading a "new" input file (version 5 and above).
SWOxCon is one of these extra parameters. If CONSELAC and DENWAT_NO3 are both activated, then SWOxCon should be equal to 1. That way, CONSELAC won't compute respiration based on electron acceptors other than oxygen, and leave the computation of the denitrification flux to DENWAT_NO3. I saw it in your list of parameters, and I suspect its value is set to 1, since the balance reports dNiDen=0.00000E+00 (nil denitrification flux calculated by CONSELAC)
The (easy) solution to avoid mistakes is to use CONSELAC to compute denitrification, and drop DENWAT_NO3. Denitrification will then be single-handedly dealt with by CONSELAC, and you won't see a (somewhat confusing) positive oxygen flux in your balance file anymore. The process will then report two fluxes in the mass balance, dOxCon and dNiDen, which refer to the mineralization flux oxidized with oxygen (=respiration) and oxidized with nitrate (=denitrification), respectively. Maybe for the interpretation, it makes more sense to have only these two fluxes.
I would be very interested to see the mass balance resulting from such run (with DENWAT_NO3 deactivated). I think the numbers from your new run should match the numbers you reported at the beginning of this thread, but should be grouped under different fluxes. Instead of:
OXY _dDenitWat 0.10396E+01 0.00000E+00
OXY _dOxCon 0.00000E+00 -0.12247E+02
NO3 _dDenitWat 0.00000E+00 -0.36388E+00
NO3 _dNiDen 0.00000E+00 0.00000E+00
I would expect something like:
OXY _dOxCon 0.00000E+00 -0.11205E+02
NO3 _dNiDen 0.00000E+00 -0.36388E+00
Let me know if that is the case!
that has been a very detailed answer - thanks for it!
The Switch SWOxCon in the example I posted at the beginning was set to 0.0 .
I did the test you recommended, and some more, always setting SWOxCon to 0.0. Not using DENWAT_NO3 does eliminate the associated fluxes in the OXY and NO3 balances. It does, however, not change the dOxCon - flux and I never get a dNiDen - flux. I first thought it might be due to my chosen parameters (like critical oxygen concentration KsOxDenInh, etc) but this is not the case. It seems that CONSELAC does not calculate the denitrification fluxes.
You said that there are some more extra parameters which were introduced for the open source release of Delwaq. Maybe, one of them is still incorrect in my settings?!
Another possibility: for the calculation, I use a linux compilation of the open source code (version 'Deltares, DELWAQ2 Version 5.01.03.exportiert', it says at the beginning of the mon-file). To generate the inp-file templates for the linux calculation (e.g. in case of new hydrodynamics or boundary values), I prefer using the GUI and therefore I use a licenced Windows version ( Delft3D 4.01.00.rc.09, MSWindows, it says). Do you think that this might cause troubles?
I can provide you with an entire inp-file but it's a bit too much to post it here.
I assume that prepping an INP-file on Windows and running in on Linux doesn't have anything to do with what you're seeing here. I do it very often; what matters is what is written in the LST- and LSP-files: that is what the executable (whatever the OS) understood from your INP-file.
Then, if you don't have a denitrification flux from CONSELAC, I see two options:
# parameters are not properly defined.
# and/or conditions for denitrification to occur are not met;
You can drop all the parameters linked to DENWAT_NO3 (RcDen20, TcDenWat, KsNiDen, KsOxDen, COXDEN, SWVnDen, RcDenWat) which should now be turned off.
For CONSELAC, here are the parameters that you should play with (either via the GUI or by editing the INP-file):
KsOxCon 2.00000 x half saturation constant for DO limitation (g/m3)
KsNiDen 0.500000 x half saturation constant for nitrate cons. (gN/m3)
KsFeRed 2.00000 x half saturation constant for Fe limitation(gFe/m3)
KsSuRed 2.00000 x half saturation constant for SO4 limitation(gS/m3)
KsOxDenInh 0.200000 x half saturation constant for oxygen inhib. (g/m3)
KsNiIRdInh 0.200000 x half sat. const. NO3 inhib. iron reduction (gN/m3)
KsNiSRdInh 0.200000 x half sat. const. NO3 inhib. SO4 reduction (gN/m3)
KsSuMetInh 1.00000 x half saturation constant for SO4 inhibition(gS/m3)
TcOxCon 1.07000 x temperature coeff. for oxygen consumption (-)
TcDen 1.12000 x temperature coefficient for denitrification (-)
TcIRed 1.12000 x temperature coeff. for iron reduction (-)
TcSRed 1.12000 x temperature coeff. for sulphate reduction (-)
TcMet 1.12000 x temperature coeff. for methanogenesis (-)
RedFacDen 1.00000 x reduction factor for denitrif. at low temp. (-)
RedFacIRed 1.00000 x reduction factor for iron red. at low temp. (-)
RedFacSRed 1.00000 x reduction factor for sulph. red. at low temp. (-)
RedFacMet 1.00000 x reduction factor for methanog. at low temp. (-)
CoxDenInh 1.00000 x crit. diss. ox. conc. for inhib. denitrif. (g/m3)
CoxIRedInh 0.200000 x crit. diss. ox. conc. for inhib. iron red. (g/m3)
CoxSRedInh 0.200000 x crit. diss. ox. conc. for inhib. sulph. red.(g/m3)
CoxMetInh 0.200000E-01 x crit. diss. ox. conc. for inhib. methanog. (g/m3)
CniMetInh 0.100000 x crit. nitrate conc. for inhib. methanog. (gN/m3)
CTBactAc 3.00000 x critical temp. for specific bacterial activity(oC)
Temp 15.0000 x ambient water temperature (oC)
Poros 1.00000 x volumetric porosity (-)
FrMetGeCH4 0.500000 x fraction of methanogenesis towards CH4 (-)
SWOxCon 0.00000 x Switch: only OxCon (1) or not (0) (-)
The values given here are the defaults used when you activate CONSELAC. Therefore, if you don't mention anything in the INP-file, the aforementioned values will be used and reported in the LSP-file. Also, note that by default, dissolved oxygen needs to drop below CoxDenInh=1 gO2/m3 for denitrification to occur. Maybe you can confirm that this is indeed the case in your simulation, or adjust the value of CoxDenInh to suit your needs. If not, then we know why you don't have a dNiDen flux. In DENWAT_NO3, the default oxygen value for denitrification inhibition is COXDEN=3gO2/m3, which could explain why you had denitrification with DENWAT_NO3 and not with CONSELAC.
If oxygen drops below this threshold, I see no reason for denitrification not to occur. It may then be wise to output the mineralization fluxes (f_minPOC1, f_minPOC2, etc.) to make sure that mineralization is also working fine (I see you are using DecFast). Finally, it may be insighful to output FrOxCon, FrNiDen, FrFeSed, FrSuRed, and FrMetGen. These will give you the relative contribution of oxygen consumption, denitrification, iron reduction, sulphate reduction, and methanogenesis for respiration with CONSELAC.
If you still struggle, please attach your INP-file (especially block 7, list of parameters and their values), and the LST- and LSP-files here in the forum.
in the runs I reported in my last post, I used a CoxDenInh of 5.0 because my oxgen concentration surely drops below this value. I also repeated the simulation with the value set to 10, to be absolutely sure.
I will attach the inp, the lsp and lst files and also a bal-prn file with a sum over one day during a period in which I would expect denitrification to occur.
Thanks a lot
thanks for the files. I'll dig into them in the upcoming days.
After a quick first glance, I saw SwOxCon=1.0 in the input file you attached, which means consumption of electron acceptors other than oxygen is turned off in CONSELAC (ergo denitrification flux dNiDen is always 0.0). I know you used 0.0 before (as reported previously), so maybe with all the testing you forgot to switch this back to 0.0 for this run? (I wish it is that simple!)
sorry for my late reply.
It seems as if it was that simple... which is good!
Thank you very much for your help and your detailed answers.
no worries; in the mean time, I tried your setup (processes+parameters) in a simple one-cell WAQ model, and did not encounter any problem to get a denitrification flux from CONSELAC (assuming SWOxCon=0). Therefore, I am happy to learn that this did indeed solve your problem!
Good luck with your modelling,