mutationpp / Mutationpp

The MUlticomponent Thermodynamic And Transport library for IONized gases in C++
GNU Lesser General Public License v3.0
101 stars 58 forks source link

Electron mass lacks precision #210

Closed mgoodson-cvd closed 10 months ago

mgoodson-cvd commented 2 years ago

The electron mass defined as 5.5e-4 g/mol here in elements.xml is lacking in precision. The value defined in the NASA-9 thermodynamics database is 5.48579903e-4 g/mol, which agrees well with NIST CODATA value of 5.4857990888e-4 g/mol.

Is there some reason that 5.5e-4 g/mol was used rather than a more precise value? If not, can I update this to use the value, either to match the NASA-9 value or the more recent CODATA value? This is causing issues when moving between Mutation++ and another code which is using the more precise NASA-9 electron mass for other calculations.

jbscoggi commented 2 years ago

Nope, no reason other than I guess I was feeling lazy that day! Please submit the PR with the correct value and I'll merge ASAP. Thanks!

mgoodson-cvd commented 2 years ago

Will do. The fun thing about this one-line change is that it breaks several of the unit tests...

I'll try to get them sorted out before I push anything.

mgoodson-cvd commented 2 years ago

Any preference on whether to use the older NASA-9 value for the electron mass or the newer 2018 CODATA value?

Also, some of the other constants in Constants.h are out of date with the 2018 CODATA values; e.g., NA = 6.0221415E23 but CODATA value is NA = 6.02214076E23. Again, updating them will subtly change results and probably break more unit tests... If you want me to update all the constants, I can make a new issue.

mgoodson-cvd commented 2 years ago

While most of the unit tests were easy to fix, the comparisonTest is not. It is comparing against stored data (presumably generated with Mutation++?), in a certain format that sets the tolerance for the test, etc. @jbscoggi do you have a script that generates this data easily? Otherwise this will be a pain to update otherwise. I did think about just increasing the tolerance...

I'll push what I've got (which uses the NASA-9 electron mass) and you can take a look.

mgoodson-cvd commented 10 months ago

@jbscoggi I will rebase this on latest master and force-push back. I did update the version to 1.1.3 in this, but I will drop that until I can get #239 fixed. After that, I think a version update and release would be a good idea.