找回密码
 注册
Simdroid-非首页
查看: 309|回复: 0

fluent 如何udf控制多入口逐个进气?

[复制链接]
发表于 2020-2-20 18:05:59 | 显示全部楼层 |阅读模式 来自 中国
有2个进气口,如何控制入口1进气1s然后关闭,入口2进气1s然后关闭,然后循环作用。尝试学udf控制,但失败了(从效果图看还是两个口同时进气)。请教大神们如何编写udf或有什么招。

我的udf如下:

#include "udf.h"

DEFINE_PROFILE(inlet1_pressure, thread, position)

{

real t;

face_t f;

begin_f_loop(f, thread)

{

t=RP_Get_Real("flow-time");

if (0<t<=1 || 2<t<=3)

{

F_PROFILE(f,thread,position) = 300000;

}

else

{

F_PROFILE(f,thread,position) = 0;

}

}

end_f_loop(f,thread)

}

DEFINE_PROFILE(inlet2_pressure, thread, position)

{

real t;

face_t f;

begin_f_loop(f, thread)

{

t=RP_Get_Real("flow-time");

if (1<t<=2 || 3<t<=4)

{

F_PROFILE(f,thread,position) = 300000;

}

else

{

F_PROFILE(f,thread,position) = 0;

}

}

end_f_loop(f,thread)

}

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-4-19 06:17 , Processed in 0.025683 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表