|
[Sponsors] |
Create an script for a Local Application of OpenFOAM |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 5, 2013, 00:11 |
Create an script for a Local Application of OpenFOAM
|
#1 |
New Member
Tom
Join Date: Jun 2013
Posts: 26
Rep Power: 13 |
Dear All,
I'm looking for how to create an script (OpenFOAM 2.2.2 local application) which can run the following applications: blockMesh simpleFoam paraFoam My goal is to create an script for any solver so I can use it in CAESES software for the case directory. CAESES just executes the executable files. Also I was wondering if is possible to make an srcipt which can run the "blockMesh", the solver (any solver) and generate or transform the results in VTK format or FLUENT format or .foam format Any help is wellcome. Thanks! |
|
November 5, 2013, 04:17 |
|
#2 |
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22 |
Yes, this is easy
Call your script "run" Code:
#!/bin/bash blockMesh $1 foamToVTK paraFoam Is this what you need? |
|
November 7, 2013, 10:54 |
|
#3 |
New Member
Ben Zeitz
Join Date: Nov 2013
Posts: 1
Rep Power: 0 |
Hi Tom,
Actually you can combine different Software Connectors in CAESES to set up such a chain of tools. If you do so you wouldn't need a script. Create a Software Connector for each tool. Add a result file in the first Software Connector. The result file is here the output of the application, e.g. a produced mesh file. Then add an input file for this very same file in the Software Connector of the next application in line. Now you have to replace the file name of the input file with the following command: computationName.getResults().getResultFileName("nameOfTheInputFile") -> see attached image So, what you basically do is setting the output file of the first application as input for the second application. I guess that is what you are trying to achieve? Cheers Ben |
|
November 11, 2013, 06:36 |
|
#4 |
New Member
Sebastian W
Join Date: Nov 2009
Location: Germany
Posts: 16
Rep Power: 17 |
Hi RTom,
there are two nice ways of doing this: a) a script which takes the solver as an argument (or you may use the getapplication command to extract that information from the control.dict). Use the one Bernhard gave you (except for parafoam, much of the post-processing can also be done in CAESES) b) the way I prefer: a script that executes one of your CAESES template files, i.e. a file named Allrun. Pretty much the way it is done in the CAESES sample for the ahmed body. Solver and specific settings can be managed from within CAESES, the executable runOpenFOAM.sh basically just runs this script. This is not completely ready for any case, but since you can make all the changes within CAESES, it's quite efficient. runOpenFOAM.sh Code:
#!/bin/bash chmod +x Allrun ./Allrun Code:
#!/bin/bash touch case.foam blockmesh simpleFoam foamToVTK Cheers, naval edit: To clarify this: runOpenFOAM can be used for any case, this should be the executable for your Local Application for all OpenFOAM projects. Only Allrun should be unique for every case. With this method you can also easily open and run the OF tutorials, since they use such an Allrun file. |
|
Tags |
application, caeses, local, openfoam 2.2.x, scripting |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Salome] Script for converting a mesh from Salome-Platform to OpenFOAM | nsf | OpenFOAM Meshing & Mesh Conversion | 86 | February 8, 2023 11:30 |
Transient simulation not converging | skabilan | OpenFOAM Running, Solving & CFD | 14 | December 17, 2019 00:12 |
dynamic Mesh is faster than MRF???? | sharonyue | OpenFOAM Running, Solving & CFD | 14 | August 26, 2013 08:47 |
how to create the sediment transport using openfoam | hxxxmu | OpenFOAM | 0 | April 2, 2013 23:49 |
fluent add additional zones for the mesh file | SSL | FLUENT | 2 | January 26, 2008 12:55 |