CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Usage of runTimePostProcessing (https://www.cfd-online.com/Forums/openfoam-post-processing/230510-usage-runtimepostprocessing.html)

Starcatcher September 26, 2020 10:40

Usage of runTimePostProcessing
 
2 Attachment(s)
Hi folks,
I would like to make a movie from a DNS-Simulation. Therefore I want to safe fotos(frames) from each time step.
My Domain is a simple cube with turbulence inside.
I work with OF-1712 sine this special DNS-Solver only exists for this version.


The only fuction I know to produce scuch "screenshots" is: runTimePostProcessing

Unfortunatelly there is noproper guide for it. The examples in the tutorials and other websites helped only a little.

Let's say, I want to make a picture of this cube-domain visualising velocity.
You find attached the settings of the runTimePostProcessing as well as the log file with the sim-feedback.

Sooo, what I've done wrong? What would be the right syntax here? Maybe somebody has a good example file?

Thank you in advance.

Attachment 80354

Attachment 80355

bestucan September 28, 2020 03:13

maybe helpful. I use paraview to make movie. run it parallelly.
save as movies directly or step time picture, both are OK.

Starcatcher September 28, 2020 03:18

Thanks bestucan, but I really do not want to safe the results before reading them in paraview. I want to make the movie from the calculation without saving the profiles. Otherwise it would need many terrabytes and a lot of cpu-power would be lost for the saving

Nealcaffrey December 2, 2021 12:58

Solution ?
 
Quote:

Originally Posted by Starcatcher (Post 783872)
Thanks bestucan, but I really do not want to safe the results before reading them in paraview. I want to make the movie from the calculation without saving the profiles. Otherwise it would need many terrabytes and a lot of cpu-power would be lost for the saving

Hi, did you find out the solution to this ?
Any updates how one can output pictures as jpeg/png and write out every time step or duration?

Please post the solution if you have found :D

olesen December 2, 2021 15:21

Quote:

Originally Posted by Nealcaffrey (Post 817794)
Hi, did you find out the solution to this ?
Any updates how one can output pictures as jpeg/png and write out every time step or duration?

Please post the solution if you have found :D

Catalyst perhaps?
That is what was used to make the laser melting video.
Was a bit of overkill writing png images each time step since it would have made the video far too lengthy, but nonetheless cool. Using runTimePostPro should generally be the fastest, since you can reuse OpenFOAM sampled elements etc and don't have pass things through paraview at all. However, probably only useful for production runs since setting up scenes is a bit of a pain. The Catalyst viz is certainly a bit more wysiwyg

Take a look at the video:
https://vimeo.com/277640232

Nealcaffrey December 3, 2021 03:45

Quote:

Originally Posted by olesen (Post 817798)
Catalyst perhaps?
That is what was used to make the laser melting video.
Was a bit of overkill writing png images each time step since it would have made the video far too lengthy, but nonetheless cool. Using runTimePostPro should generally be the fastest, since you can reuse OpenFOAM sampled elements etc and don't have pass things through paraview at all. However, probably only useful for production runs since setting up scenes is a bit of a pain. The Catalyst viz is certainly a bit more wysiwyg

Take a look at the video:
https://vimeo.com/277640232

That looks impressive :D,

The problem is we are running transient analysis on cluster, on cluster the png creation is fast using runTimePostPro. Also additional software installation like Catalyst need extra costs. The runTimePostPro tutorial is the best option on cluster. But I am not how to implement it from the tutorials using ("librunTimePostProcessing.so"); libraries.

olesen December 3, 2021 06:28

Quote:

Originally Posted by Nealcaffrey (Post 817811)
That looks impressive :D,

The problem is we are running transient analysis on cluster, on cluster the png creation is fast using runTimePostPro. Also additional software installation like Catalyst need extra costs. The runTimePostPro tutorial is the best option on cluster. But I am not how to implement it from the tutorials using ("librunTimePostProcessing.so"); libraries.


The wind around buildings is perhaps the most extensive example. In general, you would want to take some portion of an existing simulation and then use that for doing the setup (eg, solverName -postProcess) for runTimePostProcessing. There is unfortunately not as much documentation as would be nice (will likely need to explore the source code as well).
If you do get something interesting that could either be added to an existing tutorial, or add a new one, this would be a most welcome contribution. That way others can benefit too. Once it gets that far, please open an issue on develop.openfoam.com to get your tutorial added OR perhaps through the tutorials wiki (https://wiki.openfoam.com/index.php?title=Tutorials)

NotOverUnderated December 27, 2023 13:44

Quote:

Originally Posted by olesen (Post 817821)
The wind around buildings is perhaps the most extensive example. In general, you would want to take some portion of an existing simulation and then use that for doing the setup (eg, solverName -postProcess) for runTimePostProcessing. There is unfortunately not as much documentation as would be nice (will likely need to explore the source code as well).
If you do get something interesting that could either be added to an existing tutorial, or add a new one, this would be a most welcome contribution. That way others can benefit too. Once it gets that far, please open an issue on develop.openfoam.com to get your tutorial added OR perhaps through the tutorials wiki (https://wiki.openfoam.com/index.php?title=Tutorials)

When I run windAroundBuildings tutorial on the cluster I see that the runTimePostProcessing is available (built with OpenFOAM v2306). However, the tutorial crashes when it tries to use that function object because it complains about the X server as shown below

Code:


Time = 50

smoothSolver:  Solving for Ux, Initial residual = 0.00614156, Final residual = 0.000503708, No Iterations 2
smoothSolver:  Solving for Uy, Initial residual = 0.0155772, Final residual = 0.00125321, No Iterations 2
smoothSolver:  Solving for Uz, Initial residual = 0.0177427, Final residual = 0.00150379, No Iterations 2
GAMG:  Solving for p, Initial residual = 0.0704188, Final residual = 0.00267215, No Iterations 2
time step continuity errors : sum local = 8.15277e-05, global = 6.08291e-06, cumulative = -0.000108089
smoothSolver:  Solving for epsilon, Initial residual = 0.00588112, Final residual = 0.000463942, No Iterations 1
smoothSolver:  Solving for k, Initial residual = 0.0141518, Final residual = 0.000249249, No Iterations 2
ExecutionTime = 31.9 s  ClockTime = 57 s

ensightWrite ensightWrite write: ( epsilon k p U )
vtkWrite output Time: 50
    Internal  : "postProcessing/vtkWrite/windAroundBuildings_00000050/internal.vtu"
    Boundary  : "postProcessing/vtkWrite/windAroundBuildings_00000050/boundary/inlet.vtp"
    Boundary  : "postProcessing/vtkWrite/windAroundBuildings_00000050/boundary/outlet.vtp"
    Boundary  : "postProcessing/vtkWrite/windAroundBuildings_00000050/boundary/ground.vtp"
    Boundary  : "postProcessing/vtkWrite/windAroundBuildings_00000050/boundary/frontAndBack.vtp"
    Boundary  : "postProcessing/vtkWrite/windAroundBuildings_00000050/boundary/buildings.vtp"
    volScalarField(epsilon k p)
    volVectorField(U)
subset output Time: 50
    Internal  : "postProcessing/subset/windAroundBuildings_00000050/internal.vtu"
    Boundary  : "postProcessing/subset/windAroundBuildings_00000050/boundary/inlet.vtp"
    Boundary  : "postProcessing/subset/windAroundBuildings_00000050/boundary/outlet.vtp"
    Boundary  : "postProcessing/subset/windAroundBuildings_00000050/boundary/ground.vtp"
    Boundary  : "postProcessing/subset/windAroundBuildings_00000050/boundary/frontAndBack.vtp"
    Boundary  : "postProcessing/subset/windAroundBuildings_00000050/boundary/buildings.vtp"
    volScalarField(p)
    volVectorField(U)
    volScalarField->point(p)
    volVectorField->point(U)
streamLine streamLines write:
    seeded 40 particles
    Tracks:40
    Total samples:17898
postPro1 render
2023-12-27 12:00:51.230 (  60.288s) [        B8BA2880]vtkXOpenGLRenderWindow.:464    ERR| vtkXOpenGLRenderWindow (0x11004f30): bad X server connection. DISPLAY=

Does this function object require an X server to be used?

olesen December 27, 2023 14:02

Did you compile VTK with osmesa?

NotOverUnderated December 28, 2023 06:44

Quote:

Originally Posted by olesen (Post 862316)
Did you compile VTK with osmesa?

I have no idea how it was compiled since I am using it on the cluster.

How do I check if it is compiled with osmesa?

Update:

Never mind, I had to check if any libvtk*.so has a dependency on osmesa using ldd command. I think the VTK version used during the OpenFOAM building was not built with osmesa.

NotOverUnderated December 29, 2023 06:21

I got runTimePostProcessing function object running.


0) Install osmesa, on Ubuntu 22.04:
Code:

sudo apt install libosmesa6 libosmesa6-dev
1) Download VTK by cloning its repository.
2) cd to VTK directory and create a directory 'build' and cd to it.
3) run:

