Plotting max aspect ratio with time
1 Attachment(s)
Hello Foamers.
I am running a dynamic simulation with a moving wall and velocity laplacian. I want to check the motion before the actual simulation and so moveDynamicMesh is performed. I have the mesh quality information for the time steps. 1. How do I plot the max aspect ratio with time for the mesh motion? I want to find at which timestep, the max aspect ratio is at a peak. I am at a lost. 2. checkMesh -writeAllFields have given me the required data and can be visualised via paraView. Is there a way to generate the plot from paraView? I hope someone can point me to a right direction for the plot. Meanwhile if I come up with a solution, I will be happy to share it here An instance of the simulation is attached. With regards |
According to your screenshot, the mesh quality fields including aspect ratio are written to disk every time step. You can open them in Paraview, and plot the maximum aspect ratio over time.
If you save the output from your screenshot to a log file you can use grep command to find the maximum aspect ratio. save it to a file and plot it. |
1 Attachment(s)
Quite right. I got it by following the following instruction given on
HTML Code:
https://docs.paraview.org/en/latest/Tutorials/ClassroomTutorials/beginningPlotting.html Thanks! |
Nice :)
You can also use grep command to extract those values from the log file and plot them later using Gnuplot or any other software. |
I will do that and post the commands here after I successfully plot using grep.
Cheers. 🙂 |
1 Attachment(s)
Here is the use of grep but then how to set the x axis as time and not iterations? The time was from 1s so the graph looks a bit different but then the plotting way would remain same.
Code:
set border lw 1 How to get x axis as time??? hmmm. |
Quote:
I have some comments: 1) Do not cat to grep! Most commands accept filenames as arguments. So instead of: Code:
cat filename | grep 'foo' Code:
grep 'foo' filename 2) Instead of using the command inside gnuplot script, you can proceed like this:
To combine the two files time.txt and maxAspectRatio.txt you can use many tools: LibreOffice calc, Microsoft Excel, or a command with the name 'paste': Code:
paste -d " " time.txt maxAspectRatio.txt > result.txt I know there are better ways to do that, but I hope this helps |
okay now I think I can accomplish this. I will post the result once this is done for other users if they need it. And Thank you for the input!! Really appreciated. :)
P.S. I am also looking into swak4Foam and pyFoam so if I get the alternatives, I will post here for other users. Cheers! |
1 Attachment(s)
So pyFoamPlotRunner.py can be used. or run the moveDynamicMesh > log and use
Code:
pyFoamPlotWatcher.py log --hardcopy --format-of-hardcopy=png I consider my thread closed. Thanks! |
All times are GMT -4. The time now is 01:16. |