Hi all,,I'm using the below solution of bouyancy pressure B.C. in gas cases#763576 - I have a problem involving buoyant flow of an ideal gas under atmospheric conditions so that the height at a pressure boundary varies over a significant distance. When I set the pressure at the boundary, how can I specify it so that I don't see any spurious flows due to an inconsistent specification of the opening pressure?

Family:CFXProduct:CFX-SolverVersion:11.0Area:GeneralSubarea:N/A

Answer:

Specifying the pressure at a boundary for a buoyant problem where the height in the gravity potential field varies significantly requires care, particularly for an ideal gas.

For an ideal gas, the pressure and density are related via the expression for the change in the hydrostatic pressure with height:

dP/dy = -rho*g (assuming that the height variable is y and that gravity acts in the -y direction).

It may be simplest to set the reference pressure for the domain to 0 and set the buoyancy reference density to zero as well.

For an ideal gas, the density is given by PM/RT. Eliminating pressure using the ideal gas law and integrating for isothermal flow from some reference height L where the pressure is Pref and the density is rhoL gives:

rho = rhoL*exp(Mg*(L-y)/R/T)

and:

P = Pref*exp(Mg*(L-y)/R/T)

The conditions for this type of a pressure boundary should be set up so that the conditions of the dependent variables approach that of the known ambient fluid.

A sample definition file for flow in a large 2D square box, with a height/width dimension of 300 m is attached.

The fluid is set to be Air Ideal Gas. The pressure at the top of the box (y = L = 300 m) is set at 1 atm.

The domain reference pressure is set to 0 and the buoyancy reference density to 0 as well. Gravity acts in the ży direction.

For an inlet velocity of 1 m/s, the streamlines and static pressure look reasonable. The streamlines go more or less straight across except where there is a disturbance due to flow around an internal wall.
The online help suggests setting the buoyancy reference density to the average value prevailing in the domain. When you have a pressure boundary where the height and hydrostatic pressure varies, I would ignore the recommendation from the online help and choosea reference density that simplifies setting the hydrostatic pressure at the pressure boundary. I believe setting the reference density to zero allows one to calculate the pressure and density variation with height in the simplest manner.

So can anyone tell me if I want the pressure function in temperature how i can make the excepression. I tried to use T as variable but the cfx give me an error that I divided on zero. How ever, the temperature is greater than zero. is there is any workaround solve the problem?
Regards

It might simplify the mathematics but it increases numerical round off errors. I recommend you do the additional maths (it is not that hard) and reduce round off errors.

To answer your question can you attach the output file (including the error message).

Here you are
+--------------------------------------------------------------------+
| PROBLEM ENCOUNTERED WHEN EXECUTING CFX EXPRESSION LANGUAGE |
| |
| The CFX expression language was evaluating: |
| Relative Pressure |
| |
| The problem was: |
| DIVIDE-BY-ZERO |
| |
| FURTHER INFORMATION |
| |
| The problem was encountered in executing the expression for: |
| myp |
| The complete expression is: |
| p0*exp((g*(30 [m]-y)) / (287.1[J kg^-1 K^-1]*T )) |
| The error occurs on sub-expression: |
| (g*(30 [m]-y)) / (287.1[J kg^-1 K^-1]*T ) |
| |
| BACKGROUND INFORMATION |
| |
| The error was detected at one location. The same problem may be |
| present at other locations - that has not been investigated. |
| The following values are for the first location which has the |
| problem. |
| |
| These values were set before reaching the current expression: |
| |
| Name = Expression = Value |
| |
| y = $LOCAL_y = 102.412 |
| p0 = 1 [atm] = 1013.25 |
| g = 9.8066502 [m s^-2] = 980.665 | |
| END OF DIAGNOSTIC OUTPUT FOR CFX EXPRESSION LANGUAGE |
+--------------------------------------------------------------------
By the way, into your thesis in p.62 chapter 3, you wrote an equation to define the pressure at the boundaries in compressible gas by p=ptotal/(1+(game-1)*M^2/2)^(gama/(gama-1))
Do you mean that M is mach no., where you did not mention what is M in pp.xvi,xvii,xviii
At the same time give me the following
Notice: The maximum Mach number is 3.108E+01.
Finally, about the round off error, I know that this error come form ignoring or reduce the number of digit so could you please advise me more in details.
Best Regards

Your CEL error should be a straight forward debugging exercise. Somehow it is getting a divide by zero, so you need to find it and fix it. The obvious place to start is to look at what the value of T is.

I did not say that your convergence problem was caused by numerical round off. I said that what you have done is bad practice as it increases round off error, and that it CAN cause convergence problems.

Your CEL error should be a straight forward debugging exercise. Somehow it is getting a divide by zero, so you need to find it and fix it. The obvious place to start is to look at what the value of T is.

I did not say that your convergence problem was caused by numerical round off. I said that what you have done is bad practice as it increases round off error, and that it CAN cause convergence problems.

Hi again,,
what h no is high and I want to use the pressure in your thesis , do you accept that from your point of view in my case?
Regards

What you think its wrong into my expression?
my centreline velocity still increasing even using this techniqe hoevere it should be decreasing until get constant value depending on the height of my domain?
see the attachment, please
do you think that this error results come from the bad setup into my simulation?
regards

If you know the total pressure at your inlet or outlet then the boundary condition should be specified as total pressure.

I used different B.Cs that I think it is correct, but my results did not match the thoery.
I'm working with forced plume which gas 3 diffrent regions.
The third region folor -2/3 law but the results overthere has big diffrent?/.

Hi,
You said that you have set Reference Pressure as Zero and Reference Density as zero as well. Since P = rho*R*T, Reference Temperature also goes to zero Kelvin, I am not sure but that might be cause of error.
-D.B

Hi,
You said that you have set Reference Pressure as Zero and Reference Density as zero as well. Since P = rho*R*T, Reference Temperature also goes to zero Kelvin, I am not sure but that might be cause of error.
-D.B

Thanks D.B for your input,,,,,
you are right.However, I have in my results temperature profile into my plume. honestly, the general behav of my results is okay, but the devaition is too large.

Hi,
You said that you have set Reference Pressure as Zero and Reference Density as zero as well. Since P = rho*R*T, Reference Temperature also goes to zero Kelvin, I am not sure but that might be cause of error.
-D.B

In my case I did not work with Boussinsq approximation but I solve N-S equation directly. That what I thought.