Frequently, CEI employees come across interesting and potentially useful information while developing and testing EnSight that we think could be helpful to a subset of our users. We’ll present these mini tutorials here on our blog. If you are looking for basic tutorials or answers to specific questions please visit our support center.
As part of our testing for EnSight 10.6.1(b), I put on my combustion engineering hat and had some fun with a Converge dataset, exploring how to use EnSight to explore Swirling flow.
Suppose I have some sort of an engine with an inlet and a piston that moves up and down:
My Inlet #2 sucks in some flow.
I want to have a metric to see the swirl of the flow coming into Inlet #2.
The swirl of the flow is the component that is moving in the theta direction in an RTZ cylindrical coordinate system with the axis perpendicular to Inlet #2, essential “swirling” around the centerline of the inlet. The problem is, the axes of Inlet #2 doesn’t align with the global axes.
In the past, calculating the swirl about an arbitrary axis would require a handful of intermediate variables and a lot of arduous vector math. But now, I can easily calculate this swirl by creating a new Frame, Frame 1, which has frame z axis of the frame defined to be the centerline of inlet #2.
Then, I can calculate the swirl using the new VectorCyclProjection function which can calculate one of three vectors: R, Theta or Z. I choose Theta, and I request it to use Frame 1.
Then I can create an RTZ clip and tell it to make an R clip about Frame 1’s Z and make vector arrows from the swirl and zoom in to see the swirling flow:
Now, I can look at the swirl at any given radius. Further, I can calculate the SpatialMean of the swirl on the R clip and then, using the Part Constant Query Tool, plot average swirl in the Inlet Frame coordinate system over a range of radii. Basically, it sweeps the R clip from a min to a max and collects up the average swirl value, then it plots it. I checked the box on this tool to update with timechange so I can look at other timesteps, for this example:
Then I wrote a python script to step through time, rescale the plot y axis to a constant value, and save an image. Why not just click the record button (save animation)? The scripting technique allows for clearer images with very little static, all with two lines of pyton using ens_utils enve modules:
import ens_utils as euflist = eu.get_file_list(“/Users/wndunn/testdir/file_*” , sort_flag=eu.AN_SORT)eu.images_to_mov(flist,”/Users/wndunn/testdir/final.mp4″)