03.28.06

My software port has a user!

Posted in Computational Fluid Dynamics at 1:25 pm by Brooks

The good news: Someone’s using my Windows port of OpenFOAM. It’s nice to know that it’s actually going to be useful to somebody.

The bad news: I know this, of course, because they’ve posted a bug report to say it doesn’t work for them.

Turns out that a large part of the problem was fairly obvious in hindsight. The original OpenFOAM package contains environment setup files for both bash and tcsh, and I had modified them both for use under Cygwin. However, since I use tcsh, I had completely neglected to test the bash scripts, and there were several typos in one of them. The other problem was that, since the OpenFOAM port uses a local copy of GCC 4.0.2, rather than the Cygwin system copy of GCC, this user had decided to uninstall his system GCC to avoid any possible confusion – and thereby flushed out a bug where the make system was hardwired to use the C preprocessor installed as /bin/cpp, rather than the one in the local copy of GCC. This one dates back to the original Linux version of the software, so I’ve in turn filed a bug report on that.

Aside from that, there were a number of complications that amounted to reminders that, whenever the build process goes awry, it’s important to clean up any incomplete results so that they won’t perpetuate the problem after the actual bug is fixed.

So, it looks like everything is fixed now, but I’m waiting for a final confirmation that it all works before I push all the bugfixes into a new version and post it.

03.18.06

Fixing AC power plugs in various HP and Compaq laptops

Posted in Assorted Tinkering at 1:48 pm by Brooks

(This is a slightly-edited repost of an article I wrote elsewhere, back in 2004.)

Some time ago, I posted a comment on This Is Broken, noting my frustration with motherboard-mounted AC power jacks on laptops, and noting that I had fixed a couple of them by following some online directions. Several people asked me to explain further, and I decided it would be useful to write up a more detailed explanation of how I did it.

First, the keywords: My experience is with a Compaq Presario 1210 laptop (which is very similar to the Compaq 1600 series), and a pair of HP Pavilion xf235 laptops, but this should apply to most similar laptops; the advice is mostly generic.

The problem, in short, is that most laptops have their AC power jacks hard-mounted to the motherboard just like any other soldered-on component, and for many of them this is the only structural connection. Unlike most other components, though, power jacks regularly get yanked on when someone steps on the power cord or such, and the solder joints (or the mounting tabs, which after all are pretty thin metal) start to fatigue, and eventually they crack. At this point, the laptop will only charge if the plug is twiddled “just so” (if at all), and doesn’t work reliably.

The official solution, of course, is to replace the motherboard — which fixes the symptom, but not the overall design problem. On a laptop with a street value of $300, this is also not an economical solution. But it does mean that you don’t really have anything to lose if you toast the motherboard trying to fix it yourself.

So. Enough preamble. Here’s how I fixed the problem.

Read the rest of this entry »

03.17.06

Why Simulating Free-Surface Flow is Difficult, Part 2

Posted in Computational Fluid Dynamics, Dissertation Research at 12:31 am by Brooks

(This is a continuation of Why Simulating Free-Surface Flow is Difficult, Part 1.)

In Part 1 of this series, I talked about why it’s difficult to do an accurate computer simulation of a single drop dripping from a faucet. That’s a very simple example of a free-surface flow, however, and many of the flows that are relevant to other scientific or engineering questions are far more complicated.

One general class of more complicated free-surface flows are “sprays”, also referred to as “spray flows” or “atomization” – a liquid is forced at relatively high pressure through a small nozzle (or set of nozzles), and when it comes out it breaks up into tiny droplets. Sprays are nearly ubiquitous in any handling of liquids; for instance, in my day-to-day life, I might take a shower in the morning (under a spray of water from the showerhead), wash the shower walls with a cleaner in a spray-bottle, use an aerosol spray can of cooking oil to oil the pan to cook my eggs in, and wash the pan using the spray attachment on my sink. My car has a fuel-injected engine, which means that there are nozzles in it that spray the fuel into the air intake. If I were to paint the (sadly rusting) hood on it, I’d use a spray can. The train that I take to work has a diesel engine; the term “diesel” means that in it the fuel is sprayed directly into the engine’s cylinder, where it burns immediately as it’s being sprayed in.

