Deploying low-maintenance web apps and fluid dynamics
We lament how annoying it is to maintain side projects and celebrate by creating a side project that requires maintenance – although less than ordinarily. We also lament our lack of CFD knowledge.
I hope your week is going well!
New articles
Deploying a Single-Binary Haskell Web App
I have a strong aversion toward maintaining the deployments of side projects. Hence a great number of dependency-free client side-only (Perl scripts, vanilla JavaScript, etc.) hobby projects. In this article, we consider a breach in policy, and get a minimal-maintenance Haskell web app up and running.
Full article (6–20 minute read): Deploying a Single-Binary Haskell Web App
Flashcard of the week
I really, really want to learn computational fluid dynamics. Not because I care about fluid dynamics, but because I think the things one learns as part of learning CFD can be useful in so many other cases.
I have a feeling we computer folks underestimate the power of differential equations for modeling stuff, or zooming out and thinking about binary quantities as continuous. I'm part of the problem; I'd like not to be, but every time I try to wrap my head around CFD it explodes a little.
This flashcard was written as part of my last push to try to grok CFD. It's a very bad flashcard because I almost never get every single term right, but I still like it because when I look at the answer, I go "Ooh, yeah, this all makes so much sense."
If we have U=ρu, what is the conservation law in differential form? (Correct signs on each term required.)
To begin with, U=ρu is a common substitution in this case. The differential equation we will see works on U, where we express a quantity per unit volume of fluid. However, we often only know u, the quantity per unit mass of fluid. Multiplying by the fluid density ρ gives a number with the correct dimensions.
The answer is
δρu/δt = -∇·(ρuv) + ∇·(κρ∇u) + Q
The left hand side simply expresses what the question asks for: at any point, what is the increase in the quantity U of a substance per unit volume of fluid? Then we have three terms:
-
-∇·(ρuv) represents the amount of the substance that is convected into the point, due to fluid velocity v. The divergence operator computes the outflow from the point, so we need the negative divergence to get the increase at the point due to convection.
-
∇·(κρ∇u) is another divergence, but this time the velocity is not given by the surrounding fluid, but by the gradient of concentration u, and a constant κ. This is the diffusion of substance into the point. Since the gradient points up toward high concentration, but substances diffuse away from high concentration, the velocity is really given by the negative gradient – but then again, we are looking at the negative divergence and these two minuses cancel out, making both the divergence and gradient positive.
-
Q represents any sources or sinks of the substance.
I find it neat how both convection (transport due to underlying fluid velocity) and diffusion (transport due to spreading out over time) are modeled by the same sort of term, with the only difference being where the two velocities come from: either from the underlying flow, or from the concentration gradient.
Premium newsletter
The third premium newsletter went out this weekend. It had three links, two book recommendations (covering investing and polar expeditions), a link to a future article that's not yet published, and the ACX 2025 forecast rationales.
I've started writing the next premium newsletter, which will contain a list of the 20 best technical books I've read in the past five years – as well as how one can possibly approach creating such a list without having to manually create a global book ranking, because that would suck. (Hint: we perform pairwise comparisons and compute a global ranking from that – this is more difficult than it sounds.)
If any of this sounds interesting, you should upgrade to a premium subscription! If you upgrade now, you will pay only $2/month – as interest increases and I learn to hit my stride with publishing these, the price will be set higher for future subscribers. As always, you can cancel at any time.
To upgrade, click the subscription link at the top of this newsletter and fill in your email again.
Your opinions
I cannot improve without feedback. Reply to this email to share your thoughts on any of the topics above, or anything else!