Abstract
The Method of Manufactured Solution (MMS) is a powerful technique for code verification. It provides a systematic procedure for generating analytical solutions to be discretized by a numerical solver. Usually, an arbitrary continuous solution is selected before being inserted into the governing equations. Although sufficient in many situations, this procedure may be inappropriate if the problem at hand imposes some constraints on the shape of the manufactured solutions. In such cases, some unknown parameters should be included in the continuous solution and computed to satisfy the imposed constraints. This limitation of the standard MMS has already been recognized in previous work. However, the way to handle it is most of the time case-dependent and based on ad-hoc strategies. In this work, we develop a generic framework based on the Sympy library to produce manufactured solutions complying with arbitrary complex Dirichlet and Neumann-type conditions. It is made available through an open-source Python software. As a challenging illustrative application, analytical solutions obeying the interface jumps conditions of a two-phase compressible Navier–Stokes system are built.






Similar content being viewed by others
References
Roache, P.J.: Verification and validation in computational science and engineering, vol. 895. Hermosa, Albuquerque (1998)
Knupp, P., Salari, K.: Verification of computer codes in computational science and engineering. CRC Press, Boca Raton (2002)
Oberkampf, W.L., Roy, C.J.: Verification and validation in scientific computing. Cambridge University Press, Cambridge (2010)
Steinberg, S., Roache, P.J.: Symbolic manipulation and computational fluid dynamics. J. Comput. Phys. 57(2), 251–284 (1985)
Roache, P.J.: The Method of manufactured solutions for code verification. In: Beisbart, C., Saam, N.J. (eds.) Computer simulation validation, pp. 295–318. Springer, Cham (2019)
Freno, B.A., Carnes, B.R., Brunini, V.E., Matula, N.R.: Nonintrusive manufactured solutions for non-decomposing ablation in two dimensions. J. Comput. Phys. 463, 111237 (2022)
Folkner, D., Katz, A., Sankaran, V.: Design and verification methodology of boundary conditions for finite volume schemes. Comput. Fluids 96, 264–275 (2014)
Bond, R.B., Ober, C.C., Knupp, P.M., Bova, S.W.: Manufactured solution for computational fluid dynamics boundary condition verification. AIAA J. 45(9), 2224–2236 (2007)
Veluri, S.P., Roy, C.J., Luke, E.A.: Comprehensive code verification techniques for finite volume CFD codes. Comput. Fluids 70, 59–72 (2012)
Choudhary, A., Roy, C.J., Dietiker, J.-F., Shahnam, M., Garg, R., Musser, J.: Code verification for multiphase flows using the method of manufactured solutions. Int. J. Multiph. Flow 80, 150–163 (2016)
Choudhary, A., Roy, C.J., Luke, E.A., Veluri, S.P.: Code verification of boundary conditions for compressible and incompressible computational fluid dynamics codes. Comput. Fluids 126, 153–169 (2016)
Étienne, S., Garon, A., Pelletier, D.: Some manufactured solutions for verification of fluid-structure interaction codes. Comput. struct. 106, 56–67 (2012)
Eça, L., Hoekstra, M., Vaz, G.: Manufactured solutions for steady-flow Reynolds-averaged Navier-Stokes solvers. Int. J. Comput. Fluid Dyn. 26(5), 313–332 (2012)
Freno, B.A., Carnes, B.R., Matula, N.R.: Nonintrusive manufactured solutions for ablation. Phys. Fluids 33(1), 017104 (2021)
Crockett, R., Colella, P., Graves, D.T.: A cartesian grid embedded boundary method for solving the poisson and heat equations with discontinuous coefficients in three dimensions. J. Comput. Phys. 230(7), 2451–2469 (2011)
Brady, P., Herrmann, M., Lopez, J.: Code verification for finite volume multiphase scalar equations using the method of manufactured solutions. J. Comput. Phys. 231(7), 2924–2944 (2012)
Grier, B., Figliola, R., Alyanak, E., Camberos, J.: Discontinuous solutions using the method of manufactured solutions on finite volume solvers. AIAA J. 53(8), 2369–2378 (2015)
Woods, C.N., Starkey, R.P.: Verification of fluid-dynamic codes in the presence of shocks and other discontinuities. J. Comput. Phys. 294, 312–328 (2015)
Malaya, N., Estacio-Hiroms, K.C., Stogner, R.H., Schulz, K.W., Bauman, P.T., Carey, G.F.: MASA: a library for verification using manufactured and analytical solutions. Eng. Comput. 29, 487–496 (2013)
Henneaux, D.: PyManufSol. v1.0.0 (2023). https://doi.org/10.5281/zenodo.1234 . https://github.com/henneauxd/PyManufSol
Brglez, Š: Code verification for governing equations with arbitrary functions using adjusted method of manufactured solutions. Eng. Comput. 30(4), 669–678 (2014)
Salari, K., Knupp, P.: Code verification by the method of manufactured solutions. Technical report, Sandia National Lab. (SNL-NM), Albuquerque, NM (United States) (2000)
Ulerich, R., Estacio-Hiroms, K.C., Malaya, N., Moser, R.D.: A transient manufactured solution for the compressible Navier-Stokes equations with a power law viscosity. In: 10th World Congress on Computational Mechanics, pp. 1–16 (2012)
Navah, F., Nadarajah, S.: A comprehensive high-order solver verification methodology for free fluid flows. Aerosp. Sci. Technol. 80, 101–126 (2018)
Henneaux, D., Schrooyen, P., Ricardo Barros Dias, B., Turchi, A., Chatelain, P., Magin, T.: Extended discontinuous Galerkin method for solving gas-liquid compressible flows with phase transition. In: AIAA AVIATION 2020 FORUM, p. 2971 (2020)
Henneaux, D., Schrooyen, P., Arbaoui, L., Chatelain, P., Magin, T.E.: A high-order level-set method coupled with an extended discontinuous Galerkin method for simulating moving interface problems. In: AIAA AVIATION 2021 FORUM, p. 2742 (2021)
Henneaux, D., Schrooyen, P., Chatelain, P., Magin, T.E.: High-order enforcement of jumps conditions between compressible viscous phases: an extended interior penalty discontinuous Galerkin method for sharp interface simulation. Comput. Methods Appl. Mech. Eng. 415, 116215 (2023)
Funding
The first author is supported by the Fonds de la Recherche Scientifique (FNRS) of Belgium, under a FRIA grant, no. 1.E.077.20F.
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflict of interest
The authors have no Conflict of interest to declare that are relevant to the content of this article.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Appendices
Example of Manufactured Solutions Incompatible with the Proposed Methodology
To illustrate the limitations of the current framework concerning the imposition of Neumann or Robin boundary/interface conditions, discussed in Sect. 2.2.2, we consider the example of the test case in Sect. 4.2. Instead of an horizontal interface, let’s consider the most general case of an interface whose normal vector depends on both spatial coordinates,
Let’s focus on the shape of the manufactured temperature field in phase 2 that we keep dependent only on the y coordinate,
with f(y) a general function. The energy jump condition, i.e. the last equation in Eq. (21), can be rewritten by isolating the jump of the normal heat flux on one side,
Because of the dependence to (x, y) of all the terms in Eq. (29), the assumption that \(\lambda _{T,2}\) is a constant was wrong, i.e.
This forces us to correct the energy jump, Eq. (29), such that
It is now clear from Eq. (31), which involves the unknown \(\lambda _{T,2}\) and one of its derivatives, that the system that would need to be solved is a non-linear differential algebraic system. As the solution of such system in a symbolic manner appears to be particularly intricated, we decided to select a priori the shape of the manufactured solution and the geometry of the interface or domain boundaries such that a standard algebraic system needs to be solved instead.
Example of PyManufSol MS Generation
An example of Python script importing the various modules of the PyManufSol software is given below. It is the one used to create the test case in Sect. 4.2.



Rights and permissions
Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.
About this article
Cite this article
Henneaux, D., Schrooyen, P., Chatelain, P. et al. A General Methodology for Symbolically Generating Manufactured Solutions Satisfying Prescribed Conditions: Application to Two-phase Flows Equations. Math.Comput.Sci. 18, 5 (2024). https://doi.org/10.1007/s11786-024-00584-z
Received:
Revised:
Accepted:
Published:
DOI: https://doi.org/10.1007/s11786-024-00584-z
Keywords
- Manufactured solution
- Symbolic algebraic system
- Code verification
- Open-source python software
- Computational fluid dynamics