clear all;
% File which includes three columns, y U U''
data= load ('velocityprofile2.dat'); % load your velocity profile
%----------------------------------------
% Number of Chebyshev modes
N= 150; N1 = N+1;
j = (0:N)'; X = cos(pi*j/N);
%-------------------------------------
% Scaling for mapping from -1 to 1
L = data(end,1);
scal=L/2; % Physical domain => [0, L]
Y=X*scal + scal; % Mapping from Physical to Chebyshev domain
%----------------------------------
% Velocity and its second derivative are being evaluated at scaled Y
U = interp1(data(:,1), data(:,2), Y);
U2 = interp1(data(:,1), data(:,3), Y);
fac = 1/scal;
%-------------------------------------
%%For singel value of alpha and Re, for example,
alpha = 0.25;
length(alpha)
Rey = 1500;
%%-------------------------------
% For a range of alpha and Reynolds number, for example,
% alpha = 0.1:0.01:1.5;
% length(alpha)
% Rey = 10:0.5:3000;
%-----------------------------------------
% Main program; try to understand before you run it
ci = zeros(length(alpha),length(Rey));
cr = zeros(length(alpha),length(Rey));
for ii = 1:length(alpha)
ii
for jj = 1:length(Rey)
al = alpha(ii);
R = Rey(jj);
zi = sqrt(-1); a2 = al^2; a4 = a2^2; er = -200*zi;
[D0,D1,D2,D3,D4] = Dmat(N); % Read about it in the book.
D1 = fac*D1;
D2 = (fac^2)*D2;
D4 = (fac^4)*D4;
B = (D2-a2*D0);
A = (U*ones(1,N1)).*B-(U2*ones(1,N1)).*D0-(D4-2*a2*D2+a4*D0)/(zi*al*R);
A = [er*D0(1,:); er*D1(1,:); A(3:N-1,:); er*D1(N1,:); er*D0(N1,:)];
B = [D0(1,:); D1(1,:); B(3:N-1,:); D1(N1,:); D0(N1,:)];
d = (inv(B)*A);
c = eig(d); % eigenvalues are being evaluated using eig function
[mxci,I] = max(imag(c)); % useful for contour plots
ci(ii,jj)= mxci;
cr(ii,jj) =real(c(I));
end;
end
OSE_621A.m.zip_assignment_turbulence
版权申诉
9 浏览量
2022-07-14
02:53:08
上传
评论
收藏 1KB ZIP 举报
御道御小黑
- 粉丝: 61
- 资源: 1万+
最新资源
- 基于opencv的dnn模块实现Yolo-Fastest的目标检测python源码+模型+说明(高分项目).zip
- 使用Python调用微信本地ocr服务.zip
- 【精品推荐】人工智能在医疗中的应用.pptx
- 【精品推荐】电子医疗仪器人机接口-(1).ppt
- 【精品推荐】电子医疗仪器人机接口.ppt
- ubuntu镜像ubuntu镜像01
- 基于paddle搭建神经网络实现5种水果识别分类python源码+数据集(高分毕设).zip
- 【精品推荐】电子商务网店类型介绍.ppt
- 基于paddle搭建神经网络实现水果识别分类python源码+数据集(高分项目).zip
- 三菱plc编程口通信学习笔记.doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