Skip to content

Commit d3e8999

Browse files
terzaghi1D surface plots created
1 parent 02096a9 commit d3e8999

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

examples/matlab/terzaghi1D.m

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,3 +330,41 @@
330330
times_hr(i), rel_err_p, rel_err_q, rel_err_e, rel_err_u, rel_err_r);
331331
end
332332
end
333+
334+
%% Cumulative Surface Plots
335+
% Prepare time matrix for plotting
336+
[X, T] = meshgrid(xgrid, times_sec / 3600); % Time in hours
337+
338+
% 1. Pressure surface plot
339+
figure('Name','Pressure Evolution Surface');
340+
surf(X, T, p_numerical'); % p_numerical': size (space x time)
341+
xlabel('x (m)');
342+
ylabel('Time (hr)');
343+
zlabel('Pressure p(x,t) [Pa]');
344+
title('Pore Pressure Evolution');
345+
shading interp; view(135, 30); colorbar;
346+
347+
% 2. Displacement surface plot
348+
figure('Name','Displacement Evolution Surface');
349+
surf(X, T, u_numerical');
350+
xlabel('x (m)');
351+
ylabel('Time (hr)');
352+
zlabel('Displacement u(x,t) [m]');
353+
title('Displacement Evolution');
354+
shading interp; view(135, 30); colorbar;
355+
356+
% 3. Mass balance residual surface plot (excluding ghost nodes)
357+
x_interior = xgrid(2:end-1); % length 50
358+
[Xr, Tr] = meshgrid(x_interior, times_sec / 3600); % size: (4 × 50)
359+
360+
% Plot residual surface
361+
figure('Name','Mass Conservation Residual Surface');
362+
surf(Xr, Tr, residual(2:end-1,:)');
363+
xlabel('x (m)');
364+
ylabel('Time (hr)');
365+
zlabel('Residual [1/s]');
366+
title('Mass Conservation Residual Over Time');
367+
shading interp; view(135, 30); colorbar;
368+
369+
370+

0 commit comments

Comments
 (0)