|
[Sponsors] |
Multiple OpenFOAM versions on one machine |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 17, 2012, 11:43 |
Multiple OpenFOAM versions on one machine
|
#1 |
Member
Eric M. Tridas
Join Date: May 2011
Location: Tampa, Florida
Posts: 48
Rep Power: 15 |
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 |
|
January 17, 2012, 12:06 |
|
#2 | ||
Member
Join Date: Apr 2010
Posts: 61
Rep Power: 16 |
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:
Last edited by alquimista; January 17, 2012 at 12:31. |
|||
January 17, 2012, 13:03 |
|
#3 |
Member
Eric M. Tridas
Join Date: May 2011
Location: Tampa, Florida
Posts: 48
Rep Power: 15 |
Thanks for your reply alquimista. That was exactly what I was looking for.
|
|
January 17, 2012, 16:10 |
|
#4 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
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
__________________
|
|
September 24, 2012, 14:12 |
|
#5 |
Member
Paula
Join Date: Aug 2012
Posts: 30
Rep Power: 14 |
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, |
|
September 24, 2012, 14:52 |
|
#6 | |
Member
Join Date: Apr 2010
Posts: 61
Rep Power: 16 |
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:
|
||
September 25, 2012, 12:28 |
|
#7 |
Member
Paula
Join Date: Aug 2012
Posts: 30
Rep Power: 14 |
Hi,
Thanks for your response. I got it ^^ |
|
July 5, 2013, 06:19 |
|
#8 | ||||||||
Senior Member
|
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
__________________
Learn OpenFOAM in Persian SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member Complex Heat & Flow Simulation Research Group If you can't explain it simply, you don't understand it well enough. "Richard Feynman" |
|||||||||
July 5, 2013, 10:30 |
|
#9 |
Senior Member
|
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' |
|
July 6, 2013, 10:12 |
|
#10 | |
Senior Member
|
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?
__________________
Learn OpenFOAM in Persian SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member Complex Heat & Flow Simulation Research Group If you can't explain it simply, you don't understand it well enough. "Richard Feynman" |
||
July 7, 2013, 06:17 |
|
#11 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings to all!
Quote:
So, in light of that blog post, there are a few alternatives:
Bruno
__________________
|
||
July 7, 2013, 14:43 |
|
#12 | ||
Senior Member
|
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?
__________________
Learn OpenFOAM in Persian SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member Complex Heat & Flow Simulation Research Group If you can't explain it simply, you don't understand it well enough. "Richard Feynman" |
|||
July 7, 2013, 15:23 |
|
#13 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Mojtaba,
Code:
man alias Best regards, Bruno
__________________
|
|
February 4, 2014, 06:24 |
how to set environment variables of ThirdPartys corresponding to the OpemFOAMs ??
|
#14 | |
New Member
jiatangwang
Join Date: Jan 2014
Posts: 9
Rep Power: 12 |
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 |
||
February 4, 2014, 15:22 |
|
#15 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
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
__________________
|
|
February 5, 2014, 05:01 |
my different version of OpenFOAM installation
|
#16 | |
New Member
jiatangwang
Join Date: Jan 2014
Posts: 9
Rep Power: 12 |
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 |
||
February 11, 2014, 17:55 |
|
#17 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
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:
#================================================# function cfdem_environment() { export WM_NCOMPPROCS=4 #- source cfdem env vars export CFDEM_VERSION=PUBLIC export CFDEM_PROJECT_DIR=$HOME/CFDEM/CFDEMcoupling-$CFDEM_VERSION-$WM_PROJECT_VERSION export CFDEM_SRC_DIR=$CFDEM_PROJECT_DIR/src/lagrangian/cfdemParticle export CFDEM_SOLVER_DIR=$CFDEM_PROJECT_DIR/applications/solvers export CFDEM_DOC_DIR=$CFDEM_PROJECT_DIR/doc export CFDEM_UT_DIR=$CFDEM_PROJECT_DIR/applications/utilities export CFDEM_TUT_DIR=$CFDEM_PROJECT_DIR/tutorials export CFDEM_PROJECT_USER_DIR=$HOME/CFDEM/$LOGNAME-$CFDEM_VERSION-$WM_PROJECT_VERSION export CFDEM_bashrc=$CFDEM_SRC_DIR/etc/bashrc export CFDEM_LIGGGHTS_SRC_DIR=$HOME/LIGGGHTS/LIGGGHTS-PUBLIC/src export CFDEM_LIGGGHTS_MAKEFILE_NAME=fedora_fpic export CFDEM_LPP_DIR=$HOME/LIGGGHTS/LPP/src export CFDEM_PIZZA_DIR=$HOME/LIGGGHTS/PIZZA/pizza-11Sep13/src source $CFDEM_bashrc } #================================================# ## OPENFOAM ### alias of221='[ -n "$WM_PROJECT_DIR" ] && source $HOME/OpenFOAM/OpenFOAM-2.2.1/etc/config/unset.sh; source $HOME/OpenFOAM/OpenFOAM-2.2.1/etc/bashrc; cfdem_environment' alias of21x='[ -n "$WM_PROJECT_DIR" ] && source $HOME/OpenFOAM/OpenFOAM-2.2.1/etc/config/unset.sh; source $HOME/OpenFOAM/OpenFOAM-2.1.x/etc/bashrc; cfdem_environment' alias of16ext='[ -n "$WM_PROJECT_DIR" ] && source $HOME/OpenFOAM/OpenFOAM-2.2.1/etc/config/unset.sh; source $HOME/OpenFOAM/OpenFOAM-1.6-ext/etc/bashrc; cfdem_environment' alias of211='[ -n "$WM_PROJECT_DIR" ] && source $HOME/OpenFOAM/OpenFOAM-2.2.1/etc/config/unset.sh; source $HOME/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc; cfdem_environment' ## OPENFOAM ### alias lpp="python $HOME/LIGGGHTS/LPP/src/lpp.py" alias pizza="python -i $HOME/LIGGGHTS/PIZZA/pizza-11Sep13/src/pizza.py"
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 ./Allwclean ./Allwmake Best regards, Bruno
__________________
|
|
February 13, 2014, 05:19 |
Multiple OpenFOAM versions on one machine
|
#18 |
New Member
jiatangwang
Join Date: Jan 2014
Posts: 9
Rep Power: 12 |
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 >>which paraview /home/jt/OpenFOAM/ThirdParty-2.2.1/platforms/linux64Gcc/paraview-3.12.0/bin/paraview Code:
>>of211 bash: /home/jt/CFDEM/CFDEMcoupling-PUBLIC-2.1.1/src/lagrangian/cfdemParticle/etc/bashrc: No such file or directory >>which paraview /usr/bin/paraview Code:
>>of21x bash: /home/jt/CFDEM/CFDEMcoupling-PUBLIC-2.1.x/src/lagrangian/cfdemParticle/etc/bashrc: No such file or directory >>which paraview /usr/bin/paraview Code:
>>of16ext bash: /home/jt/CFDEM/CFDEMcoupling-PUBLIC-1.6-ext/src/lagrangian/cfdemParticle/etc/bashrc: No such file or directory >>which paraview /usr/bin/paraview Code:
cd $FOAM_UTILITIES/postProcessing/graphics/PV3Readers ./Allwclean ./Allwmake And in others version of OpenFOAM, I use the command, Code:
cd $FOAM_UTILITIES/postProcessing/graphics/PV3Readers ./Allwclean ./Allwmake 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 Last edited by wyldckat; February 15, 2014 at 11:57. Reason: Added [CODE][/CODE] and removed the long quote... |
|
February 15, 2014, 01:41 |
|
#19 |
Senior Member
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 16 |
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. 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 |
|
February 15, 2014, 12:09 |
|
#20 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
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/ ln -s CFDEMcoupling-PUBLIC-2.2.1 CFDEMcoupling-PUBLIC-2.1.1 ln -s CFDEMcoupling-PUBLIC-2.2.1 CFDEMcoupling-PUBLIC-2.1.x ln -s CFDEMcoupling-PUBLIC-2.2.1 CFDEMcoupling-PUBLIC-1.6-ext 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
__________________
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Parabolic inlet velocity profile | msrinath80 | OpenFOAM Running, Solving & CFD | 157 | February 6, 2020 06:13 |
How to run a solver on a machine without installation of OpenFOAM | waynezw0618 | OpenFOAM Running, Solving & CFD | 4 | June 24, 2017 13:07 |
Help Compiling OpenFOAM 1.6 on SGI Altix Machine | deji | OpenFOAM | 11 | February 16, 2011 12:10 |
OpenFOAM Training in Europe and USA | hjasak | OpenFOAM | 0 | August 8, 2008 06:33 |
PC vs. Workstation | Tim Franke | Main CFD Forum | 5 | September 29, 1999 16:01 |