CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   trying to calculate PMV, PPD and PD in fluent using UDF (https://www.cfd-online.com/Forums/fluent/46877-trying-calculate-pmv-ppd-pd-fluent-using-udf.html)

chunying December 21, 2007 05:25

trying to calculate PMV, PPD and PD in fluent using UDF
 
I have just started learning fluent and needed to calculate PMV,PPD and PD. I want to know if anyone has already has this kind of UDF?

I tried to write a interpreted progrem for this progrem. But the compile is unsuccessful. The message I got from fluent is as follows:

C:\Fluent.Inc tbin tx86\cpp.exe -IC:\Fluent.Inc\fluent6.1.22/src -IC:\Fluent.Inc\fluent6.1.22/cortex/src -IC:\Fluent.Inc\fluent6.1.22/client/src -IC:\Fluent.Inc\fluent6.1.22/multiport/src -I. -DUDFCONFIG_H="<udfconfig.h>" C:\Documents and Settings\chunying.CITYUMD\Desktop 1\PPD.c.txt Error: C:\Documents and Settings\chunying.CITYUMD\Desktop\1\PPD.c.txt: line 1: parse error.

Following is my progrem. Could you please tell me the mistakes I made? There must be a alot. Thank you!

#include "udf.h"

DEFINE_ADJUST(pd_myudf,domain)

{ Thread *t; cell_t c;

thread_loop_c(c,domain)

begin_c_loop(c,t) { real t_myudf=C_T(c,t)-273.15; real speed_u_myudf=C_U(c,t); real speed_v_myudf=C_V(c,t); real speed_w_myudf=C_W(c,t); real turbu_k=C_K(c,t); real mh2o_myudf=C_YI(c,t,1); /*mass friction of h2o 1????*/ real clo=0.55; real icl=0.155*clo; /*clothing insulation*/ real tr_myudf=t_myudf; real M_myudf=58.0; /*metabolism, w/m2*/ real W_myudf=0.0; real p_myudf=101325;

/*calculate pd_myudf*/ /*external work, w/m2*/

real speed_myudf=sqrt(speed_u_myudf**2.0+speed_v_myudf* *2.0+speed_w_myudf**2.0); /*magnitude of speed*/

if (speed_myudf<0.05) speed_myudf=0.05; /*for speed<0.05,use speed=0.05*/

turbu_tu=100.0*(2.0*turbu_k)**0.5/speed;

pd_myudf(c,t)=(34-t_myudf)(speed_myudf-0.05)**0.62*(3.14+0.37*speed_myudf*turbu_tu);

if (pd_myudf(c,t)>1) pd_myudf(c,t)=1; /*for pd_myudf>1, use pd_myudf=1*/

/*Calculate pmv_myudf*/

pa_myudf=29*mh2o_myudf/(18+11mh2o_myudf)*p_myudf; { if (icl_myudf<0.078)

fcl_myudf=1.00+1.290*icl_myudf; else

fcl_myudf=1.05+0.645*icl_myudf;

} /*Calculate fcl*/

tcl1_myudf=40; tcl2_myudf=35.7-0.025*(M_myudf-W_myudf)-icl_myudf*(0.0000000396*fcl_myudf*((tcl1_myudf+273 )**4-(tr_myudf+273)**4)+fcl_myudf*hc_myudf*(tcl1_myudf-t_myudf);

if (tcl1_myudf-tcl2_myudf>0.000001) {

tcl1_myudf=tcl2_myudf;

temperary1_myudf=2.38*pow((tcl1_myudf-t_myudf),0.25)

temperary2_myudf=12.1*pow(speed_myudf,0.5)

{

if (temperary1_myudf<temperary2_myudf)

hc_myudf=temperary2_myudf;

else

hc_myudf=temperary1_myudf;

} /*Calculate hc*/

tcl2_myudf=35.7-0.025*(M_myudf-W_myudf)-icl_myudf*(0.0000000396*fcl_myudf*((tcl1_myudf+273 )**4-(tr_myudf+273)**4)+fcl_myudf*hc_myudf*(tcl1_myudf-t_myudf); } tcl_myudf=tcl2_myudf; /*iterate to calculate tcl*/

a_myudf=0.0000000396*fcl_myudf(pow((tcl_myudf+273) ,4.0)-pow((tr_myudf+273),4.0); b_myudf=fcl_myudf*hc_myudf(tcl_myudf-t_myudf); c_myudf=0.00305*(5733-6.99*(M_myudf-W_myudf)-pa_myudf; d_myudf=0.42*(M_myudf-W_myudf-58.15); e_myudf=0.000017*M_myudf*(5867-pa_myudf); f_myudf=0.0014*M_myudf*(34-t_myudf); /*for a shorter formula of L_myudf*/

L_myudf=M_myudf-W_myudf-(a_myudf+b_myudf+c_myudf+d_myudf+e_myudf+f_myudf);

pmv_myudf(c,t)=(0.303exp(-0.036M_myudf)+0.028)L_myudf;

/*Calculate ppd_myudf*/ ppd_myudf(c,t)=100.0-95.0exp(-0.03353*POW(pmv_myudf(c,t),4.0)-0.2179*POW(pmv_myudf(c,t),2.0)); }

end_c_loop(c,t) }

return

Thank you very much!


chinc December 28, 2010 21:32

Hi Chun Ying,

I came across your post recently. I suppose your problem is solved?

Madeinspace December 17, 2014 17:33

Hello,
I am also a beginner in fluent and looking for UDF of PMV and PPD for Fluent. If you have solved it and could share, I would be really thankful for the help.
My email is: Prad.aryal@gmail.com
Regards,
Prad

soriyoshi January 2, 2015 02:26

I've been working on this these days...but couldn't get through. Would you please share your udf? Thanks a lot~


All times are GMT -4. The time now is 08:10.