CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF: using if (https://www.cfd-online.com/Forums/fluent-udf/63723-udf-using-if.html)

lucioantonio April 17, 2009 05:45

UDF: using if
 
dear to all,

i'm trying to use the "if" command in an UDF.
when i interpreted the UDF by Fluent, it wrote:
"invalid expression type for if: double."

the line of the error is the first of this group:

if (Tg=0)
Kr=0;
else {
Kr=qrnet/(Tg);
}

Kr,qrnet,Tg were declared as real.
can someone help me?
best regards to all

O.D.Y. April 17, 2009 05:56

hi,

I think you is the if-question! you assign 0 to Tg, but I think the boolean expression is supposed to be:

if (tg == 0.0)

cheers

lucioantonio April 17, 2009 06:02

Quote:

Originally Posted by O.D.Y. (Post 213236)
hi,

I think you is the if-question! you assign 0 to Tg, but I think the boolean expression is supposed to be:

if (tg == 0.0)

cheers


oh!... it's right!!!... i can't say with words how much i am grateful...
thanks a lot!!!

best regards!


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