|
[Sponsors] |
warning C4700: uninitialized local variable 'tmin' used? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 29, 2018, 10:35 |
warning C4700: uninitialized local variable 'tmin' used?
|
#1 |
Member
Oula
Join Date: Apr 2015
Location: United Kingdom
Posts: 81
Rep Power: 11 |
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 } |
|
October 29, 2018, 10:47 |
|
#2 |
Senior Member
Join Date: Sep 2017
Posts: 246
Rep Power: 12 |
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Caffa 3D code | Waliur Rahman | Main CFD Forum | 0 | May 29, 2018 01:53 |
How to write k and epsilon before the abnormal end | xiuying | OpenFOAM Running, Solving & CFD | 8 | August 27, 2013 16:33 |
[blockMesh] BlockMeshmergePatchPairs | hjasak | OpenFOAM Meshing & Mesh Conversion | 11 | August 15, 2008 08:36 |
IcoFoam parallel woes | msrinath80 | OpenFOAM Running, Solving & CFD | 9 | July 22, 2007 03:58 |
Could anybody help me see this error and give help | liugx212 | OpenFOAM Running, Solving & CFD | 3 | January 4, 2006 19:07 |