|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
这是一个压力入口的UDF,压力为定值
#include "udf.h"
DEFINE_PROFILE(pressure_inlet, thread, position)
{
face_t f;
begin_f_loop(f,thread)
{
F_PROFILE(f,thread,position)=100000;
}
end_f_loop(f,thread)
}
现在,我想把压力值按时间进行简单的分段
我不知道这个if else 该怎么加,大家帮忙知道一下呀,谢谢。
#include "udf.h"
DEFINE_PROFILE(pressure_inlet, thread, position)
{
face_t f;
if(time<1)
begin_f_loop(f,thread)
{
F_PROFILE(f,thread,position)=100000;
}
end_f_loop(f,thread)
else
begin_f_loop(f,thread)
{
F_PROFILE(f,thread,position)=0;
}
end_f_loop(f,thread)
}
#include "udf.h"
DEFINE_PROFILE(pressure_inlet, thread, position)
{
face_t f;
begin_f_loop(f,thread)
{if(time<1)
F_PROFILE(f,thread,position)=100000;
else
F_PROFILE(f,thread,position)=0;
}
end_f_loop(f,thread)
} |
|