24小时热门版块排行榜    

Znn3bq.jpeg
查看: 1015  |  回复: 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 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[论文投稿] 售SCI一区T0P文章,我:8.O.5.5.1.O.5.4,科目齐全,可+急 +4 xx7gd5zq4e 2026-05-15 6/300 2026-05-16 22:25 by lindoudou
[考博] 现在不知道怎么办,感觉很痛苦 +5 qweww 2026-05-11 6/300 2026-05-16 19:57 by Equinoxhua
[基金申请] 请问大佬b0816评完了吗 +4 市民华南虎 2026-05-12 8/400 2026-05-16 19:54 by Equinoxhua
[高分子] 本人最近太闲了,谁有问题可以提,每天会统一回复 +9 一切都是空工 2026-05-12 20/1000 2026-05-16 19:52 by Equinoxhua
[基金申请] 重磅!青年科学基金项目(C类)资助增幅预计超过50% +6 水和泥不是水泥 2026-05-13 8/400 2026-05-16 19:50 by Equinoxhua
[有机交流] 求助2,4-二氯-5-嘧啶甲醛的合成方法 20+3 光吃不拉 2026-05-14 6/300 2026-05-16 19:46 by Equinoxhua
[基金申请] 精华III评审感受-评审感受-评审感受 +15 ferrarichen 2026-05-11 19/950 2026-05-16 19:44 by Equinoxhua
[论文投稿] 售SCI一区T0P文章,我:8.O.5.5.1.O.5.4,科目齐全,可+急 +3 ky2p12rrjj 2026-05-15 4/200 2026-05-16 18:45 by j6b2pdz07o
[找工作] 售SCI一区T0P文章,我:8.O.5.5.1.O.5.4,科目齐全,可+急 +3 ky2p12rrjj 2026-05-15 3/150 2026-05-16 18:35 by j6b2pdz07o
[论文投稿] 售SCI一区T0P文章,我:8.O.5.5.1.O.5.4,科目齐全,可+急 +3 x0mp7owy2b 2026-05-15 3/150 2026-05-16 17:50 by j6b2pdz07o
[硕博家园] 售SCI一区T0P文章,我:8.O.5.5.1.O.5.4,科目齐全,可+急 +4 x0mp7owy2b 2026-05-15 4/200 2026-05-16 17:45 by j6b2pdz07o
[硕博家园] 售SCI一区T0P文章,我:8.O.5.5.1.O.5.4,科目齐全,可+急 +3 k37jurhrau 2026-05-16 3/150 2026-05-16 13:57 by vcdazktkjx
[硕博家园] 考博自荐 +3 科研狗111 2026-05-13 4/200 2026-05-16 11:45 by 科研狗111
[硕博家园] 售SCI一区T0P文章,我:8.O.5.5.1.O.5.4,科目齐全,可+急 +4 cjf4bx70cj 2026-05-14 6/300 2026-05-16 11:16 by h3oerqvkv9
[文学芳草园] 裁员滚滚,退居二线 +4 J_wei 2026-05-10 4/200 2026-05-16 10:52 by zh10246
[考博] 2026博士还有哪些学校有名额 +5 小王求读研 2026-05-15 6/300 2026-05-16 10:44 by a4742549
[硕博家园] 售SCI一区T0P文章,我:8.O.5.5.1.O.5.4,科目齐全,可+急 +4 l7k6xnh0yc 2026-05-14 5/250 2026-05-16 04:29 by k37jurhrau
[找工作] 售SCI一区T0P文章,我:8.O.5.5.1.O.5.4,科目齐全,可+急 +3 l7k6xnh0yc 2026-05-14 3/150 2026-05-16 01:49 by k37jurhrau
[文学芳草园] 风把牡丹吹跑了 +5 myrtle 2026-05-12 9/450 2026-05-15 15:27 by myrtle
[教师之家] 教学课件你会给同学吗 +8 硕士研究生吗 2026-05-13 8/400 2026-05-14 22:23 by 常规沥青
信息提示
请填处理意见