Skip to content

Latest commit

 

History

46 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Projektarbeit CAS "Schutz vor Naturgefahren"

This repository contains the model runs for the hydrodynamical modelling with BASEMENT as part of the CAS-thesis "Hydrodynamische Modellierung der Überschwemmung im Raum Siders–Chippis mittels BASEMENT"

It contains scripts that help with the creation of the mesh as well as all configuration files for the model runs.

The Makefile defines steps to easily run certain parts of the modelling process.

Setup

The modelling process is set up so that the creation of the mesh and the modelling is run on a remote linux-server.

On the linux-server the following software needs to be available:

- BASEMENT 4.2 (https://basement.ethz.ch/download/software-download/download-v4.html)

- python

- uv (https://docs.astral.sh/uv/getting-started/installation/)

- basemesh (https://pypi.org/project/BASEmesh/)

On the client the following global variables need to be defined:

export server="server-dns"

export username="username-on-the-server"

export project_dir="path-to-project-on-server"

These variables are needed for the rsync call, to push locally modified files to the server. The call hat the following structure:

rsync -rlv --checksum "path-on-client" "$(username)@$(server):$(project_dir)/end-dir"

Modelling Steps

The modelling steps are mostly defined as code in the Makefile. There are some steps that need to be made manually when creating a new model. The commands need to be run in a terminal

Step-by-Step

Mesh-Creation

  • Make sure that the DTM, the perimeter-file and the stringdefs-file are in the the meshes/base_data/ directory

  • To set up a new mesh, run:

# mesh_name: choose a name

make create_new_basemesh \
    mesh_name=the_new_name
  • To create the mesh, run:
# syns the base_data and code to the server
# creates the mesh

# mesh_name: choose the same name as in the step before
# hole_marker: "messstationen", "with_bridges", "without_bridges", "with_road_bridge"
# maximum_area: integer value that defines the maximum mesh size

make run_basemesh \
    mesh_name=the_new_name \
    hole_marker=which_hole_marker \
    maximum_area=area
  • To sync back the result to your client, run:
# mesh_name: choose the same name as in the step before

make sync_output_basemesh \
    mesh_name=the_new_name
  • Look at the created mesh in QGIS.

Creat and run Model

  • To set up a new model, run:
# Copies the needed Data into the input_data-directory as well as the need config-file from 
# `config_templates` to `configuration` in the new model-directory.
# Makes a first sync with the server

# model_name: choose a model name
# hole_marker: "messstationen", "with_bridges", "without_bridges", "with_road_bridge"
# time: integer that sets the total run time in seconds
# mesh_name: name of the mesh name to be used

make create_new_model \
    model_name=your_model_name \
    hole_marker=which_hole_marker \
    time=run_time \
    mesh_name=mesh_to_use
  • Adjust the model.json if needed. Furthermore, the Zufluss and HQ-Relation files can/need to be adjusted.

  • To start the model, run:

# Syncs the model setup to the server
# starts a tmux background session

# model_name: model name chosen in the step before

make run_model \
    model_name=your_model_name
  • To sync the results back to your client, run:
# model_name: model name chosen in the step before
# simulation_name: in the model.json set name under: "simulation_name"

make sync_model_result \
    model_name=your_model_name \
    simulation_name=simulation_name
  • To create a raster from the result shape-file, run:
# model_name: model name chosen in the step before
# simulation_name: in the model.json set name under: "simulation_name"

make rasterize_model_result \
    model_name=your_model_name \
    simulation_name=simulation_name
  • Visualize the result in QGIS. A style-file for the output-mesh can be found in the model_result-directory

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages