How to solve a system of parabolic partial differential equations in time and 1 D space

1 次查看(过去 30 天)
Hi,
I cannot seem to solve the PDF in the figures below. This is the code I have but it produces the wrong graphs:
function New
m=0;
x=0:0.5:15;
t=1:100:28800;
sol = pdepe(m,@pdefun,@icfun,@bcfun,x,t);
u1=sol(:,:,1);
u2=sol(:,:,2);
surf(x,t,u1)
title('u1(x,t)')
xlabel('Distance x')
ylabel('Time t')
figure
surf(x,t,u2)
title('u2(x,t)')
xlabel('Distance x')
ylabel('Time t')
function [c,f,s]=pdefun(x,t,u,DuDx)
P=1200;
R=0.208;
cv=0.313;
rho=7.5;
v=0.3;
A=70;
mdot=1.2;
k=0.016/1000;
alph=0.5;
rhoG=1600;
cG=0.7;
kG=0.7/1000;
c=[((P*cv/R)/u(1));(rhoG*cG)];
f=[((k*DuDx(1))-((P*cv/R)*(mdot*R/(P*A))));(kG*DuDx(2))];
s=[(u(2)-u(1));(u(1)-u(2))]*alph;
function u0=icfun(x)
u0=[300;300];
function[pl,ql,pr,qr]=bcfun(xl,ul,xr,ur,t)
pl = [ul(1)-773; 0];
ql = [0; 1];
pr = [0; 0];
qr = [1; 1];
I think my boundary conditions are incorrect but I don't know how to fit them.
I would appreciate any help with this problem, thank you in advance.
<<
>>
%

采纳的回答

Torsten
Torsten 2017-11-22
One mistake in your settings:
f = [k*DuDx(1) ; kG*DuDx(2)];
s = [(u(2)-u(1))*alph-cv*mdot/A*DuDx(1);(u(1)-u(2))*alph];
And maybe in your boundary condition for T_A at x=0, you will need a ramp that linearly increases the temperature from 300 K to 773 K in, say, one minute.
Best wishes
Torsten.
  7 个评论
Torsten
Torsten 2017-11-22
编辑:Torsten 2017-11-22
Increasing the number of discretization points together with the ramp for a=100 solved the problem:
x = linspace(0,15,3000);
Best wishes
Torsten.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by