CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   SU2 (https://www.cfd-online.com/Forums/su2/)
-   -   Creating an output file with primitive variable (https://www.cfd-online.com/Forums/su2/146321-creating-output-file-primitive-variable.html)

viit3 December 24, 2014 02:30

Creating an output file with primitive variable
 
I am doing internal flow simulations using Euler and want to visualize vorticity. How do I write vx, vy and vz to an output file.

I can see that vorticity is calculated for NS and I guess the same methods have to be added to the Euler part.

Vino December 24, 2014 12:06

Quote:

Originally Posted by viit3 (Post 525136)
I am doing internal flow simulations using Euler and want to visualize vorticity. How do I write vx, vy and vz to an output file.

I can see that vorticity is calculated for NS and I guess the same methods have to be added to the Euler part.

you will get rho, rho*u , rho*v, rho*E in output file. from this u can get u,v (2D).

viit3 December 25, 2014 02:56

I think maybe I wasn't clear. I need dv/dx, dv/dy, dv/dz

Vino December 25, 2014 03:33

ok fine. if you need vorticity, you can utilize some flow visualizer like Tecplot. It just needs velocity components as input, right?

But if you need derivatives of velocity components, you need to find a way to write it in a data file from SU2. Derivatives will be calculated for Euler, if you use 2nd order.

viit3 December 25, 2014 23:45

Paraview crashes when it tries to calculate vorticity.

I want to know exactly how to get the derivatives and write them.

Vino December 26, 2014 01:46

I have not tried anything like that. But you explore the output related source files (SU2_CFD/src/*output) and add variables to write into flow files. I hope its possible.

viit3 December 26, 2014 06:22

I added the following lines in output_structure. I am now getting values of vorticity from them. I just want to confirm that the values I am getting are those of vorticity.

if ((Kind_Solver == EULER) || (Kind_Solver == NAVIER_STOKES) || (Kind_Solver == RANS)) {
/*--- Vorticity ---*/
nVar_Total += nDim;
}


double **gradsWrite = solver[FLOW_SOL]->node[iPoint]->GetGradient_Primitive();
double *vort = new double[nDim];
vort[0] = gradsWrite[3][1]-gradsWrite[2][2];
vort[1] = gradsWrite[1][2]-gradsWrite[3][0];
vort[2] = gradsWrite[2][0]-gradsWrite[1][1];
for(int i=0;i<nDim;i++)
{
Data[jVar][jPoint] = vort[i]; jVar++;
}

Vino December 26, 2014 07:43

Looks fine to me.!!!

jainam1259 June 3, 2021 12:40

Doubt In the above given code
 
Can someone please explain the above code written. I am trying to calculate vorticity for my domain. Using, SU2_CFD -d <your_config_file.cfg> I got to know that vorticity can be written in output format.
Thanks

bigfootedrockmidget June 4, 2021 15:24

If you want to look at vorticity, you can just use the keyword "VORTICITY" in the config file as one of the keywords for the volume output


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