How can I use the temperture distribution of solution obtained using u = parabolic() as the initial condition to a subseqent PDE with an altered boundary condition?

2 views (last 30 days)
I have used the matlab u = parabolic() function to find the temperature distribution in a solid with a boundary condition of one side being at a fixed temperature. How do I then use the temperature distribution of the solution (matrix) as the initial condition for solving a PDE of the same solid, but with a different fixed temperature as the boundary condition.
this is my code currently:
% clear variables % clc % close all %r1 is the outer square r1 = [3 4 -.205 -.205 .205 .205 0 .39 .39 0]; %r2 is the inner square r2 = [3 4 -.1 .1 .1 -.1 .39 .39 .29 .29]; gdm = [r1; r2]'; %subtract inner from outer g = decsg(gdm, 'R1-R2', ['R1'; 'R2']'); %plot geometry figure pdegplot(g, 'edgeLabels', 'on'); axis([-.5 .5 -.1 .5]); title 'Storage Geometry With Edge Labels Displayed'
%mesh the storage geometry an plot hmax = .02; % element size [p, e, t] = initmesh(g, 'Hmax', hmax); figure pdeplot(p,e,t);
axis equal title 'Storage Geometry With Finite Element Mesh Displayed'
%PDE Coefficients and Boundary Conditions
% Create a pde entity for a PDE with a single dependent variable TempBound = 80; numberOfPDE = 1; pb = pde(numberOfPDE); % Create a geometry entity pg = pdeGeometryFromEdges(g); u1 = pdeBoundaryConditions(pg.Edges(1), 'g', 0); u5 = pdeBoundaryConditions(pg.Edges(3), 'g', 0); u6 = pdeBoundaryConditions(pg.Edges(2), 'g', 0); u7 = pdeBoundaryConditions(pg.Edges(7), 'g', 0); u8 = pdeBoundaryConditions(pg.Edges(8), 'g', 0); u2 = pdeBoundaryConditions(pg.Edges(6), 'r', TempBound); u3 = pdeBoundaryConditions(pg.Edges(5), 'r', TempBound); u4 = pdeBoundaryConditions(pg.Edges(4), 'r', TempBound); pb.BoundaryConditions = [u1 u5 u6 u7 u8 u2 u3 u4];
%define PDE coefficients f_sandvolume = 0.9; volume_cavity = 0.00911; [k, Cp, rho] = effval(f_sandvolume,volume_cavity);
c = k; a = 0; f = 0; d = rho*Cp;
tlist = 0:.1:10; %initial condition u0 = 150; %solve PDE u = parabolic(u0, tlist, pb, p, e, t, c, a, f, d);
%plot temperature distribution pdeplot(p, e, t, 'xydata', u(:,end), 'contour', 'on', 'colormap', 'hot');
Thanks in advance for any help!

Answers (0)

Community Treasure Hunt

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

Start Hunting!