Skip to content

Forchheimer's law through OpenFOAM - #8

Open
jdirr wants to merge 2 commits into
mainfrom
claude/brave-hopper-20id3p
Open

jdirr wants to merge 2 commits into
mainfrom
claude/brave-hopper-20id3p

Conversation

@jdirr

@jdirr jdirr commented Dec 1, 2026

Copy link
Copy Markdown
Owner

Forchheimer's law of the pores of a periodic sample, by OpenFOAM (theory notes §139, FR-E19, specification 1.253).

  • Periodic flows at a mean velocity. write_openfoam(..., velocity=U) (morphogen openfoam export --velocity, outputs.openfoam.velocity, the tool OpenFOAM case): the faces along the axis a cyclic pair too, the pressure fixed at one cell, and OpenFOAM's source meanVelocityForce (OpenCFD's fvOptions; the Foundation's fvConstraints, put in place by Allrun for the line it runs) driving the cells of the pores to the filtration velocity. No inlet nor outlet: a sample driven by a pressure drop lost a third of it at its ends through four cells of rods at a Reynolds number of 2.8, losses that grow like Forchheimer's term itself.
  • Read back. The pressure gradient that the source prints, the apparent permeability ν U / G and the Reynolds number; SIMPLE's convergence by its residuals, or by a flow that no longer changes (the pressure of a slit vanishes, and the residual of round-off never falls).
  • The sweep morphogen.io.forchheimer (morphogen openfoam forchheimer): a creeping flow (Darcy's permeability k), periodic flows at the Reynolds numbers asked for (0.1, 0.3, 1, 3 and 10 by default), Forchheimer's law G = ν U / k_F + β U² fitted from --fit-from (Ward's c_F = β √k), the weak inertia k / k_app − 1 = A Re² below it, the exponents from flow to flow; the flows that fail or do not converge (unsteady) reported and left out; forchheimer.json and forchheimer.csv.
  • The scheme of the convection (linear or linearUpwind); the public interface written again (tests/public_api.txt) and recorded in the change log; the theory notes, the specification, the pages Other codes, Configuration and Physics.

Verification. Laws standing in for OpenFOAM give back the laws and the Reynolds numbers asked for within 10⁻⁹. OpenFOAM v2412 itself (test_forchheimer_with_openfoam, skipped where OpenFOAM is not found, as in the CI): the permeability of a slit at every Reynolds number up to 30 (10⁻⁶); through staggered rods, the weak inertia (exponents 1.995 and 1.97 below a Reynolds number of 1), then a stronger inertia up to 10 (c_F = 0.29 fitted from 3), the flow unsteady by 30. The files of the Foundation's lines follow their sources (11, 12, dev) and were not run here.

The CI of the branch (run 46713938807, by workflow_dispatch on 9f24fce) is green.


Generated by Claude Code

… numbers

A case of OpenFOAM written with a velocity is periodic along its axis too, driven to that
filtration velocity by meanVelocityForce (OpenCFD's fvOptions, the Foundation's
fvConstraints, put in place by Allrun): no inlet nor outlet, whose losses add to the
inertia of the medium. Its pressure gradient, apparent permeability and convergence are
read back (the residuals, or a flow that no longer changes). The sweep forchheimer runs a
creeping flow and periodic flows at the Reynolds numbers asked for, and fits Forchheimer's
law and the weak inertia (theory notes §139, FR-E19, specification 1.253); the command
morphogen openfoam forchheimer, outputs.openfoam.velocity and convection, the periodic flow
in the tool OpenFOAM case. Verified by laws standing in for OpenFOAM and by OpenFOAM v2412.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MSrXEMpgnWPQNUwHwAgXHV
tests/public_api.txt written again (python tests/test_public_api.py): morphogen.io's
forchheimer and fit_forchheimer, the names and parameters added to morphogen.io.openfoam;
the change log says so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MSrXEMpgnWPQNUwHwAgXHV

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants