Dear all,
I am new in UDF. I am trying to make different initial guess of temperature distribution in solid by using #DEFINE_INIT CODE in Fluent 17.2. I took the whole code from UDF Fluent Customization sample. I just make little modification. The case is 2D and the solid is in y- direction.
Do you have any advice?
However when the code is interpreted the error shows
Error: E:/profile_temp.c: line 8: parse error.
Thank you for your help
Here is my code
/***********************************************************************
UDF for initializing flow field variables
************************************************************************/
#include "udf.h"
#define d 5
DEFINE_INIT(temp_prof_init,d)
{
cell_t c;
Thread *t;
real xc[ND_ND];
/* loop over all cell threads in the domain */
thread_loop_c(t,d)
{
/* loop over all cells */
begin_c_loop_all(c,t)
{
C_CENTROID(xc,c,t);
y = xc[1]
if (y < 0) /* y < 0 */
C_T(c,t) = 10.578*y +302.26;
else if (y