Wiki
Clone wikiSimflowny / DamBreakTutorial
Dam Break Quick Tutorial
Problem discretization
For this quick tutorial, the focus will be directed to discretization and simulation. All the needed documents for this process are already in the provided database. The first step for discretization is locating the Dam break with bed discretization policy and opening in an editor, the document is in policies folder. Then, as a good practice before discretizing, validate the policy using Save & Validate button.
Discretization and code generation
Close the editor and select the discretization policy in the document manager. In order to start the discretization, click Discretize Problem button:
Then, wait until the discretization has finished. The result is the creation of a new document, representing the discretized problem.
Generating code in Simflowny is straightforward. Simply select the discretized problem created in the previous section and press the Generate SAMRAI Code button:
After a while, the code is generated and shown in the document manager:
The code can be downloaded clicking in it and then in the download button in the toolbar:
The code is downloaded as a zip file containing all the files needed to compile it.
Running a simulation
Extract the downloaded file to a folder. This folder will be the location for the compilation and simulation. The source code files, a sample parameter file and a Makefile to assist the compilation are uncompressed.
Open a terminal an cd to the code folder.
The next step is to edit the input parameters file to set the simulation requirements. With any text editor we edit problem.input file.
To produce the output from Simflowny 3.0 paper, the following values must be set:
- Problem
- number_of_particles = 200, 200
- particle_distribution = "STAGGERED"
- influenceRadius = 0.08
- dissipation_factor_rho = 0.4
- dissipation_factor_vx = 0.4
- dissipation_factor_vy = 0.4
- Main
- output_interval = 1000
- timer_output_interval = 1000
- dt = 0.00005
- FileWriter
- hdf5_dump_interval = 2000
- CartesianGeometry
- domain_boxes = [ (0, 0) , (50, 50) ]
Save the file.
Next, compile the code using the Makefile system. Open a terminal, cd to the code folder and type:
make
Once the compilation has completed, we are ready to perform a simulation. In the same terminal, run:
./Dambreakwithbed problem.input
The command above executes the binary file recently created by the compilation and uses the parameter file we previously set.
To view the results, use Visit [1].
Next step
At this point, the software has been introduced. For a detailed aproach to Simflowny, an User Guide is provided, with all the features explained.
[1] | https://en.wikipedia.org/wiki/Wave_equation <https://en.wikipedia.org/wiki/Wave_equation>. |
[2] | The document management is explained extensively in the Simflowny user guide, the aim of this tutorial is PDE generation. For document managment details, visit the user guide. |
[3] | https://wci.llnl.gov/simulation/computer-codes/visit/. |
Updated