I am trying to average the data in the span-wise direction referring to the previous posts:
I am now slicing the span-wise area in 10-20 slices and then will average these slices to get the averaged span-wise slice. Using the help of @ paraview_ran I got a running script for taking the slice which is as follows:
from paraview.simple import * #### disable automatic camera reset on 'Show' paraview.simple._DisableFirstRenderCameraReset() # create a new 'OpenFOAMReader' demofoam = OpenFOAMReader(FileName='<FOAM_PATH>') demofoam.MeshRegions = ['CYLINDER'] demofoam.CellArrays = ['U', 'p'] # Properties modified on demofoam demofoam.CellArrays = ['U'] # get active view renderView1 = GetActiveViewOrCreate('RenderView') ####Then slice data using the code similar to this: # find source e0foam = FindSource('demo.foam') # create a new 'Plot On Intersection Curves' plotOnIntersectionCurves1 = PlotOnIntersectionCurves(Input=e0foam) plotOnIntersectionCurves1.SliceType = 'Plane' # Properties modified on plotOnIntersectionCurves1.SliceType plotOnIntersectionCurves1.SliceType.Origin = [0.0, 0.0, 0.9] plotOnIntersectionCurves1.SliceType.Normal = [0.0, 0.0, 1.0] # get layout layout1 = GetLayout() # save data SaveData('SAVE_LOACATION/demo.csv', proxy=plotOnIntersectionCurves1)
To work with this I need to run this code (
pvpython slice1.py) at different span-wise location for 10 times, instead I want to automate this slicing process by script/bash file, is it easily doable ? Any comment suggestions will be a great help.