CFX Expressions
Hi all,
Can anyone explain how do i add a condition if i want to avoid zero division error (Esp expressions)? Below is the expression i have enter. EXPRESSIONS: Esp = (Uf^3)/(0.41*z) Uf = sqrt(k*sqrt(0.09)) Ug = 13 [m s^1] Uz = Ug*((z/Zg)^0.25) Zg = 400 [m] k = 1.5*(Uz*0.12)^2 Need to set a condition that z must be greater than zero and not more than 400 m. Thanks in advance. Lex 
You can do conditional stuff either using the step() function, or if you use V12 you can use the new "if" statement. Look in the CEL reference guide for details.

if you have a number that is divided by zero
A = x/y where y 1<y<1 the follwing is numericaly similar and you dont have divide by zero A = x/ (y + 1e15[m]) 
Hi,
Thanks for the advice. Problem resolved. Lex 
Quote:
A = sign(y)*x/ max(abs(y),1e15[m]) 
in CFDPOSTANSYS v12, the function sign() is not found? do I need to do something different?
Cheers, Javier 
Quote:

All times are GMT 4. The time now is 10:56. 