Community header

Forum

RE: Issue using initial conditions for sediment fractions from restart file

Birgit de Lange, modified 1 Year ago.

Issue using initial conditions for sediment fractions from restart file

Keen Forecaster Posts: 9 Join Date: 1/14/22 Recent Posts
Dear users of this forum, 

I am currently experimenting with implementing sediment nourishments in the 1D Rhine branches model. I wish to save time by using restart files, to start a simulation from a certain point in another simulation. While this works fine for most components, I noticed that the sediment composition of the bed starts from the initial conditions as specified in a .ini-file, rather than from the restart-file. I have already tried the following options:
  1. In the .mor-file: replace "IniComp = mor.ini" with "IniComp = rijn-flow-model_19980101_000000_rst.nc". This is not allowed, since this is not the right file-type for the IniComp-keyword:
    ** ERROR  : Invalid file version of rijn-flow-model_19980101_000000_rst.nc. Expecting [BedCompositionFileInformation] FileVersion = 01.00 or 02.00
  2. In the .mor-file: delete the line "IniComp = mor.ini". This means that the initial conditions for the sediment fractions are taken from the .sed-file, which is also not the right composition. 
  3. In the .mor-file: delete the line "IniComp = mor.ini" and in the sed-file: delete the lines "IniSedThick      =  1.0000000e+000". This also results in an error, since no initial conditions can be found.
    Sediment fraction  1: Sediment1           
    *** ERROR File not found: Error in SdBUni.
    ** FATAL  : unstruc::flow_sedmorinit - Error in subroutine rdstm.

In the D-Morphology manual on page 37, it does say that using the restart-file for the initial conditions of the sediment fractions is allowed: "Space-varying initial concentrations read from a restart file generated by a previous run".

Does anyone have experience with this who knows how to take the initial conditions for the sediment fractions from the restart-file instead of from an initial conditions file?

For completeness, in the .mdu-file, the restart-block looks like this:
1
[restart]
2
RestartFile                       = rijn-flow-model_19980101_000000_rst.nc                    # Restart netcdf-file, either *_rst.nc or *_map.nc
3
RestartDateTime                   =                     # Restart date and time (YYYYMMDDHHMMSS) when restarting from *_map.nc
And the sediment-block looks like this:
1
[sediment]
2
MorFile                           = mor.mor             # Morphology settings file (*.mor)
3
SedFile                           = sed.sed             # Sediment characteristics file (*.sed)
4
Sedimentmodelnr                   = 4                   # Sediment model nr, (0=no, 1=Krone, 2=SvR2007)
5
MorphoPol                         = mor_active_v2.pol 
6
InMorphoPol                       = 1
7
MorCFL                            = 0
8
DzbDtMax                          = 0.1                 # Maximum bed level change per time step
9
DredgeFile                        = Nourishment.dad 
thumbnail
Willem Ottevanger, modified 1 Year ago.

RE: Issue using initial conditions for sediment fractions from restart file

Keen Forecaster Posts: 6 Join Date: 9/20/11 Recent Posts
Dear Birgit, 

Thanks for your question. As I remember, the restart including the sediment should be possible from the restart file. How was the restart file generated ? Did that simulation include morphology. When you open the file using QuickPlot does the sediment information show?

Look forward to your reply
​​​​​​​WIllem 
Birgit de Lange, modified 1 Year ago.

RE: Issue using initial conditions for sediment fractions from restart file

Keen Forecaster Posts: 9 Join Date: 1/14/22 Recent Posts
Dear Willem, 

Thank you for your reply to my question!

The restart-file was indeed created in a simulation that includes morphodynamics. However, in Quickplot, I can read the sediment information, such as sediment composition, transport etc. from the map-file but not from the restart-file. Thank you for pointing me to this.

I now notice that there is one line in the mdu-file that indicates what should be written to the restart-file: 
1
Wrirst_bnd                        = 1                   # Write waterlevel, bedlevel and coordinates of boundaries to restart files

Is there perhaps another keyword that I can 'turn on' to let the sediment composition be written to the restart file as well? I cannot find such a keyword in the manuals. 

Best regards, 
Birgit
thumbnail
Willem Ottevanger, modified 1 Year ago.

RE: Issue using initial conditions for sediment fractions from restart file

Keen Forecaster Posts: 6 Join Date: 9/20/11 Recent Posts
Hi Birgit, thank you for the clarification. I received the model you are using from Victor, and I can reproduce the error. The sediment information is stored on the restart file (you can find it in in the variable 'msed'), it is however not correctly used. I will generate an issue to fix this. In the meantime, if you are pressed for time, you could generate the IniComp files based on the moment which you would like to restart from as a workaround. The location information could be obtained from the map file. Just out of curiosity, which version of the software are you using? 
Birgit de Lange, modified 1 Year ago.

