レイリー問題

clear; close all; clc;

C = 1;
mu = 1;
rho = 1;
tmax = 5;
ymax = 1;
ts = [0.01, 0.1];

figure(1);
hold on;
figure(2);
hold on;

for idx=1:length(ts)
  t = ts(idx);
  y = linspace(0,ymax,50);
  dudy = C./sqrt(mu*t/rho).*exp(-y.^2./(4*mu*t)*rho);
  dudy = dudy(2:end);
  figure(1);
  plot(dudy,y(2:end));
  us = [];
  for idy=2:length(y)-1
    y_partial = y(1:idy);
    dudy_partial = dudy(1:idy);
    u = trapz(dudy_partial,y_partial);
    us(idy) = u;
  end
  figure(2);
  us
  plot(us,y(2:end));
end

figure(1);
% legend('t=0.01','t=0.1');
legend(string(ts));
title('速度勾配の大きさ');
xlabel('$\partial u / \partial x $','interpreter','latex', 'FontWeight','bold')
ylabel('y','interpreter','latex');


figure(2);
% legend('t=0.01','t=0.1');
legend(string(ts));
title('流速');
xlabel('$u / U$','interpreter','latex', 'FontWeight','bold')
ylabel('y','interpreter','latex');

big;

f:id:seinzumtode:20220319233150p:plain
f:id:seinzumtode:20220319233154p:plain
f:id:seinzumtode:20220319233209p:plain