Computational Methods in Engineering

Chapter 8
Partial Differential Equations and Discretization Frameworks

Post Graduate Program in Mechanical Engineering
Computational Methods in Engineering   •   Post Graduate

8. Partial Differential Equations and Discretization Frameworks

Introduction and Context

Partial differential equations (PDEs) describe physical systems in which a dependent variable varies with two or more independent variables. In mechanical engineering, temperature in a solid, pressure and velocity in a fluid, displacement in an elastic body, and concentration in a reacting medium are commonly governed by PDEs. Unlike ordinary differential equations, PDEs represent the combined effects of spatial variation, temporal evolution, transport, diffusion, and source generation.

Analytical solutions exist only for a limited class of geometries, material laws, boundary conditions, and initial conditions. Engineering analysis therefore relies heavily on numerical discretization. A continuous domain is replaced by a finite collection of nodes, elements, or control volumes, and the differential equations are transformed into algebraic equations that can be solved computationally.

The quality of a numerical solution depends not only on the algebraic solver but also on the classification of the PDE, the choice of discretization framework, the treatment of boundaries, and the stability and convergence properties of the resulting scheme. This chapter develops these ideas for finite-difference, finite-volume, weighted-residual, and spectral methods.

Learning Objectives

After studying this chapter, the reader should be able to:

1. Classify second-order PDEs as elliptic, parabolic, or hyperbolic.

2. Relate PDE type to physical behaviour and boundary or initial data.

3. Derive representative finite-difference approximations and assess their truncation error.

4. Formulate conservation laws using the finite-volume method.

5. Explain weighted-residual, Galerkin, and spectral discretizations.

6. Apply appropriate boundary treatments to different numerical frameworks.

7. Analyse consistency, stability, convergence, and numerical diffusion.

8. Select a discretization method for practical mechanical-engineering problems.

The Structure and Classification of PDEs

A general linear second-order PDE in two independent variables may be written as

A u_xx + B u_xy + C u_yy + D u_x + E u_y + F u = G.

Its type is determined by the discriminant Δ = B² − 4AC:

  • Elliptic: Δ < 0
  • Parabolic: Δ = 0
  • Hyperbolic: Δ > 0

This classification is not merely algebraic. It determines how information propagates and what data are mathematically appropriate.

Elliptic equations

The steady heat-conduction equation,

∇ · (k∇T) + Q = 0,

is elliptic when thermal conductivity is positive. Laplace’s equation, ∇²u = 0, and Poisson’s equation, ∇²u = f, are canonical examples. Elliptic problems describe equilibrium or spatially smooth states. Information effectively influences the entire domain, so boundary conditions are required around the boundary. Typical conditions are prescribed value (Dirichlet), prescribed normal flux (Neumann), or a combination (Robin condition).

Parabolic equations

The transient diffusion equation,

∂u/∂t = α∇²u + s,

is parabolic. It describes the gradual smoothing of gradients, as in transient heat conduction or species diffusion. A parabolic problem requires an initial condition throughout the domain and suitable boundary conditions for each time level. Disturbances propagate with theoretically infinite speed in the diffusion model, although their amplitude decreases rapidly with distance.

Hyperbolic equations

The wave equation,

∂²u/∂t² = c²∇²u,

and the inviscid advection equation,

∂u/∂t + a∂u/∂x = 0,

are hyperbolic. They describe finite-speed propagation of information, waves, and dominant transport. Boundary data are required primarily at inflow boundaries, while initial data are essential. Imposing conditions at an outflow boundary can overconstrain the problem and generate reflections or instability.

For variable-coefficient or nonlinear equations, classification may vary from point to point. Compressible-flow equations, for example, can contain elliptic, parabolic, and hyperbolic regions depending on the local Mach number and physical model.

Important Numerical Concepts

A computational grid or mesh divides the physical domain into discrete locations. In finite-difference methods, unknowns are usually associated with grid points. In finite-volume methods, they are associated with control volumes. In finite-element and weighted-residual methods, the solution is represented through basis functions over elements. Spectral methods use globally smooth basis functions.

The exact solution u is approximated by u_h. The residual is the error obtained when u_h is substituted into the governing differential equation. A consistent method makes the residual approach zero as the mesh size h and, where relevant, time step Δt approach zero. Stability means that errors, including round-off and perturbations, remain bounded under the prescribed discretization. Convergence means that u_h approaches u as the discretization is refined. The Lax equivalence theorem states, for a well-posed linear initial-value problem, that consistency plus stability implies convergence.

