Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1D solver API docs #1803

Merged
merged 5 commits into from
Oct 28, 2024
Merged

1D solver API docs #1803

merged 5 commits into from
Oct 28, 2024

Conversation

speth
Copy link
Member

@speth speth commented Oct 27, 2024

Changes proposed in this pull request

  • Document all member functions and member variables of the C++ classes comprising the 1D solver
  • Deprecate/remove a handful of redundant/unused methods and variables in 1D classes

If applicable, fill in the issue number this pull request is fixing

This is the last step needed to complete Cantera/enhancements#25.

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

Copy link

codecov bot commented Oct 27, 2024

Codecov Report

Attention: Patch coverage is 63.63636% with 16 lines in your changes missing coverage. Please review.

Project coverage is 73.09%. Comparing base (15a941e) to head (82d298f).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
include/cantera/oneD/Domain1D.h 0.00% 8 Missing ⚠️
src/oneD/Flow1D.cpp 75.00% 0 Missing and 2 partials ⚠️
src/oneD/MultiJac.cpp 75.00% 1 Missing and 1 partial ⚠️
src/oneD/Sim1D.cpp 77.77% 2 Missing ⚠️
src/clib/ctonedim.cpp 0.00% 1 Missing ⚠️
src/oneD/StFlow.cpp 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1803      +/-   ##
==========================================
- Coverage   73.10%   73.09%   -0.02%     
==========================================
  Files         383      383              
  Lines       54632    54617      -15     
  Branches     9106     9101       -5     
==========================================
- Hits        39940    39921      -19     
- Misses      11692    11698       +6     
+ Partials     3000     2998       -2     

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

@speth speth marked this pull request as ready for review October 27, 2024 13:33
Copy link
Member

@ischoegl ischoegl left a comment

Choose a reason for hiding this comment

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

Thanks, @speth. I have a couple of minor comments.

include/cantera/oneD/Flow1D.h Outdated Show resolved Hide resolved
include/cantera/oneD/IonFlow.h Outdated Show resolved Hide resolved
include/cantera/oneD/MultiJac.h Show resolved Hide resolved
@@ -220,13 +216,13 @@ int OneDim::solve(double* x, double* xnew, int loglevel)
return m_newt->solve(x, xnew, *this, *m_jac, loglevel);
}

void OneDim::evalSSJacobian(double* x, double* xnew)
void OneDim::evalSSJacobian(double* x, double* r)
Copy link
Member

Choose a reason for hiding this comment

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

I’m generally not convinced that single-letter variables or functions are a good idea.

Copy link
Member Author

Choose a reason for hiding this comment

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

I renamed it rsd, which is what's used a few other places, but just r is used in other places in the 1D solver for the residual. Here, r is strictly an improvement, as the old name was misleading -- this definitely does not contain a "new" value for x.

ThermoBasis m_fluxGradientBasis = ThermoBasis::molar;
vector<bool> m_do_species;
Copy link
Member

Choose a reason for hiding this comment

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

It would be good if you could comment on the rationale for removing this feature.

Copy link
Member Author

@speth speth Oct 28, 2024

Choose a reason for hiding this comment

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

This was just a variable that had no methods for being set except when being restored from a saved data file, and was not being used to control the logic for evaluating the governing equations.

Digging through the Git history a bit jogged my memory. The idea of solving with a fixed species profile was a feature that was removed in Cantera 2.3, but I'm not sure it ever made sense from a consistency standpoint.

Copy link
Member

@ischoegl ischoegl left a comment

Choose a reason for hiding this comment

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

Thanks, @speth!

@ischoegl ischoegl merged commit 3ba21c4 into Cantera:main Oct 28, 2024
50 of 52 checks passed
@speth speth deleted the onedim-doxygen branch October 28, 2024 13:43
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.

2 participants