Descriptive Naming
Most of the modules in ChemApp for Python use a common naming convention. The
only exception to this is the basic
module, which is meant to be a copy of
the original ChemApp API. It therefore retains all the naming used in
ChemApp.
The purpose of the naming convention is to ensure that Python code that uses ChemApp for Python is easily readable and understandable.
The ChemApp for Python naming convention uses a set of one-, two-, and three-letter abbreviations for frequently used terms. This is shown in the following table.
Abbreviation |
Term |
Abbreviation |
Quantity |
---|---|---|---|
eq |
equilibrium |
A |
amount |
mm |
molar mass |
AC |
relative activity |
ph |
phase |
CP |
heat capacity |
phs |
phases |
E |
energy |
pc |
phase constituent |
G |
Gibbs energy |
pcs |
phase constituents |
H |
enthalpy |
sc |
system component |
IA |
incoming amount |
scs |
system components |
MU |
chemical potential |
st |
stream |
P |
pressure |
sts |
streams |
S |
entropy |
tg |
target |
T |
temperature |
tx |
transition |
V |
volume |
txs |
transitions |
VT |
total volume |
X |
amount fraction |
||
XT |
mole fraction |
||
Y |
mass fraction |
These abbreviations are used to create descriptive and easily readable names for functions and variables. Here are a few examples.
from chemapp.friendly import ThermochemicalSystem
from chemapp.friendly import EquilibriumCalculation
# get the number of system components in the thermochemical system
ThermochemicalSystem.get_count_scs()
# get the molar mass of the system component 'Fe'
mm_Fe = ThermochemicalSystem.get_mm_sc('Fe')
# set the equilibrium pressure and temperature for a calculation
EquilibriumCalculation.set_eq_P(1.0)
EquilibriumCalculation.set_eq_T(1000.0)
# get the equilibrium amounts of all phases after a calculation
amounts = EquilibriumCalculation.get_eq_A_phs()
# get the equilibrium Gibbs energy of a phase after a calculation
G = EquilibriumCalculation.get_eq_G_ph('gas_ideal')