CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > CFX

CFX Expressions

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   November 24, 2009, 11:35
Default CFX Expressions
  #1
lex
New Member
 
lex
Join Date: Nov 2009
Posts: 2
Rep Power: 0
lex is on a distinguished road
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
lex is offline   Reply With Quote

Old   November 24, 2009, 17:48
Default
  #2
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 10,824
Rep Power: 85
ghorrocks has a spectacular aura aboutghorrocks has a spectacular aura aboutghorrocks has a spectacular aura about
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.
ghorrocks is offline   Reply With Quote

Old   November 24, 2009, 20:40
Default
  #3
Senior Member
 
ckleanth's Avatar
 
George
Join Date: Mar 2009
Location: Birmingham, UK
Posts: 257
Rep Power: 9
ckleanth is on a distinguished road
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 + 1e-15[m])
__________________
Top 4 tips
1. Knowledge is everything and Ignorance is dangerous.
2. Understand your limitations and try to eliminate them.
3. Get yerself a bike and hoon the chuffer. You will soon learn why dogs like to hang their heads out the car window.
4. Please before asking any questions on how to run simulations in CFX, go though all the tutorials
ckleanth is offline   Reply With Quote

Old   November 25, 2009, 09:36
Default
  #4
lex
New Member
 
lex
Join Date: Nov 2009
Posts: 2
Rep Power: 0
lex is on a distinguished road
Hi,

Thanks for the advice. Problem resolved.

Lex
lex is offline   Reply With Quote

Old   November 25, 2009, 10:25
Default
  #5
Member
 
Join Date: Mar 2009
Posts: 44
Rep Power: 8
Timon is on a distinguished road
Quote:
Originally Posted by ckleanth View Post
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 + 1e-15[m])
Except for y=1-1e-15[m]. So use:
A = sign(y)*x/ max(abs(y),1e-15[m])
Timon is offline   Reply With Quote

Old   January 7, 2010, 00:05
Default
  #6
New Member
 
Javier Larrondo
Join Date: Jun 2009
Posts: 17
Blog Entries: 1
Rep Power: 8
jalarron is on a distinguished road
in CFDPOST-ANSYS v12, the function sign() is not found? do I need to do something different?
Cheers,
Javier
jalarron is offline   Reply With Quote

Old   January 7, 2010, 09:12
Default
  #7
Senior Member
 
Join Date: Jul 2009
Posts: 211
Rep Power: 9
kingjewel1 is on a distinguished road
Quote:
Originally Posted by jalarron View Post
in CFDPOST-ANSYS v12, the function sign() is not found? do I need to do something different?
Cheers,
Javier
I found that by adding 1e-15 or so didn't work for me. Is there a difference between Version11 (which I'm running) and V12?
kingjewel1 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pros and Cons for CFX, CFdesign, COMSOL Val Main CFD Forum 3 June 10, 2011 02:20
ATTENTION! Reliability problems in CFX 5.7 Joseph CFX 14 April 20, 2010 15:45
Importing solutions in CFX. Alphonso CFX 1 August 1, 2008 14:01
PhD using CFX Rui CFX 9 May 28, 2007 05:59
CFX 4.4 installation problem Pandu Sattvika CFX 1 December 1, 2001 05:07


All times are GMT -4. The time now is 21:59.