Gradient Code_saturne vs Paraview

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Ionut G
Posts: 43
Joined: Fri Apr 20, 2018 2:43 pm

Gradient Code_saturne vs Paraview

Post 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
Attachments
cs_user_extra_operations.f90
(5.8 KiB) Downloaded 228 times
image001.png
Yvan Fournier
Posts: 4075
Joined: Mon Feb 20, 2012 3:25 pm

Re: Gradient Code_saturne vs Paraview

Post 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
Ionut G
Posts: 43
Joined: Fri Apr 20, 2018 2:43 pm

Re: Gradient Code_saturne vs Paraview

Post by Ionut G »

Thank you very much Yvan.

I will try to find the algorithm from Paraview.
Ionut G
Posts: 43
Joined: Fri Apr 20, 2018 2:43 pm

Re: Gradient Code_saturne vs Paraview

Post 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
Attachments
The pressure calculated by Code_saturne
The pressure calculated by Code_saturne
Comparison between Code_saturne(right) and Fluent(left), pressure variation
Comparison between Code_saturne(right) and Fluent(left), pressure variation
The pressure calculated by Fluent
The pressure calculated by Fluent
Yvan Fournier
Posts: 4075
Joined: Mon Feb 20, 2012 3:25 pm

Re: Gradient Code_saturne vs Paraview

Post 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
Ionut G
Posts: 43
Joined: Fri Apr 20, 2018 2:43 pm

Re: Gradient Code_saturne vs Paraview

Post by Ionut G »

Hi,

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

Thank you,
Ionut
Attachments
listing.log
(2.01 MiB) Downloaded 217 times
setup.log
(24.92 KiB) Downloaded 211 times
Flat_plate_3d.xml
(8.33 KiB) Downloaded 209 times
Yvan Fournier
Posts: 4075
Joined: Mon Feb 20, 2012 3:25 pm

Re: Gradient Code_saturne vs Paraview

Post 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
Ionut G
Posts: 43
Joined: Fri Apr 20, 2018 2:43 pm

Re: Gradient Code_saturne vs Paraview

Post 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
Attachments
Code_saturne fortum flat plate comparison Code_saturne vs Fluent.pdf
(215.63 KiB) Downloaded 218 times
Yvan Fournier
Posts: 4075
Joined: Mon Feb 20, 2012 3:25 pm

Re: Gradient Code_saturne vs Paraview

Post 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
Erwan Le Coupanec
Posts: 45
Joined: Sun Sep 08, 2013 8:50 pm

Re: Gradient Code_saturne vs Paraview

Post 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.
Post Reply