Installing OpenFOAM 2.3 on Ubuntu 18.04
Hi guys,
I am fairly new to OpenFOAM and I just started a research project with my university. I took on a project that uses OpenFOAM to simulate some fluid dynamics. The previous student who worked on this used OpenFOAM 2.3 along with some python wrapper to generate the necessary 0, constant, system files,etc. I am just wondering if there is a way to install OpenFOAM 2.3 on my Ubuntu 18.04 ? All the tutorial that I found work for older versions of Ubuntu like 16.04 and older. I even tried those and as expected, they did not work... Thanks ! |
I've been able to get the OpenFOAM working on Ubuntu 18.04 via the Docker fine. That's with 1712 (I'm not sure what the conversion from the X.X version system to the XXXX versioning system is), though you can probably find a Docker with the version you're looking for?
I'm as much of a newbie (probably more) as you are, so I might be steering you in the wrong direction, but I figured I'd let you know that I've gotten OF to work on 18.04. |
I am working on it, but it does not work yet. :-(
|
Greetings to all!
Sorry for the late reply, but I simply was not able to look into the forum questions until now. Please find the requested installation instructions here: https://openfoamwiki.net/index.php/I...u#Ubuntu_18.04 Best regards, Bruno |
1 Attachment(s)
Thank you for your time.
I have tried this method, but failed to compile the of 2.3.1 on Ubuntu 18.04. The log is attached ( since the file size is too big, only the beginning is uploadded) Quote:
I have tried this method, but failed to compile the of 2.3.1 on Ubuntu 18.04. The log is attached ( since the file size is too big, only the beginning is uploadded) |
Quick post:
|
5 Attachment(s)
Quote:
|
Quote:
To modify src/conversion/ensight/part/ensightPart.H After line 63 Code:
// Static data memebers Code:
// wrapper for isnan, namely C99 or C++11 |
Greetings charryzzz,
The fix you proposed for "isnan" would not solve this issue as indicated in the log files: Code:
gcc -m32 -Wall -O3 -fPIC dirToString.c -o /home/charry/OpenFOAM/OpenFOAM-2.3.1/wmake/platforms/linuxGcc/dirToString The problem was that since I had written this: Code:
export WM_CC='gcc-5' Code:
export WM_CC='gcc' Code:
source $HOME/OpenFOAM/OpenFOAM-2.3.1/etc/bashrc WM_NCOMPPROCS=4 WM_MPLIB=SYSTEMOPENMPI As for the fix you proposed, my guess is that you had started a new terminal and ran of231. This means that the following command was called when you started a new terminal: Code:
source $HOME/OpenFOAM/OpenFOAM-2.3.1/etc/bashrc WM_NCOMPPROCS=4 WM_MPLIB=SYSTEMOPENMPI; export WM_CC=gcc-5; export WM_CXX=g++-5 However, I'm not certain why you needed the fix for "isnan", because the library inside which you made that change, did not require that fix in the test build that I did while writing the instructions. That fix would only have been necessary if g++ 7 (part of GCC) was being used, which in the second build attempt that you did, I believe you were already using g++ 5. For example, in the log file of my build, I got this: Code:
SOURCE=ensight/part/ensightPart.C ; g++-5 -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/home/ofuser/OpenFOAM/OpenFOAM-2.3.1/src/fileFormats/lnInclude -I/home/ofuser/OpenFOAM/OpenFOAM-2.3.1/src/finiteVolume/lnInclude -I/home/ofuser/OpenFOAM/OpenFOAM-2.3.1/src/meshTools/lnInclude -IlnInclude -I. -I/home/ofuser/OpenFOAM/OpenFOAM-2.3.1/src/OpenFOAM/lnInclude -I/home/ofuser/OpenFOAM/OpenFOAM-2.3.1/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/ensightPart.o Code:
SOURCE=ensight/part/ensightPart.C ; g++-5 Only when I replace g++-5 with g++, do I get this error: Code:
ensight/part/ensightPart.C: In member function ‘bool Foam::ensightPart::isFieldDefined(const Foam::List<double>&) const’: Best regards, Bruno |
Greetings Bruno
You are right! I have installed openfoam 2.3.1 on ubuntu 18.04 successfully according to your newest instructions. Thank you :-) |
I have compiled OpenFOAM 2.3.0 including paraview 4.1.0 successfully on the Ubuntu 18.04 based on the instruction provided for the 16.04! just needed to install gcc 5.5 accroding to this guide: (side by side with gcc 7.3 and selecting gcc5 before compiling)
https://gist.github.com/application2...cf9f56315a2d91 also needed to add these two lines in Make/options to get foamyQuadMesh and foamyHexyMesh compiled: Code:
EXE_LIBS = \ |
Greetings Daniel,
Many thanks for sharing! Although now I am a bit confused... when did you start to try to build OpenFOAM 2.3.0 on Ubuntu 18.04? I ask this because I had added a section for it here https://openfoamwiki.net/index.php/I...u#Ubuntu_18.04 - on the 17th of August 2018... so perhaps you had started your build before that? Which leads me to the following question: Would it be preferable that I copy the complete instructions from the page for 2.3.1 to 2.3.0, instead of providing the wiki link? Best regards, Bruno |
Quote:
I have compiled it a month ago when I decided to upgrade to ubuntu 18.04 from 16.04! The first reasonable thing to do was to follow 16.04 instruction step by step and it didn't failed me... after the step involving the installation of the necessary packages, I did as follow: Code:
sudo apt-get update Code:
sudo update-alternatives --config gcc Code:
sudo apt-get install qt4-default Code:
alias selectGCC='sudo update-alternatives --config gcc' Quote:
I can only confirm that the instruction for 16.04 in this page: https://openfoamwiki.net/index.php/I...M-2.3.0/Ubuntu is completely applicable to 18.04 with the above mentioned modifications! Furthermore, the instruction for swak4Foam is also working on ubuntu 18.04: https://openfoamwiki.net/index.php/I...2.2.0_to_3.0.x Regards, |
Hi Daniel,
Many thanks for writing down the steps you've used! And I'm very glad that swak4Foam builds without problems with those instructions. I have a few improvement suggestions to the steps that you have:
Bruno |
I followed the guide of
https://openfoamwiki.net/index.php/I...u#Ubuntu_18.04 and successfully installed of230 and paraview on ubuntu18.04.5, without any issue, thanks a lot!! |
Dear Bruno,
Have you tried to install openfoam 2.3 on ubuntu 20.04? I follow wiki https://openfoamwiki.net/index.php/I...u#Ubuntu_18.04 But it does not work. Could you give me some ideas? Best regards, Chengan |
All times are GMT -4. The time now is 01:33. |