CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   how to change run directory (https://www.cfd-online.com/Forums/openfoam/91753-how-change-run-directory.html)

camoesas August 22, 2011 03:53

how to change run directory
 
HI,

Some time ago I created the foam run directory using:
Code:

mkdir -p $FOAM_RUN
as said in the tutorial. Now I want to change the run directory (to local drive) but deleting and creating it new didnt work. I´ve also tried to create a second run directory using simultaneously:
Code:

mkdir -p $FOAM_RUN2
Neither worked.
Somebody knows a solution?

Thanks Camoesas

jango August 22, 2011 05:05

Hi Camoesas,

$FOAM_RUN is the declaration for an environment variable that ist defined somewhere in the openfoam config files. So you have to find the file, with the entry:

export $FOAM_RUN={directory path} and change it to your new directory path. I would suggest to use the grep command to find the config files, what should be something like:

cd (openfoam_installdir)
grep -r -l FOAM_RUN (or grep -r -l 'FOAM_RUN')

I' m 100% shure, so take a look at the description for the grep command

have fun,

Jan

m2montazari August 22, 2011 15:53

Hi Camoesas,
you can change foam_run directory in openfoam installated directory/etc/setting.sh and after editing that and save, simply run with "sh setting.sh" to have desired directory as foam_run directory. now mkdir $FOAM_RUN would make directory as you described in setting.sh
test and tell about the result
yours,
mohammad

camoesas August 23, 2011 02:23

HI Guys,

Thanks for the replys. A long and exhausting search with grep showed no results. grep just didnt find it.
In the end I found it in
installed_directory/etc/config/settings.sh
and could change it. run it with sh settings.sh didn't work but it works anyway... :confused:

thanks for the help!

Mojtaba.a July 7, 2013 06:28

Quote:

Originally Posted by camoesas (Post 321128)
HI Guys,

Thanks for the replys. A long and exhausting search with grep showed no results. grep just didnt find it.
In the end I found it in
installed_directory/etc/config/settings.sh
and could change it. run it with sh settings.sh didn't work but it works anyway... :confused:

thanks for the help!

Hi,
Although this is almost an old thread, but just in case I found the solution.
in order to have a new command for any directory, it is just enough to edit the file aliases.sh within Of_install_dir/etc/config by running the command:

Quote:

sudo gedit OF_install_dir/etc/config/aliases.sh
just add the following line into it:

Quote:

alias command='cd PATH'
and source your OF again. now by typing "command", terminal takes you to the PATH.

I hope it helps,
Best Wishes
Mojtaba


All times are GMT -4. The time now is 11:59.