I looked into the code of tota
I looked into the code of totalPressure and guess that the equation for total pressure is only applied to incompressible fluid flow. The equation I copied from totalPressureFvPatchScalarField.C is:
operator==(p0_/(1.0+0.5*psi*(1.0pos(phip))*magSqr(Up))); or operator==(p0_0.5*(1.0pos(phip))*magSqr(Up)); That could be part of the reason why my simulation with sonicTurbFoam failed. So I think when using compressible solvers, atmosphere boundary type could not be used. Is my conclusion correct? In my opinion, the corresponding total pressure equation for compressible flow should be derived from second law and the enthalpy equation dh = cp(T)dT, if Cp is not constant. So the mathematical expression for ptot should be more complicated. Maybe I'm wrong, but I want to confirm this information. Thanks! 
I don't have time to reseach a
I don't have time to reseach about this subject.
I've revieved Frank M. Wite fluid mechanics text book, and yes. The bernouilli equation p/rho + 1/2 u_i*u_i + g *z =const Is only valid for stationary and incompresible fluids. In that text, equation 3.62 (mine is spanish version), is the one that is integrated to obtain the previous one. The asumptions of incompresibility and stationarity are take in order to make the integral. May you can use refered eq 3.62 an add your own asumptions to make the integrall correct for your pourposes. Nevertheless if density does not varies at the outlet and outlet is stationary (aproximatelly) may be the bernouilli equation with stationary and incompresibility asumptions can still be applied. I hope this helps Javier 
Thank you for your help. For t
Thank you for your help. For the total pressure equation:
operator==(p0_/(1.0+0.5*psi*(1.0pos(phip))*magSqr(Up))); What is psi here, and what does the function pos() mean? I looked into the code, and phip is surface flux, isn't it? Why does the equation need surface flux? Thanks! 
pos(somthing) is equal to 1 if
pos(somthing) is equal to 1 if something is positive and eqaul to 0 is something is not positive.
"psi" is the compressibility, i.e. rho/p. (Of course thats not how its calculated!) 
Thanks for your quick reply. B
Thanks for your quick reply. But can you please answer me further why pos(..) is used here for the total Pressure? Since this total pressure equation is for incompressible fluid flow, I want to implement the new equation for compressible case. In my new equation, do I also need to use this pos function? Thanks again!

Firstly, the totalPressure bou
Firstly, the totalPressure boundary condition is valid for both compressible and incompressible flows. If the "psi" variable is present, the flow is compressible, if not incompressible.
If phi is positive, the flow is outward and the total pressure is applied, (1pos(phi))=0, i.e. p=p0. If phi is negative, pos(phi)=0, the flow is inward and the pressure boundary is given by: p=p00.5*U^2. Whether you need to use pos or not depends on the reason it was used in the first place. Unfortunately, this is something I cannot comment on. 
Hallo Eugene,
Thanks! But I
Hallo Eugene,
Thanks! But I still doubt that the current totalPressure is only valid for incompressible flow. I have checked the equation of total pressure. If the Cp is constant, then the equation for total temperature(T0) holds: T0 = T + magSqr(Up)/(2*Cp) The total pressure equation for compressible flow should be(see Anderson's book Modern Compressible Flow with Historical Perspective page 59): p0 = p*(T0/T)^(gamma/(gamma1)) So if we replace T0 with the first equation, we get p0 = p*(1+magSqr(Up)/(2*T*Cp))^(gamma/(gamma1)) I cannot convert the equation used in OpenFoam into the above one. Sorry, if I made any possible mistake, please correct me. Thank you so much! 
totalPressure BC  use of pos(phip)
Hello All,
I am looking at totalPressure BC. I came across this statement: operator==(p0_  0.5*rho*(1.0  pos(phip))*magSqr(Up)) What I do not really understand is the purpose of having: 1.0  pos(phip) It would be good if somebody could explain the origins of this term. Thanks, Suraj 
All times are GMT 4. The time now is 17:23. 