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-09-24 15:50:24

dp
User
Registered: 2019-09-24
Posts: 3

Mass balance problems

Hi,

I am using Basment for rainfall-runoff simulations over a large, hilly area and run into dozens of "mass balance problems" which result into an abortion of the simulation:
MASS BALANCE PROBLEM: h = -0.000461048 < 0.0
MASS BALANCE PROBLEM: h = -0.000461048 < 0.0
MASS BALANCE PROBLEM: h = -0.000579809 < 0.0

Some infos about the model setup:
Rainfall is fed in by the source-option into the model and there are no other boundary conditions (neither inflows nor outlfows) applied.

Are there any possibilities to handle this problem? Thanks for your help in advance,
David

Last edited by dp (2019-09-24 16:02:37)

Offline

#2 2019-09-25 07:45:55

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

Re: Mass balance problems

Hi David

You can identify the region with mass balance problems with the "debug mode" by running the simulation with the flag "-debug". This could help you to further identify the problem.

Do you have any negative sources in your model and what is your minimum water depth?

Best regards
Matthias

Offline

#3 2019-09-25 13:22:24

dp
User
Registered: 2019-09-24
Posts: 3

Re: Mass balance problems

Hi Matthias,

thanks for your help!

The minimum water depth is 0.005 m and there are no negative source values. For the rainfall input I use the option "distributed" and for data "100". According to the manual, the data value is interpreted as mm/h. However, the tooltip-info says mm/s. Since the input of decimal places is restricted, I guess it is mm/h, isn't it?

However, the error-message is as follows:
-> ERROR in kernel_GLOBAL_Update... MASS not conserved
-> ... unfortunately BASEMENT is killed!

Thanks,
David

Last edited by dp (2019-09-25 15:02:19)

Offline

#4 2019-09-25 22:30:41

dp
User
Registered: 2019-09-24
Posts: 3

Re: Mass balance problems

turning off "safe mode" was the solution. everything is fine now :-)

thanks again for your help, Matthias!
Best,
David

Offline

#5 2019-10-17 13:47:35

qtheiler
User
Registered: 2015-07-30
Posts: 60

Re: Mass balance problems

Hi,

You have spoken about debug mode. Is there any option to run the debug mode from the Graphical interface? If I run my model from the terminal, how I'm supposed to write? like
$ ./BMv3_BASEplane_seq -f simulation.json -r mySim_run.h5
-o mySim_run_results.h5 -p -debug

The results of the problem will be on the terminal for the element with problem of mass balance?

Cheers,

Offline

#6 2019-10-18 13:08:41

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

Re: Mass balance problems

dp wrote:

turning off "safe mode" was the solution. everything is fine now :-)

This only turns off the error message, but does not solve the mass balance problem.



@qtheiler: Running in debug mode is only possible via the terminal with the flag --debug (or -d):

$ ./BMv3_BASEplane_seq -f simulation.json -r mySim_run.h5
-o mySim_run_results.h5 -p --debug

Best regards
Matthias

Offline

#7 2020-11-29 23:06:33

isabo
User
Registered: 2020-11-03
Posts: 6

Re: Mass balance problems

Hi,

My situation is similar to David’s: simulation of rainfall for a small area without boundary conditions causes mass conservation errors when increasing the simulation time or output timesteps. I was wondering why this is the case…
is the reason for this error typically rooted in the mesh? how can you prevent it from happening, if possible?

My second concern is about running in debug mode to detect the trouble causing cells. I tried debugging my simulation.json with a batch file (for Windows), but it doesn’t actually recognise the commands you suggested in the user manual (-f, -r, -o,..). I must be missing the point here:

START C:\"Program Files"\BASEMENT_31\bin\BMv3_BASEplane_cuda.exe
-f C:\"Program Files"\BASEMENT_302\batch_file_debug\input_simulation\simulation.json
-r C:\"Program Files"\BASEMENT_302\batch_file_debug\input_simulation\mySim_run.h5
-o C:\"Program Files"\BASEMENT_302\batch_file_debug\output_debug\mySim_run_results_debug.h5 -p --debug
PAUSE 

Thanks a lot and kind regards,
Isabel

Offline

#8 2020-12-01 10:26:30

isabo
User
Registered: 2020-11-03
Posts: 6

Re: Mass balance problems

Hi again,

Decreasing the CFL-value to a much lower level for a more stable calculation did the trick for me... smile

Cheers,
Isabel

Offline

#9 2020-12-21 12:27:32

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

Re: Mass balance problems

Hi Isabel,

just out of curiosity: do you have the DIRECTION module active?

Cheers
Matteo

Offline

#10 2024-07-07 09:56:17

Giampietro
User
Registered: 2021-06-25
Posts: 5

Re: Mass balance problems

Hi,

I have the same problem. I am using the BASEHPC module. What exactly I have to do to activate the debug mode. Could you please provide me a screenshot about it?

Thank you in advance!!

Regards,

Giampietro

Offline

#11 2024-07-08 08:14:44

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

Re: Mass balance problems

Hi Giampietro

The debug mode is only available when starting a simulation via the command line, and not in the GUI. For this, you have to start a command prompt and navigate to the folder with your simulation files. From there, the BASEMENT executables can be called for example as:

'C:\Program Files\BASEMENT 4.1.0\bin\BMv4_BASEHPC_omp.exe' -f .\simulation.json -r .\setup.h5 -d

The "-d" at the end of the command activates the debug mode. More examples on how to run a simulation via the command line can be found in the User Manual part of the documentation. To change the directory and see content in a directory you can use the commands "cd" and "dir" (e.g. have a look here: https://www.stationx.net/windows-comman … eat-sheet/

The safe mode can be deactivated via the model.json file (in the GUI). Just set the parameter "safe_mode" in the block "SETUP/BASEHPC/BASEPLANE_2D/HYDRAULICS/PARAMETER/safe_mode" to "off".

Best regards,
Matthias

Offline

#12 2024-07-08 22:37:54

Giampietro
User
Registered: 2021-06-25
Posts: 5

Re: Mass balance problems

Hi Matthias,

Thanks for the quick response. The problem persists. Can I send more details via email?

Thanks in any case.

Regards, Giampietro

Offline

#13 2024-07-10 08:18:13

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

Re: Mass balance problems

Hi Giampietro,

Mass balance errors occur when more water flows out of a cell than its volume and inflow can account for during a given time step. This error is often seen at the wet/dry interface, or can also be related to imposed boundary conditions that rapidly change the hydrodynamic conditions in boundary cells.

To mitigate these errors, you can try reducing the CFL number and thereby, the time step. However, be aware that this adjustment might significantly slow down your simulation, potentially to an unacceptable level.

If this slowdown is problematic, the only current solution is to disable "safe_mode" (set to "off"). Turning off "safe_mode" will allow the simulation to continue despite the mass balance errors, which are usually negligible compared to the overall simulated flow rates. This way, you can prevent the simulation from aborting and maintain a reasonable simulation speed.

Best of luck with your simulations!

Regards,
Matthias

Offline

#14 2024-07-16 15:39:03

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

Re: Mass balance problems

Hi Giampietro,

I don't see an issue with the boundary condition.  I cannot help you out without further details on what the problem is. Does the model crash even with safe mode off?

Best regards,
Matthias

Offline

Board footer

Powered by FluxBB