sandlerchemeq package¶
- class Component[source]¶
Bases:
CompoundA chemical component with thermochemical and system properties based on the Compound class of sandlerprops.
- classmethod from_compound(compound, **kwargs)[source]¶
Create a Component instance from a Compound instance
- Parameters:
compound (Compound) – An instance of the Compound class
- Returns:
component – An instance of the Component class
- Return type:
- Cp_polynomial_as_tex()[source]¶
Returns a LaTeX-formatted string for the compound’s heat capacity polynomial
- Returns:
retstr – LaTeX formatted heat capacity polynomial string
- Return type:
- CpInt_polynomial_as_tex()[source]¶
Returns a LaTeX-formatted string for the integral of the compound’s heat capacity polynomial
- Returns:
retstr – LaTeX formatted integral of heat capacity polynomial string
- Return type:
- __eq__(other)[source]¶
Compounds are equal if their empirical formulas are identical
- Parameters:
other (Compound)
- __init__(No=0, Formula='', Name='', Molwt=<factory>, Tfp=<factory>, Tb=<factory>, Tc=<factory>, Pc=<factory>, Vc=<factory>, Zc=0.0, Omega=0.0, Dipm=<factory>, CpA=0.0, CpB=0.0, CpC=0.0, CpD=0.0, dHf=<factory>, dGf=<factory>, Eq=0, VpA=0.0, VpB=0.0, VpC=0.0, VpD=0.0, Tmin=<factory>, Tmax=<factory>, Lden=0.0, Tden=<factory>, charge=0, atomset=<factory>, atomdict=<factory>, metadata=<factory>, T=<factory>, P=<factory>, Tref=<factory>)¶
- Parameters:
No (int)
Formula (str)
Name (str)
Molwt (Quantity)
Tfp (Quantity)
Tb (Quantity)
Tc (Quantity)
Pc (Quantity)
Vc (Quantity)
Zc (float)
Omega (float)
Dipm (Quantity)
CpA (float)
CpB (float)
CpC (float)
CpD (float)
dHf (Quantity)
dGf (Quantity)
Eq (int)
VpA (float)
VpB (float)
VpC (float)
VpD (float)
Tmin (Quantity)
Tmax (Quantity)
Lden (float)
Tden (Quantity)
charge (int)
atomset (set)
atomdict (dict)
metadata (dict)
T (Quantity)
P (Quantity)
Tref (Quantity)
- Return type:
None
- class Reaction[source]¶
Bases:
objectA chemical reaction consisting of reactant and product Components. Automatically balances the reaction upon initialization.
- __init__(components=<factory>, nu=<factory>, stoProps=<factory>)¶
- class ChemEqSystem[source]¶
Bases:
objectChemical equilibrium system solver using either explicit reactions with equilibrium constants or implicit Lagrange multiplier method.
- __init__(P=<factory>, T=<factory>, components=<factory>, N0=<factory>, reactions=<factory>, N=<factory>, ys=<factory>)¶
- solve_implicit(Xinit=None, ideal=True, simplified=False)[source]¶
Implicit solution of M equations using equilibrium constants. Solutions are stored in attributes Xeq, N, and ys.
- Parameters:
Xinit (list, optional) – Initial guess for extent of reaction (default is zeros)
ideal (bool, optional) – Whether to assume ideal behavior (default is True)
simplified (bool, optional) – Whether to use simplified van’t Hoff equation (default is False). Use
False(full van’t Hoff with Cp correction) to match the Lagrange solver.Trueomits the heat-capacity correction and is provided for educational comparison only.
- solve_lagrange(ideal=True, zInit=[])[source]¶
Implicit solution of chemical equilibrium system using Lagrange multipliers. Solutions are stored in attributes N and ys.
- Parameters:
ideal (bool, optional) – Whether to assume ideal behavior (default is True) (NOT USED)
zInit (np.ndarray, optional) – Initial guess for mole numbers and Lagrange multipliers (default is [])