This is the C++ implementation of the fluid-structure interaction problem from Emmanuel Lefrançois and Jean-Paul Boufflet (2010). (The C-Model for now).
It is based on the Matlab code written by the authors.
Then, you can build:
cd build
cmake ..
make
The building process has been tested under Windows 10 with g++ 9.2.0, cmake 3.22.0 and Eigen-3.4.0, and in Ubuntu 20 with g++ 9.3.0 and cmake 3.16.3.
./fsi_piston.exe
If indeed the Results/
folder is in the project directory, results will be loaded there, i.e text files containing time history of the pressure, the velocity, timesteps and the density fields in the fluid domain.
- If installing Eigen is ommitted, and only header files are meant to be used, You need to include them along with the header files, and indicate it to your compiler :
Parameters in this case should be modified directly from the
gcc -I XXX/eigen_path/ ...
include/configure.h/
file, instead of modifying via cmake (see next part).
You can tune the spring mass, number of nodes in the fluid domain, the coefficient to multiply the structural natural period to give the total simulation time (see the problem details in the paper), and the nonlinear term coefficient, using respectively the four flags :
mass nmesh coeff mu_coeff
eg
cmake -Dcoeff="1.2" -Dmass="1000." -Dnmesh="200" -Dmu_coeff="6" ..