]> No Title

of course the problem is deciding which result to trust as being at least as accurate as your own result; this of course is something that cannot be determined in a rigorous way, it requires a judgment call based on your experience.

Scrutinizing computer solutions

(Thispart is $\mathit{b}\mathrm{\setminus }\mathit{e}\mathit{y}\mathit{o}\mathit{n}\mathit{d}$ what ${\mathit{I}}_{\mathit{\theta }\mathit{j}}\mathit{\phi }\mathit{e}\mathit{c}{\mathit{r}}_{\mathrm{\bigvee }}\mathit{y}\mathit{o}\mathit{u}$ to knowforAME 101 but Iincluude itfor comple teness).

$\mathrm{S}\stackrel{\mathrm{˙}}{\mathrm{L}}$mjlar to analyses, I often see computational results that I can tell within 5 seconds must be wrong.

It is notoriously easy to be lulled into a sense of confi dence in computed results, because

the computer always gives you some result, and that result always looks good when plotted

in a $\mathrm{3}\mathrm{D}$ shaded color orthographic projection. The corresponding ""smoke test,“ ""function test,“ and ""performance test,“ are as follows:

1. Smoke test. Start the computer program running, and see if it crashes or not. If it doesn't crash, you've passed the smoke test, part (a). Part (b) of the smoke test is to determine if the computed result passes the global conserv ation test. The goal of any program is to satisfy mass, momentum, energy and atom conservation at every point in the $\mathit{c}\mathit{o}\mathrm{Reject}\mathit{r}\mathit{p}\mathit{u}\mathit{t}\mathit{a}{J}\mathit{l}\mathit{o}\mathit{n}\mathit{a}\mathit{l}$ domain subject to certain constituitive relations (e.g., Newton's law of viscosity ${\mathit{\tau }}_{\mathrm{x}}\mathrm{=}\mathit{\mu }\mathrm{\partial }{\mathrm{u}}_{\mathrm{x}}\mathrm{/}\mathrm{\partial }\mathrm{y}$), Hooke's Law $\mathrm{=}\mathrm{E}\mathit{\epsilon }$) and equations of state (e.g., the ideal gas law.) This is a hard problem, and it is even hard to verify that the solution is correct once it is obtained. But it is easy to determine whether or not global conservation is satisfied, that is,

$\mathrm{•}$ Is mass conserved, that is, does the sum of all the mass fluxes at the inlets, minus the mass fluxes at the outlets, equal to the rate of change of mass of the system $\mathrm{\left(}\mathrm{=}\mathrm{0}$ for steady problems)

$\mathrm{•}$ Is momentum conserved in each coordinate directioni)

$\mathrm{•}$ Is energy conservedi)

$\mathrm{•}$ Is each type of atom conservedi)

If not, you are 100% certain that your calculation is wrong. You would be amazed at how many results are never ""sanity checked“ in this way, and in fact fail the sanity check when, after months or years of effort and somehow the results never look right, someone finally gets around to checking these things, the calculations fail the test and you realize all that time and effort was wasted.

2. Pejfopyvance test. Comes before the function test in this case. For computational studies, a critical performance test is to comparee $\mathrm{\sim }\mathit{y}\mathit{o}\mathit{u}\mathit{r}$ re sult to a known $\mathit{a}\mathit{n}{\mathit{a}}_{\mathrm{\bigvee }}\mathit{l}{\mathit{y}}^{\mathit{\gamma }\mathit{p}}\mathit{c}\mathit{a}\mathit{l}$ re sult under $\mathrm{J}\mathit{l}\mathrm{Reject}\mathit{r}\mathit{p}{\mathit{l}}_{\mathit{l}}\mathit{f}\mathit{l}\mathit{e}\mathit{d}$ conditions. For example, if you're computing flow in a pipe at high Reynolds numbers (where the flow is turbulent), with chemical reaction, temperature‐dependent transport properties, variable density, etc., first

check your result against the textbook solution that assumes constant density, constant transport properties, etc., by making all of the simplifying assumptions (in your model) that the

analytical solution employs. If you don't do this, you really have no way of knowing if your

model is valid or not. You can also use previous computations by yourself or others for testing, but of course there is no absolute guarantee that those computations were correct.

3. Function test. $\mathrm{S}\stackrel{\mathrm{˙}}{\mathrm{L}}$mjlar to function test for analyses.

13