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

warning C4700: uninitialized local variable 'tmin' used?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By obscureed

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 29, 2018, 09:35
Default warning C4700: uninitialized local variable 'tmin' used?
  #1
Member
 
Oula
Join Date: Apr 2015
Location: United Kingdom
Posts: 81
Rep Power: 10
Oula is on a distinguished road
Hi everyone

I'm getting the following warning when I compil a UDF function in fluent.

warning C4700: uninitialized local variable 'tmin' used

Does anyone have any idea why?. Please see below the function. Any help is much appreciated

#include "udf.h"

#define ID 8
DEFINE_EXECUTE_AT_END(wall_temp)
{
#if !RP_HOST
face_t f;
real temp, tmax, tmin;
real value;
Domain *domain = Get_Domain(ROOT_DOMAIN_ID);
Thread *t = Lookup_Thread(domain,ID);
begin_f_loop(f,thread)
{
temp = F_T(f,t);
value = (temp - tmin) / (tmax-tmin);
F_UDMI(f,t,0) = value;
F_UDMI(F_C0(f, t), t->t0, 0) = value;
}
end_f_loop(f,thread);
#endif
}
Oula is offline   Reply With Quote

Old   October 29, 2018, 09:47
Default
  #2
Senior Member
 
Join Date: Sep 2017
Posts: 246
Rep Power: 11
obscureed is on a distinguished road
Hi Oula,

That error message can be restated: you use the value of "tmin" in a calculation, but you have not put a value into "tmin". This is true in your code, and it is a serious problem -- the compiler calls it a warning (rather than an error), but it means that all your calculations could be garbage. You need to give "tmin" a value (for example "tmin = 100.0;") before you use it.

Also, in "begin_f_loop(f,thread)" and "end_f_loop(f,thread);", there is no variable called "thread" -- you should use "t" instead. Also, strictly speaking, that semicolon is unnecessary.

Good luck!
Ed
Oula likes this.
obscureed is offline   Reply With Quote

Reply


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
Caffa 3D code Waliur Rahman Main CFD Forum 0 May 29, 2018 00:53
How to write k and epsilon before the abnormal end xiuying OpenFOAM Running, Solving & CFD 8 August 27, 2013 15:33
[blockMesh] BlockMeshmergePatchPairs hjasak OpenFOAM Meshing & Mesh Conversion 11 August 15, 2008 07:36
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 02:58
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 18:07


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