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

If Conditional Expression with Multiple Conditions

Register Blogs Community New Posts Updated Threads Search

Like Tree6Likes
  • 5 Post By Antanas
  • 1 Post By ashtonJ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 6, 2014, 21:27
Question If Conditional Expression with Multiple Conditions
  #1
Senior Member
 
Ashkan Javadzadegan
Join Date: Sep 2010
Posts: 255
Rep Power: 16
ashtonJ is on a distinguished road
Dear all,
I need to create the following expression in ANSYS CFX;

If Z < Z1, Y = 1.5 mm
If Z1=<Z<=Z2, Y= a*(Z-Z2)^2+c
If Z2<Z<Z3, Y = 0.75
If Z3=<Z<=Z4, Y= a*(Z-Z3)^2+c
If Z>Z4, Y = 1.5mm
I am familiar with if statement in CFX: If (cond_expr, true_expr, false_expre); however, I do not know how to define the above expression with 5 conditions. Any help is appreciated.
ashtonJ is offline   Reply With Quote

Old   April 6, 2014, 22:43
Default
  #2
Senior Member
 
Join Date: Feb 2011
Posts: 496
Rep Power: 18
Antanas is on a distinguished road
Quote:
Originally Posted by ashtonJ View Post
Dear all,
I need to create the following expression in ANSYS CFX;

If Z < Z1, Y = 1.5 mm
If Z1=<Z<=Z2, Y= a*(Z-Z2)^2+c
If Z2<Z<Z3, Y = 0.75
If Z3=<Z<=Z4, Y= a*(Z-Z3)^2+c
If Z>Z4, Y = 1.5mm
I am familiar with if statement in CFX: If (cond_expr, true_expr, false_expre); however, I do not know how to define the above expression with 5 conditions. Any help is appreciated.
It will be nested IF like this: if(z>z4,1.5[mm],if(z>=z3,a*(Z-Z3)^2+c,if(z>z2,0.75,if(z>=z1,a*(Z-Z2)^2+c,1.5[mm]))))
chaozong, Roil, snowquote and 2 others like this.
Antanas is offline   Reply With Quote

Old   April 6, 2014, 22:45
Default
  #3
Senior Member
 
Ashkan Javadzadegan
Join Date: Sep 2010
Posts: 255
Rep Power: 16
ashtonJ is on a distinguished road
Thanks very much, Antanas.
Roil likes this.
ashtonJ 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
[swak4Foam] outputTime in Swak function immortality OpenFOAM Community Contributions 20 October 6, 2022 12:08
Wind turbine simulation Saturn CFX 58 July 3, 2020 01:13
CEL expression for controlling an energy source with respect to time rglithro CFX 2 December 7, 2011 11:28
How to set multiple boundary conditions? Daggemann FLUENT 1 April 17, 2009 15:43
CFX 5.5 Roued CFX 1 October 2, 2001 16:49


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