bug message reminder

When adressing a model crash or bug, please remember to include an entire model setup in your post that reproduces the crash or exposes the bug. Also add the XBlog.txt file. This is necessary information for people that are trying to help you. Including your model setup can be achieved by adding the zipped run directory (excluding output) as an attachment to the post.

Forum

RE: Multiple sediment factions

CI
Claudio Iuppa, modified 7 Years ago.

Multiple sediment factions

Capillary Posts: 0 Join Date: 3/25/12 Recent Posts
Hi
I'm Claudio, a student of engineering ( University of Catania ).
I would ask more information for the multiple sediment factions.
Because i don't understand how to enter the sediment class.
Thanks,
Claudio.
Pieter van Geer, modified 7 Years ago.

Moved thread

Swell Posts: 176 Join Date: 1/5/11 Recent Posts
Moved thread to the Getting started category. Please add new threads in a category only, otherwise the forum will become a mess.
Bas Hoonhout, modified 7 Years ago.

RE: Multiple sediment factions (Answer)

Infra-gravity Posts: 362 Join Date: 5/20/11 Recent Posts
Hi Claudio,

I added an example on how to use multiple sediment fractions here.

Have a look at the T01_zebra test. It contains two sediment classes and 15 sediment class layers. It looks something like this:



Enjoy!

Bas
CI
Claudio Iuppa, modified 7 Years ago.

RE: Multiple sediment factions

Capillary Posts: 0 Join Date: 3/25/12 Recent Posts
Hi Bas,


Thanks! This is very helpful!

regards,

Claudio.
CI
Claudio Iuppa, modified 7 Years ago.

RE: Multiple sediment factions

Capillary Posts: 0 Join Date: 3/25/12 Recent Posts
Hi

I studied the files that you sent me.
Just one question: why there isn't any information about the files gdist1, gdist2 and the files inside the folder bc in the manual of Xbeach? Can you tell me where I can find more information?

regards,

Claudio.
Bas Hoonhout, modified 7 Years ago.

RE: Multiple sediment factions

Infra-gravity Posts: 362 Join Date: 5/20/11 Recent Posts
You can find information on the bc directory in the XBeach manual: section 2.3.1 and appendix A. Look for ezs or instat = 2 or 3.

The gdistX.inp file is not described in the manual, but it simply indicates the fraction of sediment class X per gridcell and sediment layer (so nx+1 * ny+1 * nd).

Bas
CI
Claudio Iuppa, modified 7 Years ago.

RE: Multiple sediment factions

Capillary Posts: 0 Join Date: 3/25/12 Recent Posts
thanks again,

Claudio.
JT
Javier Tercero, modified 6 Years ago.

RE: Multiple sediment factions

Wind Posts: 60 Join Date: 10/8/12 Recent Posts
Hello all,

If I have a profile and I want to define the different fractions of sediment in the profile, how can I do it? With the gdistX.inp?

For example, If nx=A and I have two different fractions, how can I indicate the point where it changes?

Regards
Javier
Bas Hoonhout, modified 6 Years ago.

RE: Multiple sediment factions

Infra-gravity Posts: 362 Join Date: 5/20/11 Recent Posts
Hi Javier,

I don't understand what you mean with the "point where it changes", but the gdistX,inp files work as follows:

If you have 2 different sediment fractions, you have two gdistX.inp files: gdist1 and gdist2.

gdist1 contains for each grid cell the fraction of sediment type 1.
gdist2 contains for each grid cell the fraction of sediment type 2.

A gdistX file therefore has (nx+1)*(ny+1)*nd fractions defined where nx and ny are the spatial grid cells in the horizontal and nd is the number of vertical layers defined in params.txt. The first number from all gdistX files should add up to 1, so should the second and the third, etc...

I think it will be clear if you look at the example mentioned above.

Bas
JT
Javier Tercero, modified 6 Years ago.

RE: Multiple sediment factions

Wind Posts: 60 Join Date: 10/8/12 Recent Posts
Thank you!

I got it! But the problem is the xbeach is not worknig with the different sizes, it starts to read the files and the program stopped to read without error, but if I do not use the multi grid it works without problem.

Regards
Javier

Attachments:

Bas Hoonhout, modified 6 Years ago.

RE: Multiple sediment factions

Infra-gravity Posts: 362 Join Date: 5/20/11 Recent Posts
Can you post your entire model setup?
JT
Javier Tercero, modified 6 Years ago.

RE: Multiple sediment factions

Wind Posts: 60 Join Date: 10/8/12 Recent Posts
Here it is

Attachments:

JT
Javier Tercero, modified 6 Years ago.

