Launching your first simulation - chaos-polymtl/lethe GitHub Wiki

The objective of this section is to highlight the steps that are necessary to launch your first simulation after you have cloned and compiled Lethe.

Launching of an application requires an executable of the required solver, and a parameters file (with extension .prm if it uses the parameter file format, or .json if it uses the JSON file format). After building Lethe, the solver executable files can be found in : $BUILD_FOLDER/applications directory

For instance, gd_navier_stokes_2d executable is located in the $BUILD_FOLDER/applications/gd_navier_stokes_2d directory.

The executable for the solvers can be used directly from the folder it is compiled to. This can be achieved by:

  • Writing the absolute path of the solver (e.g. $BUILD_FOLDER/applications/gd_navier_stokes_2d/gd_navier_stokes_2d);
  • Adding the lethe folder paths to your PATH environment variable;
  • Specifying an installation folder when you compile Lethe to ensure that all the applications are grouped within a single folder;
  • Locally copying the executable to the folder you are running your simulation from.

All these workflow can achieve the same result.

To launch a simulation, you must specify the solver executable and the parameter file in the following format: solver parameter_file. For example, glsNS2d poiseuille2d.prm

In what follow, we describe a simple procedure to launch your first simulation using Lethe.

Step 1: Copying an example

The source folder of lethe contains an examples folder. This folder contains ready to run examples. Some examples use the mesh generation capacity of Lethe and only require a parameter file, whereas others contain an additional .msh file to describe the mesh. In the present case, we copy the examples/cavity example to a new folder using the terminal:

cp -r $SOURCE_FOLDER/examples/cavity destination/first_simualtion

Step 2: Launching the example

The cavity example we are launching uses the gls_navier_stokes_2d solver. All of the solvers of Lethe can be found in the build folder where you have compiled Lethe or within the installation folder. Inside of your build folder, six other folders should be found:

  • applications
  • applications_tests
  • CMakeFiles
  • prototypes
  • source
  • tests

Inside the applications folder, there is one folder for each solver of Lethe. In the gls_navier_stokes_2d folder, we find the executable file with the same name as the folder: gls_navier_stokes_2d. This solver solves the 2D incompressible Navier-Stokes equations using a Galerkin Least-Square formulation.

From the first_simulation folder we have created, we can launch the simulation directly. I you have decided to copy the executable to the first_simulation folder, you can launch using the following command: ./gls_navier_stokes_2d cavity.prm. You can also launch the simulation using the absolute path of the executable: $BUILD_FOLDER/applications/gls_navier_stokes_2d/gls_navier_stokes_2d cavity.prm.

Step 3: Post-processing the results

Once the application has ran, the simulation results can be looked at by opening the .pvd file using Paraview.

Understanding the examples

Lethe comes pre-packaged with some examples which are documented on the present wiki. We greatly encourage you to look at these examples to understand how Lethe can be used to solve CFD problems. For a more in-depth understanding of the parameter file, the reader can take a look at this section of the wiki for general and Finite Element Method parameters, and this section for Discrete Element Methods parameters.

All examples are accessible though the sidebar menu. Tutorial examples offer basic cases, focusing on a specific aspect, whereas Engineering Applications provide complex cases to showcase some of the features of Lethe.

⚠️ **GitHub.com Fallback** ⚠️