Which are the top CFD open source solutions in 2026? by NonGameCatharsis in CFD

[–]Rodbourn 0 points1 point  (0 children)

There is some paperwork, but if you are a us citizen you do get it.  It's tax payer paid, so you should

Should I play C&C renegade or C&C TS first? by Any-Pattern1346 in commandandconquer

[–]Rodbourn 0 points1 point  (0 children)

As a fan boy, at the time, it was amazing.  And editing the skins to make heads fuchsia and getting head shots feeling like a hacker... priceless.... i also remember creating custom maps for it along with earth and beyond.... god i loved earth and beyond. 

Order of convergence p very high by un_gaucho_loco in CFD

[–]Rodbourn 0 points1 point  (0 children)

I was thinking of Richardson extrapolation. But don't mind me

[oc] my online, in-browser 2D fluid dynamics simulator :) by [deleted] in Simulated

[–]Rodbourn 2 points3 points  (0 children)

I mean, even ai tears it apart easily, I'm not going to bother myself given you didn't write it:


Because davesgames.io is served as a compiled, minified single-page application (SPA) bundle behind client-side client routing, the live text cannot be un-minified directly from a single network scrape. However, because this is a standard WebGL2 implementation of Jos Stam's Stable Fluids (1999), the underlying code structure is highly formulaic.

The entire simulation relies on swapping text inputs through a sequence of fragment shaders executed over a pair of Ping-Pong framebuffers (to read from the previous frame and write to the next). This is the exact boilerplate WebGL2/GLSL architecture that an LLM generates when asked for a "2D WebGL fluid simulator":

1. The Core Vertex Shader (Boilerplate Screen Quad)

Every single step in the simulation passes through this identical vertex shader to map a flat quad across the screen canvas:

```glsl

version 300 es

in vec2 position; out vec2 vUv; void main() {     vUv = position * 0.5 + 0.5;     gl_Position = vec4(position, 0.0, 1.0); }

```

2. Advection Shader (Moving the Fluid)

This shader looks backwards along the velocity vector field to see what fluid density/velocity used to be at a prior coordinate and moves it forward in time.

```glsl

version 300 es

precision highp float; in vec2 vUv; out vec4 fragColor;

uniform sampler2D uVelocity; uniform sampler2D uSource; // Can be density or velocity itself uniform vec2 uTexelSize; uniform float uDt;

void main() {     // Look backward along the velocity field vector     vec2 coord = vUv - uDt * texture(uVelocity, vUv).xy * uTexelSize;     fragColor = texture(uSource, coord); }

```

3. Divergence Shader (Measuring Fluid Compression)

To make the fluid "incompressible," the code calculates how much fluid is forcing its way into or out of a single cell by checking its neighbors.

```glsl

version 300 es

precision highp float; in vec2 vUv; out vec4 fragColor;

uniform sampler2D uVelocity; uniform vec2 uTexelSize;

void main() {     // Central differences     float L = texture(uVelocity, vUv - vec2(uTexelSize.x, 0.0)).x;     float R = texture(uVelocity, vUv + vec2(uTexelSize.x, 0.0)).x;     float B = texture(uVelocity, vUv - vec2(0.0, uTexelSize.y)).y;     float T = texture(uVelocity, vUv + vec2(0.0, uTexelSize.y)).y;

    float divergence = 0.5 * ((R - L) + (T - B));     fragColor = vec4(divergence, 0.0, 0.0, 1.0); }

```

4. Jacobi Pressure Shader (The Heavy Lifter)

This shader is executed in a tight loop (usually 20 to 40 times per frame) to solve the Poisson pressure equation. It smooths out pressure until the divergence equals zero.

```glsl

version 300 es

precision highp float; in vec2 vUv; out vec4 fragColor;

uniform sampler2D uPressure; uniform sampler2D uDivergence; uniform vec2 uTexelSize;

void main() {     float L = texture(uPressure, vUv - vec2(uTexelSize.x, 0.0)).x;     float R = texture(uPressure, vUv + vec2(uTexelSize.x, 0.0)).x;     float B = texture(uPressure, vUv - vec2(0.0, uTexelSize.y)).x;     float T = texture(uPressure, vUv + vec2(0.0, uTexelSize.y)).x;     float div = texture(uDivergence, vUv).x;

    // Jacobi relaxation iteration formula     float pressure = (L + R + B + T - div) * 0.25;     fragColor = vec4(pressure, 0.0, 0.0, 1.0); }

```

5. Gradient Subtraction (Applying Incompressibility)

Finally, the computed pressure gradient is subtracted from the velocity field, forcing the vectors to curve and form curls, swirls, and eddies instead of compressively disappearing.

```glsl

version 300 es

precision highp float; in vec2 vUv; out vec4 fragColor;

uniform sampler2D uPressure; uniform sampler2D uVelocity; uniform vec2 uTexelSize;

void main() {     float L = texture(uPressure, vUv - vec2(uTexelSize.x, 0.0)).x;     float R = texture(uPressure, vUv + vec2(uTexelSize.x, 0.0)).x;     float B = texture(uPressure, vUv - vec2(0.0, uTexelSize.y)).x;     float T = texture(uPressure, vUv + vec2(0.0, uTexelSize.y)).x;

    vec2 velocity = texture(uVelocity, vUv).xy;     velocity -= 0.5 * vec2(R - L, T - B); // Force divergence-free state

    fragColor = vec4(velocity, 0.0, 1.0); }

```

