|
[Sponsors] |
July 1, 2016, 11:53 |
Expression in cfx
|
#1 |
New Member
Join Date: Oct 2015
Posts: 3
Rep Power: 11 |
Hi
I will like to insert a cel expression with the following information Visupper = 271.8171 [kg m^-1 s^-1] Vislower = 7689.3521 [kg m^-1 s^-1] Tupper = 338.7055 [K] Tlower = 310.9278 [K] IF (T>Tupper) VisT = 271.8171 [kg m^-1 s^-1] END IF IF (T<Tlower) VisT = 7689.3521 [kg m^-1 s^-1] IF (T=Tupper) VisT = 271.8171 [kg m^-1 s^-1] END IF IF (T=Tlower) VisT = 7689.3521 [kg m^-1 s^-1] END IF IF (T<Tupper.AND.T>Tlower) VisT = Vislower+ (Visupper-Vislower)*(T-Tlower)/(Tupper-Tlower) I wrote it in FORTRAN language but i got this error for example ERROR CCL parser failed with message: parseCCLLineH: syntax error near "IF (T>Tupper)" If use IF (T.GT.Tupper), I got the same error. Can any one guide me to write it well? . Or is there another easy way to introduce that calculation? Thanks in advance. |
|
July 2, 2016, 07:56 |
|
#2 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144 |
CEL uses the if(<true/false>,<action if true>,<action if false>) format which is a little different to fortran. But still pretty simple so I will let you transcribe it. Note that CEL does not execute line by line like fortran - so you will have to put the entire logic in a single line (or break it up with intermediate variables).
But your function is complex enough that it will require several nested if statements. Thus I recommend you use a 1D interpolation function as it is much simpler and you can put in as many bends and wiggles as you like and the function stays simple. |
|
July 2, 2016, 14:18 |
|
#3 |
New Member
Join Date: Oct 2015
Posts: 3
Rep Power: 11 |
Thanks for your response.
i figured out and i did this. I did an aproximation for the curve i had ( can't attached the curve) to two linear equations. y = -270.99x + 92062 y = -13.083x + 4707.2 then i created 3 expressions Vis1= -270.99x + 92062 Vis2 = -13.083x + 4707.2 VisT= if ( T<=338.7055333[K],Vis1,Vis2) I hope not to get the ENFORCED BOUNDS error. Thanks for your advice Glenn |
|
Tags |
cel expression, cfx, viscosity |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Outlet boundary condition in interFoam | Andrea_85 | OpenFOAM Running, Solving & CFD | 51 | July 20, 2017 14:31 |
CFX CEL expression for the Dyer boundary layer model equation | mujahidbadshah | CFX | 0 | April 21, 2016 11:21 |
How to install CGNS under windows xp? | lzgwhy | Main CFD Forum | 1 | January 11, 2011 19:44 |
CFX Expression Statement | Ivan | CFX | 3 | June 5, 2006 12:42 |
cfx expression variables | Manoj Kumar | CFX | 2 | February 16, 2006 11:03 |