The order of accuracy describes the leading truncation error. A second-order spatial approximation has an error proportional to h², whereas a first-order approximation has an error proportional to h. Accuracy, however, does not guarantee physical realism: an unstable or nonconservative method may remain unsuitable even when its formal order is high.

Finite-Difference Discretization

Finite differences replace derivatives by algebraic differences between neighbouring nodal values. On a uniform grid, Taylor expansion gives

u_x|_i ≈ (u_{i+1} − u_{i-1})/(2Δx),

with truncation error O(Δx²), and

u_xx|_i ≈ (u_{i+1} − 2u_i + u_{i-1})/Δx²,

also with error O(Δx²). A forward difference, (u_{i+1} − u_i)/Δx, is first-order accurate, while a backward difference is appropriate when information enters from the opposite direction.

For the one-dimensional steady diffusion equation, d²u/dx² = f(x), the central approximation produces

(u_{i-1} − 2u_i + u_{i+1})/Δx² = f_i.

The resulting coefficient matrix is sparse and tridiagonal for a one-dimensional uniform grid.

Time discretization

For the diffusion equation u_t = αu_xx, the forward-Euler, central-space (FTCS) scheme is

u_i^{n+1} = u_i^n + r(u_{i+1}^n − 2u_i^n + u_{i-1}^n),

where r = αΔt/Δx². Von Neumann analysis gives the stability condition r ≤ 1/2 in one dimension. In two dimensions on a uniform grid, the corresponding condition is r_x + r_y ≤ 1/2, where r_x = αΔt/Δx² and r_y = αΔt/Δy².

The backward-Euler scheme is implicit:

u_i^{n+1} − r(u_{i+1}^{n+1} − 2u_i^{n+1} + u_{i-1}^{n+1}) = u_i^n.

It is unconditionally stable for the linear diffusion equation, although large time steps may produce excessive temporal error. The Crank–Nicolson method averages explicit and implicit diffusion terms and is second-order accurate in time, but can exhibit oscillatory behaviour for very large time steps or nonsmooth initial data.

For advection, the central difference can generate nonphysical oscillations when transport dominates diffusion. An upwind approximation, selected according to the sign of velocity, is more robust but introduces numerical diffusion. The cell Peclet number, Pe = |a|Δx/Γ, compares advection with diffusion and is a useful indicator of whether central differencing is likely to be reliable.

Boundary Treatment in Finite Differences

Dirichlet conditions are imposed by assigning the boundary value directly. For a Neumann condition, such as du/dx = q at x = 0, a one-sided difference or a ghost point may be used. A second-order ghost-point relation is

(u_1 − u_{−1})/(2Δx) = q,

which allows u_{−1} to be eliminated from the interior equation. Robin conditions combine value and flux and must be incorporated into the algebraic equation without accidentally changing the intended order of accuracy.

At corners, compatibility between two boundary conditions must be considered. For moving fronts, shocks, or irregular domains, boundary alignment may be difficult; this is one reason finite differences are less geometrically flexible than finite-volume or finite-element methods.

Finite-Volume Discretization and Conservation

The finite-volume method begins with an integral conservation law. For a scalar variable,

∂u/∂t + ∇ · F = S,

integration over a control volume V gives

(d/dt)∫_V u dV + ∮_∂V F · n dA = ∫_V S dV.

Approximating the volume and face integrals produces an equation involving the change of stored quantity, the net flux through faces, and the integrated source. In one dimension,

(u_i^{n+1} − u_i^n)Δx/Δt + F_{i+1/2} − F_{i−1/2} = S_iΔx.

The central strength of this approach is discrete conservation: flux leaving one control volume enters its neighbour with the opposite sign. This property is essential in fluid mechanics, heat transfer, combustion, and porous-media transport.

For diffusion, the face flux can be approximated using a gradient between neighbouring cell centres. For advection, the face value may be obtained by upwind, central, hybrid, QUICK, or higher-resolution bounded schemes. A higher-order reconstruction must be designed carefully: excessive compression can create oscillations, while excessive limiting can reduce accuracy.

Time-step restrictions

For explicit finite-volume transport, the Courant–Friedrichs–Lewy (CFL) condition requires that the numerical domain of dependence contain the physical domain of dependence. For one-dimensional advection, a typical condition is |a|Δt/Δx ≤ 1 for a first-order upwind scheme. Diffusion produces a restriction proportional to Δt ≤ CΔx²/α. Implicit methods relax these restrictions but do not remove accuracy requirements.

Weighted-Residual and Galerkin Formulations

Weighted-residual methods assume an approximate solution

u_h(x) = Σ_j N_j(x)a_j,

where N_j are trial or basis functions and a_j are unknown coefficients. Substitution into the differential equation produces a residual R. The method requires

∫_Ω w_i R dΩ = 0

for selected weighting functions w_i.

In the Galerkin method, w_i = N_i. For a one-dimensional diffusion equation, integration by parts changes the second derivative into first derivatives and produces the weak form

∫_Ω k (dN_i/dx)(du_h/dx) dΩ = ∫_Ω N_i f dΩ + boundary terms.

The resulting matrix equation is K a = b. Essential or Dirichlet boundary conditions are usually imposed directly on the trial space or algebraic system. Natural or Neumann conditions arise from the boundary term in the weak form and can be incorporated into the load vector.

The weak formulation reduces differentiability requirements and handles irregular geometries effectively. It also provides a systematic route to finite-element methods. Stabilized Galerkin approaches, such as streamline-upwind/Petrov–Galerkin formulations, modify the weighting functions to control advection-dominated oscillations.

Spectral Discretization

Spectral methods approximate the solution using high-degree global basis functions, such as Fourier series, Chebyshev polynomials, or Legendre polynomials. For a smooth solution, the error can decrease very rapidly as the number of modes increases, often described as spectral or exponential convergence. A Fourier approximation is particularly effective for periodic domains, while Chebyshev collocation is useful on finite intervals.

In a collocation method, the PDE is enforced at selected points. Differentiation matrices provide numerical derivatives, for example

u_x(x_i) ≈ Σ_j D_ij u(x_j).

Boundary conditions are imposed by replacing selected rows of the discretized operator or by constructing basis functions that satisfy the conditions automatically.

Spectral methods are highly accurate for smooth fields, but their global nature may produce oscillations near discontinuities (the Gibbs phenomenon). They are also less convenient for complex geometries, local refinement, and strongly nonsmooth solutions. Domain decomposition and spectral-element methods combine spectral accuracy with element-based geometric flexibility.

Stability, Accuracy, and Verification

Stability analysis should be performed before extensive computation. Von Neumann analysis assumes a Fourier error mode, e^{ikx}, and determines its amplification factor G. Stability requires |G| ≤ 1 for all resolvable wave numbers. Energy methods and matrix eigenvalue analysis are alternatives for nonperiodic domains or more complex systems.

A stable calculation may still be inaccurate because of coarse spatial resolution, inappropriate time steps, iterative-solver error, or modelling assumptions. Verification asks whether the equations have been solved correctly. Grid-refinement studies, comparison with manufactured solutions, and residual monitoring are verification tools. Validation asks whether the mathematical model represents the physical system adequately and requires comparison with experimental or trusted reference data.

A practical grid study evaluates a quantity of interest on successively refined meshes. If the observed convergence rate agrees with the theoretical order, confidence in the discretization increases. Richardson extrapolation can estimate the limiting value when the asymptotic convergence range has been reached.

An Illustrative Case: Transient Cooling of a Metal Plate

Background

Consider a thin metal plate initially at uniform temperature T_i. Its surfaces are exposed to a coolant maintained at T_∞. For a sufficiently thin plate, a one-dimensional model across thickness x is reasonable:

∂T/∂t = α∂²T/∂x².

Suppose the two outer surfaces satisfy a convective condition, −k∂T/∂n = h(T − T_∞).

Numerical problem

The objective is to predict the centreline temperature and determine the time at which the plate reaches a specified safe temperature. The convective boundary is a Robin condition, so direct assignment of surface temperature would be physically incorrect.

Approach

A cell-centred finite-volume method is selected because it preserves the integrated energy balance. The plate is divided into control volumes. At an interior face, the conductive heat flux is calculated from the temperature difference between adjacent cell centres. At the outer face, the conduction resistance from the cell centre to the surface is combined with the convection resistance to the coolant. An implicit time integration is used to avoid the severe Δt proportional to Δx² restriction associated with explicit diffusion.

At every time step, the discrete equations form a tridiagonal system. The total change in internal energy is checked against the net heat removed by convection. Mesh refinement is performed until the centreline temperature changes by less than the prescribed engineering tolerance.

Outcome and interpretation

