This repository contains code to solve the incompressible inviscid Euler equations using the artificial compressibility method. The code is implemented in FreeFEM and supports both 2D and 3D computations. For 2D computations, the geometry is created directly in FreeFEM as well as GMSH-generated meshes can be imported, while for 3D computations, only GMSH-generated meshes are imported.
To use this code, you need to have FreeFEM and GMSH installed on your system.
-
FreeFEM Installation
- Follow the instructions on the FreeFEM website to install FreeFEM.
-
GMSH Installation (for 3D computations)
- Follow the instructions on the GMSH website to install GMSH.
-
Domain Size: The computational domain should be big enough such that the far-field boundary condition is achieved and the boundaries don't interfere with the flow near the object.
-
Mesh Refinement: The mesh should be small enough near the body wall so that the flow can be computed accurately and solution doesn't diverge.
-
Artificial Compressibility: An appropriate value of artificial compressibility should be choosen so that the solution converges quickly. Generally, the value of
$\beta$ exists between 0 and 1. The default value of$\beta$ is$10^{-9}$ . (For more details and convergence study, refer to the report.
For 2D computations, you can find the 2D script in the 2D
directory.
-
Navigate to the
2D
directory:cd 2D
-
If GMSH geometry is to be imported, uncomment the lines 26-27 and comment lines 12-23 in
solver2D.edp
. The.msh
file should be exported with the following settings in the.geo
script file of GMSH. For 2D, the boundaries should be defined as Physical Curves whereas the surface should be defined as Physical Surface. An example of GMSH script file is given in2D/example.geo
.Mesh.Format = 1; Mesh.MshFileVersion = 2.2; Mesh.SaveAll = 0; Mesh.Binary = 0;
-
Run the FreeFEM script:
FreeFem++ solver2D.edp
Will be updated soon.
A sample 2D computation is provided in the 2D
directory. The script Solver2D.edp
demonstrates how to set up and solve the flow around a cylinder. The results are saved in VTK format for visualization. The code is tested for different values of N (number of points on cylinder surface), Test/2D
directory.
Will be updated soon.
Contributions are welcome! If you have any improvements, bug fixes, or new features, please submit a pull request. Ensure that your code follows the existing style and include appropriate comments.
This project is licensed under the MIT License. See the LICENSE file for details.
Feel free to modify the sections to better fit the specifics of your repository. If you have any additional information or examples, you can include them in the relevant sections.