SST K-omiga模型UDF编写求助!
浏览:101754 回答:4
湍流模型采用 SST K-omiga 三维模型!
比如我现在以B类地貌,0.45基本风压为基础(参考处流速26.83)
#include "udf.h"
DEFINE_PROFILE(velocity_inlet, thread, position) #定义速度入口
{
real x[ND_ND];
real z;
face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
z=x[2]/10;
F_PROFILE(f, thread, position) =26.83*pow(z,0.15);
end_f_loop(f, thread)
}
}
DEFINE_PROFILE(k_inlet, thread, position) #定义湍动能
{
real x[ND_ND];
real z;
real i;
face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
z=x[2];
if(z<5)
{i=0.23;}
if(z>=5,z<=350)
{i=0.1*pow(z/350,-0.2);}
if(z>350)
{i=0.1;}
F_PROFILE(f, thread, position) =1.5*(26.83*pow(z/10,0.15)*i)*(26.83*pow(z/10,0.15)*i);
end_f_loop(f, thread)
}
}
DEFINE_PROFILE(w_inlet, thread, position) #定义比耗散率
{
real x[ND_ND];
real z;
real i;
real l;
real k;
real e;
face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
z=x[2];
if(z<5)
{i=0.23;}
if(z>=5,z<=350)
{i=0.1*pow(z/350,-0.20);}
if(z>350)
{i=0.1;}
l=100*pow(z/30,0.5);
k=1.5*(26.83*pow(z/10,0.15)*i)*(26.83*pow(z/10,0.15)*i);
e=pow(0.09,0.75)*pow(k,1.5)/l;
F_PROFILE(f, thread, position) =e/(0.09*k);
end_f_loop(f, thread)
}
}
以上我这样编写的UDF文件对吗?
比如我现在以B类地貌,0.45基本风压为基础(参考处流速26.83)
#include "udf.h"
DEFINE_PROFILE(velocity_inlet, thread, position) #定义速度入口
{
real x[ND_ND];
real z;
face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
z=x[2]/10;
F_PROFILE(f, thread, position) =26.83*pow(z,0.15);
end_f_loop(f, thread)
}
}
DEFINE_PROFILE(k_inlet, thread, position) #定义湍动能
{
real x[ND_ND];
real z;
real i;
face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
z=x[2];
if(z<5)
{i=0.23;}
if(z>=5,z<=350)
{i=0.1*pow(z/350,-0.2);}
if(z>350)
{i=0.1;}
F_PROFILE(f, thread, position) =1.5*(26.83*pow(z/10,0.15)*i)*(26.83*pow(z/10,0.15)*i);
end_f_loop(f, thread)
}
}
DEFINE_PROFILE(w_inlet, thread, position) #定义比耗散率
{
real x[ND_ND];
real z;
real i;
real l;
real k;
real e;
face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
z=x[2];
if(z<5)
{i=0.23;}
if(z>=5,z<=350)
{i=0.1*pow(z/350,-0.20);}
if(z>350)
{i=0.1;}
l=100*pow(z/30,0.5);
k=1.5*(26.83*pow(z/10,0.15)*i)*(26.83*pow(z/10,0.15)*i);
e=pow(0.09,0.75)*pow(k,1.5)/l;
F_PROFILE(f, thread, position) =e/(0.09*k);
end_f_loop(f, thread)
}
}
以上我这样编写的UDF文件对吗?
呵呵!不客气!