求大神帮忙修改适合SST K-W湍流模型入口边界的UDF
浏览:104216
这是我正在使用的适用于K-E湍流模型的UDF,哪位大神能帮我改写成适合SST K-W湍流模型的UDF?
#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.21);}
if(z>350)
{i=0.1;}
F_PROFILE(f, thread, position) =1.5*(26.83*pow(z/10,0.16)*i)*(26.83*pow(z/10,0.16)*i);
end_f_loop(f, thread)
}
}
DEFINE_PROFILE(e_inlet, thread, position)
{
real x[ND_ND];
real z;
real i;
real l;
real k;
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.21);}
if(z>350)
{i=0.1;}
l=100*pow(z/30,0.5);
k=1.5*(26.83*pow(z/10,0.16)*i)*(26.83*pow(z/10,0.16)*i);
F_PROFILE(f, thread, position) =pow(0.09,0.75)*pow(k,1.5)/l;
end_f_loop(f, thread)
}
}
#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.21);}
if(z>350)
{i=0.1;}
F_PROFILE(f, thread, position) =1.5*(26.83*pow(z/10,0.16)*i)*(26.83*pow(z/10,0.16)*i);
end_f_loop(f, thread)
}
}
DEFINE_PROFILE(e_inlet, thread, position)
{
real x[ND_ND];
real z;
real i;
real l;
real k;
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.21);}
if(z>350)
{i=0.1;}
l=100*pow(z/30,0.5);
k=1.5*(26.83*pow(z/10,0.16)*i)*(26.83*pow(z/10,0.16)*i);
F_PROFILE(f, thread, position) =pow(0.09,0.75)*pow(k,1.5)/l;
end_f_loop(f, thread)
}
}