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 2023-05-25 11:59:05

JBarreiro
User
From: Lisbon, Portugal
Registered: 2019-02-12
Posts: 26
Website

BMv4NodestringResults.py

Hi everyone,

I am running a BASEMENT:HPC model and I am interested in knowing the flow values at my boundaries.

As far as I understand, for this, I need to run the BMv4NodestringResults.py. The thing is: when I run the script, it returns an error at line 16
NodeStrg0 = f['/RESULTS/NodeStrg/StateVar/']

since it can't find this info on the results file.

How can I implement this? I read the manual but it doesn't provide much detail. As far as I understand, I have to indicate in the simulation.json that I want to have these results, but I can't find the way.

If you could provide me some help I would be very grateful.

Regards


João Barreiro
Environmental Engineer (MSc) - PhD Student

Offline

#2 2023-05-29 14:42:58

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

Re: BMv4NodestringResults.py

Hi Joao,
can you copy paste the exact content of the error? Thanks
Anyway, you should have the "ns_" (e.g. "ns_hyd_discharge" for hydraulics) output(s) in your simulation.json file to be able to use the py script.
Cheers
Matteo

Last edited by Matteo Facchini (2023-05-29 14:45:03)

Offline

#3 2023-05-29 15:45:25

JBarreiro
User
From: Lisbon, Portugal
Registered: 2019-02-12
Posts: 26
Website

Re: BMv4NodestringResults.py

Hi Matteo,

My bad, I just added the OUTOUT variable "ns_hyd_discharge" and then run the script and it worked just fine...

I've missed that variable, sorry!

Thanks for the answer.

Regards
João


João Barreiro
Environmental Engineer (MSc) - PhD Student

Offline

#4 2023-08-29 12:44:47

Loriann
User
Registered: 2023-07-05
Posts: 11

Re: BMv4NodestringResults.py

Hello,

A further question on that topic : how do you get those values "ns_hyd_discharge" at other locations than boundaries (i.e. cross-sections to monitor) ? I included cross-sections (inside the river domain, not at boundaries) that I would like to monitor in the string definitions and BASEMENT crashes, because these are "unused" by the model.
How does one include them somehow in order to get the ns_hyd_discharge at cross sections ?

Thanks

Offline

#5 2023-08-31 14:45:23

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

Re: BMv4NodestringResults.py

Hi Loriann
you should have them both in the .2dm file and in the model.json file.
Cheers
Matteo

Offline

#6 2023-09-01 10:17:06

Loriann
User
Registered: 2023-07-05
Posts: 11

Re: BMv4NodestringResults.py

Hi Matteo,

Yes that is my point.

I have these String defs in the model :

          "STRINGDEF": [
            {
              "name": "Inflow",
              "upstream_direction": "right"
            },
            {
              "name": "Outflow",
              "upstream_direction": "right"
            },
            {
              "name": "Profil7",
              "upstream_direction": "right"
            }
          ]

Inflow and outflow are later used as BC :

          "BOUNDARY": {
            "STANDARD": [
              {
                "name": "inflow",
                "string_name": "Inflow",
                "type": "uniform_in",
                "slope": 0.005,
                "discharge": 90.0
              },
              {
                "name": "outflow_lac",
                "string_name": "Outflow",
                "type": "zhydrograph",
                "wse": 372.2,
                "inflowPossible": "true"
              }
            ],
          }

But "Profil7" is not a BC, so it is not "mentionned" anywhere else in the model than under "STRINGDEF".

I do have them all in the 2dm file as well :

NS 402 20144 19059 19172 18800 19057 18942 18351 18940 18799 19055 18696 19053 18938 34 19051 17422 17743 787 13146 200 11740 245 10582 2117 3081 2626 3285 1786 3280 2867 3279 2118 3082 2627 9189 462 11631 13069 2150 11630 14108 1953 14399 12495 9276 13440 1631 13718 13717 15567 12104 15235 14564 15230 165 15229 14534 14556 13359 15240 14551 15243 1871 14570 14554 14576 14546 15246 14575 15507 9725 15505 15273 15577 13771 15283 15280 15282 1542 15427 12568 14950 13938 10250 13935 13278 14943 13885 1872 13884 13957 13269 15608 15408 15706 9078 15688 15684 15686 15300 15581 15803 161 15584 14664 11971 17723 2946 18575 18110 18579 2484 20134 18613 18210 18614 581 18630 18627 18635 18626 20158 19214 20153 18623 20155 19445 19561 19368 19558 19501 20188 -578 Outflow
NS 15543 15541 15548 -1367 Inflow
NS 860 16529 16823 565 16331 569 16330 15175 15185 -1428 Profil7

The cross-sections are even also included as breaklines, so that the mesh has those breaklines and they don't come in the middle of elements.


But still, when I write the simulation file in BASEMENT, I get the following error:

-> no edges found for node string <Profil7>, in file: Z:\src\BASEplane\setup/Mesh.hpp on line 89, version v4.0.1
-> ... unfortunately BASEMENT is killed!


So I hope I can clearer this time : where do I mention that I want this CS to be monitored in the model ?

Thanks !

Last edited by Loriann (2023-09-01 10:26:21)

Offline

#7 2023-09-04 11:39:00

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

Re: BMv4NodestringResults.py

Hi Loriann
stringdefs shouldn't be longer than 40 nodes, your Outflow has more than 100.
You can find this info in a couple of threads in the forum...
Cheers

Offline

#8 2023-09-05 15:55:05

Loriann
User
Registered: 2023-07-05
Posts: 11

Re: BMv4NodestringResults.py

Hi Matteo,

The end of the river is a large delta going into a lake and the simulation works perfectly fine with this stringdefs as outflow.

It is only when I include the cross-section in the middle that it does not work anymore ("Profil7"). However, I tried with other cross-sections elsewhere and this time the model did "Write" without the error message. However, if I put cross sections to monitor along the river, even if the model writes and the simulation runs, I cannot read the results in QGIS at all.

So I guess I won't be able to monitor cross-sections in BASEMENT v4. If anyone has suggestions about this issue I would be very happy to hear them smile

Thanks

Offline

Board footer

Powered by FluxBB