Pdepe- Spacial Discretization has failed. Trying to solve a heat transfer equation and I'm confused on how to definte the boundary conditions for my case
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello,
I'm trying to solve a heat transfer equation for a heat exchanger modeled as a flat plate which has a constant temperature at one end, with no directly applied heat flux, and I want to get an output graphic of the temperature change through the material over time, and I'm getting the following error:
Error using pdepe
Spatial discretization has failed. Discretization supports only parabolic and elliptic equations, with flux term involving spatial derivative.
I was trying to do this with PDEPE but I'm unsure of how to define the boundary conditions for this case.
Please see the below:
L = 0.0155; %15.5mm
global rho cp k q
phi = 0.1;
rho=(phi*2700)+((1-phi)*712); %kg/m^3
cp=(phi*900)+((1-phi)*2200); %J/kg-K
k=(phi*80)+((1-phi)*0.36); %W/m-K
q = 73E3;
x = linspace(0,L,500);
t = linspace(0,200,500);
m = 0;
sol = pdepe(m,@PCMpde,@PCMic,@heatbc,x,t);
figure(1);
colormap hot
imagesc(x,t,sol)
colorbar
xlabel('x')
ylabel('time')
function [c,f,s] = PCMpde(x,t,u,dudx)
global rho cp k
c = rho*cp;
f = k*dudx;
s=0;
end
function u0 = PCMic(x) %Temperature is 'u'
u0 = 22; %Initial Temperature
end
function [pl,ql,pr,qr] = heatbc(xl,ul,xr,ur,t)
global q
pl = 40;
ql = 1;
pr = ur;
qr = 1;
end
I'm unsure if I'm able to do this with the above, as I believe I need to have a definite boundary condition for the temperature at the far end of the heat exchanger, but I thought this would be able to solve for that in the steady state as I don't want to limit the temperature at the distance L.
0 commentaires
Réponses (1)
Torsten
le 1 Mai 2023
Modifié(e) : Torsten
le 1 Mai 2023
At the moment, your boundary conditions read
k*dT/dx = -40 at x = 0
k*dT/dx = -T at x = L
I don't think this is what you try to set.
To set the boundary conditions, p and q have to be chosen such that
p + q*f = 0
where f = k*dT/dx in your case.
Choose pl, ql at x = 0 and pr, qr at x = L appropriately.
2 commentaires
Torsten
le 1 Mai 2023
It should be obvious that
pl = ul - 40;
ql = 0;
pr = 0;
qr = 1;
for the boundary conditions you want to set since
(T-40) + 0*k*dT/dx = 0 at x = 0
0 + 1*k*dT/dx = 0 at x = L.
Voir également
Catégories
En savoir plus sur Eigenvalue Problems dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!