本教程演示了二维轴对称流动和传热的填充床反应器模拟过程。
1 启动FLUENT并导入网格
(1)在Windows系统下执行“开始”→“所有程序”→ANSYS 2021→Fluid Dynamics→Fluent 2021命令,启动Fluent 2021。
(2)单击主菜单中File→Read→Mesh命令,导入.msh网格文件。
(3)单击主菜单中Domian→Mesh→Scale命令,弹出Scale Mesh对话框,Mesh Was Created In选择mm,单击Scale按钮。
2 定义模型
(1)单击命令结构树中General按钮,弹出General(总体模型设定)面板。在SolverTime中选择Transient,2D Space选择Axisymmetric。
(2)在模型设定面板Models中双击Viscous按钮,弹出Viscous Model(湍流模型)对话框,在Model中选择Laminar,单击OK按钮确认并关闭对话框。
(3)激活能量方程。
3 设置UDF
(1)单击主菜单中User-Defined→Functions→Compiled按钮,导入以下UDF文件。
#include "udf.h"
real delta_t;
int time_step;
#define d_b 0.00683 /* mean diameter of bulk material */
real rho_b = 2250.; /* particle density */
real cp_b = 835.; /* specific heat capacity */
real A_V_sphere = 6.0/d_b; /* area-to-volume ratio of a sphere*/
real A_b_V; /* area-to-volume ratio */
enum
{
T_B,
N_REQUIRED_UDS
};
DEFINE_ADJUST(pm_adjust, domain)
{
delta_t = RP_Get_Real("physical-time-step");
time_step = RP_Get_Integer("time-step");
}
DEFINE_UDS_UNSTEADY(pm_first_order, c, t, i, apu, su)
{
real vol; /* cell volume */
real vol_m1; /* cell volume time step minus 1 */
real fac; /* factor in time derivative */
real fac_m1; /* factor at time step minus 1 */
real eps_b = 1.0 - C_POR(c,t); /*solid volume fraction*/
vol = C_VOLUME(c,t);
vol_m1 = vol;
fac = rho_b*cp_b*eps_b;
fac_m1 = fac;
*apu = -fac*vol / delta_t;
*su = fac_m1*vol_m1*C_UDSI_M1(c,t,i)/delta_t;
}
DEFINE_UDS_UNSTEADY(pm_scnd_order, c, t, i, apu, su)
{
real vol; /* cell volume */
real vol_m1; /* cell volume time step minus 1 */
real vol_m2; /* cell volume time step minus 2 */
real fac; /* factor in time derivative */
real fac_m1; /* factor at time step minus 1 */
real fac_m2; /* factor at time step minus 2 */
real eps_b = 1.0 - C_POR(c,t);
if ((time_step < 2) || (n_time_levels == 2))
pm_first_order(c,t,i,apu,su);
else {
vol = C_VOLUME(c,t);
vol_m1 = vol;
vol_m2 = vol;
fac = rho_b*cp_b*eps_b;
fac_m1 = fac;
fac_m2 = fac;
*apu = - 1.5*fac*vol / delta_t;
*su = (2*fac_m1*vol_m1*C_UDSI_M1(c,t,i) -
0.5*fac_m2*vol_m2*C_UDSI_M2(c,t,i))/delta_t;
}
}
real htc(cell_t c, Thread *t)
{
real Nu, Re, Pr;
Re = ND_MAG(C_U(c,t),C_V(c,t),C_W(c,t))*d_b*C_R(c,t)/C_MU_L(c,t);
Pr = C_CP(c,t)*C_MU_L(c,t)/C_K_L(c,t);
Nu = 2. 1.1 * pow(Re,0.6) * pow(Pr,1./3.);
return Nu*C_K_L(c,t)/d_b;
}
DEFINE_SOURCE(energy_source, c, t, dS, eqn)
{
real pref;
real source;
real eps_b = 1.0 - C_POR(c,t);
A_b_V = eps_b*A_V_sphere;
pref = htc(c,t)*A_b_V;
source = -pref*(C_T(c, t) - C_UDSI(c, t, T_B));
dS[eqn] = -pref;
return source;
}
DEFINE_SOURCE(uds_source, c, t, dS, eqn)
{
real pref;
real source;
real eps_b = 1.0 - C_POR(c,t);
A_b_V = eps_b*A_V_sphere;
pref = htc(c,t)*A_b_V;
source = pref*(C_T(c, t) - C_UDSI(c, t, T_B));
dS[eqn] = -pref;
return source;
}
(2)单击主菜单中User-Defined→Scalars按钮,激活UDS。
(3)单击主菜单中User-Defined→Function Hooks按钮,设置UDF函数。
4 设置材料
(1)单击主菜单中Setting Up Physics→Materials→Create/Edit,弹出Create/Edit Materials(材料)对话框。设置air的Density为1.1,Cp为1010,Thermal Conductivity为0.0276,Viscosity为1.95e-05。
单击UDS Diffusivity旁边的Edit按钮,弹出UDS Diffusion Coefficients对话框,设置Coefficients为1.84。
(2)在Fluent Database Materials对话框中导入固体物质copper。
(3)创建新的固体物质glass,Density设置为2250,Cp为0,Thermal Conductivity选择为orthotropic。
5 设置计算域
(1)设置计算域,在Fluid对话框中勾选Porous Zone和Source Terms。
(2)在Source Terms选项卡中,单击Energy旁边Edit按钮,设置Energy Sources。
单击User Scalar 0旁边Edit按钮,设置User Scalar sources。
(3)在Porous Zone选项卡中,取消勾选Relative Velocity Resistance Formulation,设置Viscous Resistance为1.41e 07,Inertial Resistance为4181,Porosity为0.423,设置Solid Material Name为glass。
6 设置边界条件
(1)单击主菜单中Setting Up Physics→Zones→Boundaries按钮启动的边界条件面板。
(2)在边界条件面板中,设置Inlet,Velocity Magnitude填入0.2085,Temperature填入320.15,单击OK按钮确认退出。
(3)设置external-wall,Thermal Conditions选择为Convection,Material Name选择为copper,Heat Transfer Coefficient填入70,Free Stream Temperature填入383.15,单击OK按钮确认退出。
7 初始条件
单击主菜单中Solving→Initialization按钮,弹出Solution Initialization(初始化设置)面板。
Initialization Methods中选择Standard Initialization,单击Initialize按钮进行初始化。
8 计算求解
单击主菜单中Solving→Run Calculation按钮,弹出Run Calculation(运行计算)面板。
在Time Step Size中输入10,在Number of Time Steps中输入200,单击Calculate开始计算。
9 结果后处理
(1)进入CFD-Post界面。
(2)显示云图。