24小时热门版块排行榜    

查看: 1045  |  回复: 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 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 关于filecode,很负责任的告诉大家 +6 爱看书的可乐 2026-08-08 7/350 2026-08-08 22:13 by a_niu
[考博] 【2027博士申请】纳米药物递送方向 20+3 13586093586 2026-08-03 5/250 2026-08-08 21:54 by 13586093586
[基金申请] 2026国自然放榜时间 +3 布布和一二 2026-08-08 3/150 2026-08-08 18:15 by Lightingo
[基金申请] 国基金的申报应该改成非等额制,评价高的钱多评价低的钱少,但是增加资助率 +7 a089 2026-08-07 7/350 2026-08-08 18:05 by gltch
[公派出国] 售SCI文章,我:8O5.5.1.O.54,科目齐全,可+急 +3 qTvzQBRAHjCi 2026-08-07 4/200 2026-08-08 17:27 by oEVWOejN9taj
[论文投稿] 售SCI-T0P文章,我:8O.5.5.1.O.54,科目齐全,可+急 +3 qTvzQBRAHjCi 2026-08-07 4/200 2026-08-08 16:47 by oEVWOejN9taj
[考博] 售SCI一区T0P文章,我:8O.55.1.O.54,科目全,可伽急 +3 Vi50GxzrFcSG 2026-08-07 4/200 2026-08-08 16:27 by oEVWOejN9taj
[考博] 售一区SCI文章T0P,我:8O.551.O54,科目全,可十急 +3 Vi50GxzrFcSG 2026-08-07 4/200 2026-08-08 16:22 by oEVWOejN9taj
[博后之家] 售SCI一区文章,我:8.O.551.O.5.4,科目全,可伽急 +3 Vi50GxzrFcSG 2026-08-07 4/200 2026-08-08 16:02 by oEVWOejN9taj
[论文投稿] 售SCI一区文章,我:8.O.55.1.O.54,科目齐全,可伽急 +3 Vi50GxzrFcSG 2026-08-07 6/300 2026-08-08 15:07 by oEVWOejN9taj
[论文投稿] 售SCI一区T0P文章,我:8.O.55.1.O.54,科目齐全,可+急 +3 WQyTGMbfH7Cx 2026-08-07 4/200 2026-08-08 15:02 by oEVWOejN9taj
[教师之家] 售SCI一区T0P文章,我:8.O.55.1.O54,科目全,可伽急 +4 HEQlVqMTIA7d 2026-08-07 5/250 2026-08-08 14:27 by oEVWOejN9taj
[论文投稿] 售SCI一区T0P文章,我:8O.55.1.O.5.4,科目齐全,可+急 +3 HEQlVqMTIA7d 2026-08-07 5/250 2026-08-08 14:22 by oEVWOejN9taj
[论文投稿] 售SCI文章,我:8O.5.5.1O.54,科目全,可十急 +3 KXLV3nuBVBY7 2026-08-07 6/300 2026-08-08 14:01 by oEVWOejN9taj
[考博] 售SCI一区文章,我:8.O.55.1.O.54,科目齐全,可伽急 +3 HEQlVqMTIA7d 2026-08-07 3/150 2026-08-08 03:47 by 6vVgjDL4CnGu
[基金申请] 关于filecode +4 布布和一二 2026-08-07 7/350 2026-08-07 22:55 by zhanghaozhu
[基金申请] 化学口download_prp&amp;fileCode的固定段好像这几天一直没变,有变的大神么? +3 Tide man 2026-08-07 4/200 2026-08-07 22:39 by Tide man
[基金申请] 大家散了吧,后缀研究没有意义,别浪费时间了,过好目前的每一天,不要焦虑 +5 Tide man 2026-08-06 7/350 2026-08-07 13:11 by 医学老男孩
[基金申请] 影响面上的因素 +8 布布和一二 2026-08-05 11/550 2026-08-06 10:41 by 宝贝虫子
[基金申请] 8月时间戳变的,举个手。玩一下,释放压力 +9 archvillain 2026-08-04 11/550 2026-08-05 20:06 by wlwhappy
信息提示
请填处理意见