# creating an expression

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 April 28, 2004, 05:10 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

 April 28, 2004, 08:25 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 TT2, 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 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

 April 29, 2004, 11:35 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

 April 30, 2004, 04:10 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

 Thread Tools Display Modes Linear Mode

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

 Similar Threads Thread Thread Starter Forum Replies Last Post Tarak OpenFOAM 6 September 9, 2011 17:51 lzgwhy Main CFD Forum 1 January 11, 2011 19:44 manaliac Main CFD Forum 2 November 29, 2010 07:25 Jamesd69climber CFX 8 February 17, 2005 18:23 Jan CFX 3 July 28, 2003 11:01

All times are GMT -4. The time now is 05:32.

 Contact Us - CFD Online - Privacy Statement - Top