# problem in transcient heat flux b.c in UDF

 Register Blogs Members List Search Today's Posts Mark Forums Read

 April 8, 2003, 10:29 problem in transcient heat flux b.c in UDF #1 phani Guest   Posts: n/a i am simualating solidification and melting problems in the fluent6.0,so for that i have to give heat flux boundary condition varing with time. So i have written the Udf for that but it is diverging after time (15sec) it is diverging in the third condition of the udf.So could u plz help me #include "udf.h" #define d 0.04 #define C 2.18844 #define D -0.602603 #define A 762.048e04 #define B -0.217412 #define den 8960 #define kc 363 #define cp 423 DEFINE_PROFILE(heat_flux, thread,position) { real alpha, qmax,q; face_t f; alpha=kc/(den*cp); qmax=A*pow(d/alpha,B); begin_f_loop(f,thread) { real t=RP_Get_Real("flow-time"); if(t<=5) F_PROFILE(f,thread,position) = qmax; else if((t>5)&&(t<=15)) F_PROFILE(f,thread,position) = qmax-6.5715e4*(t-5); else F_PROFILE(f,thread,position) =- 2.0152e6*C*pow(t,-D)/(pow(alpha,0.05)); } end_f_loop(f,thread) }

 April 8, 2003, 11:43 Re: problem in transcient heat flux b.c in UDF #2 Alex Munoz Guest   Posts: n/a hello Couple of mistakes All the number must to have the form 5. or 5.0 not the form 5 in order to assign the decimal number. also you don't need to write this sentences like this else if((t>5)&&(t<=15)) you can write the sentes like this else if(t<=15.0) F_PROFILE(f,thread,position) = qmax-6.5715e4*(t-5.0); Best Regards Alex Munoz

 April 9, 2003, 01:13 Re: problem in transcient heat flux b.c in UDF #3 phani Guest   Posts: n/a Hai Alex, thank's for responding,i did what u said, again the solution is diverging at the third condition i.e [F_PROFILE(f,thread,position) =- 2.0152e6*C*pow(t,-D)/(pow(alpha,0.05));] when the fluent is solving the above equation, and the solution is get diverging.

 April 9, 2003, 01:58 Re: problem in transcient heat flux b.c in UDF #4 Alex Munoz Guest   Posts: n/a Hi It is correct that you define D=-### and then in your function you writhe pow(t,-D)? I wonder if you are making -*-=+ In addition how do you know that fluent is diverging in the third condition, the code is not able to tell you that type of information. Just it has divergence but how you can ensure that it is due to the UDF?? Regards Alex