Reynolds stress plot error
조회 수: 1 (최근 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!