definition of various pressures

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Antech
Posts: 201
Joined: Wed Jun 10, 2015 10:02 am

Re: definition of various pressures

Post by Antech »

Hello.
I faced the similar problem with pressure treatment because I work on aerodynamic resistance of the chimney with noise killers and, therefore, the leveling (elevation) pressure difference is important because the fluid is a gas turbine flue gas with density of around 0.43 kg/m3 (ambient density is ~1.2 kg/m3). Here is the terminology we consider standard.

Reference pressure (Pref)
It's a pressure that added to static pressure to compute thermophysical properties (density in pure aerodynamic cases, maybe also molecular viscosity if it depends on the pressure for the fluid used).

Dynamic pressure (Pdyn)
As I suppose, dynamic pressure is Pdyn=0.5*Rho*w^2 in all notations (Rho is a density, w is a velocity magnitude).

Hydrostatic pressure (Phyd)
As I suppose, hydrostatic pressure is Phyd=Rho*g*h in all notations (h is an elevation relative to base point).

Pressure difference due to density difference (DPrho)
If you have a case like duct or chimney, there is also an additional pressure increase due to density difference that is usually greater outside the domain than inside. It's not a hydrostatic pressure! In simplest case with constant densities, DPrho=DeltaRho*g*h, where DeltaRho is a density difference, h is an elevation relative to base point (level).

Static pressure (Pst)
It's a pressure inside a calculation domain (vessel, pipeline etc) not including dynamic pressure but including pressure difference due to density difference inside and outside the domain DPrho (not just Phyd), relative to atmospheric pressure or absolute depending on particular case. Let's assume it's relative to atmospheric pressure.

Total pressure (Ptot)
It's a sum of static and dynamic pressures: Ptot=Pst+Pdyn

I searched the forum and looked at manuals and still it was unclear for me how Saturne defines pressures. So I just ran the calculation for 8 iterations without any inflow/outflow boundary and here is what I found.

Pressure in Saturne
It's a relative pressure that doesn't include leveling (elevation) pressure, reference pressure or dynamic pressure. If you'll take a look at the vertical Pressure profile in static case you'll see a constant pressure of zero from bottom to top. So we have: Pressure=Pst-DPrho. Unfortunately, in Saturne this variable doesn't include DPrho so you should take it into account using Calculator filter in ParaView. (For example, in CFX, pressure variable includes DPrho if buoyancy was activated, it asks for the reference density for this).

Total_pressure in Saturne
This is a sum of absolute static pressure and hydrostatic pressure: Total_pressure=Pref+Pst-DPrho+Phyd=Pref+Phyd+Pressure.
It doesn't include dynamic pressure like in most other codes (usually total pressure is a sum of static and dynamic ones).

Therefore, if you want the "standard" total pressure, you may use the following expression in Calculator filter called TotalPressure:
Pressure+0.5*Density*mag(Velocity)^2
Be careful not to average total pressure because static pressure must be averaged by area, but dynamic pressure by mass flux (Rho*w) so averaging total pressure will result in error (for example, you will easily obtain an increase of total pressure in stream direction in duct with DPrho==0 if boundary velocity profile is strongly non-uniform).

If the density difference inside and outside the domain (DPrho) must be taken into account, you may use the following expression for "new" static pressure in Calculator filter called PrsStatic:
Pressure+DPrho

Prior to this, you need to define the DPRho as follows:
(coordsY-Ybase)*9.81*(RhoOutside-RhoInside)
where coordY is a vertical coordinate, Ybase is a base level (height), RhoOutside and RhoInside are densities inside and outside the domain. This is only applicable for constant densities, for variable densities an integration over height appears so it's not so simple.

[Salome/ParaVis is a ParaView so any variable you see in it is variable outputted by Saturne solver, there is no need to distinguish Salome/ParaVis variables ans Saturne ones]
StandardRANSUser001
Posts: 33
Joined: Tue Apr 09, 2024 3:26 am

Re: definition of various pressures

Post by StandardRANSUser001 »

Hi Antech (and everybody else),

I am working on an incompressible case that doesn't include a gravity term, nor density gradients. I would just like to confirm my thinking is correct.

P_{s} = CS static pressure (gauge)
p_{dyn} = dynamic pressure (i.e. 0.5 * rho * |U|^2)
p_{atm} = Used for any gauge pressure calculations
p_{t} = CS total pressure
p_{stag} = stagnation pressure

For an incompressible flow, you are saying that the total pressure in code saturne, is actually absolute static pressure, right?

Assumptions:
Calculation of "total pressure" in CS:
p_{t} = P_{s} + p_{atm}

Meaning that the pressure field in CS is static pressure (gauge).

Therefore, if we need stagnation pressure in our calculations, we need some additional post processing...
p_{stag} = p_{dyn} + p_{t}

Firstly, I just wanted to confirm this thinking is correct.

Secondly, I want to verify how these assumptions impact the p0 definition in code saturne. The cs_user_parameters.c file in 8.2 describes this as the "total pressure" (for incompressible cases), with this value being defined as a Dirichlet condition, when the coordinates are defined. I want to verify that p0 is just the absolute static pressure in this definition.

Thanks!
Sean Hanrahan
Yvan Fournier
Posts: 4185
Joined: Mon Feb 20, 2012 3:25 pm

Re: definition of various pressures

Post by Yvan Fournier »

Hello,

I'll see if someone more expert in.that part of the code, like Martin, can proofread this, but it seems right to me.

We do need to improve the documentation here, because while some lower level stuff is highly detailed, the basic fact that we solve a pressure variable which does not contain the hydrostatic part (what we usually write as "p star", and what you call the gauge pressure), is not mentioned... I may be familiar with people who are versed in classical CFD books (Peric being a good start), it is not obvious to a user, and even as a developer, I often revert to checking the source code jus to be sure whether a boundary condition uses a gaige or total pressure.

So placing and issue on the GitHub issue tracker, or pinging us on this thread if we do not handle it soon enough (our wishlist contains much more) can certainly help us improve this.

And using the cs_function_t constructs, we could add built-in postprocessing outputs for dynamic pressure for example (some parts of if being tricky, with contributions I'm some turbulence quantity computations, at least at boundaries).

Best regards,

Yvan
StandardRANSUser001
Posts: 33
Joined: Tue Apr 09, 2024 3:26 am

Re: definition of various pressures

Post by StandardRANSUser001 »

Hi Yvon,

Thanks for confirming this.

Yes, these basics would be appreciated in the documentation. From my perspective, the more scripts that can be included in the example user functions, the better.

So based on this, the reference pressure (p_{atm}) is set at the outlet of the domain. For an incompressible case, this means that p_{t} is just a constant scaled by p_{atm}, and p_{s} is effectively independent of p_{atm}, no? The reason I ask is that I am confused by the standard neumann conditions enforced at the outlet, and the conclusion that I have come to is that p_{atm} at the outlet is purely there just to scale p_{t}.

What I am getting at here is that changing p_{atm} won't change the flow physics through the domain, it will just scale p_{t}, right?

Best regards,
Sean Hanrahan
Post Reply