|
[Sponsors] |
bash files: starting test simulation automatically after another test in OpenFOAM |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 4, 2019, 10:13 |
bash files: starting test simulation automatically after another test in OpenFOAM
|
#1 |
Member
CC
Join Date: Jun 2011
Posts: 73
Rep Power: 15 |
Hi all!
I want to simulate one case in OpenFOAM and after it finish and want to simulate another case but I want that it will start automatically. For example, if I have a CFD in-house code developed in fortran I can have a batch file and run a few cases since I have the .exe file. In Ansys Fluent I can create a journal file... It is possible to do something similar in OpenFOAM? It is possible to not start the simulation manually but instead start it automatically? It would be very useful to start a new simulation automatically mainly for cases which can be finished during the night... I have been trying with bash files and also phyton, but not successfully unitl now... The bash files that I have start all the simulations at almost the same time and not one after the previous one have finished, my bash file looks like this #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions nameCases="case_3_15_4 case_3_15_5" for caseName in $nameCases do ( cd $caseName && bash simulation.sh ) done Please anyone can help? Thank you. BR, CC |
|
November 4, 2019, 11:52 |
|
#2 |
Senior Member
Join Date: Aug 2014
Location: UK
Posts: 213
Rep Power: 13 |
Have you tried the 'wait' command?
Certainly not the best solution but could you not try doing something like this in the main bash file: Code:
filename_prefix='case_3_15_' num=0 for num in {0..5}; cd $filename_prefix$num/ do {solver executable commands} cd $main_dir done Last edited by fresty; November 5, 2019 at 05:03. |
|
November 5, 2019, 03:31 |
|
#3 |
Member
Join Date: Dec 2018
Location: Darmstadt, Germany
Posts: 87
Rep Power: 7 |
Hey, you could separate your commands with semicolons:
Code:
cd dir; bash executableScript; |
|
November 5, 2019, 07:36 |
|
#4 |
Member
CC
Join Date: Jun 2011
Posts: 73
Rep Power: 15 |
To say the truth with some shame, I am quite new working on linux and OpenFOAM. I did not know about the 'wait' command . But now I know this good command and I can put to run batch mode simulations.
Thank you! |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
critical error during installation of openfoam | Fabio88 | OpenFOAM Installation | 21 | June 2, 2010 04:01 |
OF 1.6 | Ubuntu 9.10 (64bit) | GLIBCXX_3.4.11 not found | piprus | OpenFOAM Installation | 22 | February 25, 2010 14:43 |
Problems in compiling paraview in Suse 10.3 platform | chiven | OpenFOAM Installation | 3 | December 1, 2009 08:21 |
OpenFOAM15 paraFoam bug | koen | OpenFOAM Bugs | 19 | June 30, 2009 11:46 |
64bitrhel5 OF installation instructions | mirko | OpenFOAM Installation | 2 | August 12, 2008 19:07 |