正文共:1236字 10图 预计阅读时间:4分钟
1 前言
2 模型与网格
3 边界描述
real vm=10.;
real pi=3.1415926;
DEFINE_PROFILE(velocity_x, thread, position)
{
real t;
face_t f;
begin_f_loop(f,thread)
{
t=RP_Get_Real("flow-time");
if(t>=0&&t<=10)
F_PROFILE(f,thread,position)=vm*cos(pi/20*t-pi/4);
else if(t>10&&t<=20)
F_PROFILE(f,thread,position)=vm*cos(pi/4-pi/20*(t-10));
}
end_f_loop(f,thread)
}
DEFINE_PROFILE(velocity_y, thread, position)
{
real t;
face_t f;
begin_f_loop(f,thread)
{
t=RP_Get_Real("flow-time");
if(t>=0&&t<=10)
F_PROFILE(f,thread,position)=vm*sin(pi/20*t-pi/4);
else if(t>10&&t<=20)
F_PROFILE(f,thread,position)=vm*sin(pi/4-pi/20*(t-10));
}
end_f_loop(f,thread)
}
4 求解设置
5 计算结果