RE: Multiple sediment factions

Wind Posts: 60 Join Date: 10/8/12 Recent Posts
Sorry this is the file for gdist1.inp

But...when I run it, the program crashes

Attachments:

Bas Hoonhout, modified 6 Years ago.

RE: Multiple sediment factions

Infra-gravity Posts: 362 Join Date: 5/20/11 Recent Posts
You need to set nd to a value equal or larger than 3 as stated in your warning file (which should be an error rather than a warning I think).

You always need a "breathing" layer, a sub layer and a bottom infinite buffer layer. The former is defined using nd_var, the latter is always the last one (and cannot be equal to nd_var, I think) and the sublayer is the third layer (which can be on top of the "breathing" layer, in theory).

I think that conceptually it could work with only 2 layers, but with the current implementation in XBeach you need 3 at least.

Bas
JT
Javier Tercero, modified 6 Years ago.

RE: Multiple sediment factions

Wind Posts: 60 Join Date: 10/8/12 Recent Posts
You are right but I am not sure if that is the problem, because I changed it and it is still not working!

I do not why, because I used the same parameters than the Zebra example for the sediment...
Bas Hoonhout, modified 6 Years ago.

RE: Multiple sediment factions

Infra-gravity Posts: 362 Join Date: 5/20/11 Recent Posts
I got it working with your executable when I changed nd to 3 and used the second gdist1 file you sent. With the first gdist1 file it again doesn't work, because the fractions in the gdistX files do not add up to 1. This should be handled by an error handler, but apparently this one is broke. I do not see why...

So if the right nd value and the right gdistX files are not working in your case, what errors do you get? Also have a look at the errors printed to the screen rather than the log file.

Bas
JT
Javier Tercero, modified 6 Years ago.

RE: Multiple sediment factions

Wind Posts: 60 Join Date: 10/8/12 Recent Posts
Maybe it is for the memory...I do not have idea but I do not manage to run it!

and I do not have time to read in the screen the message because the code disappeared quick and as you said the blog for the errors does not work...

Any suggestion?

Regards
Javi
Bas Hoonhout, modified 6 Years ago.

RE: Multiple sediment factions

Infra-gravity Posts: 362 Join Date: 5/20/11 Recent Posts
If you start XBeach from the command line, the code will not disappear. You can start any program from the command line by going to your start menu en type "cmd" + Enter (or first select "Run..." in case you are on WindXP or lower).

In the command window that appears you can navigate to your model directory using "dir <path_to_model_dir>" or change drives using "<drive_letter>:". Once you are in your model directory run xbeach by typing "xbeach.exe" assuming that the executable is in your model dir. Otherwise type "<path_to_xbeach>\xbeach.exe".

For example:

>> d:
>> cd d:\xbeach\model1\
>> xbeach.exe

Good luck!
JT
Javier Tercero, modified 6 Years ago.

RE: Multiple sediment factions

Wind Posts: 60 Join Date: 10/8/12 Recent Posts
Are the problem the dlls?

This is the error i got using the right gdist1 file

Attachments:

Bas Hoonhout, modified 6 Years ago.

RE: Multiple sediment factions

Infra-gravity Posts: 362 Join Date: 5/20/11 Recent Posts
No, it says your gdist1 file is too short. The gdist1 file is (nx+1)*(ny+1)*nd long and so is your gdist2 file. Since you changed nd from 1 to 3, the gdist files should be three times longer. In your case there should be 795 fractions in each file. Did you do that?

Bas
JT
Javier Tercero, modified 6 Years ago.

RE: Multiple sediment factions

Wind Posts: 60 Join Date: 10/8/12 Recent Posts
Now I got it...thanks for your help!

Just one question more, the first 265 data corresponds to the first layer, the next to the intermediate layer and the last data correspond to the bottom layer, does not it?

Regards
Javier
Bas Hoonhout, modified 6 Years ago.

RE: Multiple sediment factions

Infra-gravity Posts: 362 Join Date: 5/20/11 Recent Posts
Yes
JT
Javier Tercero, modified 6 Years ago.

RE: Multiple sediment factions

Wind Posts: 60 Join Date: 10/8/12 Recent Posts
Hi all,

When you use different sediment factions, do the number of layers have to be 3 (nd=3)?

Cannot I use two different sediments and just one layer? Because I have seen that the computational time is three times if you use 3 layers... and I just would like to change the kind of sediment in that layer, is it possible?

Thanks for your help!

regards
javier
Robert McCall, modified 6 Years ago.

RE: Multiple sediment factions

Wind Posts: 83 Join Date: 3/24/11 Recent Posts
Hi Javier,

