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

UDF: using if

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

Reply
 
LinkBack Thread Tools Display Modes
Old   April 17, 2009, 04:35
Default UDF: using if
  #1
New Member
 
Join Date: Apr 2009
Posts: 10
Rep Power: 9
lucioantonio is on a distinguished road
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
lucioantonio is offline   Reply With Quote

Old   April 17, 2009, 05:15
Default
  #2
New Member
 
Dmitry
Join Date: Mar 2009
Posts: 7
Rep Power: 9
Dmitry is on a distinguished road
You should write
if (Tg==0), not (Tg=0)
Dmitry is offline   Reply With Quote

Old   April 17, 2009, 05:58
Default
  #3
New Member
 
Join Date: Apr 2009
Posts: 10
Rep Power: 9
lucioantonio is on a distinguished road
Quote:
Originally Posted by Dmitry View Post
You should write
if (Tg==0), not (Tg=0)

yes it's correct... thanks a lot...
best regards!
Lucioantonio
lucioantonio is offline   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
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 21:38
Dynamic Mesh UDF Qureshi FLUENT 1 December 2, 2009 01:27
I need UDF help. S.Whitney FLUENT 0 October 15, 2007 11:29
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 05:03
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01


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