The implicit scheme remains stable for the selected time step, but stability alone does not establish accuracy. A coarse mesh may under-resolve the near-surface temperature gradient and produce an incorrect cooling rate. The energy balance provides a conservation check, while comparison with a one-dimensional analytical solution, when available, provides an additional verification test.

Learning points

The case illustrates four important decisions: the PDE type determines the need for an initial condition; the Robin boundary condition must represent both conduction and convection; finite volume is advantageous for energy conservation; and mesh and time-step studies are required even for an unconditionally stable method.

Selection, Limitations, and Professional Practice

Finite differences are efficient on structured grids and are attractive for simple geometries and high-performance simulations. Finite volume is preferred when strict local conservation and complex transport are central. Weighted-residual and finite-element formulations provide geometric flexibility and a rigorous treatment of weak solutions. Spectral methods are powerful for smooth problems requiring very high accuracy.

Common mistakes include applying a hyperbolic boundary condition at every boundary, ignoring coefficient variation at material interfaces, using central differencing for unresolved advection, confusing solver convergence with discretization convergence, and reporting more digits than the mesh supports. Another frequent error is to impose a Neumann condition without checking global compatibility. For a pure Neumann elliptic problem, the solution is determined only up to an additive constant, and the source and boundary fluxes must satisfy an integral balance.

In industrial software, discretization choices influence computational cost, parallel scalability, conservation, and certification evidence. Automated mesh generation, adaptive refinement, residual-based error indicators, and GPU-oriented sparse linear algebra increasingly support engineering workflows. Machine-learning surrogates and physics-informed neural networks may accelerate repeated PDE evaluations, but they do not eliminate the need for well-posed equations, boundary-condition enforcement, numerical verification, and physical validation.

Professional responsibility requires transparent reporting of mesh resolution, time-step restrictions, solver tolerances, boundary conditions, material data, and uncertainty. In safety-critical applications, an apparently smooth numerical field must not be accepted without an assessment of stability, conservation, sensitivity, and model-form error.

Best-Practice Framework

A robust PDE computation generally follows this sequence:

1. Identify the governing equations, domain, coefficients, source terms, and physical scales.

2. Classify the PDE and determine the appropriate initial and boundary data.

3. Select a discretization consistent with geometry, conservation requirements, smoothness, and transport dominance.

4. Derive the discrete equations and boundary treatment before coding.

5. Establish consistency and estimate stability restrictions.

6. Implement diagnostics for residuals, conservation, and physical bounds.

7. Conduct mesh, time-step, and solver-tolerance studies.

8. Compare with analytical solutions, manufactured solutions, benchmark data, or experiments.

9. Document assumptions and quantify uncertainty before using results for design decisions.

Chapter Summary

PDE classification provides the first guide to numerical formulation. Elliptic equations describe equilibrium and require boundary data; parabolic equations describe diffusion and require initial and boundary data; hyperbolic equations describe finite-speed transport and waves, with data entering primarily through initial and inflow conditions. Finite differences offer direct derivative approximations, finite volumes enforce local conservation through flux balances, weighted-residual methods produce weak formulations and flexible basis representations, and spectral methods provide exceptional accuracy for smooth solutions. Boundary conditions must be incorporated in a manner consistent with the governing physics and the order of the scheme. Stability, consistency, convergence, conservation, verification, and validation are distinct requirements. Effective professional practice combines mathematical analysis with mesh studies, physical checks, and transparent reporting.

Key Terms

PDE: An equation involving partial derivatives of an unknown function with respect to multiple independent variables.

Elliptic equation: A PDE type associated primarily with equilibrium and global spatial influence.

Parabolic equation: A PDE type associated with diffusion and time-dependent smoothing.

Hyperbolic equation: A PDE type associated with finite-speed propagation, waves, or dominant advection.

Dirichlet condition: A boundary condition prescribing the value of the dependent variable.

Neumann condition: A boundary condition prescribing the normal derivative or flux.

Robin condition: A linear combination of the variable and its normal flux prescribed at a boundary.

Consistency: The property that the discrete equations approach the differential equation as resolution increases.

Stability: Bounded growth of numerical and perturbation errors.

Convergence: Approach of the numerical solution to the exact solution under refinement.

Truncation error: The local error introduced by replacing derivatives or integrals with discrete approximations.

Finite difference: A method that approximates derivatives using neighbouring discrete values.

Finite volume: A method based on integral conservation over discrete control volumes.

Weighted residual: A method requiring the residual to be orthogonal to selected weighting functions.

Galerkin method: A weighted-residual method using the trial functions as weighting functions.

