基于 MacCormack 有限体积法实现二维喷嘴设计附matlab代码

✅作者简介:热爱科研的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电子书和数学建模资料

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

matlab科研助手

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值