In every one of those cases, it’s important to get the spray “right”. The shower-cleaner, cooking-oil, and paint sprays need to provide an even coating on the walls without spraying any off to the sides. The shower head needs to produce rather large drops that act like rain rather than fog. The fuel injectors in my car need to produce tiny droplets that will evaporate quickly, while the ones on the diesel locomotive need to produce droplets of the right size to get to the middle of the cylinder before they burn up. Thus, it would be very useful to be able to simulate the spray that comes out of a new nozzle design, so that it can be tested and improved without needing to do costly experiments.

As an example to talk about, here’s a fairly typical spray that’s easy to photograph – water being squirted through the nozzle from a Windex® bottle. I should credit my wife for patiently helping me take the picture; it took quite a few tries before I managed to get the flash timed correctly with the spray!


Water spraying from a Windex-bottle nozzle

(click on the photo for a larger version)

Read the rest of this entry »

03.06.06

What does online commerce have to do with free software?

Posted in Programming and People at 6:12 pm by Brooks

Rick Segal just referenced a post by Russell Beattie, about “Web 2.0″ hype and the proliferation of companies with business plans that seem to have plenty of ideas on how to provide value to the people who visit their website or use their services, but seem to have omitted the part where they get paid.

There’s an interesting contrast between Rick and Russ’s idea of a good business plan and some parts of the free software world, which in many ways ends up being about the free-as-in-free-beer even if that’s not the actual drive. I think the difference is much shallower than it appears — and I think the similarities are quite important, because I suspect that much of the Web 2.0 hype is based on seeing the success of free software but missing the point of why it works.

To start with an immediately handy example, consider the Windows port of the OpenFOAM computational fluid dynamics software that I’m distributing. On the face of it, my doing this seems to completely ignore Russ’s point – the packages for that represent a good week of my own work (above and beyond the hard work of the people who wrote the original program and created the initial version of the port), and here I am giving it away without charging a penny.

And, if you look at it like that, you’ve probably missed the key point.

My business plan, metaphorically speaking, goes like this: I have the knowledge and experience to develop simulation methods for fluid flows and improve the state of the art in that field. People pay me (in the form of a student research assistanceship, at present, and in the form of research positions after I graduate) to improve the state of the art in ways that benefit them. This is straightforward, simple, and quite clear about who pays me and why.

One of the pieces that’s not in that description is the fact that, in order to advance the state of the art, I need good tools. That’s where creating and distributing the port of OpenFOAM comes in. Creating the port is essentially a sunk cost as far as the distribution question is concerned; I did that because I needed it, and because the experience I gained was valuable. Distributing it, once I’ve created it, doesn’t cost much; thus, it doesn’t take much value to make it worth doing.

So, let’s get back to the key point: What is the value I expect from this? I expect to get feedback from people who use it; bug reports and patches. Those improve the tool, and that means that I have a better tool to use in the core value-generation equation. Moreover, I have a better tool for less than it would have cost me to find all the bugs and write the patches myself, and that’s time I can use for working on the problems I’m being paid to research. That’s worth real money, and the conversion process is pretty clear.

This business plan scales up to actual companies, too. OpenCFD, who wrote and distribute OpenFOAM, have a similar business model. People pay them to solve fluid-flow simulation problems, or to develop systems to do the simulations. OpenFOAM is a large part of their toolbox, and the benefits they get from having a large and participatory userbase (and, specifically, a userbase of potential customers) pay for the costs of distributing it.

So what’s my takeaway message from Russ’s post, then? If the value that I get from distributing this software is the feedback that I get from users, then I need to put make it very clear and obvious how they can do that, and effortless for them to do so – because that connection is how I get “paid”. Right now, all I’ve got is a non-obvious and munged email link at the bottom of the page, and that’s not good enough.

03.03.06

Why Simulating Free-Surface Flow is Difficult, Part 1

Posted in Computational Fluid Dynamics, Dissertation Research at 10:08 pm by Brooks

“Free-surface flows” are fluid flows that involve a surface that can move freely in response to the flow, such as the surface of the ocean, which is moved by the waves. This is contrasted to flows where all of the surfaces are fixed, such as water in a rigid pipe – or, alternately, a submarine deep under the ocean, where the only relevant surfaces are the rigid surfaces of the submarine which can only move as a solid piece.

As an example of a simple free-surface flow, consider water slowly dripping from a faucet. The surface of water across the bottom of the faucet moves downward, forming a drop, which eventually becomes heavy enough to fall and break off. I’ll use this to illustrate a couple of the reasons why computer simulations of free-surface flows are difficult.


Water dripping from a kitchen faucet

(click on the photo for a larger version)

Read the rest of this entry »