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

Correct typo, see #1270 #1282

Merged
merged 1 commit into from
Oct 23, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Backends/Helmholtz/VLERoutines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1173,13 +1173,13 @@ void SaturationSolvers::successive_substitution(HelmholtzEOSMixtureBackend &HEOS
df += dfdK*(deriv_liq-deriv_vap);
}

if (std::abs(df) <= 1e-12) { // To avoid dividing by 0
if (std::abs(f) <= 1e-12)
if (std::abs(df) <= 1e-14) { // To avoid dividing by 0
if (std::abs(f) <= 1e-12) // 1e-12 is the loop convergence criterion
{
change = -f; // Should be converged. f <= e-12, so change will have nearly no impact.
}
else {
throw ValueError(format("df very small (df = %g) in successive_substitution but f is not converged (f = %g < 1e-12).",df,f));
throw ValueError(format("df very small (df = %g) in successive_substitution but f is not converged (f = %g > 1e-12).",df,f));
}
}
else {
Expand Down