필터 지우기
필터 지우기

PDEPE solver failure (spatial discretization) ; partial differential/derivative temperature modelling

조회 수: 4 (최근 30일)
Attempting to model temperature profile of an adsorption column based on concentration profile since this determines the heat of adsorption.
This is the function:
function[c,f,s] = pdefunEB(x,t,u,dudx)
global qmax_phenol K_L_phenol kf De u_s Rep Dp epsilon rho_liq cp_AC cp_feed H_ads h alpha
C = u(1) ;
q = u(2) ;
Tf = u(3) ;
dCdx = dudx(1) ;
dqdx = dudx(2) ;
dTdx = dudx(3) ;
Ts = 298.15 ; % adsorbent temp Kelvin
qstar = ((qmax_phenol)*(K_L_phenol)*C)/(1+(K_L_phenol)*C) ;
dqdt = kf*(qstar-q) ;
c = ones(3,1) ;
f = [De*dCdx;
0;
0];
s = [-u_s*dCdx-(1-epsilon)/epsilon*rho_liq*dqdt;
dqdt;
-u_s*dTdx+(((h*alpha*(Tf-Ts)-(H_ads/cp_AC))+(H_ads/cp_feed))*(dqdt*((1-epsilon)/epsilon)))] ;
end
%% initial condition
function u0 = icfunEB(x)
u0 = [0;
0;
298.15] ;
end
%% boundary condition
function [p1,q1,pr,qr] = bcfunEB(x1,u1,xr,ur,t)
global C_phenol
C0 = C_phenol ;
p1 = [u1(1)-C0;0;-298.15] ;
q1 = [0;1;0] ;
pr = [0;0;0] ;
qr = [1;1;1] ;
end
this is where the error appears (Error using pdepe Spatial discretization has failed. Discretization supports only parabolic and elliptic equations, with flux term involving spatial derivative)
mEB = 0 ;
sol1 = pdepe(mEB,@pdefunEB,@icfunEB,@bcfunEB,x,t) ;
CEB = sol1(:,:,1) ;
qEB = sol1(:,:,2) ;
TEB = sol1(:,:,3) ;
figure(2)
T0 = 298.15 ;
Cp1 = C1(:,end)./C01 ;
plot(t,TEB,'b-','LineWidth',2)
grid on
title('Column Temperature')
xlabel('time in minutes')
ylabel('temp in kelvin')
Heres a picture of my mathematical working before input into matlab:

채택된 답변

Torsten
Torsten 2024년 4월 20일
편집: Torsten 2024년 4월 20일
Please include the constants defined as globals so that we can test your code.
One obvious error is the boundary condition for T in the left boundary point. Use
p1 = [u1(1)-C0;0;u1(3)-298.15] ;
instead of
p1 = [u1(1)-C0;0;-298.15] ;
Another problem can be that f = 0 for equations (2) and (3). "pdepe" - as the name indicates - is designed for parabolic-elliptic partial differential equations (thus for equations with second-order spatial derivatives present). Your second equation is a simple ODE, your third equation is hyperbolic in nature.
  댓글 수: 4
Josh
Josh 2024년 4월 20일
편집: Josh 2024년 4월 20일
Yes, so the error message has changed since i implemented your boundary condition change... How would you go about fixing it ?
Torsten
Torsten 2024년 4월 20일
편집: Torsten 2024년 4월 20일
As you can see above, the temperature explodes at the right endpoint (see above). Check the possible reasons (especially your sourceterm -u_s*dTdx+(((h*alpha*(Tf-Ts)-(H_ads/cp_AC))+(H_ads/cp_feed))*(dqdt*((1-epsilon)/epsilon))) )
h*alpha = 1.5e9 !!!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Chemistry에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by