brooksmoses: (Two)
[personal profile] brooksmoses
So this computer program I was writing this week (simulating flow around a cylinder) isn't working right.



It turns out that pure second-order spatial discretization with first-order explicit Euler timestepping is unstable for inviscid compressible flow. Because the combined fluid equations, discretized in space, are a second-order differential equation with a negative real coefficient, and thus the solution's on the imaginary axis, and a first-order explicit Euler timestep has a stability region that's a circle centered on the negative real axis and only touching the imaginary axis, so of course it doesn't ever get stable although it gets really really close if I make the timesteps small.

And that's why including the viscosity, when I was doing that by accident, makes such a difference -- it pushes the poles slightly into the negative real side of things, and suddenly we've got an actual stability region. A pretty tiny one, though, it seems, still.

And I should have remembered this, because that was actually a very specific example from one of the classes that I've taken. I don't remember where, but it somewhere I have a memory of the information that a second-order spatial discretization and a first-order explicit Euler timestepping -- that being the simplest and most obvious way to approach the problem -- doesn't work even with the hack of making the timestep really small and letting the machine crunch forever.

And, of course, once I remembered that, I felt like I should have remembered it in the first place.... But I'd thought I also remembered that a staggered grid fixed the problem, and I didn't really investigate that much. Now that my memory is cleared with being reminded, I remember that the staggered grid just fixes the checkerboarding problem; it doesn't actually add any other stability. And using a timestepping method -- say, an RK-5 for the sake of genericity, although I think a predictor-corrector step might work as well -- that's got a stability region that covers a reasonable bit of the imaginary axis ought to fix the stability problem, but it wouldn't fix the checkerboarding if I'd used a colocated grid (like my other code uses), and that's a fair part of what all the artificial dissipation takes care of.

So I understand now. Whee! All I have to do is implement it, and that should fix that (large) bug.


And I post the above, on the grounds that it was pretty much exactly my thought process as I was walking home tonight, and I figure that enough of my friends-of list presumed-readers write sf and can use it with words substituted as a template for technobabble as she is spoke by a Real Engineer(tm), with all the caveats and entertainments thereby implied. And there's always the amusing possibility that someone might understand.

It's also a good argument for the existence of jargon; there are at least a half-dozen words in there that would take a couple of paragraphs to explain in non-jargon terms, and there's no way to have a thought-pattern like that if you've got to stop every half-sentence and explain all that.

On the other hand, I could probably outline a fairly complete computational fluid mechanics course that did little more than explain the above post. *grin*

- Brooks

Date: 2002-10-05 01:51 am (UTC)
From: [identity profile] oneironaut.livejournal.com
This was more confusing on first skimming, because I thought I understood some of the jargon: I was reading 'Euler' as 'Eular [angles]', a kind of rotational matrix.

Now I know I don't understand a word, and I can let my eyes glaze peaceably over.

Date: 2002-10-05 02:59 am (UTC)
From: [identity profile] oneironaut.livejournal.com
Huh. Well, color me corrected. I've been spelling it wrong all this time. (I've been committing another, similar malapropism for a while that I only discovered recently, but I can't remember ... oh, I've been using 'lacunar', which makes sense so long as one carefully ignores the dictionary, and sounds right, but refers to a sort of architectural phenomenon, for 'lacunal', which makes sense but sounds wrong, damn it. End digression.)

But I can still rest content in my glazing-over-of-eyes, so it's okay, it's just mildly embarrassing.

Date: 2002-10-05 02:47 pm (UTC)
kiya: (snug)
From: [personal profile] kiya
Whereas I found that, like a lot of things, it makes overall sense but I don't have the vocab to make particular sense of it, even if my ability to use language were . . . extant.
Page generated Jan. 20th, 2026 06:28 pm
Powered by Dreamwidth Studios