Skip to content

Commit

Permalink
clean up for merge
Browse files Browse the repository at this point in the history
  • Loading branch information
joyxyz1994 committed Oct 15, 2024
1 parent 5e1f75b commit a02354b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 442 deletions.
15 changes: 13 additions & 2 deletions qsdsan/processes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,19 @@ def mass2mol_conversion(cmps):
R = 8.3145e-2 # Universal gas constant, [bar/M/K]

def T_correction_factor(T1, T2, delta_H):
"""compute temperature correction factor for equilibrium constants based on
the Van't Holf equation."""
"""
Returns temperature correction factor for equilibrium constants based on
the Van't Holf equation.
Parameters
----------
T1 : float
Base temperature, in K.
T2 : float
Actual temperature, in K.
delta_H : float
Heat of reaction, in J/mol.
"""
if T1 == T2: return 1
return exp(delta_H/(R*100) * (1/T1 - 1/T2)) # R converted to SI

Expand Down
4 changes: 2 additions & 2 deletions qsdsan/processes/_adm1.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ def solve_pH(state_arr, Ka, unit_conversion):
cmps_in_M = state_arr[:27] * unit_conversion
weak_acids = cmps_in_M[[24, 25, 10, 9, 6, 5, 4, 3]]
h = brenth(acid_base_rxn, 1e-14, 1.0,
args=(weak_acids, Ka),
xtol=1e-12, maxiter=100)
args=(weak_acids, Ka),
xtol=1e-12, maxiter=100)
return h
rhos_adm1 = lambda state_arr, params: _rhos_adm1(state_arr, params, h=None)

Expand Down
Loading

0 comments on commit a02354b

Please sign in to comment.