✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。
🍎个人主页:Matlab科研工作室
🍊个人信条:格物致知。
更多Matlab仿真内容点击👇
⛄ 内容介绍
实现了多种时间、空间数值格式以及多种湍流模式与嵌补网格技术的有机结合.开发了基于嵌补网格技术,适合复杂外型亚跨超音速流场模拟的计算软件.经多个典型算例的验证,证明软件及所使用的方法具有良好的精度和可靠性.对复杂流场具有很强的模拟能力.
⛄ 部分代码
%% Intermediate Velocity
function [u_tmp, v_tmp] = Predictor(nx, ny, u, v, Re, dx, dy)
u_tmp = u; v_tmp = v;
% x - momentum
for i = 2 : nx+1
for j = 2 : ny
ue = (u(i,j) + u(i,j+1))/2;
uw = (u(i,j) + u(i,j-1))/2;
us = (u(i,j) + u(i-1,j))/2; vs = (v(i-1,j) + v(i-1,j+1))/2;
un = (u(i,j) + u(i+1,j))/2; vn = (v(i,j) + v(i,j+1))/2;
convective = -(ue*ue-uw*uw)/dx - (un*vn-us*vs)/dy;
viscous = 1/Re*( (u(i+1,j) - 2*u(i,j) + u(i-1,j))/(dy*dy) + ...
(u(i,j+1) - 2*u(i,j) + u(i,j-1))/(dx*dx) );
u_tmp(i,j) = viscous + convective;
end
end
% y - momentum
for i = 2 : nx
for j = 2 : ny+1
ue = (u(i,j) + u(i+1,j))/2; ve = (v(i,j) + v(i,j+1))/2;
uw = (u(i,j-1) + u(i+1,j-1))/2; vw = (v(i,j) + v(i,j-1))/2;
vs = (v(i,j) + v(i-1,j))/2;
vn = (v(i,j) + v(i+1,j))/2;
convective = -(ue*ve - uw*vw)/dx - (vn*vn - vs*vs)/dy;
viscous = 1/Re*( (v(i+1,j) - 2*v(i,j) + v(i-1,j))/(dy*dy) + ...
(v(i,j+1) - 2*v(i,j) + v(i,j-1))/(dx*dx) );
v_tmp(i,j) = viscous + convective;
end
end
end
⛄ 运行结果
⛄ 参考文献
[1] 宋慎义,王彦棡,刘冰,等.基于GPU的非结构网格CFD求解器的设计与优化[J].科研信息化技术与应用, 2012, 3(1):9.DOI:CNKI:SUN:KYXH.0.2012-01-005.
[2] ZHONG Ying,钟英,ZHANG Li-Lun,等.并行JFNK在结构多块网格CFD隐式求解中的应用[C]//全国高性能计算学术年会.中国计算机学会, 2013.
[3] 晏畅.基于MATLAB和CFD数据库的流场可视化的实现[J].河南科技, 2019(002):000.