Skip to content

Example/pipe cht - #42

Merged
StephenSmith25 merged 2 commits into
masterfrom
example/pipe-cht
Nov 12, 2026
Merged

StephenSmith25 merged 2 commits into
masterfrom
example/pipe-cht

Conversation

@StephenSmith25

Copy link
Copy Markdown
Owner

No description provided.

StephenSmith25 and others added 2 commits November 12, 2026 21:13
examples/pipe_cht/pipe1d.py: co-simulation FMU of a pipe discretised into N
axial segments, to be coupled to a (3D) solid solver. Per segment it takes the
wall temperature and returns the bulk fluid temperature and heat transfer
coefficient (Robin coupling), plus wall heat flux, outlet temperature, total
heat, Re, Nu and pressure drop.

- implicit upwind finite volume energy equation: one O(N) sweep per step,
  stable for any communication step; reverse flow supported
- Nu = 3.66 laminar / Gnielinski turbulent, Petukhov friction
- cht_demo.py couples it to an axisymmetric steel-wall conduction model
  (heated middle third) through the same set/doStep/get loop a CHT driver
  uses; also runs the built FMU through FMPy with --fmu
- README with the coupling scheme, parameters, inputs/outputs and model

Tests: analytic constant-wall-temperature solution (laminar and turbulent),
steady-state energy conservation, reverse-flow symmetry, Nusselt values,
demo energy balance, model description arrays, and the built FMU run through
the FMI C API matching the Python model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X8Wmw797DJpgrMFmT6n8CG
N (UInt64, causality structuralParameter) sizes every per-segment array via
<Dimension valueReference=N>. Setting it (in Configuration Mode, or on the
Python class) reallocates the arrays through a property setter, so the
resolution no longer requires editing the script and rebuilding.

- cht_demo.py: --segments option; sets N through Configuration Mode for --fmu
- README: N parameter and the configuration-mode call sequence
- tests: N through the slave API, convergence with N against the analytic
  solution, model description dimensions, and the built FMU run through the
  FMI C API with N = 35 set in Configuration Mode

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X8Wmw797DJpgrMFmT6n8CG
@StephenSmith25
StephenSmith25 merged commit 94b99fc into master Nov 12, 2026
15 checks passed
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.

1 participant