Code:

ccmake .. -DVTK_OPENGL_HAS_OSMESA=ON
When you run that you will get a warning that enabling OSMESA cannot co-exist with others such as SDL, etc (disable them). You still need to activate the modules below before generating your Makefile or (ninja file if opt to).

4) Now, to find the VTK module required by the runTimePostProcesisng function object, clone the openfoam repository and the visualization module.
5) cd to the runTimePostProcessing directory and find the required modules by running:

Code:

grep -r 'VTK::'

# For me the output was:

VTK::FiltersCore
VTK::FiltersGeometry
VTK::FiltersSources
VTK::IOGeometry
VTK::IOImage
VTK::IOLegacy
VTK::IOXML
VTK::ParallelCore
VTK::ParallelMPI
VTK::RenderingAnnotation
VTK::RenderingCore
VTK::RenderingParallel

6) cd back to the vtk folder (step 2) and run the command from step 3 again and enable the modules above.

7) Compile vtk and install it
Code:


sudo make install #will be installed by default under /usr/local/

8) Now it is important to set the environment variable VTK_DIR to /usr/local/

Code:


export VTK_DIR=/usr/local

8*) I have tried to to compile the runTimePostProcessing FO by running ./Allwmake, it compiled but it does not work (for unknown reasons) with the version of of OpenFOAM I install via the official binaries. So I had to compile OpenFOAM from scratch (took hours on my laptop).

9) Clone OpenFOAM repository (skip if you did in step 4).
10) Build OpenFOAM.
11) Compile the runTimePostProcessing library.


12) If you have tried step (8*) make sure to remove the librunTimePostProcessing.so from $FOAM_USER_LIBBIN and $FOAM_LIBBBIN and replace them with the newly compiled one after building OpenFOAM from source.

13) You must run this to get it to work for this session to load (you need to run this only this time):

Code:

sudo ldconfig
14) Run the $FOAM_TUTORIALS/incompressible/simpleFoam/windAroundBuildings to test this FO.

The steps above are not perfect but they should work.


All times are GMT -4. The time now is 15:22.