CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   CEL expression (https://www.cfd-online.com/Forums/cfx/65882-cel-expression.html)

jai June 29, 2009 12:49

CEL expression
 
below is my expression:
0.5 [kg s^-1]*step (1-t/1[s])*step (t/1[s]-2)

from 0 to 1 sec mass flow rate is 0.5kg/s and then 1-2sec mass flow rate is 0kg/s and then it is 0.5kg/s

i want to create expression for this condition:
0-1 sec = 0.5kg/s
1-2 sec = 0kg/s
2-3sec = 0.5kg/s
and so on....

Rui June 29, 2009 18:13

0.5 [kg s^-1]*step (sin(pi*t/1 [s])) ;)

I haven't used CFX12, so don't know if it's also possible to define this with the 'conditional functions' in CEL.


By the way, with your above expression, the flow is always zero

John June 30, 2009 09:36

Quote:

Originally Posted by jai (Post 220850)
below is my expression:
0.5 [kg s^-1]*step (1-t/1[s])*step (t/1[s]-2)

from 0 to 1 sec mass flow rate is 0.5kg/s and then 1-2sec mass flow rate is 0kg/s and then it is 0.5kg/s

i want to create expression for this condition:
0-1 sec = 0.5kg/s
1-2 sec = 0kg/s
2-3sec = 0.5kg/s
and so on....

Try the following formula...

If x<a, then V1
If a<=x<b, V2
If b<=x<c, V3
If x>c, V4

Celfunction=V1*step(0.5-step( x/a ))+V2*step(step( x/a )-0.4)*step(0.5-step( x/b ))+V3*step(step( x/b )-0.4)*step(0.5-step( x/c ))+V4*step(step( x/c )-0.6)


All times are GMT -4. The time now is 02:55.