✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。
🍎个人主页:Matlab科研工作室
🍊个人信条:格物致知。
更多Matlab仿真内容点击👇
⛄ 内容介绍
给定燃烧室的条件(温度、压力等)以及环境条件和喉部的直径/面积,程序将:
a) 求解产生最大推力的喷嘴出口区域。
b) 用特征法求解所述喷嘴的形状。
c) 自动生成用于模拟喷嘴的曲线网格
d) 使用 MacCormack 有限体积法求解网格上的欧拉方程。
e) 绘制结果进行比较
⛄ 部分代码
% ****** See nozzle.m for instructions ******
% Program to extrapolate the data points from nozzle design and make a
% uniform grid spacing in the x-direction
% Change nothing... simply run this script
% Find the minimum spacing given by the method of characteristics
% and set as the dx value
dx = 0;
for i=1: size(noz,1)-1
len = noz(i+1,1) - noz(i,1);
if (len < dx || i == 1)
dx = len;
end
end
% Explicitly give the dx value here
dx = max(noz(:,1))/ceil(max(noz(:,1))/dx);
n = max(noz(:,1))/dx;
% len = max(noz(:,1));
% n = 50; % Note # of points is actually n+1
% dx = len/n
% Pick m points in y as some factor of x points
yfactor = .8;
m = ceil(yfactor*n);
% Make uniform x-distribution of points
xmax = 0;
i = 1;
while xmax < max(noz(:,1))
xmax = dx*(i-1);
x(i,1:m) = xmax;
i = i+1;
end
% Make the y-points and extrapolate linearly from closest points to fit
% the nozzle geometry
% Initialize and assign last value
y(1:size(x,1),1:size(x,2)) = 0;
y(1,size(y,2)) = noz(1,size(noz,2));
y(size(y,1),size(y,2)) = noz(size(noz,1),size(noz,2));
for i = 1 : size(x,1)-1
j = 1;
while x(i,1) >= noz(j,1)
x1 = noz(j,1);
x2 = noz(j+1,1);
y1 = noz(j,2);
y2 = noz(j+1,2);
j = j + 1;
end
slope = (y2 - y1)/(x2 - x1);
y(i,size(y,2)) = y1 + slope*(x(i,1)-x1);
%Fill in mesh
dy = y(i,size(y,2))/(size(y,2)-1);
for k = 1: size(y,2)
y(i,k) = dy*(k-1);
end
end
%Fill in mesh
dy = y(size(y,1),size(y,2))/(size(y,2)-1);
for k = 1: size(y,2)
y(size(y,1),k) = dy*(k-1);
end
'Mesh done'
⛄ 运行结果
⛄ 参考文献
[1]樊建人. 径向压气机动叶中三元流动的计算[J]. 工程热物理学报, 1987(04):323-328.
⛄ 完整代码
❤️部分理论引用网络文献,若有侵权联系博主删除
❤️ 关注我领取海量matlab电子书和数学建模资料