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

Derivative continuity constraints between low- and high-temperature NASA polynomials #22

Closed
gmagoon opened this issue Feb 16, 2010 · 5 comments

Comments

@gmagoon
Copy link
Contributor

gmagoon commented Feb 16, 2010

Currently, NASA polynomials created from Wilhoit polynomials are constrained to have continuous first and second derivatives at the intermediate temperature. Perhaps we should provide option(s) for relaxation of these constraints to allow discontinuous second-derivatives, and perhaps even discontinuous first derivatives, allowing a better fit.

@rwest
Copy link
Member

rwest commented Feb 16, 2010

Would it be a 'better' fit though?

In my experience discontinuities make convergence hard for Cantera at the intermediate temperature. (imagine a Newton-Raphson solve to find T from U when your dU/dT is different at either side of the T you're trying to converge upon)

@gmagoon
Copy link
Contributor Author

gmagoon commented Feb 16, 2010

You are right...I should be more precise with the term "better". By "better fit" I mean to say that the resulting NASA polynomial could have smaller (RMS) deviation from the Wilhoit polynomial (and it certainly wouldn't be a "worse fit" (in the same sense)).

Regarding convergence, I see your point, but I think it would not be an issue here. dU/dT = Cp - R (ideal gas) or Cp (incompressible liquid), which would still be continuous with T (i.e. it would still have essentially the same value on either side of the cutoff temperature, and the limit at the cutoff temperature would still be well-defined)...it would just be the second (and potentially first) derivative that could be discontinuous.

@rwest
Copy link
Member

rwest commented Feb 16, 2010

Ok, now imagine you're not doing Newton Raphson, but something that takes the second and third derivatives into account...

I remember it being an issue in my thesis work, and having to go to some trouble to ensure a smooth join.

@gmagoon
Copy link
Contributor Author

gmagoon commented Feb 22, 2010

OK, so I've pushed an update to my branch that generalizes the constraints and closes this issue, allowing for tighter or looser continuity constraints. The default is continuity of the heat capacity function and its first and second derivatives. The tightest setting makes all derivatives of the heat capacity function continuous and the loosest setting does not constrain continuity at all.

Update: I should note that the tightest case effectively constrains all the coefficients to be equal and is equivalent to fitting only one polynomial (rather than two).

@gmagoon
Copy link
Contributor Author

gmagoon commented Feb 25, 2010

generalized continuity constraints in Wilhoit2NASA; closed by f194893

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants