Urgent UDF Problem ....
Friends,
I have a proble with my UDF. There is no problem about compilation and interpreting but I can not apply my udf to the boundaries. I get error message: Error: cx-set-real-entry: wta[2] (float) Error Object : ((constant .1) (profile """""") Could you please help me about the case? my UDF is like that: #include "udf.h" #define Tm 938 Domain *d; DEFINE_PROFILE(wall_temp, thread, nv) { real T2solid=0.; real T2liquid=0.; real temp=0.; real tmax=0.; real tmin=0.; real y=0.; Thread *t; cell_t c; /* Loop over all cell threads in the domain */ thread_loop_c(t,d) { /* Compute max, min, volume-averaged temperature */ /* Loop over all cells */ begin_c_loop(c,t) { temp = C_T(c,t); /* get cell temperature */ if (temp < tmin || tmin == 0.) tmin = temp; if (temp > tmax || tmax == 0.) tmax = temp; } end_c_loop(c,t) printf("\n Tmin = %g Tmax = %g",tmin,tmax); T2solid=Tm+100.0*y ; T2liquid=Tm+40.0*y ; begin_c_loop(c,t) { temp = C_T(c,t); } end_c_loop(c,t) } } thanks alot.... |
Why do you use DEFINE_PROFILE(name, thread, nv) if your functions body does not involve 'thread' at all?
|
what do you advise me to do? I am new with the UDFs ..
|
It depends, DEFINE_ON_DEMAND or DEFINE_EXECUTE_AT_END could be an option.
|
I changed it to DEFINE_ON_DEMAND but the result is same. what can be the other reason :S
|
You Domain pointer are not initialized. Add a line
d = Get_Domain(1); |
I realized it and add it but nothing changed.
/************************************************** ********************* vprofile.c UDF for specifying steady-state temperature profile boundary condition ************************************************** **********************/ #include "udf.h" #define Tm 938 Domain *d; DEFINE_ON_DEMAND(wall_temp) { real T2solid=0.; real T2liquid=0.; real temp=0.; real tmax=0.; real tmin=0.; real y=0.; Thread *t; cell_t c; d = Get_Domain(1); /* Get the domain using Fluent utility */ /* Loop over all cell threads in the domain */ thread_loop_c(t,d) { /* Compute max, min, volume-averaged temperature */ /* Loop over all cells */ begin_c_loop(c,t) { temp = C_T(c,t); /* get cell temperature */ if (temp < tmin || tmin == 0.) tmin = temp; if (temp > tmax || tmax == 0.) tmax = temp; } end_c_loop(c,t) printf("\n Tmin = %g Tmax = %g",tmin,tmax); T2solid=Tm+100.0*y ; T2liquid=Tm+40.0*y ; begin_c_loop(c,t) { temp = C_T(c,t); } end_c_loop(c,t) } } |
Replace
Code:
printf Code:
Message0 |
it says:
CX_message not found. Do you know the reason? thanks alot. |
Then simply comment out that line and try again. If the error still persist, then I suggest you save you case, restart FLUENT and reread the case file.
|
it still does not work ..
do you think the other parts of my UDF is correct? thanks alot. |
I think the UDF is fine.
|
What is the current error?
Printing is done via: Code:
double var = 0.; Code:
#define TM 938 Code:
static const double var = 4.5; Greetz Jim |
All times are GMT -4. The time now is 04:15. |