Migration status

  • Home Page: Activity map.

intro story DELWAQ

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! **

 

 

Sub groups
D-Flow Flexible Mesh
DELWAQ

Cohesive sediments & muddy systems

 


Message Boards

RE: Roughness file .rgh

JA
Juan Arellano, modified 3 Years ago.

Roughness file .rgh

Youngling Posts: 8 Join Date: 9/25/14 Recent Posts
Hey everyone,

Does anyone know how to create a .rgh file ? I'm modelling a river and the bottom roughness is not the same in all the cells of the grid.
I've tried to do it with poligons in Quickin but I haven't figured out how to do it yet :p

Any suggestions would be great

Cheers
Richard Measures, modified 2 Years ago.

RE: Roughness file .rgh

Jedi Knight Posts: 178 Join Date: 3/23/11 Recent Posts
Hi Juan,

The process I use in Quickin to create a *.rgh file is:
  • Import grid
  • Change to data in cell centre rather than corners (Operations - Data in Cell Centre)
  • Input data (either bring in sample data or use polygons etc as you would for depth)
  • Export depth to a *.dep file
  • rename your new *.dep file to have a *.rgh extension
  • Open file in a text editor, copy the whole thing and paste it again at the end so the whole file is repeated (first half representing roughness in the M-direction, second half representing roughness in the N-direction. (Note - post edited to add this point which I initially forgot to include)
Hope that helps?
Cheers, Richard
ZJ
Zheng Jiechen, modified 3 Years ago.

RE: Roughness file .rgh

Youngling Posts: 7 Join Date: 12/22/15 Recent Posts
Hi Richard,

I'm trying to create a space varying .rgh file, but I do not know how to set roughness values using polygons. Could you tell me?

Best regards,
Jiechen Zheng
Richard Measures, modified 3 Years ago.

RE: Roughness file .rgh

Jedi Knight Posts: 178 Join Date: 3/23/11 Recent Posts
Hi,

To create a spatially varying roughness file in quickin what I do is:
  • Open the model grid in quickin
  • select "Operations - Data in Cell Centre"
  • Draw a polygon using "Edit - Polygon - New". If necessary edit the polygon using the other polygon tools (note, right click deselcts the current polygon, which can be a little counter intuitive till you get the hang of it)
  • Assign a roughness value to the cells in the polygon "Operations - Combine Depth and Uniform Value - Fill Missing Depth with Uniform Value
  • Delete polygon "Operations - Delete Polygons"
  • If necessary draw other polygons and assign depth in the same way for different patches, or use other tools such as "Edit - Depth Linear" to interpolate values (see the quickin user manual for how to use the other tools)
  • You can then use "Operations - Combine Depth and Uniform Value - Fill Missing Depth With Unifrom Value" or "Operations - Internal Diffusion" with no polygon to fill in remaing cells
  • Once you've filled your grid export it "File - Export - Depth..."
  • Then open your exported file in a text editor, copy the whole thing and paste it againa so the whole file is repeated (first half representing roughness in the M-direction, second half representing roughness in the N-direction. Rename the file .rgh and you're good to go.
Hope that helps. Let me know if you have any specific questions or get stuck anywhere.

Cheers, Richard
ES
Estelle Serrero, modified 3 Years ago.

RE: Roughness file .rgh

Youngling Posts: 7 Join Date: 5/24/16 Recent Posts
Richard Measures:
Hi Juan,

The process I use in Quickin to create a *.rgh file is:
  • Import grid
  • Change to data in cell centre rather than corners (Operations - Data in Cell Centre)
  • Input data (either bring in sample data or use polygons etc as you would for depth)
  • Export depth to a *.dep file
  • rename your new *.dep file to have a *.rgh extension
Hope that helps?
Cheers, Richard


Hi Richard,

I followed the steps to create a .rgh file but it seems to be unreadable:

"*** ERROR Premature EOF in file: roughness_2.rgh
*** ERROR Flow exited abnormally"

I think it might be because it contains 12 columns and according to the user manual, in an .rgh file, "the records must be filled with (maximal) 8 reals".

Have you ever encountered this problem before? Do you know a solution?

Best regards,
Estelle
Richard Measures, modified 3 Years ago.

RE: Roughness file .rgh

Jedi Knight Posts: 178 Join Date: 3/23/11 Recent Posts
Hi Estelle,

The .rgh file needs to specify roughness in both M and N directions - if you haven't done this (I seem to have missed this step in my earlier post which you quote - sorry for the confusion) then that would cause the "Premature End Of File" error you are getting. This is easy to fix - see step 9 of my last post in this forum:
open your exported file in a text editor, copy the whole thing and paste it again so the whole file is repeated (first half representing roughness in the M-direction, second half representing roughness in the N-direction. Rename the file .rgh and you're good to go.


Hope that helps,
Richard
ES
Estelle Serrero, modified 3 Years ago.

RE: Roughness file .rgh

Youngling Posts: 7 Join Date: 5/24/16 Recent Posts
Thank you Richard, that helps a lot !
MK
Manuela König, modified 2 Years ago.

RE: Roughness file .rgh

Youngling Posts: 14 Join Date: 3/31/17 Recent Posts
Hej,

I hope I can join the discussion. I had similar problems with my .rgh file.
I got the following error during my simulation run: *** ERROR Premature EOF in file: Bodenrauheit_kalibrierung.rgh

I checked and renewed my file to include just taps...

I would be delighted if you could take a short look in my attached file, maybe I am too blind to see an obvious mistake.

Thx
Manuela
Richard Measures, modified 2 Years ago.

RE: Roughness file .rgh

Jedi Knight Posts: 178 Join Date: 3/23/11 Recent Posts
Hi Manuela,

Have you repeated the data in the *.rgh file to represent roughness in both the M & N directions. If not then this will lead to a "premature EOF" error.

Also I think *.rgh files are generally space separated rather than tab separated - I'm not sure if this is important though?

Hope that helps,
Richard
MK
Manuela König, modified 2 Years ago.

RE: Roughness file .rgh

Youngling Posts: 14 Join Date: 3/31/17 Recent Posts
Hej Richard,

thanks for your answer.

Yes, I copied the data from my depth-file to have the M- as well as the N-direction included. For the negative values I added a quite small value of 0.0001.

I also tried to separate the values through a simple space, as you suggested. But unfortunately the same error occurs.

Best regards,
Manuela
Richard Measures, modified 2 Years ago.

RE: Roughness file .rgh

Jedi Knight Posts: 178 Join Date: 3/23/11 Recent Posts
Hi Manuela,

I had a quick look at the *.rgh file you posted and I think maybe you have made a mistake when duplicating the data for M and N directions:

At the moment your *.rgh file has 169 values in each block of data and 138 blocks. This should represent a 168cells x 68cells grid, with null values around the edge making it 169 x 69, repeated twice (for M and N directions), hence 168 x 138. Is you grid 168cells x 68cells? Without the *.grd and *.enc files for your grid it is impossible for me to check this.

The reason I think you may have made an error is that if you have repeated the grid twice to represent M and N directions I would expect the 1st and 70th blocks to be identical, the 2nd and 71st blocks to be identical, etc - but they are not. Unless you intentionally have different roughness values in the M and N directions there is definitely something wrong.

Good luck,
Richard
MK
Manuela König, modified 2 Years ago.

RE: Roughness file .rgh

Youngling Posts: 14 Join Date: 3/31/17 Recent Posts
Hej Richard,

thanks a lot for your help.
I checked some things with your tipps in mind.
Seems to work now, my simulation is running emoticon

Have a nice day,
Manuela
SC
Simon Colman, modified 3 Months ago.

RE: Roughness file .rgh

Youngling Posts: 5 Join Date: 10/2/18 Recent Posts

Hi Richard,

I have followed every step you have said and made all modifications but I can't seem to run the flow-file successfully. It exits abruptly when trying to read the roughness file.

*** ERROR Read error from file: ..\..\..\Grids\Friction\Friction 1.rgh 
*** ERROR Flow exited abnormally 


I exported the depth file after making it in QUICKIN.

Changed the -999 values with 0.0001 values

I checked the number of blocks and the number of values per block (10 blocks with 2050 values for a 2049x9 grid).

Thank you for your help, I am desperate at this point.

regards

Simon

SC
Simon Colman, modified 3 Months ago.

RE: Roughness file .rgh

Youngling Posts: 5 Join Date: 10/2/18 Recent Posts

*Edit* I also changed the tabs with spaces but continued to have the same results

Richard Measures, modified 3 Months ago.

RE: Roughness file .rgh

Jedi Knight Posts: 178 Join Date: 3/23/11 Recent Posts

I just had a quick look at your file and can't see anything obviously wrong. I did notice that there are a couple of extra tabs at the end of each block (e.g. line 171 ends with <tab><tab><CR><LF>) not sure if these trailing tabs are the cause of the issue? In my own rgf files (space separated) I note there are no trailing spaces on any lines...

I guess if you had edited your file in excel or similar it would have inserted these extra tabs automatically so there are the same number of columns on each row as I'm prettu sure quickplot doesn't put them in. See attached a version I modified with find and replace in a text editor.

Hopefully that might work, if not i'm a bit stumped.

SC
Simon Colman, modified 3 Months ago.

RE: Roughness file .rgh

Youngling Posts: 5 Join Date: 10/2/18 Recent Posts

Hi Richard,

Thank you for your quick reply but I have found the problem:

When saving my files after editing them in the text editor, my coding settings were set at 'Unicode' and not 'ANSI'.

This is a silly mistake but can easily be overlooked.

Thank you!

TL
Tony Lee, modified 2 Years ago.

RE: Roughness file .rgh

Youngling Posts: 9 Join Date: 4/1/17 Recent Posts
Richard Measures:
Hi Juan,

The process I use in Quickin to create a *.rgh file is:
  • Import grid
  • Change to data in cell centre rather than corners (Operations - Data in Cell Centre)
  • Input data (either bring in sample data or use polygons etc as you would for depth)
  • Export depth to a *.dep file
  • rename your new *.dep file to have a *.rgh extension
  • Open file in a text editor, copy the whole thing and paste it again at the end so the whole file is repeated (first half representing roughness in the M-direction, second half representing roughness in the N-direction. (Note - post edited to add this point which I initially forgot to include)
Hope that helps?
Cheers, Richard


Hi Richard?
Your answer helps me indeed. But I am still puzzled by the data inputted in step 3.How can I gain it?If I have a xyz .dep file ,dose it mean I can calculate roughness via it ?
Any suggestions would be great
Best regards.
Hui
Richard Measures, modified 2 Years ago.

RE: Roughness file .rgh

Jedi Knight Posts: 178 Join Date: 3/23/11 Recent Posts
Hi Tony,

Roughness is generally a calibration parameter. I suggest you start out by selecting an appropriate formulation and finding a suitable coefficient for you model from the literature, then iteratively adjust it to calibrate your model. This initial roughness estimate could be a single global roughness coefficient (in which case you don't need a *.rgh file) or a spatially varying roughness coefficient, depending on how much variability there is spatially in your model. If you have data on bed material this could be used to inform your initial estimate. For example if you have a map of bed material you could use this as a basis for a spatially varying roughness map.

Sometimes during calibration you may find you need to have a spatially varying roughness coefficient which is different in deep and shallow areas. In this case you could use your depth map as a basis for setting up your spatially varying roughness map. When I referred to "sample data" in my previous post I meant any x,y,value data that could be used to specify roughness. For example, you could have created a roughness map in GIS software and exported it into this format so you could read it into Quickin easily.

Regards,
Richard
TL
Tony Lee, modified 2 Years ago.

RE: Roughness file .rgh

Youngling Posts: 9 Join Date: 4/1/17 Recent Posts
Richard?thanks for your help emoticon
MD
meddy danial, modified 1 Year ago.

RE: Roughness file .rgh

Youngling Posts: 19 Join Date: 7/25/18 Recent Posts

Dear Richard

My case is like this: I have three branches and want to assign three different coeff. of Manning. Because I don't know how to assign Manning value on 3 different branches with three different mannings using "Combine Depth and Uniform Value" tools, I make three .dep files for 3 branches, after that I rename to .rgh file. Then, I combine it together three .rgh files in only 1 file. After that I copy whole data, and past again at the end of the previous data as you mentioned.

My question is,  the first : what do you excatly mean about 'At the end'? in the new row ? or in the same row of the end of data?

 

Thanks in advance

Meddy

Richard Measures, modified 1 Year ago.

RE: Roughness file .rgh

Jedi Knight Posts: 178 Join Date: 3/23/11 Recent Posts

Hi Meddy,

I usually paste it into a new line (or even leave a blank line in between so it is easy to find the end of the U-roughness block and the start of the V-roughness block). The file format of the *.rgh file is described in the delft3d-flow manual section A.2.19 with an example.

Cheers,

Richard

MD
meddy danial, modified 1 Year ago.

RE: Roughness file .rgh

Youngling Posts: 19 Join Date: 7/25/18 Recent Posts

Dear Richard

Thank you for your quick reply. I understand the sample in the section
A.2.19. (In a DRAFT DELFT3D Manual, at section A. 3.18). But the
sample you mentioned is for a simple domain, only rectangular domain.
Moreover, I didn't see the coordinate, only just the Manning coefficient.

I try to follow your instruction to assign Manning value using rgh
file format, for instance: rename .dep file -> and change -> .rgh file
-> change depth value to Manning value.
How about the complex domain consisting of three branches. (I attach
my .grd and enc.). My problem is how to easily assign three different Manning
value to three different branches (each branch for each Manning value)?

Would you give me suggestions, how I should assign three different
Manning Coeff. in three different branches?

Thanks in advance
Meddy

Richard Measures, modified 1 Year ago.

RE: Roughness file .rgh

Jedi Knight Posts: 178 Join Date: 3/23/11 Recent Posts

Hi Meddy,

To assign spatially varying roughness you need to have generate a map of roughness in quickin (similar to how you generated your *.dep file). In quickin you can:

  1. import your grid
  2. draw a polygon over one branch
  3. from the menu select "operations - combine depth and uniform value - fill missing value with uniform depth" and specif your desired roughness
  4. repeat for the other branches
  5. save as a dep file
  6. rename as .rgh
  7. open in a text editor and duplicate the whole file content (to give roughness in U and V direction identical)

The rgh file you create should have 2 * 197 * 496 = 195424 values (e.g. U and V velocity for your entire grid which has m dimension 197 and n dimension 496).

I also noticed that you may want to consider improving your grid orthogonality which is very poor at the moment.

Richard

MD
meddy danial, modified 1 Year ago.

RE: Roughness file .rgh

Youngling Posts: 19 Join Date: 7/25/18 Recent Posts

Dear Richard,

Would you please explain more specific for step number 2, i.e., Draw polygon over the grid. Do you mean I should manually trace to the entire periphery of gird of one branch using poly, right? I Attach the screenshot of drawing polygon over the grid. If I am wrong, please let me know.

Thank you for your suggestion about the orthogonality of grid mesh. I just learn Delft3D one month ago.

 

Thanks in advance

Meddy

MD
meddy danial, modified 1 Year ago.

RE: Roughness file .rgh

Youngling Posts: 19 Join Date: 7/25/18 Recent Posts

Dear Richard and everyone who follow my thread.

Finally I have succeded to running Delft3d using 3 different Manning values in three different branches using polygon as suggested by Richard.

Finally i can figured out after trying two times to use polygon over grid to make *.rgh file, 

I attach the screenshot of my work from Quickin. 

To be noted, I have correction for Richard, You mentioned that I should have  2 * 197 * 496 = 195424 values. But this is not correct. 

I only have 8449 values for U, so-> 8449*2 =16898 value.

However, from Quick Plot, yes we will get the value -> 2 * 197 * 496 = 195424. M=198, N= 497.

But if we using polygon to make *rgh from *dep file, we have different M and N.

Let me know if I am not correct.

 

Very nice.

Meddy