24小时热门版块排行榜    

查看: 965  |  回复: 0

jjtyly

新虫 (初入文坛)

[求助] 编译UDF显示命名错误

FLUENT编译UDF提示错误,无效的UDF命名,求助大神们下面的程序中命名哪里出现错误
Error: Set_Property: null user-defined-function name

Error: Set_Property: null user-defined-function name
Error Object: #f

程序:
#include "udf.h"
#include "sg.h"
#include "sg_mphase.h"
/*#include "flow.h" */
#include "mem.h"
#include "metric.h"
#include "math.h"

/* USER INPUTS */
     
#define relax 0.05     /* underrelaxation factor equal to 0.01-0.05 */
#define threshold 1e-7     /* error tolerance*/
#define Tsub_min 3.     /* minimum liquid subcooling, K*/
#define Ctd 1.0        /* turbulent diffusion coefficient  */
#define sigma 23.82e-3 /*surface tension coefficient of vapor-liquid
system, N/m*/
#define gravity 9.8    /* gravity, m/sec2 */
#define L 2500e3  /* latent heat at system pressure, J/kg */

#define Ks 16.27        /*thermal conductivity of adjacent solid material (copper) */
#define Ros 8030.0       /*density of adjacent solid material (copper) */
#define Cps 502.48         /*heat capacity of adjacent solid material (copper)*/


#define Ks_aluminum 16.27        /*thermal conductivity of adjacent solid material (aluminum) */
#define Ros_aluminum 8030.0       /*density of adjacent solid material (aluminum) */
#define Cps_aluminum 502.48         /*heat capacity of adjacent solid material (aluminum)*/


#define P_sys 1.0e5   /*system pressure, Pa */

#define T_sat 273.15  /*saturated temperature*/

#define domain_index_gas 0 /*domain indexes of phases*/
#define domain_index_vap 1




/* END OF USER INPUTS */





/* this macro is hooked up as a source term for vapor  */
/* continuity equation    */                             

DEFINE_MASS_TRANSFER(vaporisation_condensation, c, mixture_thread,primary_phase_index,second_phase_index)
{
        Thread *pt = DOMAIN_SUPER_DOMAIN(mixture_thread);
        Thread **moist_air=DOMAIN_SUB_DOMAIN(pt, primary_phase_index); /* primary_phase is the moist_air*/
        Thread **frost=DOMAIN_SUB_DOMAIN(pt, second_phase_index);
        real vof_vapor,vof_liquid,total_mass_exchange;
        real dbub,Tsat;
        real reb,urel,Tl, urelx,urely,urelz,Pr,Ai,Nu,H;
    Ai = Interfacial_area(vof_vapor, dbub);
        vof_vapor = C_VOF(c,moist_air);
        dens=C_R(c,moist_air);/*the air mixture  density*/
        vof_liquid = 1.-vof_vapor;
        Tair = C_T(c,moist_air); /*the temperature of the moist_air*/
        P_air=C_P(c,moist_air);   /*the pressrue of the moist_air*/
        /*the saturated pressure of the water vapor at the air temperature 有待确定*/
        if (Tair<=T_sat)
        {
                P_sat=exp(-5674.5359/Tair+6.3925247-(0.9677843e-2)*Tair+(0.62215701e-6)*pow(Tair,2)+pow(0.20747825,-18)*pow(Tair,3)+pow(-0.9484024,-12)*pow(Tair,4)+4.1635019*log(Tair));
        }
        else
        {
                P_sat=exp(-5800.2206/Tair+1.3914993-0.04860239*Tair+(0.41764768e-4)*pow(Tair,2)+pow(-0.14452093,-7)*pow(Tair,3)+6.5459673*log(Tair));
        }
       
        /*the water vapor mass fraction in the saturated moist_air corresponding to temperature*/
        xs=0.62198*p_sat/(P_sys-P_sat);
        wav_s=xs/(1+xs);
        /*the water vapor mass fraction in the moist_air corresponding to temperature*/
        wav_yi=C_YI(c,moist_air,1);
       
       
        total_mass_exchange=10*vof_vapor*dens*(wav_yi-wav_s)*Ai;
        C_UDMI(c,mixture_thread,15) = total_mass_exchange;

       
        return total_mass_exchange;
}



DEFINE_SOURCE(energy_vapor,cell, primary_phase_index,second_phase_index,dS,eqn)
{
        Thread *pri_th,sec_th;
        real h_vapor;
        pri_th=THREAD_SUB_THREAD(mixture_thread,0);
        sec_th=THREAD_SUB_THREAD(mixture_thread,1);
        t=C_T(c,pri_th)/1000;
        h_vapor=2.003216+1.79*t+0.0535*pow(t,2)+0.1953*pow(t,3)-0.05*pow(t,4);
        source=-C_UDMI(cell,mixture,15)*h_vapor;
        dS(eqn)=0;
        return source;
}
       
DEFINE_SOURCE(energy_ice,cell, primary_phase_index,second_phase_index,dS,eqn)
{
        Thread *pri_th,sec_th;
        real h_vapor;
        pri_th=THREAD_SUB_THREAD(mixture_thread,0);
        sec_th=THREAD_SUB_THREAD(mixture_thread,1);
        t=C_T(c,pri_th)/1000;
        h_vapor=2.003216+1.79*t+0.0535*pow(t,2)+0.1953*pow(t,3)-0.05*pow(t,4);
        source=C_UDMI(cell,mixture,15)*(h_vapor+L);
        dS(eqn)=0;
        return source;

}

       
DEFINE_SOURCE(x_moen_vapor,cell, primary_phase_index,dS,eqn)
{
        Thread *pri_th;
        real ux;
        pri_th=THREAD_SUB_THREAD(mixture_thread,0);
    ux=C_U(c,pri_th);
        source=-C_UDMI(cell,mixture,15)*ux;
        dS(eqn)=0;
        return source;
}


DEFINE_SOURCE(y_moen_vapor,cell, primary_phase_index,dS,eqn)
{
        Thread *pri_th;
        real uy;
        pri_th=THREAD_SUB_THREAD(mixture_thread,0);
    uy=C_V(c,pri_th);
        source=-C_UDMI(cell,mixture,15)*uy;
        dS(eqn)=0;
        return source;
}

DEFINE_SOURCE(z_moen_vapor,cell, primary_phase_index,dS,eqn)
{
        Thread *pri_th;
        real uz;
        pri_th=THREAD_SUB_THREAD(mixture_thread,0);
    uz=C_W(c,pri_th);
        source=-C_UDMI(cell,mixture,15)*uz;
        dS(eqn)=0;
        return source;
}
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 jjtyly 的主题更新
信息提示
请填处理意见