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

WIP: Dipole moment addition #1701

Open
wants to merge 147 commits into
base: master
Choose a base branch
from

Conversation

wandadars
Copy link
Contributor

@wandadars wandadars commented May 31, 2018

Requirements

**I'm looking for help on what other files I need to change in order to make the dipole_moment attribute that I add to the database file accessible within CoolProp.

For now I am working on just getting the data into the JSON files.

Description of the Change

added "dipole_moment" attribute to JSON fluid files for species where the data for the dipole moment is available. The units in the JSON files can be in either the standard literature Debye [D] unit or in C*m (Where C is Coulomb). The values are stored and returned from CoolProp in C*m, which is an SI unit.

Benefits

The dipole moment can be used in some thermodynamic calculations.

Possible Drawbacks

Incorrect value of the dipole_moment

Verification Process (@henningjp)

Files were compiled and tested in both Python (3.6):

dpm test python

and Mathcad Prime (4.0 & 5.0):

mathcad dpm

If the dipole moment is not available, it is listed as -1 in the fluid JSON file and results in an error as shown in the examples above for the fluid SES36.

Applicable Issues

Addresses one of the wish-list component from issue #115.

@ibell
Copy link
Contributor

ibell commented Jun 8, 2018

Thanks for what you've done so far - looking good. What's the game plan here? Collect all of them and then bump the PR?

@wandadars
Copy link
Contributor Author

Yeah. I'll continue to add data to the files, and then push more commits for the coding to read the dipole moment data.

Value tabulated in "The Properties of Gases and Liquids" 5th edition, Poling, Prausnitz, and O'Connell.
Value tabulated in "The Properties of Gases and Liquids" 5th edition, Poling, Prausnitz, and O'Connell.
Only source that could be located which reported a dipole moment for D4:  https://www.gelest.com/product/octamethylcyclotetrasiloxane-98/
Only source that could be located which reported a dipole moment for D5:  https://www.gelest.com/product/decamethylcyclopentasiloxane/
Only source that could be located which reported a dipole moment for D6:  https://www.gelest.com/product/dodecamethylcyclohexasiloxane/
Actual dipole moment is actually 0.0 for cyclopentane based on "The Properties of Gases and Liquids" 5th edition, Poling, Prausnitz, and O'Connell. The previous value was mis-read.
Value tabulated in "The Properties of Gases and Liquids" 5th edition, Poling, Prausnitz, and O'Connell.
Value tabulated in "The Properties of Gases and Liquids" 5th edition, Poling, Prausnitz, and O'Connell.
Value tabulated in "The Properties of Gases and Liquids" 5th edition, Poling, Prausnitz, and O'Connell.
Value tabulated in "The Properties of Gases and Liquids" 5th edition, Poling, Prausnitz, and O'Connell.
Value tabulated in "The Properties of Gases and Liquids" 5th edition, Poling, Prausnitz, and O'Connell.
Value tabulated in "The Properties of Gases and Liquids" 5th edition, Poling, Prausnitz, and O'Connell.
Value tabulated in "The Properties of Gases and Liquids" 5th edition, Poling, Prausnitz, and O'Connell.
Value tabulated in "The Properties of Gases and Liquids" 5th edition, Poling, Prausnitz, and O'Connell.
Value tabulated in: Haynes, William M., ed. (2011). CRC Handbook of Chemistry and Physics (92nd ed.). Boca Raton, FL: CRC Press. ISBN 1439855110.
Value tabulated in "The Properties of Gases and Liquids" 5th edition, Poling, Prausnitz, and O'Connell.
@henningjp
Copy link
Contributor

@wandadars - I updated your PR text at the top to include the verification checks. I only spot checked a few fluids, but the values match the JSON files, zeroes are returned where they should be and fluids with -1 are returning errors as designed.

@ibell - If you're ok with this, I'll squash and merge.

@ibell
Copy link
Contributor

ibell commented Oct 12, 2018 via email

@henningjp
Copy link
Contributor

Great idea. I’ll automate a check against REFPROP for all fluids.

@henningjp
Copy link
Contributor

henningjp commented Oct 13, 2018

@ibell Most values are pretty close. My computer is going down until Monday, so I'll print a full report later. @wandadars , just a few look suspect, when compared to the values in REFPROP. Please recheck references for:

  • EthylBenzene (about 30% low)
  • n-Butane (400% high)
  • NitrousOxide (2.0, looks suspect)

The rest that you put in look pretty good. 3 out of 122 - Not bad! CoolProp has a few fluids that REFPROP does not, so there is no comparison value.

