CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   SU2 Shape Design (https://www.cfd-online.com/Forums/su2-shape-design/)
-   -   Getting U and V from rms[RhoV] and rms[RhoU] (https://www.cfd-online.com/Forums/su2-shape-design/248344-getting-u-v-rms-rhov-rms-rhou.html)

elninoft9 March 9, 2023 22:58

Getting U and V from rms[RhoV] and rms[RhoU]
 
Hi everyone, The "rms[RhoU]", "rms[RhoV]", and "rms[Rho]" values in the history_direct.csv file are generated after i perform shape optimisation for the NACA 0012 2D airfoil, in a transonic and inviscid flow. How can i get the values of U and V alone? Can i just use the following approach?
U = rms[RhoU] / rms[Rho]
V = rms[RhoV] / rms[Rho]

I am not confident if the above formula gives me the values of U and V, which are the x and y components of the flow velocity, which is what I am required to analyse. I do appreciate any help and thank you!

bigfootedrockmidget March 10, 2023 01:58

No, RMS[..] are the root mean square values of the residuals, so they only give information about how far you are from the exact numerical solution. You should construct velocity from the momentum in the volume output. You can see all options for screen, history and volume output using:
Code:

SU2_CFD -d config.cfg
To analyze velocity you do:

Code:

OUTPUT_FILES= RESTART, PARAVIEW_MULTIBLOCK
VOLUME_OUTPUT= PRIMITIVE


And you view the paraview_multiblock solution file xx.vtm in paraview. With the calculator you can construct velocity by dividing the momentum by density.

elninoft9 March 11, 2023 14:18

Thank you for your help! Does that mean that I have to edit the inv_NACA0012_basic.cfg file to include the code of "OUTPUT_FILES= RESTART, PARAVIEW_MULTIBLOCK & VOLUME_OUTPUT= PRIMITIVE" ?

This would also mean that I would have to re-run my simulations again? Unfortunately, I may not have time to re-run my simulations, and hence, is there any way I can get the U and V values, with the data alr present from my history_project.csv or history_direct.csv or surface_flow.csv?

bigfootedrockmidget March 12, 2023 06:18

Hi,


If you have a restart file, you can restart from that and run 1 iteration. I am assuming you have a steady state solution, not time dependent. And that you want to view the final, optimized geometry + flow solution of the naca profile. Copy your testcase into a separate folder, so you do not accidentally overwrite your simulations.
Then add/change in the .cfg file these lines:



Code:

RESTART_SOL= YES
SOLUTION_FILENAME= solution.dat
ITER= 1


Just copy your restart file (restart.dat?) to solution.dat and restart it.



I am assuming you actually want the flow field solution for velocity? The history file contains convergence information and some mean data on selected surfaces like lift and drag. If your solution has converged, the RMS values should be really low and the lift/drag should have reached a constant value.

elninoft9 March 12, 2023 07:54

Actually, with regards to your initial reply, you asked me to open the paraview file. I realized that my output files already has a paraview file called flow.vtu. Therefore, would I be able to use the calculation that you said of "momentum/density" to get the flow field solution for velocity? Also, could you elaborate on why momentum divided by density gives me velocity? Is that any equation?

bigfootedrockmidget March 12, 2023 12:15

Yes, if you already have a paraview file, just open it and use the calculator function. Momentum is defined as density times velocity.

elninoft9 March 16, 2023 13:13

thank you for your help! I managed to obtain the velocity values. Specifically, I got the x and y components of the velocity. However, I need to plot a velocity distribution graph for the airfoil. Online, it say's that i would need v/V(freestream). But how do I get the freestream velocity? Or is there another way to plot the velocity distribution over the airfoil? Because, simply plotting the x and y components of the velocity is giving me a nonsensical graph.

bigfootedrockmidget March 17, 2023 03:42

The velocity is divided by freestream velocity to get a nice non-dimensional value. It's just a scaling by a constant value.


The freestream velocity is the velocity 'far away' from the airfoil. It is the velocity that is imposed at the boundary of your domain, usually defined as a 'far field' boundary. So what does your geometry look like?

If you have placed a 2D airfoil inside a circular domain and define the edge of the circle as a far field boundary using MARKER_FAR, then the free stream velocity is the velocity on this marker.

What this far field velocity is depends on your setup (for compressible computed from the Mach number). The far field velocity determines your entire solution, you should know what it is.


All times are GMT -4. The time now is 00:08.