CFD Online Logo CFD Online URL
Home > Forums > Visualization & Post-Processing Software > ParaView

[OpenFOAM] How to use python script in paraFoam?

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Search this Thread Display Modes
Old   October 12, 2015, 04:34
Default How to use python script in paraFoam?
Join Date: May 2015
Posts: 30
Rep Power: 10
Thomas pan is on a distinguished road

I am using the Postprocessing for Turbomachinery,I download the code from:,but i don't know how to use them in paraFoam.
I try the in the turbevtk.And I use the ProgrammableFilter,the script is:

import sys
sys.path.insert(0 ,"/home/username/python/vtk/")
import turbofilter as filter

## Input format default value is openfoam
## Set input format to numeca
## omega default value is 0.0 = 2*filter.math.pi*28160.0/60.0
## Calculate only Cm, Cr and Cu
filter.setTrue(["Cm", "Cr", "Cu","Ma", "MaRel"])
## All variables were calculated
# filter.setAllTrue()
## run calculation
But I get the error:
File "<string>", line 2
if not file:///home/pjc/OpenFOAM/pjc-1.6-ext/turbopost-turbovtk/src/
SyntaxError: invalid syntax
Traceback (most recent call last):
File "<string>", line 26, in <module>
File "<string>", line 16, in RequestData
File "/home/pjc/OpenFOAM/pjc-1.6-ext/turbopost-turbovtk/src/", line 744, in run
turbofilter(curInput, curOutput)
File "/home/pjc/OpenFOAM/pjc-1.6-ext/turbopost-turbovtk/src/", line 521, in turbofilter
Cr.InsertNextValue((input_loc.GetPoint(i)[:3][0]*input_loc.GetPointData().GetVectors(absolutVeloci tyXYZ).GetTuple3(i)[0]+input_loc.GetPoint(i)[:3][1]*input_loc.GetPointData().GetVectors(absolutVeloci tyXYZ).GetTuple3(i)[1])/radius)
AttributeError: 'NoneType' object has no attribute 'GetTuple3'
I have also try the python shell in paraview,it doesn't work.

Who can tell me the step of using python script in paraview?thanks.

Last edited by Thomas pan; October 12, 2015 at 08:05.
Thomas pan is offline   Reply With Quote


filter, parafoam, paraview, python script, turbo

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[OpenFOAM] Using python script for automatic post processing of openFoam vPaquet ParaView 12 December 16, 2021 03:30
python script to create geometry for salome, and then mesh 6863523 Mesh Generation & Pre-Processing 4 March 18, 2017 09:00
How to use python script in paraFoam? Thomas pan OpenFOAM Post-Processing 0 October 13, 2015 21:29
[OpenFOAM] using the python shell in paraFoam colinB ParaView 14 September 14, 2015 09:04
CentFOAM Python Script Installation: Error socon009 OpenFOAM Installation 2 May 26, 2012 09:36

All times are GMT -4. The time now is 14:58.