CFD Online Discussion Forums

CFD Online Discussion Forums (
-   CFX (
-   -   Expression in cfx (

selim August 30, 2007 06:23

Expression in cfx
Hi I have a problem with expression

I want to define a variable that depends on temprature


What I calculate for a tempr. of 1000C is totally different what CFX Evalute option gives

What is wrong? I want to get a dimensionless expression in CFX that is why I use (T)/1[C] in the expression. But I am not sure about that.Probably error comes from that

Any help,suggestions

Thanks a lot


Claudia August 30, 2007 07:07

Re: Expression in cfx
Do you have any errors in CFX-pre? Have you tried to evaluate or to plot your expression in CFX-Pre?


selim August 30, 2007 07:12

Re: Expression in cfx
Hi, I can plot it but what I obtain for example is different for 27 C and for 300 K

I think there is a problem with 1T/{K] with non dimensionalizing

I dont know how can do that properly?

Thanks in advance, selim

Claudia August 30, 2007 07:17

Re: Expression in cfx
I tried it and you are right. The result is not the same. Then I changed 1[C] into 1[K] and calculated the expression with T=1000 K. Then the CFX result and my result is almost the same.


selim August 30, 2007 08:28

Re: Expression in cfx

My e-mail: ::))

opaque August 30, 2007 10:11

Re: Expression in cfx
Dear Selim,

Would you mind explaining why are you using 1 [C] instead of 1[K]?.. They are complete different things..

The ANSYS CFX solver uses absolute temperature for T, that is either [K] or [R]

Thanks, Opaque

selim August 30, 2007 10:30

Re: Expression in cfx
The expression I entered is for T in Celsius. I also tried to write as for T-273 and non dimensionalized with K ,but doesnt work

My question is simply? How can I write an expression that has a polynomial type dependence on Temprature? I cannot write simply : Q=1+1E-3*T+2*T^2 as an expression since dimensions dont match

Thanks Selim

opaque August 30, 2007 15:01

Re: Expression in cfx
Dear Selim,

A polynomial expression with dimensional quantities cannot have dimensionless coefficients. Therefore, you are missing the units for your coefficients:

Also, you must keep in mind that you cannot divide a temperature in empirical units by another temperature and expect any physical consistency (due to the offset). You can divide temperature differences by temperature differences and you will be OK.

If your input temperature is in C or F, you must convert them to K or R and continue from there. It is very important to know what kind of temperature dimensions are used in a denominator, either temperature values, or temperature differences.


Brendan August 30, 2007 15:12

Re: Expression in cfx
I assume your pulling info from the simulation like follows?

T = areaAve(Total Temperature in Stn Frame)@location1

In that case the default units will be Kelvin (i.e. CFX will be using Kelvin).

So for your eqn, I would define another expression:

Tnd = 1 [k]

where [k] is defining the unit as you tried inside the equation.

Then I'd write the eqn as:

Q = 6.11549E-06 * (1 + 4.8297E-03*(T/Tnd) + 1.663E-06*(T^2/Tnd^2)

With CFX using degrees Kelvin, you will get the wrong answer if you derived your equation from a degrees celsius trendline (or similar).

Hope this helps

Brendan August 30, 2007 15:14

Re: Expression in cfx
As an add on to the thread...

Does anyone know if it is possible to use logical (if/for/elseif etc) statements in expressions, if so, what is the syntax?

Glenn Horrocks August 30, 2007 18:44

Re: Expression in cfx

If/then/else can be created out of step functions. Clunky but it does work.

Glenn Horrocks

KB September 4, 2007 09:41

Re: Expression in cfx
What result do you expect for the expression 0[C]/1[C]? It's not zero, as you might expect, since CFX internally converts it into [K], i.e. 0[C]/1[C] = 273.15[K]/274.15[K] = 0.996352

selim September 4, 2007 09:46

Re: Expression in cfx

you are cheating cfx

HekLer September 5, 2007 13:09

Re: Expression in cfx
Not to mention this is coming in 12.0, finally.....

All times are GMT -4. The time now is 17:02.