I'm trying to learn about numerically solving PDE by myself.I've been beginning with finite difference method(FDM) for some time because I heard that FDMis the fundament of numerous numerical methods for PDE. So far I've got some basic understanding for FDM and been able to write codes for some simple PDE lay in regular region with the materials I found in the library and Internet, but what's strange is, those materials I've got usually talks little about the treatment of irregular, curved, strange boundary, like this.What's more, I've never seen a easy way to deal with the curved boundary. For example, the book Numerical Solution of Partial Differential Equations - An Introduction (Morton K., Mayers D), which contains the most detailed discussion (mainly in 3.4 from p71 and 6.4 from p199) I've seen until now, has turned to a extrapolation that is really cumbersome and frustrating for me.So, as the title asked, as to the curved boundary, usually how do people deal with it when using FDM? In other words, what's the most popular treatment for it? Or it depends on the type of PDE?Is there a (at least relatively) elegant and high-precision way to deal with the curved boundary? Or it's just an inevitable pain?I even want to ask, do people actually use FDM for curved boundary nowadays? If not, what's the common method for it?Any help would be appreciated.
How to deal with curved boundary condition when using finite difference method?
pde;finite difference;boundary conditions
Answering your last question first, do people actually use FDM for curved boundary nowadays I'd say the answer is no. In the commercial CFD world, 2nd order accurate finite volume schemes are the de-facto industry standard. One of the advantages of FV (and finite element/discontinuous galerkin approaches Jed mentioned) over FD is the much more natural handling of complex boundaries. FD does provide the foundation of a lot of numerical methods (FV included) and it's necessary to learn as a first step, but it's not advisable for large-scale complex problems.As for dealing with complex boundaries in FD, I can think of two canonical ways, one of which is the interpolation/extrapolation method you mentioned. The other is to use body-fitted grid points in physical $(x,y)$ space with a conformal mapping to computational $\xi = \xi(x,y),\eta = \eta(x,y)$ space where $\Delta \xi = \Delta \eta = constant$. Then one can re-write terms like$$\frac{\partial u}{\partial x}=\frac{\partial u}{\partial \xi} \frac{\partial \xi}{\partial x} + \frac{\partial u}{\partial \eta} \frac{\partial \eta}{\partial x}$$where the $\frac{\partial (\xi,\eta)}{\partial (x,y)}$ terms are called metric terms and can be computed at the beginning of a problem (or for a simple domain you might have an exact conformal mapping available), and the $u$ derivatives can be computed on a logically simple computational domain. This process makes the implementation of boundary conditions straightforward, but it requires generating a sufficiently smooth, nominally orthogonal curvilinear mesh.I'd say this body-fitted grid approach is the most popular treatment for dealing with curved boundaries in FD, with the caveat that FD methods themselves are not very popular anymore for complex applications. It's rare to see them still come up in CFD literature except for on very simple domains.