Skip to content

[FXC-6100] Fix restart of mass flow rate boundary conditions#1874

Merged
yifan-flex merged 1 commit intomainfrom
yifan/fixMassFlowRateRestart
Mar 3, 2026
Merged

[FXC-6100] Fix restart of mass flow rate boundary conditions#1874
yifan-flex merged 1 commit intomainfrom
yifan/fixMassFlowRateRestart

Conversation

@yifan-flex
Copy link
Copy Markdown
Contributor

@yifan-flex yifan-flex commented Mar 3, 2026

Mass Flow Rate Boundary Condition Restart Bug

Symptom

When a converged steady-state case with mass flow rate inflow/outflow boundaries is forked (restarted), the solver diverges within the first few pseudo steps. Mass flow rates change drastically from their converged values and supersonic flow
appears at outflow boundaries.

Root Cause

Mass flow rate boundaries are implemented as PI controllers that iteratively adjust a pressure ratio to match a target mass flow rate. The controller's internal state (the converged pressure ratio) is correctly saved to and loaded from the restart
file.
However, on a forked restart the pseudo-step counter is reset to zero. The controller's output expression uses a pseudoStep > 0 guard that was designed to apply an initial default value (pressure ratio = 1.0) on the very first step of a fresh run.
On restart, this guard incorrectly overrides the loaded converged state with the default value, causing a sudden jump in the applied boundary pressure — for example from ~1.15 to 1.0 for total pressure ratio at an inflow.
This mismatch between the converged flow field and the suddenly-wrong boundary condition causes immediate instability and divergence.

Fix

Move the pseudoStep > 0 guard from the output expression to the update expression. The output always uses the current controller state directly. At pseudo step 0 the update becomes a no-op, preserving whatever value the state holds — the default
1.0 on a fresh start, or the converged value on a restart. This is correct in both cases since at step 0 no flow data has been computed yet to base an update on.

Note

Cursor Bugbot is generating a summary for commit 4e32ee5. Configure here.

@yifan-flex yifan-flex force-pushed the yifan/fixMassFlowRateRestart branch from 4e32ee5 to ea3d9d5 Compare March 3, 2026 20:59
Copy link
Copy Markdown
Contributor Author

@yifan-flex yifan-flex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@johnmoore4 With the fix the update law will not get called for a forked case at the first pseudo step, so it still doesn't behave the same as a case continuously running. We could also remove the pseudoStep==0 guard, but this will make a fresh start case have a total pressure ~1.002. Which do you think is better?

@yifan-flex yifan-flex merged commit 960fa55 into main Mar 3, 2026
19 checks passed
@yifan-flex yifan-flex deleted the yifan/fixMassFlowRateRestart branch March 3, 2026 21:34
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