Calculating properties using class¶
All calculations are performed by a single simple class. The class solves all unit conversion problems.
Currently, it is impossible to reuse same class object for calculating another gas. You need to create another class instance instead.
Examples¶
from ifg_py import IfgCalculator, get_metal_specific_volume
import numpy as np
# see `get_metal_specific_volume` reference for details
v_al = get_metal_specific_volume(density_sgs=2.70, molar_mass_sgs=26.98, num_electrons=3)
T_range = np.array([1, 10, 100, 1000])
calculator = IfgCalculator(temperatures=T_range, specific_volumes=v_al, input_in_si=True, output_in_si=True)
calculator.mu
# array([[9.82775992e+16], [9.82775987e+16], [9.82775550e+16], [9.82731832e+16]])
calculator.p
# array([[1.56068519e-16], [1.56068523e-16], [1.56068870e-16], [1.56103577e-16]])
API Reference¶
-
class
ifg_py.ifg.IfgCalculator(specific_volumes, temperatures, input_in_si, output_in_si)¶ -
C_P¶ Get IFG heat capacity C_P in atomic units
Returns: C_P[i][j] - C_P in atomic units. i-th index is for temperature, j-th one is for volume
-
C_S¶ Get IFG sound speed C_S in atomic units
Returns: C_S[i][j] - C_S in atomic units. i-th index is for temperature, j-th one is for volume
-
C_T¶ Get IFG sound speed C_T in atomic units
Returns: C_T[i][j] - C_T in atomic units. i-th index is for temperature, j-th one is for volume
-
C_V¶ Get IFG heat capacity C_V in atomic units
Returns: C_V[i][j] - C_V in atomic units. i-th index is for temperature, j-th one is for volume
-
F¶ Get IFG Helmholtz potential F in atomic units
Returns: F[i][j] - Helmholtz free energy in atomic units. i-th index is for temperature, j-th one is for volume
-
S¶ Get IFG entropy S in atomic units
Returns: S[i][j] - Entropy in atomic units. i-th index is for temperature, j-th one is for volume
-
get_all_properties(csv_dir=None)¶ Calculate all properties and save them to csv file
Parameters: csv_dir – Directory to save csv files to Returns: dict {‘property_name’: ndarray}
-
mu¶ Get IFG chemical potential mu in atomic units
Returns: mu[i][j] - chemical potential in atomic units. i-th index is for temperature, j-th one is for volume
-
p¶ Get IFG pressure P in atomic units
Returns: P[i][j] - Pressure in atomic units. i-th index is for temperature, j-th one is for volume
-