|
[Sponsors] |
[OpenFOAM.org] How change OpenFoam run directory |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 18, 2019, 01:49 |
How change OpenFoam run directory
|
#1 |
New Member
John
Join Date: Nov 2013
Location: USA
Posts: 22
Rep Power: 13 |
Installed OpenFoam 6 on an Ubuntu Linux v 18.04 system. OF installation went nicely but need to change the OpenFoam run directory from the default setup to something different.
I imagine this means changing an Environment variable somewhere as well as creating the new directories. I'm aware that OF uses a directory structure to save cases and variables. There is an old thread from 2011 on this same topic but those solutions don't work. Thanks very much for any help. |
|
March 18, 2019, 05:29 |
|
#2 |
Senior Member
|
Hi,
Hope, I got your question right. There is FOAM_RUN environment variable, which by default points to $WM_PROJECT_USER_DIR/run (and alias run just do 'cd $FOAM_RUN'). So, a) you can set this variable to whatever value you like, b) keep your cases wherever you like, ignoring FOAM_RUN variable. |
|
March 18, 2019, 14:00 |
need to find envir variable to change run directory
|
#3 |
New Member
John
Join Date: Nov 2013
Location: USA
Posts: 22
Rep Power: 13 |
Hi & thanks for your reply. I know how to find my Openfoam run directory, the issue is to change it. Apparently the setup configured my OF for multiple users but I'm the only one on this laptop, thus I don't want a very convoluted directory structure. I was able to find other OpenFOAM environment variables in the file: /opt/openfoam6/etc/bashrc but these were for the installation directory which I do not want or need to change. This is the only line that discusses user settings in bashrc # Location of user files # ~~~~~~~~~~~~~~~~~~~~~~ export WM_PROJECT_USER_DIR=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION However, this does not change the run location. |
|
March 18, 2019, 21:57 |
|
#4 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Quick/simple answer: In your file "~/.bashrc", right after the line:
Code:
source /opt/openfoam6/etc/bashrc Code:
export FOAM_RUN=$HOME/myRunFolder This does not need any changes inside the folder "/opt/openfoam6" and will work without problems when you need to rely on the variable "FOAM_RUN".
__________________
|
|
March 19, 2019, 04:57 |
|
#5 | |
New Member
Mattia
Join Date: May 2018
Location: Novara - Italy
Posts: 29
Rep Power: 8 |
Quote:
if you check OpenFOAM's etc README.md file you'll see: Code:
OpenFOAM Configuration ---------------------- The main OpenFOAM settings are located in the parent `etc/` directory. Both POSIX (bash, dash,...) and csh shells are supported. To configure OpenFOAM, source either the `etc/bashrc` or the `etc/cshrc` file, as appropriate for your shell. These source the following files in the `config.sh/` or `config.csh/` directories: * `setup` : finalize setup of OpenFOAM environment (called by bashrc,cshrc) * `settings` : core settings * `aliases` : aliases for interactive shells * `unset` : sourced to clear as many OpenFOAM environment settings as possible * `mpi` : MPI communications library settings * `paraview` : application settings for ParaView * `scotch` : application settings for compiling against scotch * `metis` : application settings for compiling against metis The `config.*/example` directories contain additional example configuration files for the corresponding shell: * `compiler` : an example of fine tuning ThirdParty compiler settings * `openmpi` : an example of fine tuning openmpi settings for OpenFOAM * `paraview` : an example of chaining to the standard config/paraview with a different ParaView_VERSION * `prefs`: an example of supplying alternative site-defined settings For example $FOAM_RUN is defined inside "settings" file. Code:
export FOAM_ETC="$WM_PROJECT_DIR/etc" export FOAM_APP="$WM_PROJECT_DIR/applications" export FOAM_SRC="$WM_PROJECT_DIR/src" export FOAM_TUTORIALS="$WM_PROJECT_DIR/tutorials" export FOAM_UTILITIES="$WM_PROJECT_DIR/applications/utilities" export FOAM_SOLVERS="$WM_PROJECT_DIR/applications/solvers" export FOAM_RUN="$WM_PROJECT_USER_DIR/run" I posted just to clearify how that works. Bye |
||
August 12, 2021, 13:07 |
|
#6 | |
Member
|
Quote:
I want to change my "run" folder to an external HDD and tried this in some various ways but it seems it does not work that easy outside from $HOME. I tried to do this in Linux Mint but I am just another beginner at Linux. Is there a similar easy way to change it to "/media/..." as in this description? Best regards Michael |
||
August 13, 2021, 07:53 |
|
#7 |
Member
|
...well, seems that all I needed was still here.
I changed the bashrc file as mentioned in the thread: Code:
# Location of user files # ~~~~~~~~~~~~~~~~~~~~~~ # export WM_PROJECT_USER_DIR=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION export WM_PROJECT_USER_DIR=/media/michel/DATEN/CFD/OF9 media/michel/DATEN/CFD/OF9/run Works. Thanks to your posts in before. Maybe this helps some other users. Regards Michael |
|
September 15, 2021, 15:48 |
|
#8 |
New Member
Cheng Chen
Join Date: Apr 2020
Posts: 1
Rep Power: 0 |
I don’t know if this is the version/system difference or not, but I couldn’t find the line in bashrc under the home folder(found in wyldckat’s reply). Instead I found line in bashrc under the ~/OpenFOAM/OpenFOAM-x.x/etc/
|
|
September 25, 2021, 11:45 |
|
#9 | |
Member
Ali B.
Join Date: Mar 2020
Location: abzrg.github.io
Posts: 44
Rep Power: 6 |
Quote:
Code:
grep -R 'FOAM_RUN='
Note that on some very old version of grep, you should supply the directory to search: Code:
grep -R 'FOAM_RUN=' $WM_PROJECT_DIR/etc Last edited by reverseila; September 26, 2021 at 10:37. |
||
Tags |
change run directory |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] funkyDoCalc with OF2.3 massflow | NiFl | OpenFOAM Community Contributions | 14 | November 25, 2020 04:30 |
[waves2Foam] Waves2Foam Related Topics | ngj | OpenFOAM Community Contributions | 660 | August 20, 2018 13:39 |
How to contribute to the community of OpenFOAM users and to the OpenFOAM technology | wyldckat | OpenFOAM | 17 | November 10, 2017 16:54 |
Working directory via command line | Luiz | CFX | 4 | March 6, 2011 21:02 |
Compiling OpenFOAM13 on AMD64 with Redhat Enterprise | mbeaudoin | OpenFOAM Installation | 20 | June 17, 2008 07:43 |