added idea xml and iml files

pull/1/head
titusquah 5 years ago
parent c29be6afc6
commit 3c0ccc6b30

@ -0,0 +1,7 @@
<component name="ProjectDictionaryState">
<dictionary name="Titus">
<words>
<w>kmol</w>
</words>
</dictionary>
</component>

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

@ -0,0 +1,171 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="f4439dc0-6756-4612-8f7d-596d8949f300" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/data/csvs/exp_data.csv" afterDir="false" />
<change afterPath="$PROJECT_DIR$/data/xmls/twophase.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/methods.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/tests/test1.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Python Script" />
</list>
</option>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="ProjectId" id="1cb4dMPbzwchdRM32ufpLaZ6Ir0" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showExcludedFiles" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../../parameter estimation/parameter estimation/fit.py" />
<property name="run.code.analysis.last.selected.profile" value="aDefault" />
<property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable" />
</component>
<component name="RunManager">
<configuration name="methods" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<module name="parameter-estimation" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/methods.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<recent_temporary>
<list>
<item itemvalue="Python.methods" />
</list>
</recent_temporary>
</component>
<component name="ServiceViewManager">
<option name="viewStates">
<list>
<serviceView>
<treeState>
<expand />
<select />
</treeState>
</serviceView>
</list>
</option>
</component>
<component name="StructureViewFactory">
<option name="ACTIVE_ACTIONS" value=",SHOW_INHERITED,ALPHA_COMPARATOR" />
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="f4439dc0-6756-4612-8f7d-596d8949f300" name="Default Changelist" comment="" />
<created>1590784044993</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1590784044993</updated>
</task>
<task id="LOCAL-00001" summary="started project">
<created>1590789450060</created>
<option name="number" value="00001" />
<option name="presentableId" value="LOCAL-00001" />
<option name="project" value="LOCAL" />
<updated>1590789450060</updated>
</task>
<option name="localTasksCounter" value="2" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="started project" />
<option name="LAST_COMMIT_MESSAGE" value="started project" />
</component>
<component name="WindowStateProjectService">
<state x="-1330" y="212" key="#Inspections" timestamp="1590787654691">
<screen x="-1920" y="2" width="1920" height="1040" />
</state>
<state x="-1330" y="212" key="#Inspections/0.0.1536.824/-1920.2.1920.1040@-1920.2.1920.1040" timestamp="1590787654691" />
<state x="-1506" y="178" width="1092" height="706" key="#com.intellij.execution.impl.EditConfigurationsDialog" timestamp="1590784453144">
<screen x="-1920" y="2" width="1920" height="1040" />
</state>
<state x="-1506" y="178" width="1092" height="706" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.0.1536.824/-1920.2.1920.1040@-1920.2.1920.1040" timestamp="1590784453144" />
<state x="-1213" y="379" key="ANALYSIS_DLG_com.intellij.analysis.BaseAnalysisAction$1" timestamp="1590787657711">
<screen x="-1920" y="2" width="1920" height="1040" />
</state>
<state x="-1213" y="379" key="ANALYSIS_DLG_com.intellij.analysis.BaseAnalysisAction$1/0.0.1536.824/-1920.2.1920.1040@-1920.2.1920.1040" timestamp="1590787657711" />
<state x="-1364" y="117" key="CommitChangelistDialog2" timestamp="1590789936804">
<screen x="-1920" y="2" width="1920" height="1040" />
</state>
<state x="-1364" y="117" key="CommitChangelistDialog2/0.0.1536.824/-1920.2.1920.1040@-1920.2.1920.1040" timestamp="1590789936804" />
<state x="-1828" y="94" width="1736" height="856" key="DiffContextDialog" timestamp="1590786199657">
<screen x="-1920" y="2" width="1920" height="1040" />
</state>
<state x="-1828" y="94" width="1736" height="856" key="DiffContextDialog/0.0.1536.824/-1920.2.1920.1040@-1920.2.1920.1040" timestamp="1590786199657" />
<state x="-1180" y="278" key="FileChooserDialogImpl" timestamp="1590786964173">
<screen x="-1920" y="2" width="1920" height="1040" />
</state>
<state x="-1180" y="278" key="FileChooserDialogImpl/0.0.1536.824/-1920.2.1920.1040@-1920.2.1920.1040" timestamp="1590786964173" />
<state width="1897" height="281" key="GridCell.Tab.0.bottom" timestamp="1590784657740">
<screen x="-1920" y="2" width="1920" height="1040" />
</state>
<state width="1897" height="281" key="GridCell.Tab.0.bottom/0.0.1536.824/-1920.2.1920.1040@-1920.2.1920.1040" timestamp="1590784657740" />
<state width="1897" height="281" key="GridCell.Tab.0.center" timestamp="1590784657739">
<screen x="-1920" y="2" width="1920" height="1040" />
</state>
<state width="1897" height="281" key="GridCell.Tab.0.center/0.0.1536.824/-1920.2.1920.1040@-1920.2.1920.1040" timestamp="1590784657739" />
<state width="1897" height="281" key="GridCell.Tab.0.left" timestamp="1590784657739">
<screen x="-1920" y="2" width="1920" height="1040" />
</state>
<state width="1897" height="281" key="GridCell.Tab.0.left/0.0.1536.824/-1920.2.1920.1040@-1920.2.1920.1040" timestamp="1590784657739" />
<state width="1897" height="281" key="GridCell.Tab.0.right" timestamp="1590784657739">
<screen x="-1920" y="2" width="1920" height="1040" />
</state>
<state width="1897" height="281" key="GridCell.Tab.0.right/0.0.1536.824/-1920.2.1920.1040@-1920.2.1920.1040" timestamp="1590784657739" />
<state x="-1460" y="164" key="SettingsEditor" timestamp="1590784300386">
<screen x="-1920" y="2" width="1920" height="1040" />
</state>
<state x="-1460" y="164" key="SettingsEditor/0.0.1536.824/-1920.2.1920.1040@-1920.2.1920.1040" timestamp="1590784300386" />
<state x="-1368" y="256" key="Vcs.Push.Dialog.v2" timestamp="1590789945157">
<screen x="-1920" y="2" width="1920" height="1040" />
</state>
<state x="-1368" y="256" key="Vcs.Push.Dialog.v2/0.0.1536.824/-1920.2.1920.1040@-1920.2.1920.1040" timestamp="1590789945157" />
<state x="463" y="236" key="com.intellij.ide.util.TipDialog" timestamp="1590784072879">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state x="463" y="236" key="com.intellij.ide.util.TipDialog/0.0.1536.824/-1920.2.1920.1040@0.0.1536.824" timestamp="1590784072879" />
</component>
</project>

