✅作者简介:热爱科研的Matlab仿真开发者,擅长数据处理、建模仿真、程序设计、完整代码获取、论文复现及科研仿真。
🍎 往期回顾关注个人主页:Matlab科研工作室
👇 关注我领取海量matlab电子书和数学建模资料
🍊个人信条:格物致知,完整Matlab代码获取及仿真咨询内容私信。
🔥 内容介绍
本项目报告介绍了采用 MATLAB 有限差分技术求解二维稳态对流-扩散方程的方案。该方程在边长为 𝒍 = 𝟏 的正方形区域中求解,区域各边界的边界条件已预先设定。扩散项采用二阶中心差分格式离散,对流项则通过三种独立技术实现离散:一阶UDS、二阶UDS和中心差分格式,从而能够对这些离散技术对近似解的影响进行定性比较。开发的 MATLAB 程序支持调整输入参数,包括流动方向角、扩散系数以及区域尺寸 𝑵𝒙 和 𝑵𝒚 。
Image
Image
Image
Image
⛳️ 运行结果
Image
Image
Image
📣 部分代码
alpha = 1 * 10^(-6); % difussivity
Nx = 11; % Number of grid points in x
Ny = 11; % Number of grid points in ya
scheme = 1; % 1 for UD1, 2 for UD2, 3 for CDS
phi = convection_diffusionSolver(theta, alpha, Nx, Ny, scheme);
phi = flipud(phi);
%% Beyond this point, the inputs are fixed to produce the results asked for in the report!
%% Discretization 1: UD1
phi_ud1_coarse = convection_diffusionSolver(theta, alpha, 11, 11, 1);
phi_ud1_medium = convection_diffusionSolver(theta, alpha, 21, 21, 1);
phi_ud1_fine = convection_diffusionSolver(theta, alpha, 41, 41, 1);
%% Discretization 2: UD2
phi_ud2_coarse = convection_diffusionSolver(theta, alpha, 11, 11, 2);
phi_ud2_medium = convection_diffusionSolver(theta, alpha, 21, 21, 2);
phi_ud2_fine = convection_diffusionSolver(theta, alpha, 41, 41, 2);
%% Discretization 3: CDS
phi_cds_coarse = convection_diffusionSolver(theta, alpha, 11, 11, 3);
🔗 参考文献
图片
🏆团队擅长辅导定制多种科研领域MATLAB仿真,助力科研梦: