Page 1 of 2

Gradient Code_saturne vs Paraview

Posted: Mon Jul 02, 2018 4:58 pm
by Ionut G
Hi all,

I am simulating a test case of a steady state 3D Flat plate flow.
I run the simulation for 500 iterations and for post-processing the results I use Paraview.

I am calculating the pressure gradient in Code_saturne with "field_gradient_scalar function", using the cs_user_extra_operations.f90 file.
In order to be sure that I calculate the right pressure gradient in Code_saturne, in Paraview I found a filter for calculating the gradient of a variable, "GradientOfUnstructuredDataSet", and I apply this filter to the pressure in order to calculate the pressure gradient.

When I compare the pressure gradient calculated in Code_saturne with the pressure gradient calculated in Paraview I notice some differences.
Do anybody know the reason for these differences?
I attached the figure with the differences that I am talking about, and the code files that I use for simulation.

Thank you,
Ionut

Re: Gradient Code_saturne vs Paraview

Posted: Tue Jul 03, 2018 10:10 am
by Yvan Fournier
Hello,

The gradient computed by Code_Saturne uses a discretization consistent with that of the code (2-point finite volume with gradient reconstruction), and takes precribed boundary conditions into account.

That of ParaView is more "generic", I do not know which algorithm is used.

Regards,

Yvan

Re: Gradient Code_saturne vs Paraview

Posted: Tue Jul 03, 2018 3:34 pm
by Ionut G
Thank you very much Yvan.

I will try to find the algorithm from Paraview.

Re: Gradient Code_saturne vs Paraview

Posted: Mon Jul 09, 2018 10:19 am
by Ionut G
Hi,

From the same simulation made in Code_saturne, I plotted the "Pressure" along a line that goes on the X axis from the start to the end of the flat plate.
The plotted "Pressure" starts from 0.52 and ends at 0.02. I am not sure if the units are Pascals.

I tried to validate this simulation with a similar one made in Fluent. Here the pressure is totally different, it ranges from 101360 to 100850 Pascals. Even the variation of the pressure is different.

What pressure is calculating Code_saturne?
I added some figures with the plotted pressure from Code_saturne and Fuent.

Thank you,
Ionut

Re: Gradient Code_saturne vs Paraview

Posted: Mon Jul 09, 2018 10:45 am
by Yvan Fournier
Hello,

If you do not provide any more details about your intended setup it will be difficult to provide any meaningful help.

Regards,

Yvan

Re: Gradient Code_saturne vs Paraview

Posted: Mon Jul 09, 2018 11:57 am
by Ionut G
Hi,

I've uploaded the simulations setup files.
Do I need to upload anything else?

Thank you,
Ionut

Re: Gradient Code_saturne vs Paraview

Posted: Tue Jul 10, 2018 11:21 am
by Yvan Fournier
Hello,

I do not currently have acess to my computer, so can't check, but it seems you are running a relatively standard computation, with no velocity source terms added, but just regular boundary conditions.

So your pressure profile between the domain inlet and outlet would be expected to be regularly decreasing, as you observe. Unless the profile is clise to the plate ? Did you plot the total pressure ? With no reference case description (a pdf would help), I can't say much more.

Regards,

Yvan

Re: Gradient Code_saturne vs Paraview

Posted: Thu Jul 12, 2018 1:53 pm
by Ionut G
Thank you Yvan,

I figure out the problem of pressure variation, fluent needed more iterations than code_saturne to achieve a similar convergence.

In the first figure (download/file.php?id=2719&mode=view) is plotted the "Pressure" variablefrom code_saturne.
In the second figure, right side (download/file.php?id=2718&mode=view) is plotted the "Total Pressure" variable from code_saturne.

I don't understand why the values are so small from the first figure, where is plotted the "Pressure" variable.
How is calculated the "Pressure" variable from code_saturne?
What is representing this "Pressure" variable?

Thank you very much,
Ionut

Re: Gradient Code_saturne vs Paraview

Posted: Thu Jul 12, 2018 6:26 pm
by Yvan Fournier
Hello,

I am not the most knowledgeable person for this sort of explanation, as I know only some part of the numerics. The solved pressure is more of an incompressibility constraint than a physical pressure, and does not contain hydrostatic terms, nor I believe some terms related to turbulence, both of which are in the total pressure. So total pressure is probably better for most post processing aspects.

I don't really know more, but at least your results seem good.

Best regards,

Yvan

Re: Gradient Code_saturne vs Paraview

Posted: Mon Jul 16, 2018 3:06 pm
by Erwan Le Coupanec
Hi,

you can take a look at section 2.1.4 of the theory guide for the definition of the solved pressure p*.

Hoping you'll find useful elements there,

Regards,
Erwan.