scholarly journals Rigorous Code Verification: An Additional Tool to Use With the Method of Manufactured Solutions

Author(s):  
Aaron M. Krueger ◽  
Vincent A. Mousseau ◽  
Yassin A. Hassan

Abstract The Method of Manufactured Solutions (MMS) has proven to be useful for completing code verification studies. MMS allows the code developer to verify that the observed order-of-accuracy matches the theoretical order-of accuracy. Even though the solution to the partial differential equation is not intuitive, it provides an exact solution to a problem that most likely could not be solved analytically. The code developer can then use the exact solution as a debugging tool. While the order-of-accuracy test has been historically treated as the most rigorous of all code verification methods, it fails to indicate code “bugs” that are of the same order as the theoretical order-of-accuracy. The only way to test for these types of code bugs is to verify that the theoretical local truncation error for a particular grid matches the difference between the manufactured solution (MS) and the solution on that grid. The theoretical local truncation error can be computed by using the modified equation analysis (MEA) with the MS and its analytic derivatives, which we call modified equation analysis method of manufactured solutions (MEAMMS). In addition to describing the MEAMMS process, this study shows the results of completing a code verification study on a conservation of mass code. The code was able to compute the leading truncation error term as well as additional higher-order terms. When the code verification process was complete, not only did the observed order-of-accuracy match the theoretical order-of-accuracy for all numerical schemes implemented in the code, but it was also able to cancel the discretization error to within roundoff error for a 64-bit system.

Author(s):  
Aaron M. Krueger ◽  
Vincent A. Mousseau ◽  
Yassin A. Hassan

Abstract The method of manufactured solutions (MMS) has become increasingly popular in conducting code verification studies on predictive codes, such as nuclear power system codes and computational fluid dynamic codes. The reason for the popularity of this approach is that it can be used when an analytical solution is not available. Using MMS, code developers are able to verify that their code is free of coding errors that impact the observed order of accuracy. While MMS is still an excellent tool for code verification, it does not identify coding errors that are of the same order as the numerical method. This paper presents a method that combines MMS with modified equation analysis (MEA), which calculates the local truncation error (LTE) to identify coding error up to and including the order of the numerical method. This method is referred to as modified equation analysis methd of manufactured solutions (MEAMMS). MEAMMS is then applied to a custom-built code, which solves the shallow water equations, to test the performance of the code verification method. MEAMMS is able to detect all coding errors that impact the implementation of the numerical scheme. To show how MEAMMS is different than MMS, they are both applied to the same first-order numerical method test problem with a first-order coding error. When there are first-order coding errors, only MEAMMS is able to identify them. This shows that MEAMMS is able to identify a larger set of coding errors while still being able to identify the coding errors MMS is able to identify.


Author(s):  
João Muralha ◽  
Luís Eça ◽  
Christiaan M. Klaij

Abstract Although most flows in maritime applications can be modeled as incompressible, for certain phenomena like sloshing, slamming, and cavitation, this approximation falls short. For these events, it is necessary to consider compressibility effects. This paper presents the first step toward a solver for multiphase compressible flows: a single-phase compressible flow solver for perfect gases. The main purpose of this work is code verification of the solver using the method of manufactured solutions. For the sake of completeness, the governing equations are described in detail including the changes to the SIMPLE algorithm used in the incompressible flow solver to ensure mass conservation and pressure–velocity–density coupling. A manufactured solution for laminar subsonic flow was therefore designed. With properly defined boundary conditions, the observed order of grid convergence matches the formal order, so it can be concluded that the flow solver is free of coding mistakes, to the extent tested by the method of manufactured solutions. The performance of the pressure-based SIMPLE solver is quantified by reporting iteration counts for all grids. Furthermore, the use of pressure–weighted interpolation (PWI), also known as Rhie–Chow interpolation, to avoid spurious pressure oscillations in incompressible flow, though not strictly necessary for compressible flow, does show some benefits in the low Mach number range.


2019 ◽  
Vol 116 ◽  
pp. 103178 ◽  
Author(s):  
Arman Khoshghalb ◽  
Omid Ghaffaripour ◽  
Kaveh Zamani ◽  
Arash Tootoonchi

Sign in / Sign up

Export Citation Format

Share Document