Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new pipe flow example demonstrating thermal energy transport with constant wall temperature boundary conditions. The example simulates oil flowing through a pipe submerged in icy lake water and validates results against analytical Nusselt number correlations.
Changes:
- Added comprehensive pipe flow example with laminar flow, energy equation, custom oil properties, and temperature profile visualization
- Updated documentation configuration to include the new example in the gallery
- Added CI workflow step to execute the new example
Reviewed changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| examples/00-fluent/pipe_flow.py | New example script implementing pipe flow simulation with thermal analysis and analytical validation |
| doc/source/conf.py | Added pipe_flow.py to sphinx-gallery filename pattern for documentation generation |
| .github/workflows/execute-examples-weekly.yml | Added execution step for pipe_flow.py in weekly CI workflow |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "density": 888.1, | ||
| "viscosity": 0.0009429, |
There was a problem hiding this comment.
The viscosity value appears to be kinematic viscosity (ν) in m²/s as specified in the problem description, but Fluent typically expects dynamic viscosity (μ) in Pa·s or kg/(m·s). This should be converted: μ = ρ × ν = 888.1 × 0.0009429 ≈ 0.8375 Pa·s.
| "density": 888.1, | |
| "viscosity": 0.0009429, | |
| "density": 888.1, # kg/m^3 | |
| "viscosity": 0.8375, # Pa·s (dynamic viscosity μ = 888.1 kg/m^3 × 0.0009429 m^2/s) |
| fluid_materials.rename(new="oil", old="air") | ||
| fluid_materials["oil"] = { | ||
| "density": 888.1, | ||
| "viscosity": 0.0009429, |
There was a problem hiding this comment.
@MohammedAnsys The resolved Copilot comments regarding viscosity here are justified.
| calculation = RunCalculation(solver) | ||
| calculation.iterate(iter_count=300) | ||
|
|
||
| # %% |
There was a problem hiding this comment.
The comment should go before the iterate() call and it should not comment concretely on what has happened.
E.g.,
# Allow up to 300 iterations. The solver will terminate early if
# convergence criteria are met, so the actual iteration count may
# be lower and can vary between runs.
calculation.iterate(iter_count=300)| # | ||
| # Analytical outlet temperature: :T_e = 292.74 K | ||
| # | ||
| # PyFluent outlet temperature: :T_e = 291.79 K |
There was a problem hiding this comment.
We might refer to this as a typical result for PyFluent, given that the user is not guaranteed to get the same result in future.
| # | ||
| # PyFluent outlet temperature: :T_e = 291.79 K | ||
| # | ||
| # Both approaches show only a small temperature drop over the 200-m pipe, consistent with the very long thermal entry length. |
There was a problem hiding this comment.
I have concerns about how this validation is being presented.
- Significance of the discrepancy
The discussion compares two absolute outlet temperatures and concludes that “both show only a small temperature drop.”
However, the relevant quantity for validation is not the absolute temperature but the temperature drop relative to the inlet:
- Inlet: 293.15 K
- Analytical outlet: 292.74 K → ΔT ≈ 0.41 K
- PyFluent outlet: 291.79 K → ΔT ≈ 1.36 K
The difference between the two predicted drops (~0.95 K) is more than twice the magnitude of the analytical drop itself.
That is not a minor deviation—it corresponds to substantially different thermal behaviour over the pipe length.
As written, the text risks giving the impression that the two approaches are in close agreement when, in terms of the physics being evaluated (heat transfer rate), they are not.
- Model vs. model vs. reality
The analytical solution is itself a model based on idealisations (fully developed laminar flow, constant properties, etc.).
The PyFluent result is another model with different assumptions and discretisation.
What we are doing here is:
model A ↔ model B
not
model ↔ physical reality.
The discussion should acknowledge that a discrepancy reflects a gap between two modelling approaches, and that either (or neither) may be closer to reality. Calling this a “validation of PyFluent’s capability” feels too strong without experimental reference data or a more rigorous error analysis.
- Viscosity specification
There is also the unresolved issue noted earlier: the example appears to supply kinematic viscosity where Fluent expects dynamic viscosity.
The material properties used in the simulation are inconsistent which would directly affect the Prandtl number and the predicted thermal entry behaviour.
Before drawing conclusions about agreement with the analytical solution, we should correct the viscosity definition.
Context
No existing example demonstrated thermal energy transport with constant wall temperature boundary conditions and validation against analytical heat transfer solutions.
Change Summary
Added pipe_flow example simulating oil flow through a pipe submerged in icy lake water. Includes laminar flow setup, energy equation, custom oil material properties, constant wall temperature (0°C), temperature profile visualization, and analytical validation using Nusselt number correlations. Added 2 supporting images.
Rationale
Provides a validated benchmark for conjugate heat transfer in PyFluent
Impact
Purely additive, no modifications to existing code