CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ParaView (https://www.cfd-online.com/Forums/paraview/)
-   -   [General] Compare Velocities (Mag/X/Y/Z) (https://www.cfd-online.com/Forums/paraview/144997-compare-velocities-mag-x-y-z.html)

chrisb2244 November 26, 2014 02:34

Compare Velocities (Mag/X/Y/Z)
 
Dear all,

Is it possible to compare views of velocity in X/Y/Z directions with magnitude during one animation?

I'm currently using PV-4.2.0 and my datasets are generated by OpenFOAM.
I'm using the built-in OpenFOAM reader (PVs, not paraFoam).

I can't use 'Comparitive Views' since this is used to give different 'snapshot' style images - eg for 4 different times.

Using a grid of multiple 'Render View's allows tiling of for example, Pressure, Velocity and Alpha (fluid fraction) etc, but not of different views of the velocity - changing from Magnitude to X or Y changes all RenderView windows to the new values.

Opening the files multiple times behaves in the same way.

Perhaps duplicating the files and creating physical copies would allow this to be possible, but that would require 3x more space (since I want to render Mag, X and Y, along with Alpha, which can be taken from any of the other sets of data, so 3 sets of the data files, currently sitting at around 50GB - possible but obviously not ideal.

If there are any better ideas (including perhaps using Python scripts - I'm clueless there, or hacking the reader) I'd appreciate a pointer.

chrisb2244 November 27, 2014 00:31

It seems (at least to the untrained eye) that Python scripting based solutions are unlikely - ParaView uses the lines

Code:

uLUT = GetColorTransferFunction('U')
uLUT.VectorMode = 'Magnitude'

to colour by magnitude of the U vector, and

Code:

uLUT.VectorMode = 'Component'
uLUT.VectorComponent = '0'

to colour by U_x, etc.
Since the proxy ('uLUT' here) is returned by the 'GetColorTransferFunction('U')' function, I suspect creating different colourings at the same time might be challenging (/impossible? If I'm completely wrong and this can be simply duplicated, please say!)

Consequently, I'm now looking at copying the vtkOpenFOAMReader.{h,cxx} files and compiling a "vtkOpenFOAMReader_new.{h,cxx}" pair of files (probably along with "vtkPOpenFOAMReader.{h,cxx}" - the parallel files, although changes here look to be unneeded, perhaps beyond changing the names of the parent class) and altering the reader to open the file 'U' and return multiple matrices - eg Ux, Uy, Uz, UMag.

If anyone has a simpler method, or tips, please let me know.

Edit:
Duplicating the U files and changing the 'object' field in the header allows for separate data sets (of the same data) to be loaded, but symbolic links are insufficient (since then the object field remains the same, and a different file name is not enough (as can be tested by copying the file without changing the 'object' field)). This however leads to data in triplicate, making it difficult to load large data sets into memory etc.


All times are GMT -4. The time now is 04:53.