at this stage you always have to include at least 3 vertical layers (nd >=3) if you include multiple sediment types in XBeach. I not very sure how you would get much useful information from a (morphodynamic) model with multiple fractions, but only 1 vertical layer. For instance sediment mixing would be quite difficult to keep track of realistically. If you have any ideas, please do post them here.

Anyway, I think the main increase to the computation time is the fact that multiple sediments mean multiple advection-diffusion equations to solve. We haven't tested this for a while, so perhaps you could give some examples of computation times for varying layers and sediment types.

Robert
JT
Javier Tercero, modified 6 Years ago.

RE: Multiple sediment factions

Wind Posts: 60 Join Date: 10/8/12 Recent Posts
Robert McCall:
Hi Javier,

at this stage you always have to include at least 3 vertical layers (nd >=3) if you include multiple sediment types in XBeach. I not very sure how you would get much useful information from a (morphodynamic) model with multiple fractions, but only 1 vertical layer. For instance sediment mixing would be quite difficult to keep track of realistically. If you have any ideas, please do post them here.


You are right, but what is happening when you define 3 layers and in the interaction between both material you have the same kind of material in all the layers?


Robert McCall:
Anyway, I think the main increase to the computation time is the fact that multiple sediments mean multiple advection-diffusion equations to solve. We haven't tested this for a while, so perhaps you could give some examples of computation times for varying layers and sediment types.

Robert


Using the same grid and same boundary conditions, the computation time for one sediment type was around 30 hours and with 3 vertical layers was 100 hours, so approximately is 3 times
Robert McCall, modified 6 Years ago.

RE: Multiple sediment factions

Wind Posts: 83 Join Date: 3/24/11 Recent Posts
Sorry, I don't understand your first question. I can only suggest that the interaction with the lower layers is dependent on what you specify as an initial condition of the lower layers.

For the second part, just so I am clear about your input:

- 1 grain type (ngd=1) and 1 layer (nd=1) = 30 hours
- 1 grain type (ngd=1) and 3 layers (nd=3) = 100 hours

Correct?

If so, did you also try with multiple sediment types?

- 3 grain type (ngd=3) and 3 layers (nd=3) = ?? hours

Robert
JT
Javier Tercero, modified 6 Years ago.

RE: Multiple sediment factions

Wind Posts: 60 Join Date: 10/8/12 Recent Posts
Robert McCall:
Sorry, I don't understand your first question. I can only suggest that the interaction with the lower layers is dependent on what you specify as an initial condition of the lower layers.


I mean what is the difference between both figures:



Is it solved in different ways?

Robert McCall:
For the second part, just so I am clear about your input:

- 1 grain type (ngd=1) and 1 layer (nd=1) = 30 hours
- 1 grain type (ngd=1) and 3 layers (nd=3) = 100 hours

Correct?

If so, did you also try with multiple sediment types?

- 3 grain type (ngd=3) and 3 layers (nd=3) = ?? hours

Robert


Yes you are right.
As the three grain types, I have not tried yet but I will give you an estimation of how long it takes to run 0.1% next week

Cheers
Robert McCall, modified 6 Years ago.

RE: Multiple sediment factions

Wind Posts: 83 Join Date: 3/24/11 Recent Posts
Hi Javier,

There is a difference between both pictures you show, which becomes important when materials are transported and start to mix. Mixing of the sediments only occurs in the top layer. If you only have one (very large) layer, then any 'sand' will 'disappear' as a very low concentration in the 'rock' cell. The 'sand' will probably never be full transported away from the 'rock' cell. Note that if you have any significant erosion, you will always need a thick layer to allow for the full extent of erosion.

On the other hand, if you have multiple layers, with one thin top layer, you can effectively allow a thin layer of 'sand' on top of the 'rock', that in later time steps can be removed by wave/flow action. Erosion, when it occurs, is accounted for by merging the top layer with lower layers.

Looking specifically at your example with 'rock' (immobile?) and 'sand', I would recommend using the 'struct' option in XBeach. This allows you to define areas of the model that cannot erode (concrete, bedrock, etc.), without having to specify multiple fractions. Your simulation should therefore run just as fast as with one bed layer and sediment fraction.

Also, thanks for time the results of the various models. This will help us look into the drop in calculation speed.

Robert
JT
Javier Tercero, modified 6 Years ago.

RE: Multiple sediment factions

Wind Posts: 60 Join Date: 10/8/12 Recent Posts
Thanks you Robert!

As the hard layers, I have not found anything in the manual but I found a couple of examples (Egmond and petten) on the website and a topic where they discussed about it, but I do not know exactly how to do it...

