Multiple OpenFOAM versions on one machine
Hey Foamers,
I've been running OF-2.0.1 on my Ubuntu 11.04 machine and want to try out some of the solvers that were made for OF-1.6-ext at the same time. I installed 2.0.1 using a precompiled package. Will I have problems being able to run both versions at the same time? How can I ensure that the application I wish to run will be from the desired OF version? If I download the solvers and compile them without compiling OF-1.6-ext will I run into issues? Thanks for your input. -Eric |
It was discussed before in this forum I'm not sure if this is the optimal way but you can run different OpenFOAM executables adding that lines in your $HOME/.bashrc file, for example (change your paths and versions):
alias startFoamGPU='source /opt/openfoam201GPU/etc/bashrc' alias startFoam='source /opt/openfoam201/etc/bashrc' alias startFoam210='source /opt/OpenFOAM-2.1.0/etc/bashrc' So when you want to use OpenFOAM type in the console: startFoamGPU, startFoam or startFoam210. Be sure that the WM_PROJECT_DIR environment variable present in the bashrc of your OpenFOAM directory was right. Also delete previous PATH environment variables in $HOME/.bashrc, something like: source /opt/OpenFOAM-2.1.0/etc/bashrc Quote:
Quote:
|
Thanks for your reply alquimista. That was exactly what I was looking for.
|
Greetings to all!
For future reference, you can also check a blog post of mine: Advanced tips for working with the OpenFOAM shell environment There is still more to be written, but I haven't had the time and inspiration to write more about it. Best regards, Bruno |
Hi, I have the same problem that Eric (I have installed OF 2.0.1 and 2.1.0 and I canīt run cases in 2.1.0) but I canīt follow Alquimistaīs indications.
I canīt find the route /opt/OpenFOAM-2.1.0/etc/bashrc I canīt execute the command startFoam in my console neither... Any help please? Thanks Regards, |
Hi couriosity,
You should locate the OpenFOAM paths first. Try to find directly in your folders the different version of OpenFOAM that you want to use. If you have problems and you used the rpm package you can find informstion about the installation in the official webpage. The aliases won't work if the bashrc files doesn't exist. So, for example try to open first each bashrc of OpenFOAM to be sure about that. Post more information if you have problems or you are not confortable in linux environments. Regards. PD: you can find also interesting the information provided by wyldckat Quote:
|
Hi,
Thanks for your response. I got it ^^ |
1 Attachment(s)
Hi Guys and thank you for your guidance,
I am also trying to have multiple OF version on a single machines but There have been a strange behavior of aliases while running them. I am trying to use both OF version 2.1.1 and OF version 1.6-ext. As you have mentioned I have added aliases for both OF version in my ~/bashrc file: Quote:
Quote:
Quote:
Quote:
Quote:
But strangely some of other environment variables are OK, like Quote:
Quote:
Quote:
Thank you Mojtaba |
Hi,
try to add those "unset" Variable prior you call bashrc to your ./bashrc alias OF16ext='unset FOAM_INST_DIR;unset WM_PROJECT_USER_DIR;unset WM_THIRD_PARTY_DIR;source ...../OpenFOAM-1.6-ext/etc/bashrc' alias myOF20='unset FOAM..., .../bashrc' |
Quote:
So I have got to see which variables are working and which is not, one by one? and them unset them before bashrc. P.S: unfortunately it didn't work. It just works when I define them and export them one by one. is there any alternative? |
Greetings to all!
Quote:
So, in light of that blog post, there are a few alternatives:
Bruno |
Quote:
Quote:
Well this is interesting, I hadn't mentioned the file unset.sh before. The description in the file says: "Clear as many OpenFOAM environment settings as possible" That's exactly what I needed, But there is a question I have, I couldn't understand the difference between "wmUNSET" and "alias wmUNSET". I think they both do the same for me, am I wrong about this? |
Hi Mojtaba,
Code:
man alias Best regards, Bruno |
how to set environment variables of ThirdPartys corresponding to the OpemFOAMs ??
Quote:
Hi, Currently I am struggling with the post-processing with multi-version of OpenFOAM on my ubuntu 12.04. Actually I have installed the version of OpenFOAM 2.2.1 and ThirdParty 2.2.1. But I also need the OpemFOAM 2.1.1 and 1.6-ext . When I use the paraFoam in these cases of various versions, I meet a block like this, FATAL ERROR: ParaView reader module libraries do not exist Please build the reader module before continuing: cd $FOAM_UTILITIES/postProcessing/graphics/PV3Readers ./Allwclean ./Allwmake So my question is how to set environment variables of ThirdPartys corresponding to the OpemFOAMs ?? Best wishes, Jiatang |
Greetings Jiatang,
If you can provide more information on how you installed each version of OpenFOAM, it'll will be easier to help you. Best regards, Bruno |
my different version of OpenFOAM installation
2 Attachment(s)
Quote:
Hi,Brun, In the beginning I installed OpenFOAM 2.2.1, corresponding post-processing ThirdParty 2.2.1 as well on my ubuntu 12.04, and they are all in the $HOME/user/OpenFOAM fold direction. As my aim is to use the CFDEM coupling, but also need simulation in OpenFOAM individually, so I installed the required package called LIGGGHTS and CFDEM in the $HOME/user direction. The OpenFOAM as well as CFDEM coupling can work smoothly. But I shared some code related to my research field, which codes are compatible with OpenFOAM 2.1.1 and OenFOAM 1.6-ext version. During the OpenFOAM 2.2.1, ThirdParty 2.2.1 LIGGGHTS and CFDEM installation I followed the attached steps file "1#-installation" Followed the same instruction "1#-installation" to install OpenFOAM 2.1.1. Also corresponding ThirdParty 2.1.1 have been complied. At the same time I want to let OpenFOAM 2.1.x coupling with DEM, so I tried OpenFOAM 2.1.x as well. Followed the instruction http://openfoamwiki.net/index.php/In...1.6-ext/Ubuntu to install OpenFOAM 1.6-ext. Now I can use the different version of OpenFOAM except OpenFOAM 1.6-ext because some errors when I tried to compile the OF using the command "./Allwmake" When I use the post-processing of OpenFOAM 2.1.1, after the command "paraFoam", a block is as follows, FATAL ERROR: ParaView reader module libraries do not exist ************************************** Please build the reader module before continuing: cd $FOAM_UTILITIES/postProcessing/graphics/PV3Readers ./Allwclean ./Allwmake ********************************* Attached you can find my .bashrc file and the "1#-installation" Thank you. Best wishes, jiatang |
Hi Jiatang,
Sorry for taking so long to answer to you, but I haven't managed to get enough time to answer questions here on the forum. First, I advise you to change the last big part of your "~/.bashrc" file to this: Code:
#================================================#
Now, as I suggested, start 4 terminal windows or tabs and on each one run only one of the alias commands; in other words, on each terminal run:
Code:
which paraview Code:
cd $FOAM_UTILITIES/postProcessing/graphics/PV3Readers Best regards, Bruno |
Multiple OpenFOAM versions on one machine
Hi Bruno,
A few days before, I installed a Praraview in the /home/ directory but not depend on the each version of OpenFOAM called ThirdyParty. Actually I can use the command "paraFoam" when I run the case in OpenFOAM 221. And in others version of OpenFOAM I can use the command "touch caseneme.OpenFOAM", then use "paraview" to view the results of runung case. New I follow the advice you give me above. Changed the .bashrc fill environment. After that use the command you supplied, and each results are as follows in every terminal, In OenFOAM 2.2.1 terminal, Code:
>>of221 Code:
>>of211 Code:
>>of21x Code:
>>of16ext Code:
cd $FOAM_UTILITIES/postProcessing/graphics/PV3Readers And in others version of OpenFOAM, I use the command, Code:
cd $FOAM_UTILITIES/postProcessing/graphics/PV3Readers It is strange that I can use the command "paraFoam" directly when I run the case in OpenFOAM 16ext to view the results of running case. Now the conclusion is that I can use each version of OpenFOAM, and view the results of running case even though some times I need to transfer the results to .OpenFOAM file using command 'touch casename.OpenFOAM' and then "paraview". So this situation is not too bad. If you cant solve the problem do not worry. But if you can it is better. My question is that I cant use the CFDEM coupling in each version (only can be used in OpenFOAM 2.2.1). I do not know If you can give me some advice. I really need to use the OpenFOAM 21x and Open16ext on my computer. Thanks for your help. Best wishes, Jiatang Wang |
Greetings Bruno
Many thanks for your valuable hints about installing different versions of O.F. on one machine and also the blog you have written (advanced tips).:):) I have O.F. 2.2.x on my $HOME/OpenFOAM directory and my operating system is ubuntu 12.10. I want to install O.F. 2.1.0 in my $HOME/OpenFOAM directory too. I think I am familiar with alias methodology now. However, before starting my installation there is a question remained in my mind.:confused: What about paraview? I mean do I need to just download and build O.F. 2.1.0 and use the alias methodology and then my earlier paraview (3.12.0) installed with O.F. 2.2.x will be used automatically for 2.1.0 too ? Or should I install paraview along with O.F.2.1.0 (which is my second O.F.), too? Regards Bobi |
Greetings to all!
@Jiatang: My advice is to have separate installations of CFDEM, one per OpenFOAM version. I say this because for each version, you might need different code bases of CFDEM. In other words, it might be best to follow the installation instructions for CFDEM, once per OpenFOAM version. Nonetheless, if you want to use the same one in all of them, try this: Code:
cd $HOME/CFDEM/ Since you have one ParaView in the Linux Distribution, then add this alias to your "~/.bashrc" file: Code:
alias paraFoamB='(touch case.foam && paraview --data=case.foam)' Code:
paraFoamB The other possibility is to use this alias: Code:
alias paraFoam221='([ -n "$WM_PROJECT_DIR" ] && source $HOME/OpenFOAM/OpenFOAM-2.2.1/etc/config/unset.sh; source $HOME/OpenFOAM/OpenFOAM-2.2.1/etc/bashrc; $WM_PROJECT_DIR/bin/paraFoam)' Code:
paraFoam221 @Bobi: The instructions I wrote above for Jiatang, namely regarding "paraFoam221", should also work for you :) Best regards, Bruno |
All times are GMT -4. The time now is 09:41. |