Sampling at time-varying locations
To my knowledge no one has asked this question, so here goes.
I am currently calculating a field that exists only on wall patches. I would like to be able to use the sample utility to extract the value at certain locations. However, the boundary is moving (translating only), and I can't think of a way to use sample to get the values.
I know where the mesh starts, so one possibility I was mulling was to change sample so that it would identify the patch that is at the initial sampling location and only output data from that patch afterwards.
I've done similar things before using very basic for loops, but I was looking do things using pre-existing OpenFOAM code for better performance. What are some pieces of code I could look at to get ideas?
Due to legacy support I am using OpenFoam 1.4 (will be making the transition to 1.(whatever-the-current-version-is) in about a year).
As a follow up, I see that as of OF1.6, there is the option to sample a movingWall. From the sampleDict in the sample application directory, it looks like I can only sample the patch itself, is this correct?
One solution I thought of was writing a script that changed the sampleDict sample line points, since its only one coordinate that is required to change. This is tricky as I would have to be able to identify the exact place the coordinate occurs in. Then I would have to call sample with the -time argument. This looks very messy.
I was poking around the documentation for ParaView, and saw that "Programmable Filter" might do the trick. I don't have much experience with Python though.
What I would like to do is use "Programmable Filter" on "Plot over Line" to shift the position of the line so that it remains in the same place relative to a particular patch. I know how to calculate the displacement based on the current time, but I don't know how to
1) Retrieve the time
2) Change the coordinates of the line endpoints
Anyone have ideas of how to do this? This could actually open up a lot of cool stuff.
|All times are GMT -4. The time now is 17:18.|