Spectral method: A method using global, often high-order, basis functions for approximation.

CFL condition: A time-step restriction relating numerical propagation to physical information propagation.

Numerical diffusion: Artificial smoothing introduced by a discretization, especially in transport calculations.

Manufactured solution: A chosen analytical function used to verify a numerical implementation.

Peclet number: A dimensionless ratio comparing advection or transport to diffusion.

Review Questions

Short Answer Questions

1. State the discriminant criterion used to classify a second-order PDE.

2. Why does a parabolic problem require an initial condition?

3. Write the central finite-difference approximation for a second derivative.

4. What is the principal conservation advantage of the finite-volume method?

5. Distinguish consistency from stability.

Long Answer Questions

1. Explain the physical meaning of elliptic, parabolic, and hyperbolic PDEs and relate each type to appropriate data requirements.

2. Derive the FTCS scheme for one-dimensional diffusion and discuss its stability condition.

3. Describe the finite-volume formulation of a scalar conservation law, including face fluxes and source terms.

4. Develop the weak form of a one-dimensional diffusion equation and explain the treatment of essential and natural boundary conditions.

5. Compare finite-difference, finite-volume, Galerkin, and spectral methods for mechanical-engineering applications.

Analytical / Application Questions

1. A one-dimensional explicit diffusion calculation uses α = 1.0 × 10⁻⁵ m²/s and Δx = 0.01 m. Determine the maximum FTCS time step permitted by the one-dimensional stability condition.

2. An advection-dominated calculation exhibits oscillations near a sharp temperature front. Diagnose the likely numerical cause and recommend two possible remedies.

3. A transient plate-cooling simulation is stable but fails an energy-balance check. Identify possible discretization or boundary-treatment errors and propose a verification procedure.

22. Multiple Choice Questions with Answers

Question 1

Which PDE classification is associated with equilibrium problems such as Laplace’s equation?

A. Elliptic

B. Parabolic

C. Hyperbolic

D. Mixed temporal

Correct Answer: A. Elliptic

Question 2

For the one-dimensional FTCS scheme for diffusion, which condition is required for stability?

A. αΔt/Δx² ≥ 1

B. αΔt/Δx² ≤ 1/2

C. αΔt/Δx² = 2

D. Δt/Δx = 0

Correct Answer: B. αΔt/Δx² ≤ 1/2

Question 3

What is the defining conservation property of a finite-volume method?

A. It always has spectral accuracy

B. It eliminates the need for boundary conditions

C. Flux leaving one control volume enters its neighbour oppositely

D. It uses only global basis functions

Correct Answer: C. Flux leaving one control volume enters its neighbour oppositely

Question 4

Which boundary condition prescribes a combination of variable value and normal flux?

A. Dirichlet

B. Neumann

C. Periodic

D. Robin

Correct Answer: D. Robin

Question 5

For advection with positive velocity, which basic difference is generally selected to avoid upstream information violation?

A. Backward upwind difference

B. Forward downwind difference

C. Second derivative difference

D. Random difference

Correct Answer: A. Backward upwind difference

Question 6

In a Galerkin weighted-residual method, the weighting functions are usually:

A. Zero everywhere

B. The same as the trial or basis functions

C. Always Fourier modes

D. Only boundary values

Correct Answer: B. The same as the trial or basis functions

Question 7

What does the CFL condition primarily compare?

A. Mesh cost with memory cost

B. Diffusion with reaction

C. Numerical and physical information propagation

D. Temperature with pressure

Correct Answer: C. Numerical and physical information propagation

Question 8

A spectral method is most likely to provide very rapid convergence when the solution is:

A. Smooth

B. Discontinuous at many points

C. Randomly sampled

D. Undefined at the boundary

Correct Answer: A. Smooth

Question 9

Which statement correctly distinguishes verification from validation?

A. Verification assesses physical realism; validation checks coding errors

B. Verification checks solution of the equations; validation assesses physical adequacy of the model

C. They are identical procedures

D. Validation is performed only through mesh refinement

Correct Answer: B. Verification checks solution of the equations; validation assesses physical adequacy of the model

Question 10

A stable numerical solution changes significantly when the mesh is refined. The most likely conclusion is that:

A. Stability guarantees accuracy

B. The solution is sufficiently converged

C. The discretization error may still be significant

D. The boundary conditions are irrelevant

Correct Answer: C. The discretization error may still be significant

Computational Methods in Engineering
Chapter 8 of 15