XYFDPlus is a C++ CFD project for solving 2D compressible Navier-Stokes equations on polygonal unstructured grid.
This project contains a C++ namespace xyfd which allows manipulation and computation on grid.
Grids can be created manually or loaded from external grid generators like Gmsh via a well-formatted .msh file.
@author : Xiasu Yang
-
g++ or clang compiler (c++1x compatible);
-
Eigen for linear algebra;
-
(Optional) Gmsh to visualize .msh files.
- go to the project folder :
cd path/to/XYFDPlus/
- make a copy of
main.cppand name itlocal_main.cpp(git-ignored) :
cp main.cpp local_main.cpp
- make a copy of
test.cppand name itlocal_test.cpp(git-ignored) :
cp test.cpp local_test.cpp
- build project using
-
make : make options :
- default : make all programs
make- main : make main program
make main- test : make test program or any other program you choose to put in
local_test.cpp
make test -
VS Code : all build options of make exist also in VS Code. Open folder in VS Code and in the toolbar, click
Terminal -> Run Task ...
and select one of the tasks above to run, ex. buildAll task corresponds to make.
- collect header files for external usage (with library) using
- make :
make headers
- VS Code :
Terminal -> Run Task ... -> buildHeaders
- clean-up using
- make :
make clean
- VS Code :
Terminal -> Run Task ... -> buildClean
- run main program and basic grid info will be written in
out, note theoutfile is git-ignored
- command line :
./main >out
- VS Code :
Terminal -> Run Task ... -> runMain
- when
Enter .msh file name (without extension) :appears in terminal, enter a grid file name (without .msh extension). Two Gmsh .msh filessquare.mshandugly.mshare provided as examples. To check .msh file content, go toXYFDPlus/grids/:
cd path/to/XYFDPlus/grids/
vi *.msh
- to run other tests in
local_test.cpp:
- command line :
./test
- VS Code :
Terminal -> Run Task ... -> runTest