CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   expression with variable domains (https://www.cfd-online.com/Forums/cfx/26528-expression-variable-domains.html)

jpshulf October 15, 2008 15:34

expression with variable domains
 
I want to create an expression used to define a boundary condition.

The expression needs to be able to calculate the specified boundary condition at different time(s).

For example, the inlet velocity for one of my boundary conditions is defined as:

(3*t+5), for t<2

(11), for t>2

(-12t+14), for t>5

I tried messing aronud with the step function, but I don't believe this is the right approach. Any help would be greatly appreciated.

Glenn Horrocks October 15, 2008 20:33

Re: expression with variable domains
 
Hi,

Either use the step function or an interpolation function. There are no other options.

In CFX V12 you will be able to use an if function.

Glenn Horrocks

Georg October 16, 2008 01:50

Re: expression with variable domains
 
(3*t+5)*step(2-t)+11*step(t-2)*step(5-t)+(14-12*t)*step(t-5) Becouse Step is dimensionless function you should use t/1[s] insted of t (if t=time, of course). All parts of expression must have Velosity units. So, finally expression is ((3*t+5[s])*step(2-t/1[s])+11[s]*step(t/1[s]-2)*step(5-t/1[s])+(14[s]-12*t)*step(t/1[s]-5))*1[m/s^2] Not so camfortable as "if" "else" but it works. I hope it help you.


jpshulf November 14, 2008 17:46

Re: expression with variable domains
 
Thank you very very much!!!


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