RE: Issue using initial conditions for sediment fractions from restart file

Keen Forecaster Posts: 9 Join Date: 1/14/22 Recent Posts
Dear Willem, 

Thank you for finding the issue. I will then indeed create the initialization files manually from the results of the simulation. I have a short question about this. The bed consists of 11 layers: the active transport layer, 9 under layers and a base layer. The active layer and the under layers are currently initialized in the IniComp files. However, the base layer is not since it is not present in the first timestep (no sediment has aggraded yet so no sediment had to be 'pushed down' to the bookkeeping layers yet). When restarting the simulation from a certain point in time, this base layer can be present. Can I just add an 11th layer to the mor.ini-file (and add the corresponding .xyz-files to the simulation folder) and will that layer then automatically be treated as the base layer? Or should I initialize this in a different way?

Furthermore, I have a question about using a timeseries file for nourishments. I have generated a .dad-file in which the [General] block looks like this:
1
[General]
2
PolygonFile             = Nourishment_areas.pol
3
InPolygon                 = 2                            # Indicate how to check whether a grid cell is inside polygon 1: all corners (min. area), 2: centre (default), 3: one of the corners (max. area)
4
TimeSeries                 = Nourishment_times.ddt
In the .ddt-file, a timeseries-file is included, which is made according to the description in the manual, such as this:
1
location                     'General                 '
2
time-function                'non-equidistant '
3
reference-time               'from model'
4
time-unit                    'seconds'
5
interpolation                'block'
6
parameter                    'time '         unit ' '
7
parameter                    'active '       unit '-'
8
    0.0000                    0.0
9
    7884000.0000              1.0
10
    23652000.0000             0.0
11
    31536000.0000             0.0

However, the timeseries file is not correctly read. In the dia-file it is written that the nourishment is always active (and from the results I can see the same), rather than reading the timeseries-file that is assigned to the nourishments:
1
Nourishment active          : always

 When I change the information in the timeseries file to something that cannot be right (e.g. change the location name to some random word), I do not get an error message, so it seems as if the file is not read at all. However, when I change the filename of the timeseries-file in the .dad-file to a filename that does not exist, it does give an error message that the indicated filename was not found in the folder, meaning that it does search for the file. Do you have any idea what I could do such that the timeseries file is properly read?

If it costs too much time to answer the second question, I can also first work around this by using restart-files after a nourishment. 

I am currently using software version 2022.02.

Thank you in advance! 
Best regards, 
Birgit
Birgit de Lange, modified 1 Year ago.

RE: Issue using initial conditions for sediment fractions from restart file

Keen Forecaster Posts: 9 Join Date: 1/14/22 Recent Posts
Dear users of this forum, 

Does anyone have any experience with either creating an initialization file for the base layer or implementing a timeseries when using the dredge/dump module, as explained in my questions above?

Furthermore, I am running into some other minor issues when creating the initialization files.
Firstly, when a layer has a thickness of 0, there is also no sediment distribution that can be defined. However, when no distribution is given, I get an error saying that the sum of all fractions does not add up to 1. Is it okay to then just define an arbitrary distribution, since the thickness of the layer is 0 anyways or does this influence the model in some way?

Secondly, when a layer has a thickness of 0, in some cases I get an error saying "** ERROR  : Negative sediment thickness specified for layer  2 in file mor.ini at nm=21". However, the thickness is not negative but just 0. I also checked this in Matlab, where I created the initialization files, and manually verified that it is indeed 0 by just replacing the value with 0. The latter also did not help to resolve the issue. Does anyone know how this is caused and how to prevent this fatal error from occurring? I currently replaced the thickness of 0 with a very small number (order -12) to work around this issue, but it still is strange to me why the model would think it is negative in the first place.
 
This is an example of a line for which the error is given (layer 2, nm=21):
1
1.000000000000000E+00 3.559971156157359E+03 0.000000000000000E+00

  ​​​​​​​
Best regards, 
Birgit
thumbnail
Victor Chavarrias, modified 1 Year ago.

RE: Issue using initial conditions for sediment fractions from restart file

Famous Fortune teller Posts: 98 Join Date: 4/24/20 Recent Posts
Hi, 

For creating the initial condition of the bed you can check function <D3D_morini_files> in the OET. 

Yes, you need to provide a composition that adds up to 1 for all locations, also if the thickness is 0. 

It is unfortunate that you encoutner the problem of negative thickness. The problem may be with interpolation of the data. The data provided at a point x-y is interpolated to the cell nodes and it may be that it is negative. That is something to try to solve, indeed. Setting it to a very small value seems a good workaround that I would have also used. 
Birgit de Lange, modified 1 Year ago.

