# Guidelines for choosing manufactured solutions for numerical PDE schemes

When testing a numerical method for a PDE, I know that it's often useful to compare it to a known analytical solution. If none is available, one can always 'manufacture' a solution, substitute it into the PDE and obtain the source term, boundary conditions, and initial conditions needed for the problem.

But what guidelines should I follow for choosing an appropriate 'manufactured' solution to test the scheme on? What qualities should the manufactured solution have?

After some thought, I've come up with the following considerations:

1. Sufficient Smoothness - Whatever the highest order derivative is in the PDE (for any variable), the manufactured solution should have at least this degree of smoothness within the domain of the problem.
2. Physically Plausible Coefficients - Non-negative values for coefficients that are physically positive.
3. Appropriate Scaling - A non-dimensional version of the problem should be used, if possible.

However, my main concern is manufacturing a solution that can adequately capture the theoretical order of accuracy. Is there anything else i should consider in the properties of the manufactured solution to ensure that the theoretical order of accuracy will be captured?

Are there anything else I should generally consider when choosing a manufactured solution?

• (1) could be rephrased as requesting a classical solution. It's usually preferred to choose smooth ($C^\infty$) manufactured solutions so that (if implemented correctly) you can expect to attain the design order of accuracy for any convergent discretization. Commented Jun 15, 2014 at 4:29

The typical approach to this problem is to use infinitely smooth functions like trigonometric, inverse trig, exponential, etc. There's a handy library called MASA that has a library of manufactured solutions and makes it easy to make your own.

Your PDE coefficients will become parameters in the forcing function that your chosen solution leads to, so you should probably choose your PDE coefficients as you would when solving your real problem. The problem here is that often these coefficients lead to interesting solution features that you want to see if your numerical method/discretization captures, like, say, a boundary layer, but no matter what you choose for these coefficients your manufactured solution and its associated forcing function can hide such features completely.

MMS is good for testing whether your method is implemented correctly and achieves the correct order of accuracy as you refine the mesh, but it's bad at determining whether or not your method captures the solution features implicit in the PDE and its coefficients (like layers or turbulence).

Your #3 is up to you, but it's not a requirement of MMS or even good MMS. You should manufacture solutions that correspond to the form of the PDE you actually want to solve for real problems.