How to load all <case>/surfaces/*/*.vtk at once into Paraview
I am still new to OpenFoam and did not discover full functionallities. So I hope the question is easy for you guys.
I am looking for a fast way to extract slices from interFoam results (total size: ~20-50GB) and calculate fluxes for these areas over time.
The slices are located vertically somwhere inside the domain. Their extend is smaller than the whole lengths or widths of the domain. Cells have various sizes (I used blockMesh with simpleGrading).
- A slow way would be using foamToVTK, loading the results into Paraview, cutting off all parts of the domain which are beside the length of the desired slice, apply the slice filter, use the mesh quality filter to caluclate areas, calculate area*u-component*alpha1, export it to csv and then plot/analyze it using whatever.
- I would still let Paraview do the area/flux calculation, because I don't know an alternative.
- I meanwhile discovered some openFoam tools such as "cellSet", "cellsToZones" and "sample", but I got stucked, when I want to load the aforementioned "slices" which are now surfaces. I have all data, which I want to load into paraview in vtk files, but they are lying in seperate files for each time step and I have no idea how to load them all at once. I also tried various formats using "sample", including foamFile, but don't succeeded.
After that I have 3 questions:
1) Is there a better way to get my fluxes at these slices/surfaces?
2) If not, how can I load all vtk files of the surfaces directory into Paraview?
3) Is there a way to extract directly cell sizes from interFoam results, which can be used for flux calculation?
Thanks for any suggestion!
I don't know if it answers all your questions or not, but I sample the desired slices during runtime with the sampling library. Inside the functions( ); you can put something like this:
thanks for your reply. It definitely rises my possibilities to treat this problem. So far, I arrived at the following stage:
- changed the source code in interFoam.C and createFields.H, so that it writes also cellsize. This prevents me from using Paraview, which is a bit slow for my purposes.
- used cellSet, setsToZone and sample in a shell script
That works quite well and I will probably change the source code further so that it calculates fluxes directly.
For all upcoming simulations I would have to extend your functions() section with cellSet and setsToZone. Do you know what is faster, doing cellSet, setsToZone and sample while simulation runs or during post-processing?
For your last question, I don't know which method is faster and whether it is a significant part compared to the total simulation time. However, if you sample during runtime, it may be sufficient to write less data, which also can be an advantage.
True. Thank you for the comment!
Have a good day!
How can I load all vtk files of the surfaces directory into Paraview?
|All times are GMT -4. The time now is 03:13.|