@henningjp
Copy link
Contributor

Ok. I'm convinced on cyclohexane. REFPROP lists a very slight dipole moment for cyclohexane, but I don't believe it. The very weak C-H polarity and the molecule symmetry means it's zero.

@henningjp
Copy link
Contributor

ethylbenzene: I see references for 0.359 D, certainly closer to your value, but I also see references for 0.58 D and 0.59 D (NIST).

@henningjp
Copy link
Contributor

Nitrous Oxide (N2O) - NIST lists the dipole moment at 0.167 D. Other sources list similar.

@ibell
Copy link
Contributor

ibell commented Oct 18, 2018

Since I can't do this easily currently, can you (@henningjp) dump a CSV listing of the new dipole moments and their values in REFPROP into this issue?

@henningjp
Copy link
Contributor

@ibell Yep. Already created, but my computer is down while I install new floor in my office. Hope to be back up and running this weekend. (Posting from iPhone)

@henningjp
Copy link
Contributor

@ibell OK, back up and running. Value table (csv with a txt extension) comparing to REFPROP results attached.
DM_Compare.txt

@ibell
Copy link
Contributor

ibell commented Oct 21, 2018 via email

@wandadars
Copy link
Contributor Author

In the commit message for each fluid I should have included the exact reference that I used to obtain the value.

@ibell
Copy link
Contributor

ibell commented Oct 21, 2018 via email

@henningjp
Copy link
Contributor

@ibell Should we create an additional dipole_moment_source key that holds the reference source string right in the JSON file? I think if it is not accessed by the code it would be a valuable comment in each file as to where the values come from, especially since there is some discrepancy between sources. Would that extra key be innocuous?

@ibell
Copy link
Contributor

ibell commented Oct 21, 2018 via email

@henningjp henningjp mentioned this pull request Oct 24, 2018
@henningjp henningjp added this to the v6.2.0 milestone Oct 24, 2018
@ibell ibell removed this from the v6.2.0 milestone Oct 26, 2018
@henningjp
Copy link
Contributor

@wandadars , you or me? I don't want to duplicate effort if you're already making these keys for the source string in each JSON. Either way is fine with me.

@wandadars
Copy link
Contributor Author

@henningjp I haven't started any work on adding the additional keys. I'm busy with some other things this week, so I won't be able to get started anytime soon if you want to take a crack at adding those keys.

@henningjp
Copy link
Contributor

@wandadars Sorry for the delay. It's a long sad story of corrupted local git repositories, lost files, and having to repeat the work all over again. I made a new PR to your branch that contains the following:

  1. Added the source references from your original commits to the "dipole_moment_ref" field in each of the fluid JSON files.
  2. Fixed some minor precision issues with some of the values. There were some extra digits that weren't in the source reference. These were probably rounding residue from the conversion to C*m and back to Debye units. Sorry for that unnecessary iteration.
  3. Figured out the issue with the Alkanes. Back when these were originally committed, I checked the JSON values against eThermo and they indeed had the values posted online. Checking this week they have changed! The values posted were actually the acentric factor and they are now labelled as such on the eThermo site. New values that much more closely match the REFPROP values are now posted for dipole moment for all the normal alkanes.
  4. Found a source reference for a few refrigerants that were in REFPROP but missing from CoolProp.

To verify everything I took the following steps:

  • Compiled and ran CoolProp with the new JSON files and all fluids load successfully and report dipole moment values.
  • Generated a new comparison csv file between the new CoolProp values and the values reported from REFPROP, listing the % difference between the two. This csv is attached here (Github made me rename it to a .txt file). The list is sorted by %difference from REFPROP (low to high) and I put notes in the fields that have suspect values or missing data.

DM_Compare_sorted.txt

Clean up JSON fluid files and add source reference field dipole_moment_refs
@henningjp
Copy link
Contributor

henningjp commented Dec 1, 2018

@wandadars Here are a few remaining precision issues to check against Poling and two with the Geleste references. They are nit-picky, but they should be double checked. If the Poling values are accurate, then I'm fine with them as the difference is small and they are newer than the CCDBD and NBS10 references used heavily by REFPROP. Thanks.

