method of manufactured solutions

9
Method of manufactured solutions •The first stage in code verification is to test for problems for which we have analytical solutions. •However, often we have codes that are intended for more complex problems than we can solve analytically. •Codes typically solve differential equations for applied loadings in the form of right hand sides and boundary conditions. •If we cannot solve the differential equation for some representative loading and boundary condition, we can specify a solution, calculate the corresponding loading and boundary

Upload: vui

Post on 22-Feb-2016

57 views

Category:

Documents


0 download

DESCRIPTION

Method of manufactured solutions. The first stage in code verification is to test for problems for which we have analytical solutions. However, often we have codes that are intended for more complex problems than we can solve analytically. - PowerPoint PPT Presentation

TRANSCRIPT

Method of manufactured solutions

Method of manufactured solutionsThe first stage in code verification is to test for problems for which we have analytical solutions.However, often we have codes that are intended for more complex problems than we can solve analytically.Codes typically solve differential equations for applied loadings in the form of right hand sides and boundary conditions.If we cannot solve the differential equation for some representative loading and boundary condition, we can specify a solution, calculate the corresponding loading and boundary conditions, and use them as input to the code.

Beam exampleThe general equations of a beam loaded by a transverse load q(x)

We want to verify a code that solves this problem for any distribution of EI.We can start by comparing the solution for constant EI, since for this case it is easy to obtain an analytical solution.For example, for constant EI and constant q, integrating to obtain a quartic polynomial is very easy, and solution can be found in Mechanics of Materials textbooks.

Manufactured solution for beamWe next want to test code for varying EI, for example EI=cos(x/L) with clamped boundary conditions

Instead of specifying load and trying to find an analytical solution, we will specify the solution w=x2 and calculate the load

We will now apply this load and check whether our code will produce w=x2

General procedure (V&CSC 6.3.1)Establish the mathematical model in the form L(u)=0, where L() is the differential operator and u is the dependent variable.Choose the analytic form of the manufactured solution um.Operate the mathematical model L onto the manufactured solution um and obtain the analytic source term s=L(um).Obtain the modified mathematical model by including the analytic source term L(u)=s(Mine) check whether the code produces the manufactured solution under the action of s.

Top Hat questionYou wrote a code to solve the algebraic equation cosx+7tan(ln(x))=aFor a series of values of a.What value of a will you test the code on in the spirit of manufactured solutions?Assume that the equation gives numerical problems to your favorite root solver, and this is why you wrote your own code to solve it.

RemarksManufactured solutions do not need to be physically realistic, but care must be taken that they do not crash the code (e.g. square root of negative temperature).When multiple terms appear in the equations, manufactured solutions should not make one term dominant because this will not verify the other terms.Trigonometric and exponential functions are good for manufactured solutions because they are infinitely differentiable.Having a manufactured solution that varies slowly will allow convergence with coarse meshes, hence inexpensive.

Example of MMS with order verification6.3.4.1 Steady state heat conductionA discrete solution described in 6.3.4.1 was proven to have second order convergence, which needed to be verified for the code implementing it.Manufactured solution that was used

What is needed to generate the manufactured solution besides the source term?

GridsFive grids were used 9x9, 17x17, 33x33, 65x65, and 129x129 nodes.Grids are non-uniform to cater to how fast solution is changing.

Grid convergenceObserved order of accuracy