1 Star 0 Fork 1

深蓝/UDF-of-Urban-Microclimate

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
udf_of_inlet.c 1.90 KB
一键复制 编辑 原始数据 按行查看 历史
kidisgod 提交于 2016-12-19 11:05 . Update the format
/**************************************************************************
inlet udf
@author:Jialei Shen
@e-mail:shenjialei1992@163.com
@latest:2016.09.17
This is a UDF file to setup the inlet boundary conditions in Fluent,
including the following terms:
1 profile term of inlet velocity
2 profile term of inlet k
3 profile term of inlet e
**************************************************************************/
#include "udf.h"
#define UH 4.8 //reference velocity
#define H 20 //height of buildings
#define DELTA 300 //doundary layer depth; DELTA=15*H
#define A 0.27 //coefficient
#define Utau 0.23 //friction velocity
#define K 0.435 //von Karman constant
#define Cmu 0.09
/*********************profile term of inlet velocity**********************/
DEFINE_PROFILE(velocity_profile,t,i)
{
real x[ND_ND];
real h;
face_t f;
begin_f_loop(f,t)
{
F_CENTROID(x,f,t);
h=x[1];
if(h<=DELTA && h>=0)
{
F_PROFILE(f,t,i)=UH*pow(h/DELTA,A);
}
else
{
F_PROFILE(f,t,i)=UH;
}
}
end_f_loop(f,t)
}
/************************profile term of inlet k**************************/
DEFINE_PROFILE(k_profile,t,i)
{
real x[ND_ND];
real h;
face_t f;
begin_f_loop(f,t)
{
F_CENTROID(x,f,t);
h=x[1];
if(h<=DELTA)
{
F_PROFILE(f,t,i)=((Utau*Utau)/sqrt(Cmu))*(1-h/DELTA);
}
else
{
F_PROFILE(f,t,i)=0;
}
}
end_f_loop(f,t)
}
/*************************profile term of inlet e**************************/
DEFINE_PROFILE(e_profile,t,i)
{
real x[ND_ND];
real h;
face_t f;
begin_f_loop(f,t)
{
F_CENTROID(x,f,t);
h=x[1];
if(h<=DELTA)
{
F_PROFILE(f,t,i)=((Utau*Utau*Utau)/(K*h))*(1-h/DELTA);
}
else
{
F_PROFILE(f,t,i)=0;
}
}
end_f_loop(f,t)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/im_zhhl/UDF-of-Urban-Microclimate.git
git@gitee.com:im_zhhl/UDF-of-Urban-Microclimate.git
im_zhhl
UDF-of-Urban-Microclimate
UDF-of-Urban-Microclimate
master

搜索帮助