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

creating an expression

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   April 28, 2004, 05:10
Default creating an expression
  #1
ioana
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
  Reply With Quote

Old   April 28, 2004, 08:25
Default Re: creating an expression
  #2
pi
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
  Reply With Quote

Old   April 29, 2004, 11:06
Default Re: creating an expression
  #3
ioana
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

  Reply With Quote

Old   April 29, 2004, 11:35
Default Re: creating an expression
  #4
pi
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
  Reply With Quote

Old   April 30, 2004, 04:10
Default Re: creating an expression
  #5
ioana
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
  Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


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 19:44
CGNS lib and Fortran compiler manaliac Main CFD Forum 2 November 29, 2010 07:25
Lift, Drag Vs time chart,calculations Jamesd69climber CFX 8 February 17, 2005 18:23
Creating, loop or iteration using expression edito Jan CFX 3 July 28, 2003 11:01


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