-
-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide OpenFOAM consistent output interval #33
Comments
In our tutorials, we write every e.g. 0.1s of simulated time (and OpenFOAM will perform a smaller time step just before the write time, so that it writes exactly at that time). For example: In the same example, deal.II writes every 10 time steps (of 0.01s). Assuming that the time step size remains constant, the two results should be synchronized. What actually seems to confuse ParaView (5.8.0) is that it reads the actual time from OpenFOAM, but the number of output file from deal.II. So, we essentially would need a way to write the time to the VTK files. |
Hm, we could simply enable synchronization by using openfoams foamToVTK tool, which results in output numbers similar to the one used in deal.II currently, right? |
Why not change the naming in the deal.II adapter? dealii-adapter/linear_elasticity/linear_elasticity.cc Lines 706 to 710 in c332050
Then we don't need the user to do anything and the OpenFOAM part remains consistent with the rest of the tutorials (where we don't see this problem at the moment, but we also don't visualize the structure in ParaView). |
Because this will not work. ParaView just counts the number of vtk files and does not read the actual naming. In our case, the numbering is just the order in which paraView shows the results. Hence, naming a file according to the current time step will not have the effect you are thinking of. |
But in any case, ParaView currently does not have any information about the time of the results. Can't we add this information inside the vtk files? As I wrote above, there seems to be a way for this:
|
So, deal.ii provides this feature https://www.dealii.org/developer/doxygen/deal.II/structDataOutBase_1_1VtkFlags.html#a8944cf4f29e449a73c11c6f348b86c20 and I just tried it, but similar to an annotation, this just adds the time and cycle as a separate field. We don't get any synchronization here (or I am doing it wrong). Have you just looked yourself or ever tried this? Let me know, if you want me to push it anyway. |
I don't really have much experience with writing VTK files, but maybe I can prepare some dummy files and see afterwards how we can produce them from deal.II. This is not a priority in any case. Let's just keep documenting ideas here and we can address this later. |
In case you want to get to know, what vtk (the link you posted) does, it is sufficient to add the following: diff --git a/linear_elasticity/linear_elasticity.cc b/linear_elasticity/linear_elasticity.cc
index 8be277a..822e4fd 100644
--- a/linear_elasticity/linear_elasticity.cc
+++ b/linear_elasticity/linear_elasticity.cc
@@ -677,6 +677,8 @@ namespace Linear_Elasticity
// Note: There is at least paraView v 5.5 needed to visualize this output
DataOutBase::VtkFlags flags;
flags.write_higher_order_cells = true;
+ flags.time = time.current();
+ flags.cycle = time.get_timestep();
data_out.set_flags(flags); I think another aspect would be to allow the user to specify an absolute time value instead of time step numbers in the parameter files. Should simplify things, right? I thought this was also your initial intention. |
This is, what I mentioned above
Maybe it is just possible for visit (where your link points to) and not for paraView. Anyway, I have no idea, how to fix it. OpenFOAM has its own format. I still guess the simplest synchronization would be foamToVTK. |
Then let's leave this open for now. |
So, you get the synchronization from the Fluid side, since the OpenFOAM |
@MakisH How to proceed here? Do you expect any change in the deal.II codes? |
Not sure if this is of any help, but for the OpenFOAM-Nutils cases the time sync in vtks work. Maybe we could borrow some ideas from there? |
If we have a post-processing solution that works (just |
As discussed, the time output is currently defined by using a fixed number of time steps. This differs from OpenFOAM.
@MakisH could you specify, what would be the best solution here/ how it is commonly defined in OpenFOAM?
The text was updated successfully, but these errors were encountered: