|
[Sponsors] |
July 6, 2013, 13:42 |
Run case from a script?
|
#1 |
Member
Miro
Join Date: Jan 2013
Location: Europe
Posts: 51
Rep Power: 13 |
Hello everyone, sorry if it's the wrong place for this question.
I would like to create a script that will run my case after i set the dictionaries. This is similar to Allrun script in tutorials, and i was looking through those but i don't quite understand them. I tried to modify allRun from one of the tutorials (motorBike) but that is way off. I guess this maybe is more of a Linux question, but i don't know where else to ask. Thank you for your help. I'm running Ubuntu 12.04. -miro |
|
July 7, 2013, 03:32 |
|
#3 |
Member
Miro
Join Date: Jan 2013
Location: Europe
Posts: 51
Rep Power: 13 |
Thanks for help!
The c/p of Allrun script from motorbike tutorial: #!/bin/shWhat do first two commands do? What do ls -d processor* | xargs..... do? What i want to do : source //opt/openfoam220/etc/bashrcand later run calculation, but you can see what I mean. What i have for now: #!/bin/shI run it as a shell script: sh run.sh and the error: run.sh: 3: cd: can't cd to run.sh If i run it without runApplication i get something like "command now found". Thanks again |
|
July 7, 2013, 04:46 |
|
#4 |
Senior Member
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 19 |
Your error is related to item 2. To avoid the error, go to the case directory and put your script there and run your script(./run.sh). Hope this helps, Fumiya |
|
July 7, 2013, 06:52 |
|
#5 |
Member
Miro
Join Date: Jan 2013
Location: Europe
Posts: 51
Rep Power: 13 |
ok, thank you for your answer.
i have removed everything but: #!/bin/shAnd now it works. i placed source in ~/.bashrc and now i don't have to enter in manually. However, I have a few more questions: 1. What exactly does bashrc do? 2. I think I will install another version of OF so this will not work. if i add:source //opt/openfoam220/etc/bashrc to the scriptThanks for your effort, -Miro PS: when i enter source in the script it gives an error that says something like: not found |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Case running in serial, but Parallel run gives error | atmcfd | OpenFOAM Running, Solving & CFD | 18 | March 26, 2016 13:40 |
Can't run a case in HelyxOS with an imported mesh from Fluent | HHOS | OpenFOAM Running, Solving & CFD | 0 | July 2, 2013 07:25 |
Discretizer: How to run a case in parallel? | klausb | OpenFOAM | 2 | January 23, 2011 15:12 |
Perl script for intialisation | pratik mehta | CFX | 2 | September 10, 2008 04:09 |
Run in parallel a 2mesh case | cosimobianchini | OpenFOAM Running, Solving & CFD | 2 | January 11, 2007 07:33 |