入口速度和温度都随时间变化,怎么写UDF?
浏览:180291 回答:11
求教大神,入口速度和温度都是随时间变化的,之前写了个入口速度随时间变化的,不知道2个变量放一起编一个程序怎么编,还有2个变量放一起导入后,fluent能够区分么?
之前程序如下:
#include "udf.h"
DEFINE_PROFILE(inlet_velocity, thread,index)
{
real t,v;
face_t f;
begin_f_loop(f, thread)
{
t=RP_Get_Real("flow-time");
{
if (t<800)
{v=20;
}
else if (t<1500)
{v=15;
}
else
{v=12;
}
}
F_PROFILE(f,thread,index)=v;
}
end_f_loop(f,thread)
}
之前程序如下:
#include "udf.h"
DEFINE_PROFILE(inlet_velocity, thread,index)
{
real t,v;
face_t f;
begin_f_loop(f, thread)
{
t=RP_Get_Real("flow-time");
{
if (t<800)
{v=20;
}
else if (t<1500)
{v=15;
}
else
{v=12;
}
}
F_PROFILE(f,thread,index)=v;
}
end_f_loop(f,thread)
}
师兄,我也是机电的,能不能加个qq交流一下?1258163430,谢谢!