Reflections on the NaN Temperature bug

Started by bjo0rn, March 12, 2015, 02:23:39 PM

Previous topic - Next topic

bjo0rn

I'm taking a course in mathematical modeling of casting where we're writing a code for simulating heat flow and solidification. I just wanted to say I'm amused by Tynan's entry in the change log for Alpha9e:
Quote from: TynanFixed a bug that caused temperatures indoors to sometimes become NaN (not a number)
...because I was struggling with this very symptom.

In my case the bug was caused by my use of infinite heat transfer coefficients between nodes within a material (legit according to the book). Despite Matlab's capabilits to handle infinite numbers, subtracting infinite from infinite turned out to be a hard nut to crack (hence NaN), so I had to implement an ad-hoc workaround. It was not trivial to find the source of the problem because the heat transfer was solved implicitly, meaning that depsite the NaN value originating from a specific node the value propagated to all nodes.

Though I'd be surpriced if the source of Tynan's problem was of the same nature as I'm sure his modeling of heat flux is quite different.