|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
在一个对称的三维模型中,对入口的气速进行定义,使得入口气速随时间进行周期变化,比如每5min入口气速就由5m/s变为-5m/s,自己套用的程序老保存,请大神指导下,什么函数好,或者有没有相关的程序案例参考
程序如下:
#include "udf.h"
#include<stdio.h>
#include <time.h>
DEFINE_PROFILE(inlet_velocity,thread,position)
{
real t,v;
face_t f;
begin_f_loop(f,thread)
{
t=RP_Get_Real("flow-time");
{
int main()
{
int t, temp = 0;
float v;
time_t now;
time(&now);
t = now;
printf("now: %d\n",t);
temp = t/600;
if(temp%2==1){
v=3.71;
}else{
v = -3.71;
}
printf("v=%.2f\n",v);
return 0;
}
}
F_PROFILE(f,thread,position)=v;
}
end_f_loop(f,thread)
}
|
|