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

Expression: Should dimensions be included? And should spaces be used?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 10, 2015, 15:17
Default Expression: Should dimensions be included? And should spaces be used?
  #1
New Member
 
sadjad
Join Date: Oct 2015
Posts: 15
Rep Power: 10
sadjad is on a distinguished road
Hi
In CFX , when we write an expression, do need dimension is written?
for example : Den*g*(0.5[m] -y) or 1000 [kg m^-3]

And need locate or put SPACE between values and dimension or not?
for example : Den*g*(0.5[m] -y) or 1000 [kg m^-3]

what mines [.....]

How write an expression?
sadjad is offline   Reply With Quote

Old   November 10, 2015, 16:48
Default
  #2
Senior Member
 
Join Date: Jun 2009
Posts: 1,804
Rep Power: 32
Opaque will become famous soon enough
Let us say this is your expression set

Code:
LIBRARY:
  CEL:
     EXPRESSIONS:
        MyDen = 1000 [kg m^-3]
        MyBuoyForce = MyDen * ( 0.5 [m] - y ) * g
     END
   END
END
I always space my [ .. ] by one space from the preceding value, as well as between items in the expressions. Never failed me.

Keep in mind that a given expression, such as MyDen, it is not only the value but its dimension as well; therefore, when you reference it somewhere else you only refer the variable name and not its components (value or dimensions)
Opaque is offline   Reply With Quote

Old   November 10, 2015, 22:08
Default
  #3
New Member
 
sadjad
Join Date: Oct 2015
Posts: 15
Rep Power: 10
sadjad is on a distinguished road
Thanks Opaque.

My expression is according below but it dosnt answer me :
What is my error?

Den : 1000 [kg m^-3]
InPress : Den*g*(0.5[m] -y)
WaterX : 1 [m]
AirVF : Step((x-WaterX)/1[m])
WaterVF : 1-AirVF

and , in Global Initialization > Fluid Settings , when type "WaterVF" or "AirVF" ,cfx give me error and wants numerical value and dosnt accept "WaterVF" or "AirVF"
sadjad is offline   Reply With Quote

Old   November 12, 2015, 14:13
Default
  #4
Senior Member
 
Join Date: Feb 2011
Posts: 496
Rep Power: 18
Antanas is on a distinguished road
Quote:
Originally Posted by sadjad View Post
Thanks Opaque.

My expression is according below but it dosnt answer me :
What is my error?

Den : 1000 [kg m^-3]
InPress : Den*g*(0.5[m] -y)
WaterX : 1 [m]
AirVF : Step((x-WaterX)/1[m])
WaterVF : 1-AirVF

and , in Global Initialization > Fluid Settings , when type "WaterVF" or "AirVF" ,cfx give me error and wants numerical value and dosnt accept "WaterVF" or "AirVF"
What kind of error? What is range for x?
Antanas is offline   Reply With Quote

Old   November 16, 2015, 02:42
Default
  #5
New Member
 
sadjad
Join Date: Oct 2015
Posts: 15
Rep Power: 10
sadjad is on a distinguished road
my range of x=1 m
sadjad is offline   Reply With Quote

Old   November 16, 2015, 08:57
Default
  #6
Senior Member
 
Join Date: Jun 2009
Posts: 1,804
Rep Power: 32
Opaque will become famous soon enough
Your example uses : instead of =. Is that correct ?
Opaque is offline   Reply With Quote

Old   November 16, 2015, 15:53
Default
  #7
New Member
 
sadjad
Join Date: Oct 2015
Posts: 15
Rep Power: 10
sadjad is on a distinguished road
my x value is 1
ok ?
sadjad is offline   Reply With Quote

Old   November 17, 2015, 07:45
Default
  #8
Senior Member
 
Join Date: Feb 2011
Posts: 496
Rep Power: 18
Antanas is on a distinguished road
Quote:
Originally Posted by sadjad View Post
my x value is 1
ok ?
And the error is.... ?
Antanas 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



All times are GMT -4. The time now is 01:54.