- 积分
- 0
- 注册时间
- 2020-2-19
- 仿真币
-
- 最后登录
- 1970-1-1
|
有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)
}
|
|