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

If statement question

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 23, 2012, 07:01
Default If statement question
  #1
Senior Member
 
Join Date: Jan 2011
Posts: 339
Rep Power: 16
mariam.sara is on a distinguished road
Hello I am tried to wright if statement to set velocities of two fluids (one at the bottom of the pipe and the other on the upper part) I tried use CEL expression and I use in it If expression to distribute the velocity between the phases as below:

if(y>0.01 [m],if(y<=0.01 [m],12.5 [m s^-1],0.0066 [m s^-1]),0 [m s^-1])

where y vertical distance
0.01 m is the free surface level
knowing that the velocities at walls are zero (no slip condition).

when I try test the expression above before run in cfx-pre it gives zero velocity everywhere along y direction so what the problem? may somebody tell me? is the expression incorrect? I read at the documentations about IF statement but not find similar example to my case?
mariam.sara is offline   Reply With Quote

Old   May 23, 2012, 11:34
Default
  #2
Senior Member
 
Lance
Join Date: Mar 2009
Posts: 669
Rep Power: 22
Lance is on a distinguished road
Code:
if(cond_expr,true_expr,false_expr)
Do you want 12.5 m/s above 0.01 m and 0.0066 m/s below 0.01?
if(y>0.01 [m],12.5 [m s^-1],0.0066 [m s^-1])
Lance is offline   Reply With Quote

Old   May 23, 2012, 14:17
Default
  #3
Senior Member
 
Join Date: Jan 2011
Posts: 339
Rep Power: 16
mariam.sara is on a distinguished road
Yes when y>0.01 m velocity is 12.5 m/s
But when y<=0.01 m velocity is 0.0066 m/s
When y=0 & y=0.0985 m (at lower and upper walls respectively) velocity is 0 m/s
with the above conditions how the expression will be?
Thanks

Quote:
Originally Posted by Lance View Post
Code:
if(cond_expr,true_expr,false_expr)
Do you want 12.5 m/s above 0.01 m and 0.0066 m/s below 0.01?
if(y>0.01 [m],12.5 [m s^-1],0.0066 [m s^-1])
mariam.sara is offline   Reply With Quote

Old   May 24, 2012, 02:33
Default
  #4
Senior Member
 
Lance
Join Date: Mar 2009
Posts: 669
Rep Power: 22
Lance is on a distinguished road
The expression I gave you will work. At the walls the velocity will be zero unless you have defined a free-slip wall.
Lance is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question Re Engineering Data Source imnull ANSYS 0 March 5, 2012 13:51
internal field question - PitzDaily Case atareen64 OpenFOAM Running, Solving & CFD 2 January 26, 2011 15:26
Question about Table applicaiton. universez OpenFOAM Running, Solving & CFD 0 January 12, 2010 20:31
Poisson Solver question Suresh Main CFD Forum 3 August 12, 2005 04:37
Philosophical CFD question Richard Howe Main CFD Forum 14 June 17, 2001 14:41


All times are GMT -4. The time now is 13:44.