Fluid CP Value REFPROP Value Comment
IsoButene 0.5001 0.5 (aka 2-MethylPropene) Poling reference listts 0.5 - should be updated
cis-2-Butene 0.3001 0.3 Poling reference has 0.3 - should be updated.
DimethylEther 1.3 1.301 Poling reference has 1.3 - OK
D4 1.091 1.09 1.09 reported by https://www.gelest.com/product/octamethylcyclotetrasiloxane-98/ This should be updated without the extra digit.
Ethanol 1.7 1.6909 Poling reference has 1.7 - OK
R12 0.5001 0.51 NSRDS-NBS19 lists 0.51 ; Poling lists 0.5 - OK, but remove last digit ; REFPROP 10 references REFPROP 5 (!!!)
HydrogenChloride 1.1 1.079 Poling has 1.1 - OK; NIST CCBDB and NSRDS-NBS10 report 1.08

@henningjp
Copy link
Contributor

@wandadars , @ibell suggested a target of 1% difference from the REFPROP values; however, this may not be reasonable given some of the very small values. A survey of the fluids that do not agree with REFPROP are listed in the tables below with comments and a suggested resolution. (NOTE: the rest of the fluids in the library agree 100% with the REFPROP values.) For a few of the fluids in the table, I land on the side of the submitted values (newer, confirmed references over the REFPROP source) and a few (???) have non-reconciled differences. References are only used that we can actually lay eyes on and I do not have access to DIPPR, which is used for several of the REFPROP values. If anyone has issue with the proposed resolutions, or has suggestions on the non-reconciled differences, or can provide a better reference value, please comment.