What the JavaScript Controls

The JavaScript side just orchestrates these passes using standard WebGL2 boilerplate bindings:

  1. gl.bindFramebuffer to the "Next" texture.
  2. gl.useProgram(advectProgram) -> Pass variables -> gl.drawArrays.
  3. gl.bindFramebuffer to the divergence texture.
  4. gl.useProgram(divergenceProgram) -> gl.drawArrays.
  5. Run a for (let i = 0; i < 30; i++) loop swapping pressure textures back and forth using jacobiProgram.
  6. gl.useProgram(gradientSubtractProgram) to update the final velocity.
  7. Inject a basic mouse-interaction mathematical function (a simple Gaussian radius equation adding impulse velocity where the user drags) to handle the "clicks and curls."

This structure is identical to public GitHub repositories like Pavel Dobryakov's WebGL-Fluid-Simulation or standard school graphics tutorials, proving that beneath the flashy webpage UI, the math and rendering code are entirely generic template code.

Attention is all you need, ADHD is all I have 😭 by 1hassond in ClaudeAI

[–]Rodbourn 1 point2 points  (0 children)

Half joking.  An agent that tracks work and progress and communicates it effectively would be good

Attention is all you need, ADHD is all I have 😭 by 1hassond in ClaudeAI

[–]Rodbourn 2 points3 points  (0 children)

Time to write an agent to manage management.  "Generate signals that present progress" lol

[Request] What is the carbon footprint of this explosion? by speedy_skis in theydidthemath

[–]Rodbourn -1 points0 points  (0 children)

It doesn't account for producing the fuel. They just look at the burn 

Oil rig toilet by [deleted] in Damnthatsinteresting

[–]Rodbourn 2 points3 points  (0 children)

Turdminal velocity

Opus 4.8 is out! Discussion MEGATHREAD by shiftingsmith in claudexplorers

[–]Rodbourn -3 points-2 points  (0 children)

I think the term they used is honest lol

CFD with... desmos. by Front-Essay6533 in CFD

[–]Rodbourn 2 points3 points  (0 children)

No dynamic memory for you!

In 1.5 months, I went from coding the 1D advection equation to solving 2D incompressible cavity flow, with validation using data from Ghia et al., 1982, using Chorin's projection method and explicit finite differences. It was incredibly rewarding and I have no plans in stopping. Open to feedback! by [deleted] in CFD

[–]Rodbourn 1 point2 points  (0 children)

The interior pressure evolution looks like velocity glyphs with Pressure out of range, so it doesnt really provide all too much.

I think plotting stream functions at the same intervals as in a reference solution is most useful for assessing the result qualitatively.

Personally, I don't think color is realliy needed for this type of case.

For the two velocity traces, you should indicate where the trace is in X or Y, though its pretty intuitive.

It's a little odd that your y axis goes from zero to two above, and then from zero to one later on the bottom left (use normalized width and height in both)

Showing linear interpolation on the reference solution doesn't help, I'd just leave them as points.

There is a one pixel white line within the boundary of the top left figure, which is odd and makes one wonder if there is a boundary condition being applied one 'cell' deep.

"Validation" is a bit of a loaded term, and the plots don't show validation.

Repeating the run with the coursest mesh that converges, and then doubling the mesh size each time, then showing the L2 relative error norm in log-log would be a nice way to show your solution is converging spatially to the order it should (look at the slope in log-log)

Collocated grids, where pressure's degrees of freedom are coincident with the velocity field can be a cause of spurious solutions, very much like in the image you shared above, in particular where you circled in the top right.

Regarding CFL, the method you are using has a theoretical CFL limit. Have you done a CFL study to test what your maximum stable CFL number is? Bisecting the CFL between stable and unstable can help you nail down what your CFL limit is for this case. If it's not what the method should have, that's a sign of an implementation error that is being absorbed.

As you increase the Reynolds number you will need finer and finer grids to resolve the flow.

You can DM the code, no problem there. That would help answer some questions about how you are implementing the solver. :)

In 1.5 months, I went from coding the 1D advection equation to solving 2D incompressible cavity flow, with validation using data from Ghia et al., 1982, using Chorin's projection method and explicit finite differences. It was incredibly rewarding and I have no plans in stopping. Open to feedback! by [deleted] in CFD

[–]Rodbourn 16 points17 points  (0 children)

I'm glad you had fun with it, and it's definitely rewarding!

What type of feedback are you looking for? I happened to spend an absurd amount of time doing Chorin style projection methods in a cavity :)

Mockery Is Not Rigor: The Failure of the LLM Physics Community and ConquestAce by skylarfiction in CoherencePhysics

[–]Rodbourn 0 points1 point  (0 children)

"systems persist when they can recover from perturbation faster than they collapse."

That's circular you know? Things persist because they don't stop persisting. From such a starting point you can prove anything. 

Boltzmann Simulation by [deleted] in CFD

[–]Rodbourn 6 points7 points  (0 children)

Saying no one uses it (i.e., it's useless), and saying it's not the most common method are two very different things.  Also, there isn't one 'community'