|
[Sponsors] |
April 28, 2004, 05:10 |
creating an expression
|
#1 |
Guest
Posts: n/a
|
Hello everybody!
I have to model the absorption coefficient of the air and gas mixture and this is: a = 0.01 if T< 323 K a=0.01 +(3/49/377)(T/-323) if 323<=T<700 K a=3.5 +(3.5/700)(T-700) if T>700 How can I set this? I tried to set it the in the expression editor but I don't know how to set the "if" argument... Can you give me a suggestion? Ioana |
|
April 28, 2004, 08:25 |
Re: creating an expression
|
#2 |
Guest
Posts: n/a
|
Hi Ioana, the only way using CEL that comes into mind is using nested step functions. If your picewise function a is a=a1 for T<T1 a=a2 for T between T1 and T2 a=a3 for T>T2, then try:
f1=step(T-T1) f2=step(T-T2) A(T)=a1+(a2-a1)*f1 so then your desired function is a(T)=A+(a3-A)f2 regards pi |
|
April 29, 2004, 11:06 |
Re: creating an expression
|
#3 |
Guest
Posts: n/a
|
Hi Pi!
There is no other way to do it? I don't know CEL and unfortunately I do not understand of word of your explanation. I saw that the help doesn't provide more suggestions in this direction, so I guess I have to look for another way. ioana |
|
April 29, 2004, 11:35 |
Re: creating an expression
|
#4 |
Guest
Posts: n/a
|
Hi Ioana, the typing in my message yesterday was not very clear. sorry. Type the right units for the absortion coef where is indicated below and load it into pre as a CCL:
LIBRARY:LIBRARY CEL:CEL EXPRESSIONS:EXPRESSIONS T1=323 [K] T2=700[K] f1=step((T-T1)/1 [K]) f2=step((T-T2)/1 [K]) a1 = 0.01 [units?] a2=0.01 +(3/49/377)(T-323[K]) [units?] a3=3.5 +(3.5/700)(T-700[K]) [units?] A=a1+(a2-a1)*f1 a=A+(a3-A)*f2 END END END hope it is more clear. regards |
|
April 30, 2004, 04:10 |
Re: creating an expression
|
#5 |
Guest
Posts: n/a
|
Dear Pi,
Thank you very much for your help. I will load the file in pre. Have a nice day, Ioana |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem in running ICEM grid in Openfoam | Tarak | OpenFOAM | 6 | September 9, 2011 17:51 |
How to install CGNS under windows xp? | lzgwhy | Main CFD Forum | 1 | January 11, 2011 18:44 |
CGNS lib and Fortran compiler | manaliac | Main CFD Forum | 2 | November 29, 2010 06:25 |
Lift, Drag Vs time chart,calculations | Jamesd69climber | CFX | 8 | February 17, 2005 17:23 |
Creating, loop or iteration using expression edito | Jan | CFX | 3 | July 28, 2003 11:01 |