@ -0,0 +1,256 @@
<ctml>
<validate reactions="yes" species="yes" />
<phase dim="3" id="PC88A_liquid">
<elementArray datasrc="elementz.xml">
Cl O H C P Nd dummy
</elementArray>
<speciesArray datasrc="#species_PC88A_liquid">
(HA)2(org) dodecane Nd(H(A)2)3(org)
</speciesArray>
<state>
<temperature units="K"> 298.15 </temperature>
<pressure units="Pa"> 100000.0 </pressure>
<soluteMolalities>
(HA)2(org): 0.25
</soluteMolalities>
</state>
<thermo model="IdealSolidSolution">
<standardConc model="molar_volume" />
</thermo>
<standardConc model="molar_volume" />
<transport model="None" />
<kinetics model="none" />
</phase>
<speciesData id="species_PC88A_liquid">
<species name="(HA)2(org)">
<atomArray> C:16 H:35 O:3 P:1 </atomArray>
<thermo>
<const_cp Tmax="300.0" Tmin="298.0">
<t0 units="K">298.14999999999998</t0>
<h0 units="J/mol"> -1302518.58 </h0>
<s0 units="J/mol/K"> 558.9824 </s0>
<cp0 units="J/mol/K"> 0.0</cp0>
</const_cp>
</thermo>
<standardState model="constant_incompressible">
<molarVolume> 0.3214 </molarVolume>
</standardState>
</species>
<species name="Nd(H(A)2)3(org)">
<atomArray> C:48 H:102 O:9 P:3 Nd:1 </atomArray>
<thermo>
<const_cp Tmax="300.0" Tmin="298.0">
<t0 units="K">298.14999999999998</t0>
<h0 units="J/mol" updated="Updated at 12:04:45">-4704700.167611002</h0>
<s0 units="J/mol/K"> 1117.965 </s0>
<cp0 units="J/mol/K">0.0</cp0>
</const_cp>
</thermo>
<standardState model="constant_incompressible">
<molarVolume> 1.0073 </molarVolume>
</standardState>
</species>
<species name="dodecane">
<atomArray> dummy:1 </atomArray>
<thermo>
<const_cp Tmax="300.0" Tmin="298.0">
<t0 units="K">298.14999999999998</t0>
<h0 units="J/mol"> 0.0 </h0>
<s0 units="J/mol/K"> 0.0 </s0>
<cp0 units="J/mol/K">0.0</cp0>
</const_cp>
</thermo>
<standardState model="constant_incompressible">
<molarVolume> 0.227113 </molarVolume>
</standardState>
</species>
</speciesData>
<phase dim="3" id="HCl_electrolyte">
<speciesArray datasrc="#species_waterSolution">
H2O(L) H+ OH- Cl- Nd+++
</speciesArray>
<state>
<temperature units="K"> 298.15 </temperature>
<pressure units="Pa"> 100000.0 </pressure>
<soluteMolalities>
Cl-: 1.0E-7
H+: 1.0E-7
</soluteMolalities>
</state>
<thermo model="HMW">
<standardConc model="solvent_volume" />
<activityCoefficients TempModel="complex1" model="Pitzer">
<A_Debye model="water" />
<ionicRadius default="3.042843" units="Angstroms">
</ionicRadius>
<binarySaltParameters anion="Cl-" cation="H+">
<beta0> 0.177000779, 0.000125778, 0.0, -33.4777082, -0.262214535 </beta0>
<beta1> 0.292922504, -0.027938838, 0.0, 3402.47027, 19.7936248 </beta1>
<beta2> 0.0, 0.0, 0.0, 0.0, 0.0 </beta2>
<Cphi> 0.000362, -0.00003036, 0.0, -2.91038E-11, 0.0 </Cphi>
<Alpha1> 2 </Alpha1>
<Alpha2> 12 </Alpha2>
<source>
refit of Holmes, H.F., Busey, J.M., Simonson, J.M., Mesmer, R.E.,
Archer, D.G., and Wood, R.H., 1987, The enthalpy of dilution of HCl(aq)
to 648 K and 4p MPa. Thermodynamic properties, Journal of Chemical
Thermodynamics, v. 19, p. 863-890.
</source>
</binarySaltParameters>
</activityCoefficients>
<solvent> H2O(L) </solvent>
</thermo>
<elementArray datasrc="elementz.xml"> O H Nd Cl P E </elementArray>
<kinetics model="none">
</kinetics>
</phase>
<speciesData id="species_waterSolution">
<species name="H2O(L)">
<atomArray>H:2 O:1 </atomArray>
<thermo>
<NASA P0="100000.0" Tmax="600.0" Tmin="273.14999999999998">
<floatArray name="coeffs" size="7">
7.255750050E+01, -6.624454020E-01, 2.561987460E-03, -4.365919230E-06,
2.781789810E-09, -4.188654990E+04, -2.882801370E+02
</floatArray>
</NASA>
</thermo>
<standardState model="waterPDSS">
<molarVolume> 0.018068 </molarVolume>
</standardState>
</species>
<species name="OH-">
<speciesChemFormula> OH- </speciesChemFormula>
<atomArray> O:1 H:1 </atomArray>
<charge> -1 </charge>
<thermo model="HKFT">
<HKFT Pref="1 atm" Tmax="625.15" Tmin="298.15">
<DG0_f_Pr_Tr units="cal/gmol"> -37595 </DG0_f_Pr_Tr>
<DH0_f_Pr_Tr units="cal/gmol"> -54977 </DH0_f_Pr_Tr>
<S0_Pr_Tr units="cal/gmol/K"> -2.56 </S0_Pr_Tr>
</HKFT>
</thermo>
<standardState model="HKFT">
<a1 units="cal/gmol/bar"> 0.12527 </a1>
<a2 units="cal/gmol"> 7.38 </a2>
<a3 units="cal-K/gmol/bar"> 1.8423 </a3>
<a4 units="cal-K/gmol"> -27821 </a4>
<c1 units="cal/gmol/K"> 4.15 </c1>
<c2 units="cal-K/gmol"> -103460 </c2>
<omega_Pr_Tr units="cal/gmol"> 172460 </omega_Pr_Tr>
</standardState>
<source>
ref:G9
</source>
</species>
<species name="Cl-">
<speciesChemFormula> Cl- </speciesChemFormula>
<atomArray> Cl:1 </atomArray>
<charge> -1 </charge>
<thermo model="HKFT">
<HKFT Pref="1 atm" Tmax="625.15" Tmin="273.15">
<DG0_f_Pr_Tr units="cal/gmol"> -31379 </DG0_f_Pr_Tr>
<DH0_f_Pr_TR units="cal/gmol"> -39933 </DH0_f_Pr_TR>
<S0_Pr_Tr units="cal/gmol/K"> 13.56 </S0_Pr_Tr>
</HKFT>
</thermo>
<standardState model="HKFT">
<a1 units="cal/mol/bar"> 0.4032 </a1>
<a2 units="cal/mol"> 480.1 </a2>
<a3 units="cal-K/mol/bar"> 5.563 </a3>
<a4 units="cal-K/mol"> -28470 </a4>
<c1 units="cal/mol/K"> -4.4 </c1>
<c2 units="cal-K/mol"> -57140 </c2>
<omega_Pr_Tr units="cal/mol"> 145600 </omega_Pr_Tr>
<molarVolume units="cm3/mol"> 17.79 </molarVolume>
</standardState>
<source> ref:G9 </source>
</species>
<species name="H+">
<speciesChemFormula> H+ </speciesChemFormula>
<atomArray> H:1 </atomArray>
<charge> +1 </charge>
<thermo model="HKFT">
<HKFT Pref="1 atm" Tmax="625.15" Tmin="273.15">
<DG0_f_Pr_Tr units="cal/gmol"> 0 </DG0_f_Pr_Tr>
<DH0_f_Pr_TR units="cal/gmol"> 0 </DH0_f_Pr_TR>
<S0_Pr_Tr units="cal/gmol/K"> 0 </S0_Pr_Tr>
</HKFT>
</thermo>
<standardState model="HKFT">
<a1 units="cal/mol/bar"> 0 </a1>
<a2 units="cal/mol"> 0 </a2>
<a3 units="cal-K/mol/bar"> 0 </a3>
<a4 units="cal-K/mol"> 0 </a4>
<c1 units="cal/mol/K"> 0 </c1>
<c2 units="cal-K/mol"> 0 </c2>
<omega_Pr_Tr units="cal/mol"> 0 </omega_Pr_Tr>
<molarVolume units="cm3/mol"> 0 </molarVolume>
</standardState>
<source> ref:G9 </source>
</species>
<species name="Nd+++">
<speciesChemFormula> Nd+++ </speciesChemFormula>
<atomArray> Nd:1 </atomArray>
<charge> +3 </charge>
<thermo model="HKFT">
<HKFT Pref="1 atm" Tmax="625.15" Tmin="298.15">
<DG0_f_Pr_Tr units="cal/gmol"> -160600 </DG0_f_Pr_Tr>
<DH0_f_Pr_Tr units="cal/gmol"> -166500 </DH0_f_Pr_Tr>
<S0_Pr_Tr units="cal/gmol/K"> -49.5 </S0_Pr_Tr>
</HKFT>
</thermo>
<standardState model="HKFT">
<a1 units="cal/gmol/bar"> -0.33707 </a1>
<a2 units="cal/gmol"> -1454.52 </a2>
<a3 units="cal-K/gmol/bar"> 8.3211 </a3>
<a4 units="cal-K/gmol"> -21777 </a4>
<c1 units="cal/gmol/K"> 1.6236 </c1>
<c2 units="cal-K/gmol"> -118344 </c2>
<omega_Pr_Tr units="cal/gmol"> 225500 </omega_Pr_Tr>
</standardState>
<source>
ref:G9
</source>
</species>
</speciesData>
</ctml>

@ -0,0 +1,25 @@
import cantera as ct
import pandas as pd
class REEGEMParamFit:
"""Takes in experimental data
Returns parameters for GEM
:param exp_csv_file: (str) csv file containing experimental data
:param param_xml_file: (str) xml file with parameters for equilibrium calc
:param x_guess: (float) guess for multiplier variable
:param h_guess: (float) initial guess standard enthalpy (J/kmol)
:param phase_names: (list) names of phases in xml file
"""
def __init__(self,
exp_csv_file,
param_xml_file,
x_guess=1,
h_guess=-4856609.0E3,
phase_names=['HCl_electrolyte', 'PC88A_liquid']
):
self.x_guess = x_guess
self.h_guess = h_guess
exp_df = pd.read_csv(exp_csv_file)
phases = ct.import_phases(param_xml_file, phase_names)
Loading…
Cancel
Save