je-santos / MPLBM-UT

Library for performing multiphase simulations (based on the Shan-Chen model) in complicated geometries (i.e. porous media 3D images)
GNU General Public License v3.0
150 stars 58 forks source link

Compilation problem #57

Closed Jessy-YU-Aws closed 2 years ago

Jessy-YU-Aws commented 2 years ago

Hello,

I'm a user from France using your LBM code. I would first thank you for this outstanding program, but I'm having some little issues and I was hoping that you could help me.

So, I would like to move the calculation to our server of the supercomputer, which requires me to compile the code on the server instead of using the already compiled version. So, I tested to compile the program on my local computer (I emptied the /build file and use the command 'cmake ..' and 'make' under the directory of /build/ and it gives me this error by the end of compilation, could you please help me with the error?

[ 98%] Built target palabos Scanning dependencies of target permeability [ 99%] Building CXX object CMakeFiles/permeability.dir/permeability.cpp.o /mnt/f/SONAR Project/Lattice Boltzmann Model/SONAR LBM/MPLBM-UT-master-test/src/1-phase_LBM/permeability.cpp: In function ‘void readGeometry(std::string, std::string, plb::MultiScalarField3D&, plb::plint, plb::plint, bool, std::string)’: /mnt/f/SONAR Project/Lattice Boltzmann Model/SONAR LBM/MPLBM-UT-master-test/src/1-phase_LBM/permeability.cpp:109:10: warning: ‘template class std::auto_ptr’ is deprecated [-Wdeprecated-declarations] 109 | std::auto_ptr<MultiScalarField3D > floatTags = copyConvert<int,T>(geometry, geometry.getBoundingBox()); | ^~~~ In file included from /usr/include/c++/9/memory:80, from /mnt/f/SONAR Project/Lattice Boltzmann Model/SONAR LBM/MPLBM-UT-master-test/src/1-phase_LBM/../palabos-v2.2.1/src/multiBlock/multiBlockGenerator3D.h:53, from /mnt/f/SONAR Project/Lattice Boltzmann Model/SONAR LBM/MPLBM-UT-master-test/src/1-phase_LBM/../palabos-v2.2.1/src/multiBlock/multiBlockLattice3D.hh:44, from /mnt/f/SONAR Project/Lattice Boltzmann Model/SONAR LBM/MPLBM-UT-master-test/src/1-phase_LBM/../palabos-v2.2.1/src/core/vectorFunction3D.h:44, from /mnt/f/SONAR Project/Lattice Boltzmann Model/SONAR LBM/MPLBM-UT-master-test/src/1-phase_LBM/../palabos-v2.2.1/src/core/headers3D.h:59, from /mnt/f/SONAR Project/Lattice Boltzmann Model/SONAR LBM/MPLBM-UT-master-test/src/1-phase_LBM/../palabos-v2.2.1/src/palabos3D.h:37, from /mnt/f/SONAR Project/Lattice Boltzmann Model/SONAR LBM/MPLBM-UT-master-test/src/1-phase_LBM/permeability.cpp:3: /usr/include/c++/9/bits/unique_ptr.h:53:28: note: declared here 53 | template class auto_ptr; | ^~~~ /mnt/f/SONAR Project/Lattice Boltzmann Model/SONAR LBM/MPLBM-UT-master-test/src/1-phase_LBM/permeability.cpp:109:73: error: conversion from ‘std::unique_ptr<plb::MultiScalarField3D, std::default_delete<plb::MultiScalarField3D > >’ to non-scalar type ‘std::auto_ptr<plb::MultiScalarField3D >’ requested 109 | std::auto_ptr<MultiScalarField3D > floatTags = copyConvert<int,T>(geometry, geometry.getBoundingBox()); | ~~~~^~~~~~~~~~~ /mnt/f/SONAR Project/Lattice Boltzmann Model/SONAR LBM/MPLBM-UT-master-test/src/1-phase_LBM/permeability.cpp: In function ‘int main(int, char)’: /mnt/f/SONAR Project/Lattice Boltzmann Model/SONAR LBM/MPLBM-UT-master-test/src/1-phase_LBM/permeability.cpp:269:11: warning: unused variable ‘run_diff’ [-Wunused-variable] 269 | plint run_diff = ((runnum - 1)/2)+1; | ^~~~ /mnt/f/SONAR Project/Lattice Boltzmann Model/SONAR LBM/MPLBM-UT-master-test/src/1-phase_LBM/permeability.cpp: At global scope: /mnt/f/SONAR Project/Lattice Boltzmann Model/SONAR LBM/MPLBM-UT-master-test/src/1-phase_LBM/permeability.cpp:357:5: error: ‘pcout’ does not name a type 357 | pcout << "Printing outputs" << std::endl; | ^~~~~ /mnt/f/SONAR Project/Lattice Boltzmann Model/SONAR LBM/MPLBM-UT-master-test/src/1-phase_LBM/permeability.cpp:358:26: error: ‘fNameOut’ was not declared in this scope 358 | std::string outDir = fNameOut + "/"; | ^~~~ /mnt/f/SONAR Project/Lattice Boltzmann Model/SONAR LBM/MPLBM-UT-master-test/src/1-phase_LBM/permeability.cpp:361:5: error: ‘ofile’ does not name a type 361 | ofile << "Outputs" << "\n\n"; | ^~~~~ /mnt/f/SONAR Project/Lattice Boltzmann Model/SONAR LBM/MPLBM-UT-master-test/src/1-phase_LBM/permeability.cpp:362:5: error: ‘ofile’ does not name a type 362 | ofile << "Krw from run: " << "\n" << "Krnw from run: " << (run_diff+1) << std::endl; | ^~~~~ /mnt/f/SONAR Project/Lattice Boltzmann Model/SONAR LBM/MPLBM-UT-master-test/src/1-phase_LBM/permeability.cpp:363:5: error: expected unqualified-id before ‘for’ 363 | for (plint runs = 1; runs <= runnum; ++runs) { | ^~~ /mnt/f/SONAR Project/Lattice Boltzmann Model/SONAR LBM/MPLBM-UT-master-test/src/1-phase_LBM/permeability.cpp:363:26: error: ‘runs’ does not name a type 363 | for (plint runs = 1; runs <= runnum; ++runs) { | ^~~~ /mnt/f/SONAR Project/Lattice Boltzmann Model/SONAR LBM/MPLBM-UT-master-test/src/1-phase_LBM/permeability.cpp:363:42: error: expected unqualified-id before ‘++’ token 363 | for (plint runs = 1; runs <= runnum; ++runs) { | ^~ /mnt/f/SONAR Project/Lattice Boltzmann Model/SONAR LBM/MPLBM-UT-master-test/src/1-phase_LBM/permeability.cpp:374:3: error: expected declaration before ‘}’ token 374 | } | ^ make[2]: ** [CMakeFiles/permeability.dir/build.make:63: CMakeFiles/permeability.dir/permeability.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:78: CMakeFiles/permeability.dir/all] Error 2 make: *** [Makefile:84: all] Error 2

Thank you very much.

Jessy

alexgigliotti commented 2 years ago

Hey Jessy, thanks for trying out our code and letting us know about the error!

This looks like it might be a compiler error. Which compiler are you using? There is not a specific compiler or version recommended by Palabos, but from experience usually GCC 7.X works well (some Intel compilers seem to work too but depends on the version). In case you need it, here's a good reference on how to install and switch between multiple compilers: https://linuxconfig.org/how-to-switch-between-multiple-gcc-and-g-compiler-versions-on-ubuntu-20-04-lts-focal-fossa

Let us know if this helps!

Jessy-YU-Aws commented 2 years ago

Thank you for the link. I think I solved the problem by updating the version of the model. One more thing that I would like to ask is if there is a readme file for the one-phase model parameter settings maybe? Because I didn't find it anywhere and I was wondering if the meaning for omega in the permeability is the same as the two-phase fluid model. Thank you very much for your help.

alexgigliotti commented 2 years ago

I'm glad you were able to solve the problem! Omega for the 1-phase model is similar to the 2-phase one. In both cases, they're used to calculate fluid viscosity. @je-santos might have more details on this if you need them.