Page 1 of 1

Setting reference pressure position (xyzp0)

Posted: Tue Nov 14, 2023 4:45 am
by finzeo
Hi,

I want to specify the position in my domain where I want to set the reference pressure, p0. After reviewing the guides and documentation, it seems that the recommended method is through the cs_user_parameters function, using

Code: Select all

cs_fluid_properties_t *fp = cs_get_glob_fluid_properties();
fp->xyzp0[0] = ...;
fp->xyzp0[1] = ...; 
fp->xyzp0[2] = ...;
However, upon running the simulation, I observed that the pressure value at that specified position differs from the reference value. I have attached the setup.xml file for your reference.

Additionally, I've encountered a peculiar situation: I understand that the aforementioned code should not significantly impact the overall results (as what matters are the pressure differences, not their absolute values). However, I noticed a relevant change in the results solely by incorporating the above lines of code, without any other modifications to the settings. Can you provide insights into why this might be happening?

Re: Setting reference pressure position (xyzp0)

Posted: Wed Nov 15, 2023 3:18 pm
by Yvan Fournier
Hello,

I am not sure why the pressure would be different, unless we are comparing "solved" pressure and hydrostatic pressure.

In any case, changing the position of the point does have some influence, in part due to numerical sensitivity of the algorithm, and also because a P - P(x0) term appears in a pressure correction step's right-hand side, and this in turns influences the residue normalization used to check the linear solver's convergence (so if I remeber correctly, if you take a point far from the compute domain, you tend to reduce the required precision for that step).

Best regards,

Yvan

Re: Setting reference pressure position (xyzp0)

Posted: Wed Nov 15, 2023 5:06 pm
by finzeo
Yvan Fournier wrote: Wed Nov 15, 2023 3:18 pm Hello,

I am not sure why the pressure would be different, unless we are comparing "solved" pressure and hydrostatic pressure.

In any case, changing the position of the point does have some influence, in part due to numerical sensitivity of the algorithm, and also because a P - P(x0) term appears in a pressure correction step's right-hand side, and this in turns influences the residue normalization used to check the linear solver's convergence (so if I remeber correctly, if you take a point far from the compute domain, you tend to reduce the required precision for that step).

Best regards,

Yvan
Hi Yvan,

Thanks. I don't have gravity activated here, so there should be no influence of hydrostatic pressure. The only thing that comes to mind is that the position I specify in the xyzp0 variable may not exactly correspond to the center of a face or cell, and perhaps something is failing because of that.

With regard to the influence on the results, it seems better to use the default reference position, which corresponds to a face automatically selected on the outlet boundary, doesn't it?

Re: Setting reference pressure position (xyzp0)

Posted: Thu Nov 23, 2023 1:34 am
by finzeo
I am keen on correctly setting this variable as I observe that it significantly influences the evolution of residuals. I have attached two cases in which I changed the value of the xyzp0 variable in cs_user_parameters.c (although, while monitoring the run, I still do not observe a null relative pressure where I set it). First, I would like to know how to set it to effectively register a null relative pressure at that location. I am running a case of external flow around a vehicle similar to the Ahmed body.

I understand that a certain oscillation in pressure residuals is to be expected, given that I am simulating turbulent flow with the DDES model. However, I believe that the oscillation in the pressure residuals in the attached images might not be accurate.

EDIT: Additionally, I noticed, when I save the pressure field at various time steps, that the absolute values seem to oscillate continuously, although the pressure differences are maintained. Obviously, there is a problem with the reference pressure setting.

Re: Setting reference pressure position (xyzp0)

Posted: Mon Dec 11, 2023 7:41 pm
by Yvan Fournier
Hello,

Pressure residuals tend to oscillate much more than those of other variables, and this is not surprising, given that the pressure is not a "true" physical variable, but more of a numerical variable solving for the incompressibility constraint.

I checked with a colleague, who recommended not changing the settings for the reference pressure position, though I agree it is a numerically sensitive point. That does not answer the question about the changing reference. I'll try to get an answer to that, but don't have it yet.

Best regards,

Yvan

Re: Setting reference pressure position (xyzp0)

Posted: Mon Dec 11, 2023 11:16 pm
by finzeo
Thank you, Yvan. I look forward to any updates that may be helpful