NutMEG.reaction.special package¶
Submodules¶
NutMEG.reaction.special.Tdep module¶
This is the Tdep submodule of the reaction module. It emphasises the temperature dependence of reactions. For now we have only the Tdep class, which will correct reaction for discrepancies in H(T) and S(T), if known. We may add further classes later for higher temperature fidelity.
Usually, a standard reaction with reaktoro will do. However, if we don’t have much data this could come in handy.
@author P M Higgins @version 0.1
-
class
NutMEG.reaction.special.Tdep.
Tdep
(reactants, products, env, equilibrium=False, *args, **kwargs)¶ Bases:
NutMEG.reaction.reaction.reaction
Class for temperature dependent free energy calculations.
For use in a scenario where we do not have anything available in a thermochemical database but do have the RTP values and specific heat capacities of the reagents. Then, there are a few routes to DeltaG(T).
-
update_std_molar_enthalpy_of_reaction_T
()¶ Update the standard molar enthalpy at this temperature.
Use reactant paramters to get the non-RTP Delta H(T)^o, providing Cp takes integer polynomial form. This calculation is valid for ideal gases and infinitely diluted solutions.
-
update_std_molar_entropy_of_reaction_T
()¶ Update the standard entropy of at this temperature.
Use reactant paramters to get the non-RTP Delta S(T)^o, providing Cp takes integer polynomial form. This calculation is valid for ideal gases and infinitely diluted solutions.
-
NutMEG.reaction.special.solutions module¶
This is the solutions submodule of the reaction module. It emphasises the energy availability of reactions which take place in solutions, with a few corrections for temperature differences and a degree of non-ideality. There is a neutralsol class, an electrolyte class and a redox class. If it gets too messy then I’ll switch them up a bit.
All thermodynamic calculations in solution are to be done in molal form. For now, we are only considering water as the solvent.
@author P M Higgins @version 0.2
-
class
NutMEG.reaction.special.solutions.
electrolyte
(reactants, products, env, H2O=True, *args, **kwargs)¶ Bases:
reaction.reaction
Class for charged solutes in pH neutral solutions.
Used to calculate the mean activity/coefficients of fully dissociated salts in solution.
-
H2O
= True¶
-
get_a_salt
(getgamma=True)¶ Return the value of a_{salt}=a_{pm}^{ u} for this fully
dissolved salt.
a_{pm} = mean_gamma * mean_molal Set getgamma to False if you want to provide your owm mean activity coefficient.
-
get_ionic_strength_c
()¶ Return the ionic strength of the solution in mol/L.
Uses the concentration of the reagents.
-
get_ionic_strength_m
()¶ Return the ionic strength of the solution in mol/kg.
Uses the molality of the reagents.
-
get_permittivity
()¶ Return the relative pertmittivity of water at temperature T, using the expression fitted by Catenacio et al 2003. Definitely valid between 250-370 K — not sure about outside that, or at diferent pressures.
-
kappa
= None¶
-
kappa_cons
= 2.529122732e+20¶
-
mean_gamma
= None¶
-
update_gammas
()¶ Update the activity coefficent of the aqueous species in the reaction using Debeye-Huckel theory.
Requires reactants to have: conc, phase, charge
-
update_kappa
()¶ Calculate the kappa of the electrolyte for use in Debeye-Huckel theory and MSA theory.
If we have the volumes, calculations are done using molality and density. Otherwise, it uses concentrations.
-
update_mean_gamma
()¶ Update the mean activity coefficient for the aqueous ions, using the mean-spherical approximation.
Requires reactants to have: conc, radius, charge Ideally also pass the volume(s) of the solution to get molal activity coefficient.
-
-
class
NutMEG.reaction.special.solutions.
neutralsol
(reactants, products, env, solvent_activity=1.0, *args, **kwargs)¶ Bases:
reaction.reaction
Class for neutral solutes in neutral solutions, and so is rather general. The total activity of dissolved solutes can be calculated from the osmotic coefficient, which requires the activity of the solvent to be known.
-
phi
= 0.0¶
-
solute_activity
()¶
-
solvent_activity
= 1.0¶
-
total_molality
= 0.0¶
-
-
class
NutMEG.reaction.special.solutions.
redox
(forward, reverse, cell, n, env=<NutMEG.environment.environment.environment object>, H2O=True, *args, **kwargs)¶ Bases:
reaction.reaction
Class for redox reactions in solution
Will make extensive use of electrolye class, so in an ideal world our reactants have conc, molal, radius, and the V and V_RTP parameters arise from somewhere.
For now, we are considering a changing temperature and constant pressure at 1 bar, for reading off tables, though with reaktoro our entropies and heat capacities are updated with pressure. Whether this is the whole story is unlikely.
In the future if we decide to consider buffers or dissociating acids etc, these methods can be extended. For now they are limited to dissociated salts.
NOTE: This class only deals in dissociations/half reactions, if you want to work out the full redox potentials,use two redox objects and find the difference like you would on pen and paper.
-
E
= None¶
-
Fcons
= 96485.3329¶
-
H2O
= True¶
-
env
= <NutMEG.environment.environment.environment object>¶
-
forward
= None¶
-
get_equation
()¶ Return the overall cell reaction
-
n
= 0.0¶
-
react
(n)¶ Perform a reaction, consuming unit n moles of reactant.
Perform the update to the cell reaction. As all of the reactants are shared, this should automatically update the fwd and reverse reactions too.
-
reverse
= None¶
-
stdE
= None¶
-
stdE_RTP
= None¶
-
update_E
(getgamma=True, estimateDifferentials=True)¶ Calculate the electrode potential at the environmental temperature and pressure, though the latter is a little ambiguous.
If we have neither, then we can use the reaction quotient, which requires our reactants have assigned activities.
-
update_molar_gibbs
()¶ Update the standard molar gibbs free energy of this reaction.
-
update_quotient
(getgamma=True, qconc=False, qmolal=False)¶ Calculate the reaction quotient of the redox reaction.
Note that the forward reaction is the one which appears to be dissociating backwards — its kind of tricky to get your head around. We use the method in MT pp 544–546, which I have written up in a more mathematically general manner in my notes.
NOTE: this assumes only the ions taking part have an activity other than 1! In most cases this will be valid but not all.
-
-
class
NutMEG.reaction.special.solutions.
redox_half
(reactants, products, env, n, stdE_RTP, dE_by_dT=None, d2E_by_dT2=None, DeltaC_P=0.0, *args, **kwargs)¶ Bases:
NutMEG.reaction.special.solutions.electrolyte
Class for redox half equations, an extension of electrolyte so it can include non-dissociation reactions.
e.g. of the form Fe3+ + e- => Fe2+
-
Fcons
= 96485.3329¶
-
H2
= None¶
-
d2E_by_dT2
= None¶
-
dE_by_dT
= None¶
-
n
= 0.0¶
-
stdE
= 0.0¶
-
stdE_RTP
= 0.0¶
-
update_E
(estimate=True, newenv=False)¶ Update the electrode potential.
If we have dE/dT, great. If we have d2E/dT2 even better! If not, we can estimate them from entropy and isbaric heat capacities. Only do so when prompted though…
ref. salvi and deBethune 1961, Bratsch 1989 May be worth a recode as using nonstandard temperatures might improve accuracy.
-
update_std_molar_gibbs
()¶ Update the standard molar gibbs free energy of this half reaction.
-