Fluid Name CoolProp REFPROP Comment Resolution
CarbonylSulfide 0.712 0.7152 NIST CCCBDB list (on-line) and NSRDS-NBS10 (1967) list 0.712; REFPROP: J.S. Muenter, J. Chem. Phys., 48, 4544 (1968) (0.7152); From Muenter "The value obtained is 0.71521 ± 0.00020 D, which is in disagreement with a previous measurement of 0.7124 ± 0.0002 D." Use the Muenter value
Ethanol 1.7 1.6909 Poling (1.7), but rounds to single decimal place; NSRDS-NBS10 (1.69); REFPROP references DIPPR Use NSRDS-NBS10 (1.69)
R12 0.5001 0.51 NSRDS-NBS10 lists 0.51 ; Poling (0.5); (but all values rounded to single decimal place) REFPROP 9/10 reference REFPROP 5 (!!!) Use NSRDS-NBS10 (0.51)
HydrogenChloride 1.1 1.079 NIST CCBDB and NSRDS-NBS10 report 1.08 REFPROP references DIPPR; Poling has 1.1, but rounds all values to single decimal. Use NSRDS-NBS10 (1.08)
n-Propane 0.083 0.084 J. Chem. Phys. 33, 1514 (1960); https://doi.org/10.1063/1.1731434; NBS10 cites this reference (0.83) and averages with Muenter, J. S. and Laurie, V. W.: J. Chem. Phys. 45, 855 (1966). (0.85) to get 0.84.  This is probably the best value. Use NSRDS-NBS10 value (0.084 D) which is slightly newer.
MM 0.7801 0.801 0.78 reported by https://www.gelest.com/product/hexamethyldisiloxane-98/ Maybe update, but REFPROP value comes from DIPPR; not sure what to do on this one. Close enough?
DimethylCarbonate 0.93 0.899 Dimethyl Carbonate (C3H6O3).  Various cis/trans conformers make this one hard to pin down and find a source.  Not listed in Poling/Reid.  The REFPROP value comes from DIPPR. NBS10 states "The significance of these values may involve some ambiguity because of the possibility of different conformations or spatial isomers." and does not report a value but references the paper below: Kubo, M., Morino, Y. and Mizushima, S.: Sci. Papers Inst. Phys. Chem. Res. (Tokyo) 32, 129-37 (1937) (0.9 @325k, 1.05 @497K). Tisato Kajiyama, Polymer Science and Industrial Research in the Fast-changing Age: 7th SPSJ International Polymer Conference (IPC99) (1.0) Tundo, P.; Selva, M. The Chemistry of Dimethyl Carbonate. Acc. Chem. Res., 2002, 35 (9), pp 706–716 DOI: 10.1021/ar010076f (0.91) Use the Tundo value (0.91 D)
NitrousOxide 0.167 0.1608 NIST CCBDB and NSRDS-NBS10 report 0.167 ; Poling rounds to 0.2; REFPROP references J. Chem. Phys. 53, 2513 (1970); https://doi.org/10.1063/1.1674355 Use NBS10 (0.167 D) - OK
1-Butene 0.359 0.339 NIST CCCBDB list (on-line) lists 0.359. Vector sum of µ(a), µ(b), µ(c) gives 0.359(3). Poling/Reid (0.3) [rounded]; NSRDS-NBS10 (0.34);  REFPROP references this source. Use NSRDS-NBS10 (0.34 D)
HFE143m 2.32 2.48 REFPROP: (computed by A. Kazakov, Nov. 2017, DF-MP2/def2-QZVPD, unc. 0.1-0.15 D); ethermo (2.32); Gage, C. L. and Kazachid, O. S., "Predictions of Azeotropes Formed from Fluorinated Ethers, Ethanes, and Propanes" (1992), International Refrigeration and Air Conditioning Conference. Paper 201. (2.45) Use Gage/Kazachid (2.45 D)
HydrogenSulfide 0.9 0.97 Poling (0.9); REFPROP: NIST CCBDB and NSRDS-NBS10 (0.970) Use NSRDS-NBS10 (0.970 D)
MD2M 1.22 1.12 Decamethyltetrasiloxane Commercial site https://www.gelest.com/product/decamethyltetrasiloxane/ reports 1.22.  No other source found.  decamethyltetrasiloxane. REFPROP value from DIPPR 1.22 is best number we have
D5 1.22 1.349 decamethylcyclopentasiloxane; Gelest @ https://www.gelest.com/product/decamethylcyclopentasiloxane/ (1.22); http://www.ethermo.us/Mars905.htm (1.349) REFPROP: DIPPR (1.349) use eThermo (1.349)
R11 0.5001 0.45 R11 (CFCl3) is listed in NIST CCCBDB and NSRDS-NBS10 as 0.45; Poling lists 0.5 (newer, but all values rounded to single decimal place); REFPROP 9/10 reference REFPROP 5 (!!!) probably from NSRDS-NBS10. Use NBS10 value (0.45)
CarbonMonoxide 0.112 0.1 NIST & NSRDS-NBS10 list 0.112(0) references Microwave Spectoscopy method reported in Burrus, C. A.:J. Chem. Phys. 28, 427-9 (1958).  Both Poling and Reid report 0.1. Leave alone or reference Poling?
DiethylEther 1.31 1.151 Poling (1.3);  Reid (1.3); REFPROP Version 9/10 from DIPPER/DIADEM (1.151)($); Lange's Hbk (1.15 D) NIST CCCBDB and NSRDS-NBS10 (1.15); J. Am. Chem. Soc. 1950,  72, 10, 4832-4832 (1.28) Dortmund Data Bank (http://www.ddbst.com/en/EED/PCP/DPM_C12.php) reports 1.45 D (liquid) Use NSRDS-NBS10 (1.15)
n-Hexane 0.08 0.07 Close enough given the very small magnitude of these values | OK
Novec649 0.36 0.43 eThermo site (0.36 D); REFPROP cites: calculated by A. Kazakov, April 2017, unc. +/- 0.12-.2 (0.43) Not sure what to do with this one. No other sources. ???
MDM 0.8001 0.99 C8H24O2Si3 Commercial site https://www.gelest.com/product/octamethyltrisiloxane/  (0.80 D).  Gelest also reports 98% Concentration value (1.09 D) http://www.ethermo.us/ShowDetail93.htm (1.079 D) Thermophysical Properties of Chemicals and Hydrocarbons, By Carl L. Yaws (1.079 D) REFPROP: Sauer, R.O. and Mead, D.J., J. Am. Chem. Soc., 68(9):1794-1797, 1946. (0.99 D) Use Yaws (1.079 D)
EthylBenzene 0.3999 0.6 NIST CCBDB and NSRDS-NBS10 (0.590 D) REFPROP: DIPPR (0.60 D) Poling / Reid (0.4 D) http://www.vias.org/genchem/dipole_moment_table.html (0.36 D) http://www.ethermo.us/mars1041.htm (0.4) Journal of Chromatographic Science, Vol. 43, February 2005, Hiromitsu Kanai, et. al., pp. 57- (0.37) Majority point to values near 0.4; Use Poling (0.4 D)
CycloHexane 0 0.3 Should be a symmetric non-polar molecule, and there are many references that list 0.0 D.  However, REFPROP references Poling (0.3) Reid (0.3) J. Chem. Phys. 49, 2368 (1968); https://doi.org/10.1063/1.1670409 (0.331) Cyclohexane has a stable "chair" form (symmetric) and a boat conformer (non-symmetric).  At 25°C it exists as 99.9% chair form.  This would indicate a dipole moment of zero, but at higher energy levels some % of the conformer could lead to slightly higher values. Use Poling (0.3 D)
n-Dodecane 0.07 0 Original CP reference (ethermo.us/hydrocarbon54) no longer shows a dipole moment value; REFPROP: Dornte, R.W. and C.P. Smyth, J. Am. Chem. Soc. 52, 3546-3552 (1930) (0.0 D); Poling (0.0 D); http://www.ethermo.us/ShowDetail61.htm (0.0D) - no reference; http://www.stenutz.eu/chem/solv6.php?name=dodecane (0.07 D) - no reference; Use Poling (0.0 D)
R218 0.14 0 (Octofluoropropane) Poling (0.0 D); REFPROP: ab-initio calculations from HF 3-21G (0.0 D); http://www.ethermo.us/ShowDetail52.htm (0.07 D - venus model); http://www.ethermo.us/mars1546.htm (0.0 D - mars model); Use Poling (0.0 D)
Air -1 0 Mixture unsupported;  If we use the fact that air is mostly O2 and N2 and that these are monatomic molecules, then 99.9% of air has a dipole moment of zero. Either -1 (undefined) or 0
Isohexane -1 0 (alias 2-methylpentane) REFPROP: ab-initio calculations from HF 6-31G* (0.0 D); Poling (0.1 D); Lange's (0.0 D); http://www.stenutz.eu/chem/solv6.php?name=2-methylpentane reports 0.00D Use Lange's
MD3M -1 1.223 REFPROP: DIPPR (1.223 D); Comercial - https://www.gelest.com/product/dodecamethylcyclohexasiloxane/ (1.56 D); ???
MD4M -1 1.308 (Tetradecamethylhexasiloxane) REFPROP: DIPPR (1.308 D); Lange's Hbk (1.58 D) ???
MethylLinoleate -1 1.79 REFPROP: DIPPR ; http://www.ethermo.us/ShowDetail100.htm (-1) - unknown; No other sources found. OK
R365MFC -1 3.807 (Solkane 365) https://www.solvay.com/sites/g/files/srpend221/files/tridion/documents/SOLKANE-365-Green-Solvent.pdf (3.8); REFPROP: DIPPR (3.807) Use Solvay site (3.8)

