|
[Sponsors] |
October 28, 2013, 11:07 |
how to solve warning C4700
|
#1 |
Senior Member
Moha
Join Date: Mar 2013
Location: EU
Posts: 103
Rep Power: 0 |
I tried to used the below code but I have faced with "warning"
warning C4700: uninitialized local variable 'thermosensor_temperature' used warning C4700: uninitialized local variable 'thermosensor_temperature' used how to solve this warning? any helps ? what is the reason of this kind of warnings ? regards, Code:
/*********************************************************************** udfexample.c UDF for specifying the heater ************************************************************************/ #include "udf.h" /* Obtain the mean temperature at the location of thermocouple */ /* Thermocouple located at coordinates (x,y,z) = (-0.24,0.185,0.26) */ DEFINE_EXECUTE_AT_END(tsensor) /* DEFINE_EXECUTE_AT_END is a general-purpose macro that is executed at the end of an iteration in a steady state run, or at the end of a time step in a transient run. You can use DEFINE_EXECUTE_AT_END when you want to calculate flow quantities at these particular times. Note that you do not have to specify whether your execute-at-end UDF gets executed at the end of a time step or the end of an iteration. This is done automatically when you select the steady or unsteady time method in your ANSYS FLUENT model*/ { real thermosensor_coordinate[ND_ND]; real thermosensor_temperature; real xmin; real xmax; real ymin; real ymax; real zmin; real zmax; real x,y,z,nt; cell_t c; Domain *d; Thread *t; d = Get_Domain(1); xmin=-0.22; xmax=-0.26; ymin=0.183; ymax=0.188; zmin=0.25; zmax=0.27; /* Begin loop to determine the temperature at the centroid of cells near the thermocouple */ thread_loop_c(t,d) { nt=0.0; begin_c_loop(c,t) { C_CENTROID(thermosensor_coordinate,c,t); x=thermosensor_coordinate[0]; y=thermosensor_coordinate[1]; z=thermosensor_coordinate[2]; if ((x >= xmin) && (x <= xmax)) { if ((y >= ymin) && (y <= ymax)) { if ((z >= zmin) && (z <= zmax)) { thermosensor_temperature=thermosensor_temperature + C_T(c,t); /* get thermocouple temperature */ nt=nt+1.0; /* count number */ } } } } end_c_loop(c,t) } thermosensor_temperature=thermosensor_temperature/nt; } DEFINE_PROFILE(heater_bc,t,i) { real cutoff_temperature; real thermosensor_temperature; real heater_on; real heater_off; face_t f; cutoff_temperature=295.15; heater_off = 0.0; heater_on = 22500.0; if (thermosensor_temperature<=cutoff_temperature) { begin_f_loop(f,t) { F_PROFILE(f,t,i) = heater_on; } end_f_loop(f,t) } else { begin_f_loop(f,t) { F_PROFILE(f,t,i) = heater_off; } end_f_loop(f,t) } } |
|
October 29, 2018, 12:24 |
|
#2 |
Member
Oula
Join Date: Apr 2015
Location: United Kingdom
Posts: 81
Rep Power: 11 |
Hi ahvz
did you managed to solve this problem. Could you please share you experience? Regards Oula |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[CGNS] CGNS converters available | mbeaudoin | OpenFOAM Meshing & Mesh Conversion | 137 | December 14, 2018 05:20 |
[swak4Foam] wmake groovyBC in OpenFOAM 1.7 ? | randomid | OpenFOAM Community Contributions | 1 | August 27, 2010 06:15 |
Can anybody help me to solve the list errors while compiling Openfoam 15 on Opensuse 103 32bit | coompressor | OpenFOAM Installation | 0 | November 12, 2008 20:53 |
Problem with rhoSimpleFoam | matteo_gautero | OpenFOAM Running, Solving & CFD | 0 | February 28, 2008 07:51 |
[blockMesh] Axisymmetrical mesh | Rasmus Gjesing (Gjesing) | OpenFOAM Meshing & Mesh Conversion | 10 | April 2, 2007 15:00 |