the Program for Channel flow past a cylinderical obstacle, using a LB method
下面是 MATLAB 程序,程序为网络所得,版权归程序所有者 Jonas Latt
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%
% cylinder.m: Channel flow past a cylinderical
% obstacle, using a LB method
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%
% Lattice Boltzmann sample, written in C
% Copyright (C) 2006 Jonas Latt
% Address: Rue General Dufour 24, 1211 Geneva 4, Switzerland
% E-mail: Jonas.Latt@cui.unige.ch
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%
% This program is free software; you can redistribute it and/or
% modify it under the terms of the GNU General Public License
% as published by the Free Software Foundation; either version 2
% of the License, or (at your option) any later version.
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
% You should have received a copy of the GNU General Public
% License along with this program; if not, write to the Free
% Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
% Boston, MA 02110-1301, USA.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%
clear
% GENERAL FLOW CONSTANTS
lx = 250;
ly = 51;
obst_x = lx/5+1; % position of the cylinder; (exact
obst_y = ly/2+1; % y-symmetry is avoided)
obst_r = ly/10+1; % radius of the cylinder
uMax = 0.02; % maximum velocity of Poiseuille inflow
Re = 100; % Reynolds number
nu = uMax * 2.*obst_r / Re; % kinematic viscosity
omega = 1. / (3*nu+1./2.); % relaxation parameter
maxT = 400000; % total number of iterations
tPlot = 5; % cycles