ThermoHubClient

A Client for retrieving thermodynamic data sets or subsets of data from ThermoHub.

In [1]:
import thermohubclient as client

Default connection(remote) to db.thermohub.net

In [2]:
dbc = client.DatabaseClient()
In [3]:
dbc.availableThermoDataSets()
Out[3]:
['"aq17"',
 '"slop16"',
 '"psinagra-12-07"',
 '"slop98-inorganic"',
 '"cemdata18"',
 '"mines16"',
 '"slop98-organic"',
 '"heracles"']

Save ThermoDataSet aq17 to a database file. A file: aq17-thermofun.json will be written

In [4]:
dbc.saveDatabase("aq17")

Save a subset of ThermoDataSet aq17 to a database file aq17-subset-thermofun.json, using a list of elements.

In [5]:
dbc.saveDatabaseContainingElements("aq17", 
                    ["H", "O", "Na", "K", "Si", "Al", "Cl", "Zr", "Zz"])

Save a subset of ThermoDataSet mines16 to a database file mines16-subset-thermofun.json, using a (optional) list of elements, substances, and substance classes. Only the data that fulfils all selection criteria will be saved.

In [6]:
dbc.saveDatabaseSubset(thermodataset="mines16", 
                       elements=["H", "O", "Na", "K", "Si", "Al", "Cl", "Zr", "Zz"],
                       substances=["O2@", "H2@", "NaHSiO3@", "Al(OH)2+", "NaAl(OH)4@", "Al+3",
                        "AlH3SiO4+2", "AlOH+2", "Al(OH)4-", "H2", "O2", "H2O"],
                       classesOfSubstance=["{\"1\":\"SC_GASFLUID\"}", "{\"3\":\"SC_AQSOLVENT\"}"],
                       aggregateStates=[])
In [7]:
print("ThermoDataSets")
for t in dbc.availableThermoDataSets():
    print(f'{t}')
print('\n')
ThermoDataSets
"aq17"
"slop16"
"psinagra-12-07"
"slop98-inorganic"
"cemdata18"
"mines16"
"slop98-organic"
"heracles"


In [8]:
print("Elements")
for e in dbc.elementsInThermoDataSet("aq17"):
    print(f'{e}')
print('\n')
Elements
"Al"
"C"
"Ca"
"Cl"
"H"
"K"
"Mg"
"Na"
"O"
"Si"
"Zz"


In [9]:
print("Substances")
for e in dbc.substancesInThermoDataSet("aq17"):
    print(f'{e}')
print('\n')
Substances
"Akermanite"
"Al(OH)2+"
"Al(OH)3@"
"Al(OH)4-"
"Al+3"
"Albite"
"Albite high"
"AlH3SiO4+2"
"AlOH+2"
"Amesite-Mg"
"Analcite"
"Andalusite"
"Anorthite"
"Anthophyll-Mg"
"Antigorite"
"Aragonite"
"Boehmite"
"Brucite"
"Ca+2"
"CaCl+"
"CaCl2@"
"CaCO3@"
"CaHCO3+"
"CaHSiO3+"
"Calcite"
"CaOH+"
"Carpholite-Mg"
"CaSiO3@"
"Cceladonite-Mg"
"Celadonite-Mg"
"CH4"
"CH4@"
"Chlorite-Mg"
"Chloritoid-Mg"
"Chrysotile"
"Cl-"
"Clinochlore"
"Clinohumite"
"Clinozoisite"
"CO"
"CO@"
"CO2"
"CO2@"
"CO3-2"
"Coesite"
"Cordierite-Mg"
"Corundum"
"Cristobalite"
"Cummingtonite"
"Diamond"
"Diaspore"
"Diopside"
"Dolomite"
"Dolomite-od"
"Eastonite"
"Edenite-Mg"
"Enstatite"
"Forsterite"
"Gedrite-Mg"
"Gehlenite"
"Gibbsite"
"Glaucophane-Mg"
"Graphite"
"Grossular"
"H+"
"H2"
"H2@"
"H2O"
"H2O@"
"Halite"
"HCl@"
"HCO3-"
"Hcordierite-Mg"
"Heulandite"
"HSiO3-"
"Jadeite"
"K+"
"KAlO2@"
"Kalsilite"
"Kaolinite"
"KCl@"
"KCO3-"
"KHCO3@"
"KOH@"
"Kyanite"
"Larnite"
"Laumontite"
"Lawsonite"
"Leucite"
"Lime"
"Magnesite"
"Margarite"
"Meionite-Ca"
"Meionite-Na"
"Merwinite"
"Mg+2"
"MgCl+"
"MgCl2@"
"MgCO3@"
"MgHCO3+"
"MgHSiO3+"
"MgOH+"
"MgSiO3@"
"Microcline"
"Mizzonite"
"Monticellite"
"Muscovite"
"Na+"
"NaAl(OH)4@"
"NaCl@"
"NaCO3-"
"NaHCO3@"
"NaHSiO3@"
"NaOH@"
"Nceladonite-Mg"
"Nepheline"
"O2"
"O2@"
"OH-"
"Omphacite-Mg"
"Osumilite1-Mg"
"Osumilite2-Mg"
"Paragonite"
"Pargasite-Mg"
"Periclase"
"Phlogopite"
"Phlogopite-Na"
"Portlandite"
"Prehnite"
"Pseudowoll"
"Pumpellyite-Mg"
"Pyrope"
"Pyrophyllite"
"Quartz"
"Rankinite"
"Sanidine"
"Sapphirine4-Mg"
"Sapphirine5-Mg"
"Sillimanite"
"SiO2@"
"Spinel"
"Spurrite"
"Staurolite-Mg"
"Stilbite"
"Stilpnomelane-Mg"
"Stishovite"
"Sudoite-Mg"
"Sylvite"
"Talc-Mg"
"Tilleyite"
"Topaz-OH"
"Tremolite-Mg"
"Tridymite"
"Tschermak-Ca"
"Tschermak-Mg"
"Tschermakite-Mg"
"Ttalc-Mg"
"Vesuvianite"
"Wairakite"
"Wollastonite"
"Zoisite"


In [10]:
print("Reactions")
for e in dbc.reactionsInThermoDataSet("mines16"):
    print(f'{e}')
print('\n')
Reactions
"Sn(Cl)+"
"Sn(Cl)+"
"Sn(Cl)+"
"Sn(Cl)2@"
"Sn(Cl)2@"
"Sn(Cl)2@"
"Sn(Cl)3-"
"Sn(Cl)3-"
"Sn(Cl)3-"
"Ti(OH)3+"
"Ti(OH)3+"
"Ti(OH)3+"
"Ti(OH)3+"
"Ti(OH)4@"
"Ti(OH)4@"
"Ti(OH)4@"
"Ti(OH)5-"
"Ti(OH)5-"
"Ti(OH)5-"
"Ti(OH)5-"
"ZrCl+3"
"ZrCl+3"
"ZrCl+3"
"ZrCl2+2"
"ZrCl2+2"
"ZrCl2+2"
"ZrCl3+"
"ZrCl3+"
"ZrCl3+"
"ZrCl4@"
"ZrCl4@"
"ZrCl4@"
"ZrF(OH)3@"
"ZrF(OH)3@"
"ZrF(OH)3@"
"ZrF(OH)3@"
"ZrF+3"
"ZrF+3"
"ZrF+3"
"ZrF2(OH)2@"
"ZrF2(OH)2@"
"ZrF2(OH)2@"
"ZrF2(OH)2@"
"ZrF2+2"
"ZrF2+2"
"ZrF2+2"
"ZrF3+"
"ZrF3+"
"ZrF3+"
"ZrF4@"
"ZrF4@"
"ZrF4@"
"ZrF5-"
"ZrF5-"
"ZrF5-"
"ZrF6-2"
"ZrF6-2"
"ZrF6-2"


In [11]:
print("Substances classes")
for e in dbc.substanceClassesInThermoDataSet("aq17"):
    print(f'{e}')
print('\n')
Substances classes
{"0":"SC_COMPONENT"}
{"2":"SC_AQSOLUTE"}
{"1":"SC_GASFLUID"}
{"3":"SC_AQSOLVENT"}


In [12]:
print("Substances aggregate state")
for e in dbc.substanceAggregateStatesInThermoDataSet("aq17"):
    print(f'{e}')
print('\n')
Substances aggregate state
{"3":"AS_CRYSTAL"}
{"4":"AS_AQUEOUS"}
{"0":"AS_GAS"}