Skip to content

Feat/history overwrite option - #3042

Closed
nandininmmahesh-dotcom wants to merge 2 commits into
su2code:masterfrom
nandininmmahesh-dotcom:feat/history-overwrite-option
Closed

nandininmmahesh-dotcom wants to merge 2 commits into
su2code:masterfrom
nandininmmahesh-dotcom:feat/history-overwrite-option

Conversation

@nandininmmahesh-dotcom

Copy link
Copy Markdown

Proposed Changes

Add a WRT_HISTORY_OVERWRITE option so the history file isn't always overwritten. Same pattern as the existing WRT_RESTART_OVERWRITE, WRT_SURFACE_OVERWRITE, and WRT_VOLUME_OVERWRITE flags. Default is YES (truncate), set to NO to append instead — useful when you want to keep convergence history from multiple runs in one file.

Related Work
Fixes #3037.

PR Checklist

  • Targeting develop branch
  • No new compiler warnings
  • Follows SU2 style guide
  • Pre-commit hooks pass
  • Test case added (manual verification done — see description)
  • config_template.cfg updated

rois1995 and others added 2 commits October 31, 2026 19:11
## Proposed Changes

Fixes for `MUSCL_TURB`, `MUSCL_SPECIES` and the bounded scalar scheme.
One commit per fix; the test cases follow in the comments.

- **Limiter lost after `LIMITER_ITER`:** the turbulence and species were
then reconstructed with no limiter at all. Now the last limiter values
are kept, as in the flow.
- **`VAN_ALBADA_EDGE` stopped the run** for turbulence and species. It
now works, as in the flow.
- **The flow's `VAN_ALBADA_EDGE` was ignored** for the velocity that
carries the turbulence. Now it is applied.
- **Reconstruction gradient computed without MUSCL:** with `MUSCL_TURB=
NO` (or `MUSCL_SPECIES= NO`), the turbulence and species still computed
a separate reconstruction gradient when the flow used one. Now only when
they reconstruct.
- **Bounded scheme with density different from 1:** its correction did
not match the flux it corrects, and at sliding interfaces it was added
once per interpolation donor. Both now match the flux.
- **Values outside the allowed range:** the reconstruction could make k
or omega negative at a face, which can stop convergence. Such a face now
falls back to first order, as the flow does for negative pressure.

New test `turb_naca0012_sst_muscl_edge`. Reference values of
`rae2822_sa`, `rae2822_sst`, the venturi and flamelet species tests and
`bars_SST_2D` will be updated from the CI.

## Related Work

- su2code#2910 (closed): same aim as the first fix.

## PR Checklist

- [x] I am submitting my contribution to the develop branch.
- [x] My contribution generates no new compiler warnings (try with
--warnlevel=3 when using meson).
- [x] My contribution is commented and consistent with SU2 style
(https://su2code.github.io/docs_v7/Style-Guide/).
- [x] I used the pre-commit hook to prevent dirty commits and used
`pre-commit run --all` to format old commits.
- [x] I have added a test case that demonstrates my contribution, if
necessary.
- [x] I have updated appropriate documentation (Tutorials, Docs Page,
config_template.cpp), if necessary.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: rois1995 <rauxa1995@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: bigfooted <bigfootedrockmidget@hotmail.com>
…pend control

The history file was always overwritten on each SU2 run, with no option to
preserve convergence history across multiple executions. This adds a new
config option WRT_HISTORY_OVERWRITE that mirrors the existing pattern used
for restart, surface, and volume output files.

Changes:
- Common/src/CConfig.cpp: Add WRT_HISTORY_OVERWRITE bool option (default YES)
- Common/include/CConfig.hpp: Add member + getter GetWrt_History_Overwrite()
- SU2_CFD/src/output/COutput.cpp: Use ios::app mode when option is NO
- config_template.cfg: Document the new option

Behavior:
  WRT_HISTORY_OVERWRITE= YES  (default) — truncate history file each run
  WRT_HISTORY_OVERWRITE= NO              — append to existing history file

Testing verified:
- Meson build completes successfully
- Option recognized in config parsing
- Default overwrite mode: file truncated on each run
- Append mode: data from multiple runs preserved in single file
- Dry-run and full solver execution both work correctly

Closes su2code#3037
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.

history file is always overwritten

3 participants