CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

Run python scrpit as functionObject

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 3, 2017, 08:07
Default Run python scrpit as functionObject
  #1
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 313
Rep Power: 15
agustinvo is on a distinguished road
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
agustinvo is offline   Reply With Quote

Old   July 3, 2017, 12:21
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
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.
alexeym is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 10:08.