|
[Sponsors] |
Running OpenFOAM case through shell script (bash) |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 27, 2020, 18:46 |
Running OpenFOAM case through shell script (bash)
|
#1 |
New Member
Join Date: Jan 2020
Posts: 6
Rep Power: 6 |
Hello,
I intend to run an OpenFOAM case through shell script. The example that I chose was lid driven cavity. Here's what I have done - 1. Open the terminal - cd case_directory_name 2. Create a shell script (shown below) #!/bin/bash blockMesh > log.blockmesh icoFoam > log.icofoam probeLocations -latestTime > log.probes 3. The shell script was saved in the case directory 4. In the same terminal, sudo sh file_name.sh Here's the error I get - blockMesh: not found icoFoam: not found probeLocations: not found How should I proceed? Thank you for any suggestions you can provide. - Ilaj |
|
January 28, 2020, 02:57 |
|
#2 |
Member
Andreas P.
Join Date: May 2017
Posts: 41
Rep Power: 9 |
You maybe need to source your OpenFOAM environment in the terminal or in the script?
|
|
January 28, 2020, 14:14 |
|
#3 |
New Member
Join Date: Jan 2020
Posts: 6
Rep Power: 6 |
Hello,
I tried the following based on your suggestion - 1. In CAE terminal, cd open_OpenFOAM_case_directory 2. sudo bash my_bash_script.sh bash script had the following commands - #!/bin/bash source ~/openfoam6/etc/bashrc blockMesh > log.blockmesh icoFoam > log.icofoam This worked! Thanks you! - Ilaj |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM] Using python script for automatic post processing of openFoam | vPaquet | ParaView | 12 | December 16, 2021 04:30 |
Almost have my cluster running openfoam, but not quite... | bjr | OpenFOAM Running, Solving & CFD | 17 | March 6, 2020 10:52 |
OpenFOAM v3.0+ ?? | SBusch | OpenFOAM | 22 | December 26, 2016 15:24 |
Statically Compiling OpenFOAM Issues | herzfeldd | OpenFOAM Installation | 21 | January 6, 2009 10:38 |
Free surface boudary conditions with SOLA-VOF | Fan | Main CFD Forum | 10 | September 9, 2006 13:24 |