Hi guys, I was having problems fitting the timesteps of vtk with the CFD results, and I didn't find anything that showed a solution anywhere, so I wanted to post what worked for me here.
Description of the Problem:
Suppose we load the particles from the DEM part from VTK. In that case, we will encounter that the timesteps will be assigned to natural numbers (i.e. 0,1,2,...), and Paraview will add those "timesteps" to the CFD part simulation results. This is problematic, as if, for example, you have a simulation of 0.1 seconds, the lagrangian part would be outside the time length of the CFD simulation, when they should coincide. This situation happens no matter what filename format you specify.
Solution (what worked for me):
Use a "vtk.series" file. In addition to the vtk dumped in your post folder in the DEM part, I created a file that contains a dictionary that assigns the files to the timesteps. For example:
{
"file-series-version": "1.0",
"files": [
{ "name" : "frame_0.vtk", "time" : 0.0 },
{ "name" : "frame_1.vtk", "time" : 1.5 },
{ "name" : "frame_2.vtk", "time" : 2.3 },
{ "name" : "frame_3.vtk", "time" : 3.8 },
{ "name" : "frame_4.vtk", "time" : 4.0 }
]
}
And you save it as a "particles.vtk.series" file. Paraview can read natively these, and now the particle snapshots will correctly align with the CFD results.
If you want to automate the generation of this file, you can write a bash or Python script that reads the names of the dump files in the folder, generates a dictionary, and saves it to a "_.vtk.series" file. This isn't difficult; you can ask any IA how to code it nowadays.
Hope you find this post useful! I'm open to any questions.
Cheers,
Sebastián.