资源简介
多个 LBM格子波尔兹曼 matlab范例,适合初学者。
代码片段和文件信息
clc
clear
% Load LBM-C Variables
% lbm_c_vars
% Project Variables
ProjName = ‘cylinder2d‘;
DomainFile = ‘cylinder2d.cgns‘;
OutputFile = ‘cylinder2d.res‘;
% Solution Constants
Tau = 1.0;
Lx = 500;
Ly = 100;
Lz = 1;
DeltaX = 1;
DeltaT = 1;
C_smag = 0;
% Solution Configuration
ColType = ‘BGK‘;
Force = 0;
MicroBC = 1;
MacroBC = 1;
Init = 0;
Tolerance = 0;
% Timing Data
MaxT = 10000;
FileOut = 500;
ScreenMes = 50;
SteadyCheck = 0;
% Output Variables
Ux = 1;
Uy = 1;
Uz = 0;
Rho = 1;
P = 1;
ScreenX = 0;
ScreenY = floor(Ly/2);
ScreenZ = 0;
Interactive = 0;
% Domain Arrays
porosity = zeros(LxLy);
micro_bc = zeros(LxLy);
macro_bc = zeros(LxLy);
rho = zeros(LxLy);
velocity = zeros(3LxLy);
porosity(:[1Ly]) = 1;
obst_x = floor((1/5)*Lx);
obst_y = floor((1/2)*Ly)-2;
obst_r = 20;
for i = 0:(Lx)
for j = 0:(Ly)
if (i-obst_x)^2 + (j-obst_y)^2<= obst_r^2
porosity(ij) = 1;
end
end
end
micro_bc(1:) = ZOU_HE_P_x;
micro_bc(Lx:) = ZOU_HE_P_X;
macro_bc(1:) = PRESCRIBED_RHO;
macro_bc(Lx:) = PRESCRIBED_RHO
rho(1:) = 1.00002;
rho(Lx:) = 0.99998;
write_ascii_input
write_cgns_input
fname_in = [ProjName‘.lbmc‘];
command = [‘lbm-c-2d ‘fname_in];
system(command);
time_values = read_output_times(OutputFile);
ux = read_output_field(OutputFilelength(time_values)‘VelocityX‘);
uy = read_output_field(OutputFilelength(time_values)‘VelocityY‘);
rho = read_output_field(OutputFilelength(time_values)‘Density‘);
for i = 1:length(time_values)
ux = read_output_field(OutputFilei‘VelocityX‘);
uy = read_output_field(OutputFilei‘VelocityY‘);
u = sqrt(ux.*ux+uy.*uy);
imagesc(u‘);
pause
end
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1760 2014-02-27 10:04 examples\cylinder2d.m
文件 840 2014-03-04 09:13 examples\cylinder2d.rar
文件 1571 2012-12-10 13:57 examples\forced_cylinder2d.m
文件 774 2014-03-04 09:13 examples\forced_cylinder2d.rar
文件 1766 2012-12-10 13:37 examples\porous_cylinder2d.m
文件 845 2014-03-04 09:13 examples\porous_cylinder2d.rar
目录 0 2014-03-04 09:13 examples
----------- --------- ---------- ----- ----
7556 7
相关资源
- 基于Matlab的最大熵模糊图像复原算法
- KITTI雷达点云与图像数据融合matlab源码
- matlab 解码 NMEA0183格式GGA数据
- 一个有关飞机的模板匹配的跟踪的m
- 基于MATLAB的电弧模型仿真
- PRI信号分选
- Matlab论文:基于Matlab的二进制数字调
- 802.11协议吞吐量随节点数性能仿真
- matlab图片rgb转yuv,存.yuv文件 播放器
- Duda模式分类Pattern Classification MATLAB 代
- dijkstra算法的matlab实现31274
- 随机路径生成函数matlab
- matlab语音信号处理工具箱
- matlab2013激活文件
- matlab实现游程编码
- 暗通道先验+引导滤波MATLAB代码
- 边缘检测中的canny算法及其matlab实现
- 通过达曼光栅生成点阵的matlab程序.
- MATLAB核函数算法
- 求控制系统的性能指标MptrtsFAI,matl
- matlab 求DTFT
- 逆变器重复控制算法MATLAB仿真
- MATLAB R2014b 许可协议文件
- matlab读取comtrade格式的程序
- 基于Matlab的RC一阶电路仿真
- Las点云数据读取代码
- 雷达回波加天线方向图模拟程序
- MATLAB 2017b 安装文件及其破解文件百度
- Matlab实现音频降噪
- matlab实现导航卫星系统中计算多普勒
评论
共有 条评论