
Adding Convective Boundary Conditions for a 2D Heat Diffusion Problem
Boundary conditions are fundamental to solving partial differential equations (PDEs), but not all are
equally simple to implement. While Dirichlet boundary conditions are straightforward in NVIDIA
Modulus, adding Neumann or convective boundary conditions can be a bit more challenging. During my
internship at AnK, I explored and implemented two methods to incorporate convective boundary
conditions into a 2D heat diffusion problem. Here’s a walkthrough of my approach and insights.
Problem Definition
The task involved solving a 2D heat diffusion problem on a glass slab with convective boundary
conditions applied to three walls (top, right, and bottom). The fourth wall (left) was treated with a
zero-flux (Neumann) boundary condition.
This problem posed an excellent opportunity to dive deep into NVIDIA Modulus and understand its
flexibility for modeling complex boundary conditions.
Two Methods for Adding Convective Boundary Conditions
1. Defining a Custom Class
For the left wall’s zero-flux boundary condition, NVIDIA Modulus provides a built-in class, GradNormal,
which calculates the gradient normal to the wall. This class can be used directly: