Skip to main content
Log in

A General Methodology for Symbolically Generating Manufactured Solutions Satisfying Prescribed Conditions: Application to Two-phase Flows Equations

  • Published:
Mathematics in Computer Science Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6

Similar content being viewed by others

References

  1. Roache, P.J.: Verification and validation in computational science and engineering, vol. 895. Hermosa, Albuquerque (1998)

    Google Scholar 

  2. Knupp, P., Salari, K.: Verification of computer codes in computational science and engineering. CRC Press, Boca Raton (2002)

    Book  Google Scholar 

  3. Oberkampf, W.L., Roy, C.J.: Verification and validation in scientific computing. Cambridge University Press, Cambridge (2010)

    Book  Google Scholar 

  4. Steinberg, S., Roache, P.J.: Symbolic manipulation and computational fluid dynamics. J. Comput. Phys. 57(2), 251–284 (1985)

    Article  MathSciNet  Google Scholar 

  5. 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)

    Chapter  Google Scholar 

  6. 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)

    Article  MathSciNet  Google Scholar 

  7. Folkner, D., Katz, A., Sankaran, V.: Design and verification methodology of boundary conditions for finite volume schemes. Comput. Fluids 96, 264–275 (2014)

    Article  MathSciNet  Google Scholar 

  8. 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)

    Article  Google Scholar 

  9. Veluri, S.P., Roy, C.J., Luke, E.A.: Comprehensive code verification techniques for finite volume CFD codes. Comput. Fluids 70, 59–72 (2012)

    Article  MathSciNet  Google Scholar 

  10. 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)

    Article  MathSciNet  Google Scholar 

  11. 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)

    Article  MathSciNet  Google Scholar 

  12. Étienne, S., Garon, A., Pelletier, D.: Some manufactured solutions for verification of fluid-structure interaction codes. Comput. struct. 106, 56–67 (2012)

    Article  Google Scholar 

  13. 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)

    Article  MathSciNet  Google Scholar 

  14. Freno, B.A., Carnes, B.R., Matula, N.R.: Nonintrusive manufactured solutions for ablation. Phys. Fluids 33(1), 017104 (2021)

    Article  Google Scholar 

  15. 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)

    Article  MathSciNet  Google Scholar 

  16. 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)

    Article  MathSciNet  Google Scholar 

  17. 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)

    Article  Google Scholar 

  18. 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)

    Article  MathSciNet  Google Scholar 

  19. 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)

    Article  Google Scholar 

  20. Henneaux, D.: PyManufSol. v1.0.0 (2023). https://doi.org/10.5281/zenodo.1234 . https://github.com/henneauxd/PyManufSol

  21. Brglez, Š: Code verification for governing equations with arbitrary functions using adjusted method of manufactured solutions. Eng. Comput. 30(4), 669–678 (2014)

    Article  Google Scholar 

  22. Salari, K., Knupp, P.: Code verification by the method of manufactured solutions. Technical report, Sandia National Lab. (SNL-NM), Albuquerque, NM (United States) (2000)

  23. 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)

  24. Navah, F., Nadarajah, S.: A comprehensive high-order solver verification methodology for free fluid flows. Aerosp. Sci. Technol. 80, 101–126 (2018)

    Article  Google Scholar 

  25. 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)

  26. 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)

  27. 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)

    Article  MathSciNet  Google Scholar 

Download references

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

Authors

Corresponding author

Correspondence to David Henneaux.

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,

$$\begin{aligned} \textbf{n}_\Gamma = (n_{x,\Gamma }, \, n_{y,\Gamma }) (x,y) . \end{aligned}$$

Let’s focus on the shape of the manufactured temperature field in phase 2 that we keep dependent only on the y coordinate,

$$\begin{aligned} \widetilde{T}_{2}(y) = \lambda _{T,2} \, f(y) \, \end{aligned}$$

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,

$$\begin{aligned} \lambda _{T,2} \, \kappa _2 \, \left[ \frac{\text {d} f}{\text {d} y} n_y \right] \big |_{x_{\Gamma }, y_{\Gamma }} - \kappa _1 \, \left[ \frac{\text {d} \widetilde{T}_{1}}{\text {d}y} n_y \right] \big |_{x_{\Gamma }, y_{\Gamma }} = J(x,y, \lambda _{T,2}) \big |_{x_{\Gamma }, y_{\Gamma }} . \end{aligned}$$
(29)

Because of the dependence to (xy) of all the terms in Eq. (29), the assumption that \(\lambda _{T,2}\) is a constant was wrong, i.e.

$$\begin{aligned} \lambda _{T,2} = \text {constant} \Rightarrow \lambda _{T,2} = \lambda _{T,2}(x,y) . \end{aligned}$$
(30)

This forces us to correct the energy jump, Eq. (29), such that

$$\begin{aligned} \kappa _2 \, \left[ \frac{\partial \lambda _{T,2}}{\partial y} \, f \, n_y \right] \big |_{x_{\Gamma }, y_{\Gamma }} + \kappa _2 \, \left[ \lambda _{T,2} \, \frac{\text {d} f}{\text {d} y} n_y \right] \big |_{x_{\Gamma }, y_{\Gamma }} - \kappa _1 \, \left[ \frac{\text {d} \widetilde{T}_{1}}{\text {d}y} n_y \right] \big |_{x_{\Gamma }, y_{\Gamma }} = J(x,y, \lambda _{T,2}) \big |_{x_{\Gamma }, y_{\Gamma }} . \end{aligned}$$
(31)

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.

figure a
figure b
figure c

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.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

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

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s11786-024-00584-z

Keywords

Mathematics Subject Classification

Navigation