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 2020-05-04 10:59:45

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

mass balance problem only with gui

Hi

I am experiencing the following:

if I start the same simulation
(i) from the GUI,
(ii) from the PowerShell using BMv3_BASEplane_cudaC_single.exe (or BMv3_BASEplane_cudaO_single.exe),
(iii) from the PowerShell using BMv3_BASEplane_cudaC.exe (or BMv3_BASEplane_cudaO.exe)

I obtain three different behaviors:

(i) bm crashes giving mass balance problem
(ii) bm runs without any problem
(iii) bm crashes giving mass balance problem

Cheers,
Matteo

Offline

#2 2020-05-20 12:26:24

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

Re: mass balance problem only with gui

Hi Matteo

I am surprised that the single precision backend is the one that does not crash. Do you get the same behavior if you use the seq or omp backend?

Best regards
Matthias

Offline

#3 2020-05-26 09:23:51

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

Re: mass balance problem only with gui

Hi Matthias,

I am currently running some tests and at a first sight, it looks to me that the problem of the mass balance error was in the interpolation method set for the geometry.

Does it make any sense to you?

PS: you could consider making it compulsory!

Offline

#4 2020-05-26 09:53:26

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

Re: mass balance problem only with gui

Hi Matteo

Not sure if I understand. The interpolation method is determined during the Setup process and should be independent of using the GUI or the PowerShell for running the simulation, right?

Yes, we are already discussing to make it compulsory.

Best
Matthias

Offline

#5 2020-05-26 12:19:37

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

Re: mass balance problem only with gui

Sorry, my bad...I mixed up stuff

I tried to reproduce the problem under windows 10 and different backend

(i) GUI with GPU only
(ii) GUI with GPU, single-threaded on CPU
(iii) GUI with GPU, multi-threaded on CPU (4 CPUs)
(iv) from the PowerShell using BMv3_BASEplane_cudaC_single.exe (or BMv3_BASEplane_cudaO_single.exe),
(v) from the PowerShell using BMv3_BASEplane_cudaC.exe (or BMv3_BASEplane_cudaO.exe)

using the Flaz tutorial as benchmark

1. B_restart_unsteady

First, from the PowerShell I get an error on the mesh, which I do not get from the GUI and I had to put the complete path to the mesh to make it work.

Then, I had to to the same for the Inflow_transient.txt file.

(i) ok
(ii) ok
(iii) ok
(iv) crash with mass balance problem
(v) ok

2. C_morphology

(i) ok
(ii) ok
(iii) ok
(iv) crash with mass balance problem
(v) ok

Here is my batch script using BMv3_BASEplane_cudaC.exe

"C:\Program Files\BASEMENT 3.0.2\bin\BMv3_BASEplane_setup.exe" ^
-f D:\03_BASEMENT\97_3p0_test\Flaz_2D_v3\C_morphology\model.json ^
-o D:\03_BASEMENT\97_3p0_test\Flaz_2D_v3\C_morphology\C_morphology_run.h5
"C:\Program Files\BASEMENT 3.0.2\bin\BMv3_BASEplane_cudaC.exe" ^
-f D:\03_BASEMENT\97_3p0_test\Flaz_2D_v3\C_morphology\simulation.json ^
-r D:\03_BASEMENT\97_3p0_test\Flaz_2D_v3\C_morphology\C_morphology_run.h5 ^
-o D:\03_BASEMENT\97_3p0_test\Flaz_2D_v3\C_morphology\C_morphology_run_results.h5 -p
"C:\Program Files\BASEMENT 3.0.2\bin\BMv3_BASEplane_results.exe" ^
-f D:\03_BASEMENT\97_3p0_test\Flaz_2D_v3\C_morphology\results.json ^
-r D:\03_BASEMENT\97_3p0_test\Flaz_2D_v3\C_morphology\C_morphology_run_results.h5 ^
-o D:\03_BASEMENT\97_3p0_test\Flaz_2D_v3\C_morphology\C_morphology_output

Here is the mass balance error I get

Writing '/RESULTS/CellsAll/HydState/0000000' to file 'D:\03_BASEMENT\97_3p0_test\Flaz_2D_v3\C_morphology\C_morphology_run_results.h5'
Writing '/RESULTS/CellsAll/BottomEl/0000000' to file 'D:\03_BASEMENT\97_3p0_test\Flaz_2D_v3\C_morphology\C_morphology_run_results.h5'
Writing '/RESULTS/NodeStrg/StateVar/0000000' to file 'D:\03_BASEMENT\97_3p0_test\Flaz_2D_v3\C_morphology\C_morphology_run_results.h5'
 -> Progress: 0/100, dt = 0.02 [s], RTS = 0
MASS BALANCE PROBLEM: h = -0.000610352 < 0.0
MASS BALANCE PROBLEM: h = -0.000610352 < 0.0
MASS BALANCE PROBLEM: h = -0.000610352 < 0.0
MASS BALANCE PROBLEM: h = -0.00012207 < 0.0
MASS BALANCE PROBLEM: h = -0.0012207 < 0.0
MASS BALANCE PROBLEM: h = -0.000732422 < 0.0
 -> ERROR in kernel_GLOBAL_Update... MASS not conserved
 -> ... unfortunately BASEMENT is killed!

Offline

#6 2020-05-26 14:48:58

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

Re: mass balance problem only with gui

Hi Matteo

Regarding the mass balance error: Assuming that you used double precision for (i)-(iii), my best guess is that single precision is not precise enough for the Flaz test case. Possible reason: Coordinates are represented by 10 to 12 digits.

Regarding the file paths: The GUI calls the different backends from the scenario directory. Therefore, providing a relative path (i.e. only the filename) works fine. Also, if you call the batch script from within the scenario directory, it should work with relative paths in the model.json, since the different backends are also called from the scenario directory in this case. But if you call the batch script from outside the scenario directory, the SETUP backend won't find the files with a relative path.

Best regards
Matthias

Offline

#7 2020-05-26 14:56:04

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

Re: mass balance problem only with gui

That makes perfectly sense!

In the example I sent you you can test the behavior described in the first message, i.e.

Matteo Facchini wrote:

if I start the same simulation
(i) from the GUI,
(ii) from the PowerShell using BMv3_BASEplane_cudaC_single.exe (or BMv3_BASEplane_cudaO_single.exe),
(iii) from the PowerShell using BMv3_BASEplane_cudaC.exe (or BMv3_BASEplane_cudaO.exe)

I obtain three different behaviors:

(i) bm crashes giving mass balance problem
(ii) bm runs without any problem
(iii) bm crashes giving mass balance problem

The problem is exactly the precision: if I run the simulation from the GUI with single precision it works, otherwise I get the mass balance problem!

Offline

#8 2020-07-06 09:51:36

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

Re: mass balance problem only with gui

Dear BASEMENT community,

I'd like to add another chapter to the MASS-BALANCE problem story: I am running a morph simulation starting from dry condition (but the problem I am experiencing occurs even with "continue" initial conditions).

If I run the simulation with a very short output time step (e.g. 1 second) I don't get any mass balance problem, while if I use a longer output time step the simulation crashes due to MASS-BALANCE issue. If I switch off the "safe_mode" I get some minor MASS-BALANCE problems at the very beginning, after which I can run my simulation without any problem.

Best,

Matteo

Offline

Board footer

Powered by FluxBB