Fluids with no dipole moment values listed in REFPROP

Fluid Name CoolProp REFPROP Comment Resolution
Dichloroethane 1.799 -1 (1,2-Dichloroethane) Fluid not in Refprop 9.1.1 or 10.x; Poling (1.8 D); Reid (1.8 D); NBS10 does not list a value; Use Poling (1.8 D)
EthyleneOxide 1.94 -1 Not in Refprop 9.1.1 or 10.x; NIST CCBDB and NSRDS-NBS10 (1.89 D); CRC Handbook of Chemistry and Physics, 92nd ed. (1.94 D); Reid (1.9 D);  Use CRC - OK
OrthoDeuterium 0 -1 spin isomers still monatomic; Same as Deuterium; Fluid not in REFPROP Use zero value
ParaDeuterium 0 -1 spin isomers still monatomic; Same as Deuterium; Fluid not in REFPROP Use zero value
R1233zd(E) 1.44 -1 ethermo http://www.ethermo.us/ShowDetail2820.htm only known source (1.44) OK
R1234ze(E) 1.27 -1 Alt Reference: https://nvlpubs.nist.gov/nistpubs/jres/117/jres.117.014.pdf (1.27) - calculated Use NIST Source (1.27)

Once we're agreed on the resolutions above, I'll add to the PR with the above resolutions.

@henningjp
Copy link
Contributor

@ibell, @wandadars, will you have time to look these over and comment on the resolutions proposed? How should we proceed? This is really close to being a solid implementation with only a few missing values for a few new/obscure refrigerants.

@henningjp
Copy link
Contributor

@ibell - What do you want to do with this? I can wrap it up, but I think it needs a completely new PR as it's quite outdated. I think I've got reasonable assessments of the values (what to include, what to leave undefined) in the previous comments. However, I've not heard anything back from you on direction in a very long time. Is this worth finishing up?

@ibell
Copy link
Contributor

ibell commented Apr 10, 2020

@henningjp - It would indeed be great to get this into CoolProp. Sorry I've been not as responsive on this thread as I might like. I agree that a fresh PR might be the way to go given its age.

@ibell
Copy link
Contributor

ibell commented Apr 10, 2020

I don't think I can dig into the nitty gritty of the values where diescrepancies occur, but where we are all in agreement about what the value should be, let's get those in.

Also, this quantity is much mushier than it seems, so I think my 1% target was likely ambitious. Maybe more like 5% would do.

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.

None yet

3 participants