Hard layers

If you have a grid of 150x150, to define the hard layer in the nebed file you must define the contour with ones and zeros?? the ones means that the hard layer starts?

I do not have it really clear

Could you give me a hand?

Thanks
Javier
Robert McCall, modified 6 Years ago.

RE: Multiple sediment factions

Wind Posts: 83 Join Date: 3/24/11 Recent Posts
Hi Javier, and others,

To use the hard structures option you need to specify 'struct = 1' in params.txt, as well as 'ne_layer = xxxxx', where you replace 'xxxxx' with the name of the hard layer bathymetry file you have created for this simulation. The ne_layer file should be the same size and structure as your model bathymetry file, but instead of the bed level, each cell specifies the amount of mobile sediment (sand) initially lying on top of the structure. Note that the bathymetry file still contains the intial bed level, whether or not this is a 'hard' structure. To make this clear with an example: if in one model cell you want to specify a hard structure at 5m height, with no sand on top, then the value for that cell in the bathymetry file is 5, the value for that cell in the ne_layer file is 0. If you want to specify a hard structure at 2m height, with 1m of sand on top, then the value for that cell in the bathymetry file is 3 (top of the bed is at 2m+1m=3m) and the value for that cell in the ne_layer file is 1 (1m of sand covering the hard structure). In areas that you do not want to have a hard structure, set the value in the ne_layer file to a very high value (e.g. 100m). If you do not modify your bathymetry file, then this means the hard layer is burried 100m below the surface of the sediment.

Robert
JT
Javier Tercero, modified 6 Years ago.

RE: Multiple sediment factions

Wind Posts: 60 Join Date: 10/8/12 Recent Posts
Hi Robert,

It seems that works but in the third step, it crashes and I get the following error:

Quit XBeach since computational time implodes/explodes
Please check the velocities at the end of the simulation
dtref 0.468082666040216
par%dt 24.0000000000000
An extra output timestep is created to inquire the last timestep
before an error occured


If I run the same model without the structure, it works so I do not know where the mistake is.

In my case, I do not have any breawater, but rocks so the ne_layer should contain the values of the bathymetry file where the sediment is sand and 0 where I have rocks, isn't it?

Thanks in advance

J

Pd. maybe you should move the topic to not divert the thread
Silvia Unguendoli, modified 6 Years ago.

RE: Multiple sediment factions

Capillary Posts: 7 Join Date: 1/8/14 Recent Posts
Hi all,

I have a question about the file gdist1.
What is the code to insert in params.txt to read the file gdist1?

thank you very much

Silvia
JT
Javier Tercero, modified 6 Years ago.

RE: Multiple sediment factions

Wind Posts: 60 Join Date: 10/8/12 Recent Posts
Robert McCall:


If so, did you also try with multiple sediment types?

- 3 grain type (ngd=3) and 3 layers (nd=3) = ?? hours

Robert


It takes the same time as 2 grain type (ngd=2) and 3 layers! aprox 100h
AH
Artur Heleno, modified 3 Years ago.

RE: Multiple sediment factions

Capillary Posts: 3 Join Date: 2/25/16 Recent Posts
Hi all,


I have a error when I use more than one class of sediments (keyword ngd).
I suspect it is because of the memory, because already confirmed that the input's are right.


I hope you can help me, need to make simulation for my dissertation.

Regards,
Artur Heleno

Attachments:

Arnold van Rooijen, modified 3 Years ago.

RE: Multiple sediment factions

Swell Posts: 239 Join Date: 11/7/11 Recent Posts
Hi Arthur,

Hope you already figured out the issue.

If not, I suspect it has to do something with the formatting of the sediment fraction file...

Cheers
Arnold
MF
Maria Fotia, modified 3 Years ago.

RE: Multiple sediment factions

Capillary Posts: 4 Join Date: 7/13/16 Recent Posts
Dear all,

Can someone advise me how to put the gdist1.inp and gdist2.inp in the file where the the params.tsxt file exist. In the manual this hasn't been defined. I have the same problem with bedfricfile as well.
Many thanks,

Maria
Arnold van Rooijen, modified 3 Years ago.

RE: Multiple sediment factions

Swell Posts: 239 Join Date: 11/7/11 Recent Posts
Hi Maria,

You don't need to specify these files in the params.txt file, see also in the manual page 76: The bed composition is defined using external files that are not explicitly referenced from params.txt, but are assumed to be located in the working directory of the model (next to params.txt).

This is not the case for the friction file though, where you need to specify the keyword 'bedfricfile' and the filename in the params.txt.

Hope this helps.

Cheers
Arnold