CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

If statement error

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 15, 2017, 07:59
Unhappy If statement error
  #1
Member
 
sebastian bergman
Join Date: Mar 2017
Location: seattle
Posts: 52
Rep Power: 9
Tushar_Telmasre is on a distinguished road
#include "udf.h"

DEFINE_EXECUTE_AT_END(temp_gradient)
{
Domain *d;

Thread *t;

cell_t c;

real r;

d = Get_Domain(1);

thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
if ( C_T(c,t) = 600)
{
C_UDMI(c,t,0)=100;
C_UDMI(c,t,2)=5000;
C_UDMI(c,t,3)=10000;

}
else

{
C_UDMI(c,t,0)=0;
C_UDMI(c,t,2)=0;
C_UDMI(c,t,3)=0;

}
}
end_c_loop(c,t)
}
}


this code is giving following error while compiling
line 45: invalid expression type for if: double.

I can not figure out what the problem is. can anybody help.
Tushar_Telmasre is offline   Reply With Quote

Old   May 15, 2017, 08:18
Default
  #2
Member
 
sebastian bergman
Join Date: Mar 2017
Location: seattle
Posts: 52
Rep Power: 9
Tushar_Telmasre is on a distinguished road
the mistake has been sorted out. thank you everyone who took the pains to look through the question.
Tushar_Telmasre is offline   Reply With Quote

Old   May 15, 2017, 11:22
Default
  #3
New Member
 
Swapnil Chavanda
Join Date: Jan 2017
Location: Pune
Posts: 19
Rep Power: 9
swpnl9282@gmail.com is on a distinguished road
Suggestions
1. Delete real r
2.shift down end_c_loop one by row (i.e. after end_c_loop there will be only one curly parentheses)

Sent from my Moto G (4) using CFD Online Forum mobile app
swpnl9282@gmail.com is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
DPM udf error haghshenasfard FLUENT 0 April 13, 2016 06:35
[swak4Foam] GroovyBC the dynamic cousin of funkySetFields that lives on the suburb of the mesh gschaider OpenFOAM Community Contributions 300 October 29, 2014 18:00
OpenFOAM without MPI kokizzu OpenFOAM Installation 4 May 26, 2014 09:17
Problem with compile the setParabolicInlet ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 20:50
Compiling problems with hello worldC fw407 OpenFOAM Installation 21 January 6, 2008 17:38


All times are GMT -4. The time now is 21:12.