Skip to content

Minor adjustment to debugging output in Sim1d.cpp for log levels >7#1660

Merged
speth merged 2 commits intoCantera:mainfrom
wandadars:debugging_sim1d_changes
Jan 18, 2024
Merged

Minor adjustment to debugging output in Sim1d.cpp for log levels >7#1660
speth merged 2 commits intoCantera:mainfrom
wandadars:debugging_sim1d_changes

Conversation

@wandadars
Copy link
Copy Markdown
Contributor

@wandadars wandadars commented Jan 17, 2024

Changes proposed in this pull request

I added the "true" overwrite flag to the debugging save() and saveResidual() calls in the Sim1d.cpp file to prevent code-stopping errors. I cam across this when trying to debug my work in #1622 . @ischoegl suggested putting the changes in a separate pull request.

To reproduce the error, run a 1D flow case that experiences failures in the steady newton solve, after taking a few successful newton solves. The error consists of the data group at the highest level already existing in the debug file, causing the code to error out.

Checklist

  • The pull request includes a clear description of this code change
  • Commit messages have short titles and reference relevant issues
  • Build passes (scons build & scons test) and unit tests address code coverage
  • Style & formatting of contributed code follows contributing guidelines
  • The pull request is ready for review

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 17, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (7efb996) 72.75% compared to head (6604a7e) 72.76%.

Files Patch % Lines
src/oneD/Sim1D.cpp 0.00% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1660   +/-   ##
=======================================
  Coverage   72.75%   72.76%           
=======================================
  Files         375      375           
  Lines       56584    56584           
  Branches    20494    20494           
=======================================
+ Hits        41168    41171    +3     
+ Misses      12401    12399    -2     
+ Partials     3015     3014    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown
Member

@speth speth left a comment

Choose a reason for hiding this comment

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

Thanks, @wandadars, the changes here makes sense to me. Besides one minor formatting quibble, I'd like to suggest rewriting the commit message to something along the lines of:

[1D] Set overwrite flag when saving debug output files

This prevents errors that could occur if the steady-state Newton solver
experiences failures after previous successful Newton solves. In this situation,
the data group at the highest level already exists in the debug file, and must
explicitly be overwritten.

This prevents errors that could occur if the steady-state Newton solver
experiences failures after previous successful Newton solves. In this situation,
the data group at the highest level already exists in the debug file, and must
explicitly be overwritten.
…ng output files

This is just to help contrast with the other entries in the file that are labelled as
residual. A solution/residual naming scheme makes sense versus the current debug/residual
naming scheme because both outputs are technically debugging information.
@wandadars wandadars force-pushed the debugging_sim1d_changes branch from b073545 to 6604a7e Compare January 18, 2024 04:02
@speth speth merged commit 01a0284 into Cantera:main Jan 18, 2024
@wandadars wandadars deleted the debugging_sim1d_changes branch August 22, 2024 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants