Write Cell Volumes and Velocities for each TimeStep
Hello everybody,
I am write a little post-processing tool which writes out the cell volumes and the velocities in the cells for a specific region in the domain. Since I am only interested in a small part of my domain, I define a distance from z_min to z_max in an so called CoordinatesDict in the constant directory. I want to write the data in a .dat file to proceed working with python. At the moment the code looks like this... Code:
// This file is based on OpenFOAM. Code:
#include "createMesh.H" I tried so come around with mesh.readUpdate() but I did not work out... Thank a lot for your input! Best regards |
Default Write Cell Volumes and Velocities for each TimeStep
Hi Sisetrum
I do not know a way to get around reading Code:
#include "createMesh.H" Code:
runTime.setTime(timeDirs[timeDirs.size()-1], timeDirs.size()-1); Hope I could help |
Hey,
thank you for your reply! I had something similar to your version. As you said, this gets the data of the last time step... What I want to get, is a tool that it works in the same way as the sample utility: Read the mesh only one time to write out the volumes of the cells and extract the velocities from the data in the time directories. Code:
SAMPLE: |
Links to sample
I recommend you look at the sample utility then.
https://cpp.openfoam.org/v3/a04479_source.html and check how it loads the mesh in "#include "createNamedMesh.H"" before forAll. |
Thanks, I will give it a try...
|
Sample code
Hi Sisetrun,
I have taken the liberty to modify your code to import the mesh only once. I think this should work. An idea to speed up your code is not not use "createFields.H" but write in only the variables you need specifically. I have not figured out if createFields or the equivalent variables can be written out of the time loop. To write only the variables you need look at other post processing utilities. I Hope this helps. Code:
// This file is based on OpenFOAM. |
Awesome... Thanks a lot for your help!
|
All times are GMT -4. The time now is 19:30. |