// Other  ·  Computational

2D PDE Solver

Poisson Equation & Transient Heat Equation — MATLAB

Year 2024
Category Computational Fluid Dynamics
Software MATLAB
Course ME 793 — Computational Fluid Dynamics
Institution University of Nevada, Reno
Status Complete
Your browser does not support embedded PDFs. Use the download button below to view the report.
// Full Report Complete project report including derivations, implementation details, and results — compiled in LaTeX
Download PDF →
// Overview

A numerical methods project implementing two PDE solvers in MATLAB for a 2D domain. The first solver targets the steady-state Poisson equation using a sparse Laplacian matrix and MATLAB's backslash operator. The second extends this to the transient heat equation using Crank-Nicolson time integration. Both solvers share the same Laplacian matrix and boundary vector, ensuring consistency between formulations.

The domain features mixed boundary conditions: a sinusoidal Dirichlet temperature profile on the left and top boundaries, a Neumann flux condition on the bottom, and a zero-flux condition on the right. A Gaussian heat source is centered near (0.7, 0.6) in the domain.

Key Specs
Grid Size 25 × 25 interior nodes (625 total)
Solver MATLAB backslash (UMFPACK sparse direct)
Time Step Δt = 5.0
Settling Time t* = 420.0 (~84 time steps)
Convergence L² error < 10&sup4;
Grids Tested 21×21  ·  25×25  ·  31×31
Report LaTeX  ·  Overleaf
// Methodology

Approach

01
Problem Formulation

Defined the 2D Poisson and heat equations on a unit domain with mixed Dirichlet and Neumann boundary conditions. Gaussian heat source centered at (0.7, 0.6).

02
Spatial Discretization

Applied second-order central finite differences on an Nx × Ny interior grid. Assembled a sparse Laplacian matrix L with at most five nonzeros per row — symmetric negative semi-definite.

03
Boundary Conditions

Dirichlet conditions enforced directly. Neumann and flux conditions handled via ghost cells — bottom boundary ghost cell adds flux contribution 2(0.3)/hy to the right-hand side.

04
Poisson Solver

Formed the linear system αLu = -κ - αb_bc and solved directly using MATLAB's backslash operator, which employs UMFPACK sparse direct factorization.

05
Crank-Nicolson

Advanced the heat equation using the unconditionally stable Crank-Nicolson scheme with Δt = 5.0. Reused the same L matrix and boundary vector from the Poisson solver for consistency.

06
Grid Sensitivity

Verified mesh independence on 21×21, 25×25, and 31×31 grids. Confirmed transient solution converges to Poisson steady state at t* = 420.0, validating both implementations.

// Results

Key Findings

Poisson Steady-State Solution

Solution ranges from 0.14 to 1.24, with peak values concentrated in the lower-right region. High values result from the combined influence of the Gaussian heat source, the upward flux at the bottom boundary, and zero-flux accumulation at the right boundary. The left and top boundaries impose sinusoidal profiles creating a characteristic saddle-like structure near y = 1.

Transient Heat Equation Convergence

Starting from a uniform zero initial condition, the Crank-Nicolson scheme converges at t* = 420.0 after approximately 84 time steps. The relative L² deviation from the Poisson steady state drops below 10&sup4;, and the transient solution is visually indistinguishable from the steady state — confirming both solvers are consistent and correctly implemented.

Mesh Independence

Solution structure and maximum values remained consistent across all three grid resolutions (21×21, 25×25, 31×31), confirming the results are mesh-independent and the discretization is correctly converged.

// Skills

Skills Demonstrated

Numerical Methods
  • Finite Difference Discretization
  • Sparse Matrix Assembly
  • Crank-Nicolson Time Stepping
  • L² Error Convergence Criteria
  • Ghost Cell Boundary Treatment
Software & Implementation
  • MATLAB
  • Sparse Linear Systems
  • UMFPACK Direct Factorization
  • Backslash Operator
  • LaTeX Report Writing
Engineering Analysis
  • 2D Heat Transfer Modeling
  • Mixed Boundary Conditions
  • Mesh Independence Study
  • Steady-State vs. Transient Analysis
  • PDE Formulation
Back ← Portfolio