CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ParaView (https://www.cfd-online.com/Forums/paraview/)
-   -   [General] Temporal Analysis (https://www.cfd-online.com/Forums/paraview/112572-temporal-analysis.html)

mohammad.sarfaraz January 31, 2013 02:46

Temporal Analysis
 
Dear all
Hi
I have made an analysis of wave propagation (free surface flow). It is a temporal problem, which means that the wave height changes over the time at a specific section.
In my analysis each time step is saved on an individual file.
For example 01.vtk is the free surface profile of the wave at t=0.1 sec. for the whole channel.
02.vtk for t=0.2 sec. and so on.
I want to use ParaView to analyze wave height vs. time at a specific location.

Please help me.

wyldckat February 2, 2013 06:57

Hi Mohammad,

I finally managed to figure how this can be done. My test case was OpenFOAM's tutorial "multiphase/interFoam/laminar/damBreak". The steps I used were as follows:
  1. Applied the filter "Contour" and configured to use only the value "0.5" for the Isosurfaces, applied to the field "alpha1", which varies between 0 and 1, indicating where the water and air are present.
  2. Applied the filter "Extract Surface" to the previous filter. For some reason, this makes calculation of the height more stable.
  3. Applied the filter "Calculator" to the previous filter. The calculation is configured as:
    • Attribute mode: point data
    • Result Array Name: H
    • Expression: coordsY
      • This is because this case was pseudo-2D.
  4. Applied the filter "Slice" to the previous filter. With this I made a section cut of the surface, in order to have a line in which the probe will float on.
  5. Applied another filter "Slice" to the previous "Slice" filter. With this I isolated only the point that is going to be probed.
  6. Now, with the last slice selected on the "Pipeline browser", I used the window splitter (look at the 4 buttons on the upper right corner of the 3D model, it's the first or second button from the left).
  7. In the second side a list of possible views appears and I chose the "Spreadsheet" view.
  8. On this spreadsheet, select in "Showing" the last slice. Then click on the only line that appears. The point on the 3D model should appear in pink.
  9. Go back to the "Pipeline browser" and apply to the last slice the filter "Plot Selection over Time".
  10. Another view should appear, with several line plots. In the "Object inspector", select the Display tab and turn off all of the fields that don't matter and leave "H" turned on.
And that's it! You should now have a working plot over time of the height on that point.


Best regards,
Bruno

mohammad.sarfaraz February 2, 2013 10:18

Quote:

Originally Posted by wyldckat (Post 405615)
Hi Mohammad,

I finally managed to figure how this can be done. My test case was OpenFOAM's tutorial "multiphase/interFoam/laminar/damBreak". The steps I used were as follows:
  1. Applied the filter "Contour" and configured to use only the value "0.5" for the Isosurfaces, applied to the field "alpha1", which varies between 0 and 1, indicating where the water and air are present.
  2. Applied the filter "Extract Surface" to the previous filter. For some reason, this makes calculation of the height more stable.
  3. Applied the filter "Calculator" to the previous filter. The calculation is configured as:
    • Attribute mode: point data
    • Result Array Name: H
    • Expression: coordsY
      • This is because this case was pseudo-2D.
  4. Applied the filter "Slice" to the previous filter. With this I made a section cut of the surface, in order to have a line in which the probe will float on.
  5. Applied another filter "Slice" to the previous "Slice" filter. With this I isolated only the point that is going to be probed.
  6. Now, with the last slice selected on the "Pipeline browser", I used the window splitter (look at the 4 buttons on the upper right corner of the 3D model, it's the first or second button from the left).
  7. In the second side a list of possible views appears and I chose the "Spreadsheet" view.
  8. On this spreadsheet, select in "Showing" the last slice. Then click on the only line that appears. The point on the 3D model should appear in pink.
  9. Go back to the "Pipeline browser" and apply to the last slice the filter "Plot Selection over Time".
  10. Another view should appear, with several line plots. In the "Object inspector", select the Display tab and turn off all of the fields that don't matter and leave "H" turned on.
And that's it! You should now have a working plot over time of the height on that point.


Best regards,
Bruno

Too much thanksfor your answer.
It is agreat help.
But you should consider that:
I had about 100 files of .vtu, which each ofthem is for one time step,i.e. 0.vtk is for t=0,1.vtkis for t=0.1, ..., 100.vtk is for t=100 sec.
Should I open all of them with Paraview?

I would be thankful for your reply.

Best Regards

wyldckat February 2, 2013 14:13

Hi Mohammad,

I thought you already knew how ParaView handles multiple files...

There are two ways ParaView can handle them:
  1. You can open each file individually, for which you only have a single time snapshot.
  2. Or you can open the group handle. For example:
    1. If you have these files: "snap01.vtk", "snap02.vtk" and "snap03.vtk"
    2. Then "snap..vtk" will appear in the file browser, when called from within ParaView's menu "File -> Open" or from the "Open" button.
      If you pick this group handle "snap..vtk", then all 3 files will be accessible through the time controls on the top center/right part of the ParaView's window.
Best regards,
Bruno

mohammad.sarfaraz February 3, 2013 01:13

Quote:

Originally Posted by wyldckat (Post 405668)
Hi Mohammad,

I thought you already knew how ParaView handles multiple files...

There are two ways ParaView can handle them:
  1. You can open each file individually, for which you only have a single time snapshot.
  2. Or you can open the group handle. For example:
    1. If you have these files: "snap01.vtk", "snap02.vtk" and "snap03.vtk"
    2. Then "snap..vtk" will appear in the file browser, when called from within ParaView's menu "File -> Open" or from the "Open" button.
      If you pick this group handle "snap..vtk", then all 3 files will be accessible through the time controls on the top center/right part of the ParaView's window.
Best regards,
Bruno


Dear Bruno
Hi
Again too much thanks
I have about 100 files of .vtk, which they are not grouped,i.e. they are seperate.
How can I make them in a group and assign them time step?

wyldckat February 3, 2013 05:14

4 Attachment(s)
Hi Mohammad,

Attached are some images to help show what I meant:
  1. "fileopen_group.png" - file grouping is automatic in ParaView. When you open the file browser, it will show as in the image. Like I wrote before, by picking "snap..vtk", ParaView will automatically open the whole group as time snapshots.
  2. "fileopen_multiple.png" - this is just to show that the group will associate all of those files. You can open a single or a couple of these files, if you don't want them as time snapshots.
  3. "focus_on_details.png" - On the left in the "Pipeline browser" is the item "snap0*", which represents the group. On the top right you have the time controls, where you can see the "Time: 1" and the controls further on the right.
  4. "anotatetime.png" - Apply the filter "Annotate Time" and apply a scale factor. In my case, it was "0.1".
Best regards,
Bruno

mohammad.sarfaraz February 5, 2013 20:52

1 Attachment(s)
Quote:

Originally Posted by wyldckat (Post 405726)
Hi Mohammad,

Attached are some images to help show what I meant:
  1. "fileopen_group.png" - file grouping is automatic in ParaView. When you open the file browser, it will show as in the image. Like I wrote before, by picking "snap..vtk", ParaView will automatically open the whole group as time snapshots.
  2. "fileopen_multiple.png" - this is just to show that the group will associate all of those files. You can open a single or a couple of these files, if you don't want them as time snapshots.
  3. "focus_on_details.png" - On the left in the "Pipeline browser" is the item "snap0*", which represents the group. On the top right you have the time controls, where you can see the "Time: 1" and the controls further on the right.
  4. "anotatetime.png" - Apply the filter "Annotate Time" and apply a scale factor. In my case, it was "0.1".
Best regards,
Bruno

Hi Bruno
Your helps are acknowledged. But when I want to open multiple files, I can NOT see "snap.vtk" as shown in the picture.
Attachment 18792

Best Regards

wyldckat February 6, 2013 17:20

Hi Mohammad,

I forgot to tell you that you will have to rename all of the files to have text before the number, for ParaView to identify the files. This is why my example files had "snap" before the numbers.

For example, you'll have to rename these files:
Code:

0.vtk
1.vtk
2.vtk
3.vtk

to something like this:
Code:

snap0.vtk
snap1.vtk
snap2.vtk
snap3.vtk

Best regards,
Bruno

mohammad.sarfaraz February 7, 2013 10:04

Quote:

Originally Posted by wyldckat (Post 406429)
Hi Mohammad,

I forgot to tell you that you will have to rename all of the files to have text before the number, for ParaView to identify the files. This is why my example files had "snap" before the numbers.

For example, you'll have to rename these files:
Code:

0.vtk
1.vtk
2.vtk
3.vtk

to something like this:
Code:

snap0.vtk
snap1.vtk
snap2.vtk
snap3.vtk

Best regards,
Bruno

Hello my friend
Now it works!!!
I do not know how to thank you.

All the Best
Mohammad

giack April 23, 2013 13:21

Hi to all,
I follow the method proposed by wyldckat to calculate the velocity of the front of a bubble. I have a question about it. It's possible change the point after a certain time step? the front of my bubble is not always at the same y. The front of the bubble is characterized by the minimum value of z, so after set the contour of alpha=0,5 I want insert a filter that give me the point of minimum z. Moreover the second slice must be able to choose the this point that change position in y and z.

Thanks to all

wyldckat April 26, 2013 19:40

1 Attachment(s)
Greetings giack,

Attached is an image demonstration the power of the "Python Calculator" filter and how to configure it.

Note: it will give some error/warning messages, but you can ignore those :D Basically it complains about the result not being of the same array size as of the original data, but we don't care about that since we just need one value.

Keep in mind that you'll need a ParaView version that has got Python built into it. I used "ParaView 3.14.1" that Ubuntu 12.04 has got.

Best regards,
Bruno

Neraste June 12, 2013 05:43

I wanted to plot the position of an interface over time... Well, you've saved my day wyldckat!

CFDMagnus December 3, 2018 05:36

Thanks a lot (in reconstructed)
 
Hey Bruno,


just getting into OpenFoam and stumble upon so many valuable post of yours! Your help is definitely appreciated.

Let me make an addition, your solution only works (at least for me) in reconstructed Mode. Paraview will give a lot of type mismatch errors, whenever i try to calculate for H in decomposed mode. After Reconstructing everything works like charm.


Thank you!
Magnus

mahsankhan December 22, 2019 16:07

Please Help, Time not showing on x-axis and graph is all empty
 
When I select a point and press "Plot Selection Over Time", it gives me an empty graph and my time range is 0 to 9 seconds, but on x-axis it is plotting the values from -0.01 to 0.01, it's not getting the time... Why? :(

mahsankhan December 25, 2019 09:23

Quote:

Originally Posted by wyldckat (Post 405615)
Hi Mohammad,

I finally managed to figure how this can be done. My test case was OpenFOAM's tutorial "multiphase/interFoam/laminar/damBreak". The steps I used were as follows:
  1. Applied the filter "Contour" and configured to use only the value "0.5" for the Isosurfaces, applied to the field "alpha1", which varies between 0 and 1, indicating where the water and air are present.
  2. Applied the filter "Extract Surface" to the previous filter. For some reason, this makes calculation of the height more stable.
  3. Applied the filter "Calculator" to the previous filter. The calculation is configured as:
    • Attribute mode: point data
    • Result Array Name: H
    • Expression: coordsY
      • This is because this case was pseudo-2D.
  4. Applied the filter "Slice" to the previous filter. With this I made a section cut of the surface, in order to have a line in which the probe will float on.
  5. Applied another filter "Slice" to the previous "Slice" filter. With this I isolated only the point that is going to be probed.
  6. Now, with the last slice selected on the "Pipeline browser", I used the window splitter (look at the 4 buttons on the upper right corner of the 3D model, it's the first or second button from the left).
  7. In the second side a list of possible views appears and I chose the "Spreadsheet" view.
  8. On this spreadsheet, select in "Showing" the last slice. Then click on the only line that appears. The point on the 3D model should appear in pink.
  9. Go back to the "Pipeline browser" and apply to the last slice the filter "Plot Selection over Time".
  10. Another view should appear, with several line plots. In the "Object inspector", select the Display tab and turn off all of the fields that don't matter and leave "H" turned on.
And that's it! You should now have a working plot over time of the height on that point.


Best regards,
Bruno

Hello,

Can you please help me get this done for floatingObject case of multiphase, it is a 3D case and I want to know the height of water which is along z-axis I believe. When I am following your procedure, for which I am very thankful, I am not getting the pressure and especially the H (Height of water). Also there are the error messages that says like, "Column "H" must have 61 rows, but only has 1."

(I have total 61 time steps inlcuding 0th time step, like 0, 0.1, 0.2, 0.3,... ...,5.9, 6)

mahsankhan December 25, 2019 09:47

Not Getting the Time on x-Axis
 
In another case of mine, with floatingBody of overInterDyMFoam, the graph is coming empty and I have no option to get the Time on the x-axis, even in the data to be selected for the x-axis, the Time is not showing :(

Please help me if you can...

virengos January 3, 2020 15:10

Hello,
I was dealing with a similar case last year and developed a short python script to rename and to move all the *.vtk files to one specific folder. Maybe it's useful for someone. It can be run in background to the OpenFOAM run.
best,
Damian
https://gitlab.com/virengos/openfoam...PostCopyPlanes


All times are GMT -4. The time now is 11:50.