Skip to content

Commit

Permalink
Merge pull request #5 from jguo96/main
Browse files Browse the repository at this point in the history
differentiated between reference concentrations used in Ag vs Cu Tafe…
  • Loading branch information
jguo96 authored Dec 16, 2023
2 parents 5650cd6 + e97196a commit e94d7c6
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions examples/bicarb_Ag_Cu_tandem_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@

#other constants
cref = 1 # reference concentration (mol/m^3)
cref_Ag = 1e3 #reference concentration for Ag Tafel (mol/m^3)
#---------------------------------------------------------------------------
#end ofconstants, operating conditions, extraneous values used

Expand Down Expand Up @@ -352,15 +353,15 @@ def reaction_CO(u):
f_OH = pow(10.,-0.51 * pow(z_OH,2) * (pow(I,0.5)/(1. + pow(I,0.5)) - 0.3 * I ) )
f_H = pow(10.,-0.51 * pow(z_H,2) * (pow(I,0.5)/(1. + pow(I,0.5)) - 0.3 * I ) )

a_OH = f_OH * COH / cref
a_OH_bulk = C_OH_bulk / cref
a_OH = f_OH * COH / cref_Ag
a_OH_bulk = C_OH_bulk / cref_Ag

a_H = f_H * CH / cref
a_H = f_H * CH / cref_Ag
pH = -ln(a_H)/ln(10)

f_CO2 = exp(COH*(h_s_OH+h_g_CO2) + CHCO3*(h_s_HCO3+h_g_CO2) + CCO3*(h_s_CO3+h_g_CO2) + CH*(h_s_H+h_g_CO2) + CK*(h_s_K+h_g_CO2))
a_CO2 = f_CO2 * CCO2 / cref
a_CO2_bulk = C_CO2_bulk / cref
a_CO2 = f_CO2 * CCO2 / cref_Ag
a_CO2_bulk = C_CO2_bulk / cref_Ag

##-------------------------end of calculate activities

Expand Down Expand Up @@ -402,10 +403,10 @@ def reaction_H2_Ag(u):
f_OH = pow(10.,-0.51 * pow(z_OH,2) * (pow(I,0.5)/(1. + pow(I,0.5)) - 0.3 * I ) )
f_H = pow(10.,-0.51 * pow(z_H,2) * (pow(I,0.5)/(1. + pow(I,0.5)) - 0.3 * I ) )

a_OH = f_OH * COH / cref
a_OH_bulk = C_OH_bulk / cref
a_OH = f_OH * COH / cref_Ag
a_OH_bulk = C_OH_bulk / cref_Ag

a_H = f_H * CH / cref
a_H = f_H * CH / cref_Ag
pH = -ln(a_H)/ln(10)

##-------------------------end of calculate activities
Expand Down

0 comments on commit e94d7c6

Please sign in to comment.