Reynolds stress plot error
3 ビュー (過去 30 日間)
古いコメントを表示
I'm getting this error when trying to plot this:
Error in BL_9 (line 15)
R = (1./delta) * trapz(y, tau .* u - tau' .* u); % Reynolds stress
not sure how to fix it, any help will be appreciated. thanks
clear all; close all; clc;
U_inf = 100; % free stream velocity in m/s
L = 1; % plate length in m
nu = 1.5e-5; % kinematic viscosity of air in m^2/s
rho = 1.2; % air density in kg/m^3
Re = U_inf * L / nu; % Reynolds number
n = 1/7; % power law exponent for laminar flow
x = linspace(0, 1, 100); % distance from leading edge in m
delta = 5.0 * x / sqrt(Re); % boundary layer thickness
u = U_inf * (x ./ delta).^n; % velocity profile
dudy = n * U_inf ./ delta .* (x ./ delta).^(n-1); % velocity gradient
tau = rho * u .* dudy; % shear stress
R = (1./delta) * trapz(y, tau .* u - tau' .* u); % Reynolds stress
plot(y, R);
xlabel('Distance from leading edge (m)');
ylabel('Reynolds stress (Pa)');
title('Reynolds stress profile');
0 件のコメント
採用された回答
VBBV
2023 年 3 月 28 日
clear all; close all; clc;
U_inf = 100; % free stream velocity in m/s
L = 1; % plate length in m
nu = 1.5e-5; % kinematic viscosity of air in m^2/s
rho = 1.2; % air density in kg/m^3
Re = U_inf * L / nu; % Reynolds number
n = 1/7; % power law exponent for laminar flow
x = linspace(0.1, 1, 100); % distance from leading edge in m
delta = 5.0 * x / sqrt(Re); % boundary layer thickness
u = U_inf * (x ./ delta).^n % velocity profile
dudy = n * U_inf ./ delta .* (x ./ delta).^(n-1); % velocity gradient
tau = rho * u .* dudy % shear stress
R = (1./delta).*trapz(x.', tau .* u - tau.' * u) % Reynolds stress
plot(x, R);
xlabel('Distance from leading edge (m)');
ylabel('Reynolds stress (Pa)');
title('Reynolds stress profile');
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Stress and Strain についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!