This code reconstructs the bathymetry in a water channel using either simulated or experimental observation data. We use gradient descent to minimise an objective functional, where we compute the numerical solution of the continuous adjoint problem in order to determine the gradient. The forward problem is modelled by the nonlinear nonrotating shallow water equations and discretised with the spectral methods framework Dedalus.
After cloning this repository, download the measurement data from the water flume here. You can compute and save the mean of the measurements by uncommenting the lower lines in compare_observations.py
. This file will also produce the plots of the means with confidence intervals. Please change line 41 in compare_observations.py
to 'postfix = f"{i+1}' and line 43 to '+ 'Heat' + postfix + ".txt"', comment lines 29-36 and 84-216, set T_N=10 and uncomment lines 219-249.
- Go to the file
ProblemRelatedFiles/Compute_channel_forward.py
. - Set variables as needed. In particular, set
save = True
. To obtain the plots in the paper, you may copy the parameters from sim_data_Tiefe=0,3_A=40_F=0,35_meanBathy_ExactRamp_T=12_M=128.txt. - Execute the file.
- Go to the file
create_plots_forward.py
. - Insert the file name that was generated by
ProblemRelatedFiles/Compute_channel_forward.py
. - Set
save = True
. - Execute the file.
If you want to generate the optimisation results, use the file gradient_descent.py as follows.
- Set
useOtherParams = True
if you want to reproduce the data from the paper. - If you set
useOtherParams = True
: Setfolder
to one of the folders with parameters, e.g.sim_obs_sensor_pos
. - If you don't want to use one of the predefined parameter files, change the indicated variables in
ProblemRelatedFiles/params.py
as needed. - Set
save = True
. - Execute the file
gradient_descent.py
.
- Go to the file
create_plots.py
. - Insert the folder name that contains the hdf5 file with the optimisation data (e.g. 2024_02_22_09_12_AM).
- Set
save = True
. - Execute the file.
- Execute the file
plot_bathymetry.py
. - Optional: Uncomment the code lines at the bottom to save the figure.
Installation of Dedalus version 3.0.0 or newer is required. Please read the installation instructions on the Dedalus website. For the versions of NumPy, SciPy etc. see the file requirements.txt
.
This project has received funding from the European High-Performance Computing Joint Undertaking (JU) under grant agreement No 955701 (Time-X). The JU receives support from the European Union’s Horizon 2020 research and innovation programme and Belgium, France, Germany, and Switzerland. This project also received funding from the German Federal Ministry of Education and Research (BMBF) grant 16HPC048. The authors acknowledge the support by the Deutsche Forschungsgemeinschaft (DFG) within the Research Training Group GRK 2583 ``Modeling, Simulation and Optimization of Fluid Dynamic Applications''.