top of page

Tutorials

Public·3 members

Tutorial 7: Creating a Custom Configuration

For this tutorial, we assume that you have played around with the Examples, and have reviewed the previous Tutorials.  Here, creating your own simulation, separate from the Examples, is described.

The recommended approach is:


·       Create a gridded 2D bathy/topo surface, covering the area you wish to simulate.  The grid can be of any resolution, but the finer the better.  If you wish to overlay a satellite image or some other custom raster, create that image with the same spatial extents as your 2D bathy/topo surface.


·       Using the provided configuration scripts (or custom versions thereof), specify basic simulation parameters, such as model grid size (does not need to be the same as the 2D bathy/topo surface), Courant number, constant friction factor, boundary conditions, etc.


·       Upload the script-generated input files into the “Upload Custom Configuration Files here:” section of the “Start Here” panel. Click “Start Simulation” to load and…


364 Views
Patrick Lynett
Patrick Lynett
07. Sept. 2024

Hey Uwe-


Yeah, I am trying to migrate away from Matlab, but it is hard for someone who has been using it for so long...


The easiest replace option would be Python, and perhaps when/if @Mathieu Soulayrol gets them working, he can share with you.


But to the data structures.

Easiest is the json control file, which you can edit by hand. The below would be the minimum required to get a simulation started: {

"WIDTH": 919.00000000,

"HEIGHT": 799.00000000,

"dx": 1.00000000,

"dy": 1.00000000,

"Courant_num": 0.20000000,

"NLSW_or_Bous": 1.00000000,

"base_depth": 15.00000000,

"g": 9.81000000,

"Theta": 2.00000000,

"friction": 0.00100000,

"isManning": 0.00000000,

"dissipation_threshold": 0.15000000,

"whiteWaterDecayRate": 0.02000000,

"timeScheme": 2.00000000,

"Bcoef": 0.06666667,

"tridiag_solve": 2.00000000,

"west_boundary_type": 0.00000000,

"east_boundary_type": 0.00000000,

"south_boundary_type": 1.00000000,

"north_boundary_type": 2.00000000,

}


and you would change the WIDTH, HEIGHT, dx, dy, and boundary types to match your problem. WIDTH and HEIGHT are the dimensions of the input bathy/topo grid. Take a look at the Matlab configuration script for descriptions of the other variables. The bathy input file contains just the bathy grid, with no metadata or axis information (which is given in the control file). You should have your bathy grid stored in a 2D matrix, with dimensions HEIGHT by WIDTH. Save that matrix as an ascii text file, with a line break at the end of each row.


For the waves, the model expects a discrete amplitude spectrum, given as a listing of the individual wave components. The wave input file is a formatted ascii file, with the format: [NumberOfWaves] 2121

=================================

0.00497907 17.3077 -1.57075 5.11891

0.00509694 17.3077 -1.57075 5.69109

0.00520456 17.3077 -1.57075 0.797858

...


Here, the value after the [NumberOfWaves] represents the total number of individual wave components you wish to generate. So, to generate a monochromatic wave, this would be 1. The data columns are:

Column 1: Wave component amplitude (m)

Column 2: Wave period (sec)

Column 3: Wave direction (rad)

Column 4: Wave phase (rad)


If you have a small number of wave components you wish to generate, you can easily create & edit this file my hand.


Tutorial 6: Saving Images and Raw Data

For this tutorial, we assume that you have a simulation running, and it is properly using the high-performance GPU on your system. Ideally, you have worked through or reviewed the previous tutorials.


For image output, open the “Outputs: Animations & Images” Panel:

ree

From this Panel, the user can write a single jpg to file, an animated gif, or a time stack of jpg images.  All files will be saved to the browsers Downloads directory.    For the animated gif and jpg time stack, the user can specify the time in between the frames / images.   For all of these visualizations, the saved images will match those displayed in the web page. ***There are still some bugs to this feature.  In particular, when the time between frames/images is small, sometimes frames are skipped.  This is related to the asynchronous nature of javascript, where previous frames are not fully retrieved/written before the next…


ree

70 Views

Tutorial 5: Creating and Saving Time Series Data

For this tutorial, we assume that you have a simulation running, and it is properly using the high-performance GPU on your system. Ideally, you have worked through or reviewed the previous tutorials.


Set your simulation to look like the below (viewing the Free Surface Elevation with the Ocean colormap), and open the “Plot Time Series” Panel:

ree

The model allows for time series at up to 15 different locations.  This is currently a hard-coded limit.  For this example, lets create four different time series.  In the “Total Number of Time Series”, select 4.


In the “Duration” input box, the user would add the length of time for the time series to be displayed and then saved.  For example, if the user chooses 900 seconds (15 minutes), time series will be saved to disk every 900 seconds of simulation time.  If the model runs for 60 minutes, then four separate time series…


78 Views

Tutorial 4: Changing Sea Level & Bathy/Topo

For this tutorial, we assume that you have a simulation running, and it is properly using the high-performance GPU on your system. Ideally, you have worked through or reviewed the previous tutorials.


Set your simulation to look like the below (viewing the Free Surface Elevation with the Ocean colormap), and open the “Modify Sea Level & Edit Bathy/Topo” Panel:

ree

Through this Panel, the user is able to change the sea level and modify the bathymetry / topography surface.   First, lets change the sea level.  In the “Change in still water level” box, add a large number so we can visualize the change. In the image below, 3 m have been added to the sea level:

ree

This particular ability is useful for visualizing storm or tsunami evolution at different tide or future sea level conditions.  Note that the change to the water level is an impulsive change to the simulation, and…


76 Views

University of Southern California

213-740-3133

© 2024 by Patrick Lynett

bottom of page