As more people are using the model, a common desired workflow looks like: 1) Create and fine-tune the model setup using the Web interface
2) Run various different cases, including modifications to water levels, waves, bathy/topo etc Right now step 2) is laborious, requiring alot of manual interaction, including loading the files for each case, clicking Run, setting up the desired output, and then curating (copying, processing) the output. With Chrome, it is possible to automate / script all of step 2). Chrome distributes a "chromedriver" browser application, which can be controlled externally via a library in Python (e.g. Selenium). An example script on how to do this is given below. Right now, the automation abilities allow the user to:
Create an animated gif, starting at some specified time with a specified frame interval
Output 2D surfaces of model data (e.g. free surface elevation, velocity) between some start and end times, at a specified time increment
Output wave height and water level statistics. The user needs to specify a time to start determining the mean water level (this should be the time when the simulation has reached quasi-steady conditions, usually between 5-15 minutes, depending on the bathymetry), a time to start determining the wave height statistics (usually 10-15 minutes later), and finally a time to write the wave height surfaces, after which the simulation will terminate.
An example Python script with required files is attached, and a more complete (and living) example can be found at the github (https://github.com/plynett/plynett.github.io) in the "automation" directory.
As you will see from the example, you will need to download the "chromedriver" application, which can be found here for various OS's:
https://googlechromelabs.github.io/chrome-for-testing/ I recommend using the "Stable" version, and download the "chromedriver" zip for your system. Hopefully the Python script is fairly understandable. You can see that running any configuration that does not need interactivity during the simulation can easily be configured with this script. It should also be straightfoward to use this script, or a variant of it, within a batch-type workflow, running many simulations in sequence.
A note here to warn folks that if/when Chrome updates, you also need to update chromedriver... Chrome updates automatically, chromedriver doesn't.
Hi Patrick,
I’m trying to drive Celeris with incident_wave_type = 5 in my config.json (“Time Series from loaded file”), but I can’t find anywhere the exact syntax you expect for that text file.
I still have one of our old “custom spectrum” forcing files that we created for earlier tests—let me know if you’d like me to share it. In the meantime, could you confirm:
How many columns are required, and in what order?
Which physical quantities go into each column, and what units?
Whether the first column (time) can be omitted if I set a fixed interval in the JSON?
Any requirements on delimiters, header lines or decimal formats?
Thanks for your help!
Thanks Pat, much appreciated!
Hey Pat,
Great stuff, I think I have it working for my test case. A few clarifications:
This is how I modified thecode for my situation:
trigger_resetMeans_time = 300.0 # time to reset means
trigger_resetWaveHeight_time = 1800.0 # time to reset wave height
trigger_writeWaveHeight_time = 2000.0 # time to write wave height, this is also the end time for the simulation
does this mean it is doing the FSmean, HUmean and HVmean for times between 300 and 2000 secs? but doing the wave height stats (Hs and Hrms) between 1800 and 2000 secs?
do you have any suggestions for appropriate time windows over which these averages/stats should be calculated?
are the HUmean and HVmean files the average u and v currents speeds?
Thanks!
-jose
you 'da man!