User Forum of Software BASEMENT

BASEMENT
Basic Simulation Environment for computation of environmental flow and natural hazard simulation
Laboratory of Hydraulics, Hydrology and Glaciology (VAW)
ETH Zurich
Basement_Logo

You are not logged in.

#1 2019-12-20 08:54:08

sua87
User
From: Bern
Registered: 2017-05-26
Posts: 21

Restart issue

I'm currently trying to run a simulation based on a previous simulation in BMv3. I am working on the Windows version. For the testing, I'm using the GUI and as soon as the simulation works, I'm switching to batch-mode. My results.h5, from which I want the restart to be initiated, is located in a different folder (I also tried copying to the same folder).

There are two issues I am experiencing:

  1. When using the GUI, I can select the restart.h5 file directly using a browser. After setting everything, writing the setup.h5 produces an error, since for some reason another ".h5"-string is added to the file path of the restart file. At the moment I have to manually delete the ".h5"-string of the selected file, then the setup is finished correctly. However, this is just a minor problem.

  2. More problematically, I cannot get the simulation to properly restart from the time specified. As it is written in the manual, one should not set a starting time. However this is not possible, the parameter seems to be mandatory. When left away, an error is thrown. When set to my specific restart time, I get an "unexpected error (actually, this should never happen)" message. When I set the value to 0.0, the simulation starts, but from 0, which is not my intention.

Is there something I'm not understanding properly? Or can you provide a quick workaround to this issue?

Thanks in advance.

Offline

#2 2020-01-06 09:33:12

Matthias Bürgler
Developer
From: Zürich
Registered: 2019-04-04
Posts: 150

Re: Restart issue

Hi

Regarding issue 1:
At one point it was decided that the restart file must be specified without the .h5 extension. That the extension is added to the path by the GUI is impractical. We'll try to provide a better solution in a future release.

Regarding issue 2:
The idea of a restart simulation is to set an already existing simulation as initial conditions for a new simulation. The time step which should be taken as initial conditions must be specified in the "model.json" command file. This time step must match one of the time steps which were written to the results.h5 (below renamed as "myRestartFile") during the previous simulation.
However in the simulation command file "simulation.json", the start time should be set to 0 since it is a "new" simulation. The part of the manual stating "without specifying the starting time" seems to be a mistake and will be corrected in future releases.

model.json:

"INITIAL":{
     "type": "continue",
     "file": "myRestartFile",
     "time": 1.5
}

simulation.json:

{
    "SIMULATION":{
        "TIME": {
            "start": 0.0,
            "end":  100.0,
            "out":   50.0
        },
        "OUTPUT": [
            "water_surface",
            "water_depth",
            "bottom_elevation"
        ]
    }
}

On the other hand, a rerun-simulation allows to continue a simulation from given results, thus obtaining a longer simulation without starting from the beginning. In such a case you just run the simulation by specifying a start time > 0 in the simulation command file "simulation.json" (the setup binary must not be called again).

simulation.json:

 "SIMULATION":{
        "TIME": {
            "start": 50.0,
            "end":  200.0,
            "out":   10.0
        },
        "OUTPUT": [
            "water_surface",
            "water_depth",
            "bottom_elevation"
        ]
}

I hope this helps.

Best regards
Matthias

Offline

#3 2020-01-06 12:00:37

sua87
User
From: Bern
Registered: 2017-05-26
Posts: 21

Re: Restart issue

Hi
This does help, thank you for your answer.
Best regards,
Andi

Offline

#4 2020-09-30 09:37:46

Matteo Facchini
Developer
From: Trento
Registered: 2014-09-05
Posts: 281

Re: Restart issue

Hi,

I also tried a hybrid version of re-run and restart and it seems to work.

I wanted to have an obstruction "appearing" at a defined time of my simulation. Here's what I did:

  1. run a "zero" simulation, i.e. simulation0, to guess when the obstruction was happening (based on some rules I have to stick to), let's call that moment t*

  2. create a simulation1 by modifying the simulation0 model.json adding a wall on a specific stringdef (the one where the obstruction appears)

  3. use the results from simulation0 as restart by modifying the initial condition in the simulation1 using as restart time t*

  4. modify simulation1 simulation.json file to make it start from t*

  5. use the same name for the *_run.h5, *_results.h5 and *_output.xdmf to make it work like for a re-run

By doing this, I mixed the 2 approaches and it seems to work.

I have two questions now:

  1. with the restart-approach one has to modify the input hydrographs, with the re-run-approach it won't be necessary, right?

    E.g., if I have a simulation crashing at time tx and I want to do a re-run I only have to edit the simulation.json file, but if I want to make a fresh start from that point on I should also modify the input time series to make them start from 0 at the point where the first simulation crashed.

  2. What if I want to make a re-run not from the last time step but from another one? Will the results be replaced from the starting time on? This could be useful, for instance, to have more frequent outputs around a specific time of a time-series.

Cheers,
Matteo

Offline

#5 2021-06-14 10:23:43

Matteo Facchini
Developer
From: Trento
Registered: 2014-09-05
Posts: 281

Re: Restart issue

I believe there might be a problem with the 3.1.1 version of basement.

I was using the results of a simulation as restart to another simulation and noticed that at the firts time step there are many cells with negative water depth.

The only change between the two simulation is the addition of a wall in the model.

I run several tests to investigate this behavoir and I was able to replicate it even without adding the wall. That is, I was basically restarting the exact same simulation from its last time step and still got many cells with mass balance problems.

This also seems to be independent

  • of the time step, because I set the output timestep = 1 s and nothing changes.

  • of the starting time, except for 0, i.e. if I make it start from the beginning of the previous simulation everything works fine

Offline

#6 2021-06-15 11:00:13

Matteo Facchini
Developer
From: Trento
Registered: 2014-09-05
Posts: 281

Re: Restart issue

I solved my issue as described here

Offline

Board footer

Powered by FluxBB