RE: Issue using initial conditions for sediment fractions from restart file

Keen Forecaster Posts: 9 Join Date: 1/14/22 Recent Posts
 Dear Victor, 

Thank you for your answer and the explanation of the causes of this error.
 
Do you perhaps have any idea still on how I can solve the issue with reading the timeseries file when implementing nourishments, as I explained in my second response to this thread? I can work around this issue by restarting my simulation after a nourishment, but it would be much more convenient (and less prone to errors) if the timeseries file could be read. 

Best regards, 
Birgit
  
Birgit de Lange, modified 1 Year ago.

RE: Issue using initial conditions for sediment fractions from restart file

Keen Forecaster Posts: 9 Join Date: 1/14/22 Recent Posts
Does anyone have experience with using a timeseries when implementing nourishments (or dredging operations)? If so, do you also run into the issues I mentioned above and do you know how to solve this?
thumbnail
Willem Ottevanger, modified 1 Year ago.

RE: Issue using initial conditions for sediment fractions from restart file

Keen Forecaster Posts: 6 Join Date: 9/20/11 Recent Posts
Dear Birgit, 

Sorry for missing the second part of your question. I have not tested this, but it appears from your description that the time series for dredging and dumping input is not correctly read using the Delft3D FM. I will have a look into this. 

Kind regards,
Willem  
Eki Liptiay, modified 1 Year ago.

RE: Issue using initial conditions for sediment fractions from restart file

Keen Forecaster Post: 1 Join Date: 1/24/22 Recent Posts
Good afternoon everyone,

I will be following up on Birgits research, which will almost certainly mean that I will be using the same model. Therefore, I was wondering if you had any time to look at the problems Birgit ran in to.

Kind regards,

​​​​​​​Eki
thumbnail
Victor Chavarrias, modified 1 Year ago.

RE: Issue using initial conditions for sediment fractions from restart file

Famous Fortune teller Posts: 98 Join Date: 4/24/20 Recent Posts
From Willem:

[17:13] Willem OttevangerHi Eki, 

I have tested the nourishment with a time series and it appears to work. 
Could you let me know if the following files work for you too? 

Kind regards,
Willem 

nourishment.dad
1
[DredgeFileInformation]
2
   FileCreatedBy    = Willem Ottevanger
3
   FileCreationDate = 01-03-2023
4
   FileVersion      = 01.02   
5
[General]
6
   PolygonFile      = nourishment.pol
7
   InPolygon        = 2                            # Indicate how to check whether a grid cell is inside polygon 1: all corners (min. area), 2: centre (default), 3: one of the corners (max. area)
8
   TimeSeries       = nourishment.bct
9
[Nourishment]
10
   Name            = Nourishment
11
   MaxVolRate      = 365
12
   DistrOverDump   = 1
13
   Dump            = Nourishment1
14
   Sediment        = Sediment1
15
   SedPercentage   = 0.0
16
   Sediment        = Sediment2
17
   SedPercentage   = 0.0
18
   Sediment        = Sediment3
19
   SedPercentage   = 100.0
20
   Sediment        = Sediment4
21
   SedPercentage   = 0.0
22
   Sediment        = Sediment5
23
   SedPercentage   = 0.0
24
   Sediment        = Sediment6
25
   SedPercentage   = 0.0
26
   Sediment        = Sediment7
27
   SedPercentage   = 0.0
28
   Sediment        = Sediment8
29
   SedPercentage   = 0.0
30
   Sediment        = Sediment9
31
   SedPercentage   = 0.0
32
   Sediment        = Sediment10
33
   SedPercentage   = 0.0
34
   Sediment        = Sediment11
35
   SedPercentage   = 0.0
36
   Sediment        = Sediment12
37
   SedPercentage   = 0.0
38
   Sediment        = Sediment13
39
   SedPercentage   = 0.0
40
   Sediment        = Sediment14
41
   SedPercentage   = 0.0
42
   Sediment        = Sediment15
43
   SedPercentage   = 0.0
44
   Sediment        = Sediment16
45
   SedPercentage   = 0.0


nourishment.pol
1
Nourishment1
2
     5     2
3
      -0.560837    4623.072754
4
       1.761494    4623.072754
5
       1.700382    4596.793457
6
       1.578152    4578.092285
7
      -0.194153    4578.214355


nourishment.bct
1
location                     'Nourishment'
2
time-function                'non-equidistant '
3
reference-time               19940101
4
time-unit                    'seconds'
5
interpolation                'block'
6
parameter                    'time '         unit ' '
7
parameter                    'active '       unit '-'
8
    0.0000                    1.0
9
    536457600.000             1.0
10
    820454400.000             1.0