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

Fix some 1D solver errors #1103

Merged
merged 3 commits into from
Sep 23, 2021
Merged

Fix some 1D solver errors #1103

merged 3 commits into from
Sep 23, 2021

Conversation

speth
Copy link
Member

@speth speth commented Sep 20, 2021

Changes proposed in this pull request

  • Fixed an error in the error handler for singular Jacobians where the wrong domain was being identified as containing the problematic row, that ultimately resulted in an integer divide by zero error instead of a CanteraError identifying which domain, grid point, and solution component the row corresponded to. This fixes a regression introduced in e8194af.
  • Fix some cases where the solution involves large values of lambda and the initial guess of lambda = 0 was leading to singular Jacobians. A reasonable initial guess for lambda can be obtained by noting the proportionality between lambda and rho*V**2 in the radial momentum equation.
  • Fix use of user-specified solver tolerances after internal solver restarts, e.g. automatic grid expansion of FreeFlame

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

Resolves #1067

If applicable, provide an example illustrating new features this pull request is introducing

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

codecov bot commented Sep 20, 2021

Codecov Report

Merging #1103 (f4dff38) into main (29587ee) will increase coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1103   +/-   ##
=======================================
  Coverage   73.49%   73.49%           
=======================================
  Files         364      364           
  Lines       47809    47808    -1     
=======================================
  Hits        35138    35138           
+ Misses      12671    12670    -1     
Impacted Files Coverage Δ
src/oneD/MultiNewton.cpp 77.10% <0.00%> (+0.46%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 29587ee...f4dff38. Read the comment docs.

Fixed an error in the error handler for singular Jacobians where the
wrong domain was being identified as containing the problematic row,
that ultimately resulted in an integer divide by zero error instead of
a CanteraError identifying which domain, grid point, and solution
component the row corresponded to.

This fixes a regression introduced in e8194af.
A reasonable initial guess for lambda can be obtained by noting the
proportionality between lambda and rho*V**2 in the radial momentum
equation.

This fixes some cases where the correct solution involves large values
of lambda and the initial guess of lambda = 0 was leading to singular
Jacobians.

See Cantera#1067
@speth speth changed the title [1D] Fix error when reporting singular Jacobian Fix some 1D solver errors Sep 21, 2021
This is analogous to the issue with multicomponent transport / Soret
diffusion that was reported in Cantera#615 and fixed in Cantera#631.
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.

Looks good to me - thanks for tracking down the issue!

@ischoegl ischoegl merged commit ee8c7b0 into Cantera:main Sep 23, 2021
@speth speth deleted the fix-onedim-jac-error branch July 23, 2024 15:38
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.

Extracted submechanism causes failure with CounterflowDiffusionFlame
2 participants