For a while, I used the old version of Palabos software.
It recently updated and I have opportunity to attend a online Summer school. Honestly to say, there are so many items I do not know. Then, it is necessary to practice the hands-on exercises.
Install cmake and paraview
To compile this example you need Cmake installed in your system. To check the installation
type on your terminal: cmake --version
.
If it returns an error, you need to proceed with the installation. Try sudo apt install cmake
You will also need to have installed paraview
in your machine to read the output files and
(optionally) gifsicle
to merge .gif
files created by Palabos. Test if they are already installed with installed:
gifsicle --version
and paraview --version
. If this is not the case, try to install them:
sudo apt install gifsicle
sudo apt install paraview
CMAKE file
At first, you need compile the CMAKE file, and produce a EXE file. For this file, you need to know where to change the project name and define the executable_name, when necessary.
|
|
Most importantly, you need set the PALABOS_ROOT. Otherwise you will face a compile error after the command cmake ..
# # # If the palabos root folder is in your path, you don't need to modify anything.
# # # In the other case you have 2 options: 1. add PALABOS_ROOT=path/to/palabos to the path of your system
# # # 2. you comment the next line and uncomment the one after, explicitly giving the path/to/palabos
# # # (NB you can use ${CMAKE_CURRENT_SOURCE_DIR} to give paths relative to the CMakeLists.txt location)
#file(TO_CMAKE_PATH $ENV{PALABOS_ROOT} PALABOS_ROOT)
set(PALABOS_ROOT "../../.")
Open a terminal in the current directory and type the following commands to compile the code with cmake:
cd build
cmake .. && make -j 2
cd ..
At this point you should have an executable in the current directory
named cavity_2d_incomplete_with_bug
. Try to run it in parallel
mpirun -np 2 cavity_2d_incomplete_with_bug
in the case of a linux-based system.
or just using:
./cavity_2d_incomplete_with_bug
Cavity2d.cpp
In the main function, Physical and Numerical parameters can be set for the simulation.
|
|
At last, have a glance at the uNorm at 9s in the 2D Cavity: