Update HeavyWater hs_anchor state

This commit is contained in:
Ian Bell
2015-04-26 18:04:42 -06:00
parent 679de3517f
commit 3fbbb4914b
2 changed files with 53 additions and 0 deletions

View File

@@ -193,6 +193,18 @@
"BibTeX_CP0": "",
"BibTeX_EOS": "Herrig-2015",
"STATES": {
"hs_anchor": {
"T": 708.2317,
"T_units": "K",
"hmolar": 1347440762.9027348,
"hmolar_units": "J/mol",
"p": 868573187971672.2,
"p_units": "Pa",
"rhomolar": 15997.994999999999,
"rhomolar_units": "mol/m^3",
"smolar": -33287.806522940875,
"smolar_units": "J/mol/K"
},
"reducing": {
"T": 643.847,
"T_units": "K",

View File

@@ -0,0 +1,41 @@
import json, CoolProp, sys
CP = CoolProp.CoolProp
def inject(fluid):
fluid_path = '../fluids/'+fluid+'.json'
# Open the fluid JSON file
fp = open(fluid_path, 'r')
j = json.load(fp)
fp.close()
Tanchor = 1.1*CoolProp.CoolProp.PropsSI('Tcrit','D2O')
rhoanchor = 0.9*CoolProp.CoolProp.PropsSI('rhomolar_critical','D2O')
hanchor_molar = CP.PropsSI('Hmolar','T',Tanchor,'D',rhoanchor,fluid)
sanchor_molar = CP.PropsSI('Smolar','T',Tanchor,'D',rhoanchor,fluid)
p = CP.PropsSI('P','T',Tanchor,'D',rhoanchor,fluid)
j['EOS'][0]['STATES']['hs_anchor'] = {
"T": Tanchor,
"T_units": "K",
"hmolar": hanchor_molar,
"hmolar_units": "J/mol",
"p": p,
"p_units": "Pa",
"rhomolar": rhoanchor,
"rhomolar_units": "mol/m^3",
"smolar": sanchor_molar,
"smolar_units": "J/mol/K"
}
sys.path.append('..')
from package_json import json_options
fp = open(fluid_path, 'w')
fp.write(json.dumps(j, **json_options))
fp.close()
print('writing '+ fluid)
inject('HeavyWater')