|
[Sponsors] |
July 3, 2017, 08:07 |
Run python scrpit as functionObject
|
#1 |
Senior Member
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 313
Rep Power: 15 |
Good afternoon
I would like to know if it is possible to add a python script inside a functionObject, so I can postprocess some files that I have created in a previous functionObject. I am also wondering I could use pyFOAM for it. What I am doing is 1. I extract some slices with the OpenFOAM surfaces (done already) 2. With a python script, I perform an average on each point of the slice (done with python, and what I want to add to my controlDict) Maybe with pyFOAM i could access to the field data, and then work on it directly. What do you think? Is is possible? Thank you in advance, Agustín |
|
July 3, 2017, 12:21 |
|
#2 |
Senior Member
|
Hi,
fieldValues function object seems to do what you want without Python (see $FOAM_SRC/functionObjects/field/fieldValues/controlDict for example of settings). There is also systemCall function object, which can execute arbitrary shell code, so you can execute your Python script and post-process extracted slices. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[PyFoam] run pyFoam utilities from python script | ilpaso | OpenFOAM Community Contributions | 9 | January 27, 2022 03:04 |
OpenFOAM can't be run in parallel in cluster | sibo | OpenFOAM Running, Solving & CFD | 4 | February 21, 2017 16:29 |
simpleFoam parallel | AndrewMortimer | OpenFOAM Running, Solving & CFD | 12 | August 7, 2015 18:45 |
functionObject to control run time | marc.immer | OpenFOAM Programming & Development | 0 | March 25, 2014 10:43 |
First Parallel Run - need some help | Gian Maria | OpenFOAM | 3 | June 17, 2011 12:08 |