Generate a dictionary of fluid properties using CoolProp.
Parameters:
p (float) – Pressure (Pa).
T (float) – Temperature (K)
Returns:
Dictionary containing several fluid properties needed for various
calculations in pytanksim. “hf” is the enthalpy (J/mol). “drho_dp”
is the first partial derivative of density (mol/m^3) w.r.t.
pressure (Pa). “drho_dT” is the first partial derivative of density
(mol/m^3) w.r.t. temperature (K). “rhof” is density (mol/m^3).
“dh_dp” is the first partial derivative of enthalpy (J/mol) w.r.t.
pressure (Pa). “dh_dT” is the first partial derivative of enthalpy
(J/mol) w.r.t. temperature (K). “uf” is the internal energy
(J/mol). “du_dp” is the first partial derivative of internal energy
(J/mol) w.r.t. pressure (Pa). “du_dT” is the first partial
derivative of internal energy (J/mol) w.r.t. temperature (K). “MW”
is molar mass (kg/mol).
Generate a dictionary of fluid properties at saturation.
Parameters:
T (float) – Temperature in K.
Q (float) – Vapor quality of the fluid being stored.
Returns:
A dictionary containing the fluid properties at saturation
at a given temperature. “psat” is the saturation vapor pressure
(Pa). “dps_dT” is the first derivative of the saturation vapor
pressure (Pa) w.r.t. temperature (K). “hf” is the enthalpy (J/mol).
“drho_dp” is the first partial derivative of density (mol/m^3)
w.r.t. pressure (Pa). “drho_dT” is the first partial derivative of
density (mol/m^3) w.r.t. temperature (K). “rhof” is density
(mol/m^3). “dh_dp” is the first partial derivative of enthalpy
(J/mol) w.r.t. pressure (Pa). “dh_dT” is the first partial
derivative of enthalpy (J/mol) w.r.t. temperature (K). “uf” is the
internal energy (J/mol). “du_dp” is the first partial derivative of
internal energy (J/mol) w.r.t. pressure (Pa). “du_dT” is the first
partial derivative of internal energy (J/mol) w.r.t. temperature
(K). “MW” is molar mass (kg/mol).
Calculate a pressure value corresponding to an adsorbed amount.
Parameters:
n_abs (float) – Amount adsorbed (mol/kg).
T (float) – Temperature (K).
p_max_guess (float, optional) – Maximum pressure (Pa) for the optimization. The default is 20E6.
If the value provided is larger than the maximum that can be
handled by the CoolProp backend, it will take the maximum that
can be handled by the CoolProp backend.
Returns:
Pressure (Pa) corresponding to the specified adsorbed amount
and temperature value.
It automatically decides the direction of the derivative so that the
evaluations are done for fluids at the same phases. Otherwise, there
will be discontinuities in the fluid properties at different phases
which causes the resulting derivative values to be invalid.
It automatically decides the direction of the derivative so that the
evaluations are done for fluids at the same phases. Otherwise, there
will be discontinuities in the fluid properties at different phases
which causes the resulting derivative values to be invalid.
The volume of the adsorbed phase (m^3/kg). The default is None.
If None and va_mode is “Constant”, the va_mode will be switched to
“Excess” and the va will be assumed to be 0.
Determines how the adsorbed phase volume is calculated. “Excess”
assumes that the adsorbed phase volume is 0, so the model
calculates excess adsorption instead of absolute adsorption.
“Constant” assumes a constant adsorbed phase volume. “Vary” will
assume that the adsorbed phase volume varies according to the pore
filling mechanism posited by the Dubinin-Astakhov equation. The
default is “Constant”, but if the parameter va is not specified it
will switch to “Excess”.
Determines how the adsorbed phase density is calculated. “Ozawa”
uses Ozawa’s approximation to calculate the adsorbed phase density.
“Constant” assumes a constant adsorbed phase volume. The default is
“Constant”.
Determines how the fugacity at saturation is calculated. “Dubinin”
uses Dubinin’s approximation. “Constant” assumes a constant value
for the fugacity at saturation. The default is “Dubinin”.
Type:
str, optional
Initialize the DAModel class.
Parameters:
sorbent (str) – Name of sorbent material.
stored_fluid (StoredFluid) – Object containing properties of the adsorbate.
w0 (float) – The volume of the adsorbed phase at saturation (m^3/kg).
f0 (float) – The fugacity at adsorption saturation (Pa).
eps (float) – Characteristic energy of adsorption (J/mol).
m (float, optional) – The empirical heterogeneity parameter for the Dubinin-Astakhov
model. The default is 2.
k (float, optional) – The empirical heterogeneity parameter for Dubinin’s approximation
of the saturation fugacity above critical temperatures. The default
is 2.
va (float, optional) – The volume of the adsorbed phase (m^3/kg). The default is None.
rhoa (float, optional) – The density of the adsorbed phase (mol/m^3). The default is None.
If None, the value will be taken as the liquid density at 1 bar.
va_mode (str, optional) – Determines how the adsorbed phase volume is calculated. “Excess”
assumes that the adsorbed phase volume is 0, so the model
calculates excess adsorption instead of absolute adsorption.
“Constant” assumes a constant adsorbed phase volume. “Vary” will
assume that the adsorbed phase volume varies according to the pore
filling mechanism posited by the Dubinin-Astakhov equation. The
default is “Constant”, but if the parameter va is not specified it
will switch to “Excess”.
rhoa_mode (str, optional) – Determines how the adsorbed phase density is calculated. “Ozawa”
uses Ozawa’s approximation to calculate the adsorbed phase density.
“Constant” assumes a constant adsorbed phase volume. The default is
“Constant”.
f0_mode (str, optional) – Determines how the fugacity at saturation is calculated. “Dubinin”
uses Dubinin’s approximation. “Constant” assumes a constant value
for the fugacity at saturation. The default is “Dubinin”.
Returns:
A DAModel object which can calculate excess and absolute adsorption
at various conditions as well as the thermophysical properties of
the adsorbed phase.
Fit the DA model to a list of ExcessIsotherm data.
Parameters:
ExcessIsotherms (List[ExcessIsotherm]) – A list containing ExcessIsotherm objects which contain measurement
data at various temperatures.
stored_fluid (StoredFluid, optional) – Object for calculating the properties of the adsorbate. The default
is None. If None, the StoredFluid object inside of one of the
ExcessIsotherm objects passed will be used.
sorbent (str, optional) – Name of sorbent material. The default is None. If None, name will
be taken from one of the ExcessIsotherm objects passed.
w0guess (float, optional) – The initial guess for the adsorbed phase volume at saturation
(m^3/kg). The default is 0.001.
f0guess (float, optional) – The initial guess for the fugacity at saturation (Pa). The default
is 1470E6.
epsguess (float, optional) – The initial guess for the characteristic energy of adsorption
(J/mol). The default is 3000.
vaguess (float, optional) – The initial guess for the volume of the adsorbed phase (m^3/kg).
The default is 0.001.
rhoaguess (float, optional) – The initial guess for the adsorbed phase density (mol/m^3).
The default is None. If None, it will be taken as the liquid
density at 1 bar.
mguess (float, optional) – The initial guess for the heterogeneity parameter of the
Dubinin-Astakhov equation. The default is 2.0.
kguess (float, optional) – The initial guess for the heterogeneity parameter of Dubinin’s
approximation method for saturation fugacity. The default is 2.0.
rhoa_mode (str, optional) – Determines how the density of the adsorbed phase (rhoa) is
calculated. If “Fit”, rhoa is a constant to be fitted
statistically. If “Ozawa”, Ozawa’s approximation is used to
calculate rhoa and rhoa is not a fitting parameter. If “Constant”,
the user supplied value for rhoaguess is taken as the density.
The default is “Fit”.
f0_mode (str, optional) – Determines how the fugacity at saturation (f0) is calculated. If
“Fit” then f0 is a constant to be statistically fitted to the data.
If “Dubinin” then Dubinin’s approximation is used. If “Constant”
then the user supplied value for f0guess is used. The default is
“Fit”.
m_mode (str, optional) – Determines whether the heterogeneity parameter of the Dubinin-
Astakhov equation is taken as a user-supplied constant (if
“Constant”) or a fitted parameter (if “Fit”). The default is “Fit”.
k_mode (str, optional) – Determines whether the heterogeneity parameter of Dubinin’s
approximation for the fugacity above the critical temperature is
taken as a user-supplied constant value (if “Constant”) or as a
statistically fitted parameter (if “Fit”). The default is “Fit”.
va_mode (str, optional) – Determines how the volume of the adsorbed phase is calculated. If
“Fit”, the value is a statistically fitted constant. If “Constant”,
the value is the user defined value vaguess. If “Vary”, the value
varies w.r.t. pressure according to the micropore filling
mechanism posited by the Dubinin-Astakhov model. The default is
“Excess”.
pore_volume (float, optional) – The experimentally measured pore volume of the sorbent material
(m^3/kg). It serves as the maximum possible physical value for the
parameters w0 and va. The default is 0.003.
verbose (bool, optional) – Determines whether or not the complete fitting quality report is
logged for the user. The default is True.
Returns:
A DAModel object which can calculate excess and absolute adsorption
at various conditions as well as the thermophysical properties of
the adsorbed phase.
A class for the Modified Dubinin-Astakhov model for adsorption.
A key modification compared to the DA model is the use of the enthalpic and
entropic factors to calculate the adsorption energy as a function of
temperature instead of treating it as a constant.
Initialize the MDAModel class.
Parameters:
sorbent (str) – Name of the sorbent material.
stored_fluid (StoredFluid) – Object to calculate the thermophysical properties of the adsorbate.
nmax (float) – Maximum adsorbed amount (mol/kg) at saturation.
f0 (float) – Fugacity at saturation (Pa).
alpha (float) – The empirical enthalpic factor for determining the characteristic
energy of adsorption.
beta (float) – The empirical entropic factor for determining the characteristic
energy of adsorption.
va (float) – The volume of the adsorbed phase (m^3/kg).
m (float, optional) – The empirical heterogeneity parameter for the Dubinin-Astakhov
model. The default is 2.
k (float, optional) – The empirical heterogeneity parameter for Dubinin’s approximation
of the saturation fugacity above critical temperatures. The default
is 2.
va_mode (str, optional) – Determines how the adsorbed phase density is calculated. “Ozawa”
uses Ozawa’s approximation to calculate the adsorbed phase density.
“Constant” assumes a constant adsorbed phase volume. The default is
“Constant”.
f0_mode (str, optional) – Determines how the fugacity at saturation is calculated. “Dubinin”
uses Dubinin’s approximation. “Constant” assumes a constant value
for the fugacity at saturation. The default is “Constant”.
Returns:
An MDAModel object. It can calculate the excess and absolute
adsorbed amounts at various pressures and temperatures, and it can
provide thermophysical properties of the adsorbed phase.
Fit the MDA model from a list of excess adsorption data.
Parameters:
ExcessIsotherms (List[ExcessIsotherm]) – A list of ExcessIsotherm objects which contain measurement
data at various temperatures.
stored_fluid (StoredFluid, optional) – Object for calculating the properties of the adsorbate. The default
is None. If None, the StoredFluid object inside of one of the
ExcessIsotherm objects passed will be used.
sorbent (str, optional) – Name of sorbent material. The default is None. If None, name will
be taken from one of the ExcessIsotherm objects passed.
nmaxguess (float, optional) – The initial guess for the maximum adsorbed amount (mol/kg). The
default is 71.6.
f0guess (float, optional) – The initial guess for the fugacity at saturation (Pa). The default
is 1470E6.
alphaguess (float, optional) – The initial guess for the enthalpy factor determining the
characteristic energy of adsorption. The default is 3080.
betaguess (float, optional) – The initial guess for the entropy factor determining the
characteristic energy of adsorption. The default is 18.9.
vaguess (float, optional) – Initial guess for the adsorbed phase volume (m^3/kg). The default
is 0.00143.
mguess (float, optional) – The initial guess for the heterogeneity parameter of the
Dubinin-Astakhov equation. The default is 2.0.
kguess (float, optional) – The initial guess for the heterogeneity parameter of Dubinin’s
approximation method for saturation fugacity. The default is 2.0.
va_mode (str, optional) – Determines how the volume of the adsorbed phase (va) is
calculated. If “Fit”, va is a constant to be fitted
statistically. If “Ozawa”, Ozawa’s approximation is used to
calculate va and va is not a fitting parameter. If “Constant”,
the user supplied value for vaguess is taken as the volume.
The default is “Fit”.
f0_mode (str, optional) – Determines how the fugacity at saturation (f0) is calculated. If
“Fit” then f0 is a constant to be statistically fitted to the data.
If “Dubinin” then Dubinin’s approximation is used. If “Constant”
then the user supplied value for f0guess is used. The default is
“Fit”.
m_mode (str, optional) – Determines whether the heterogeneity parameter of the Dubinin-
Astakhov equation is taken as a user-supplied constant (if
“Constant”) or a fitted parameter (if “Fit”). The default is “Fit”.
k_mode (str, optional) – Determines whether the heterogeneity parameter of Dubinin’s
approximation for the fugacity above the critical temperature is
taken as a user-supplied constant value (if “Constant”) or as a
statistically fitted parameter (if “Fit”). The default is “Fit”.
beta_mode (str, optional) – Determines whether the entropic factor determining the
characteristic energy of adsorption is taken as a user-supplied
constant (if “Constant”) or as a fitted parameter (if “Fit”). The
default is “Fit”.
pore_volume (float, optional) – The experimentally measured pore volume of the sorbent material
(m^3/kg). It serves as the maximum possible physical value for the
parameters w0 and va. The default is 0.003.
verbose (bool, optional) – Determines whether or not the complete fitting quality report is
logged for the user. The default is True.
Returns:
An MDAModel object. It can calculate the excess and absolute
adsorbed amounts at various pressures and temperatures, and it can
provide thermophysical properties of the adsorbed phase.
A function which takes in the temperature (K) of the sorbent and
returns its specific heat capacity (J/(kg K)). If specified, this
function will override the Debye model for specific heat calculation.
The default is None.
Type:
Callable[[float], float], optional
Initialize the SorbentMaterial class.
Parameters:
skeletal_density (float) – Skeletal density of the sorbent (kg/m^3).
bulk_density (float) – Tapped/compacted bulk density of the sorbent (kg/m^3).
specific_surface_area (float) – Specific surface area of the sorbent (m^2/g).
model_isotherm (ModelIsotherm) – Model of fluid adsorption on the sorbent.
mass (float, optional) – Mass of sorbent (kg). The default is None.
molar_mass (float, optional) – Molar mass of the sorbent material. The default is 12.01E-3 which
corresponds to carbon materials.
Debye_temperature (float, optional) – The Debye temperature determining the specific heat of the sorbent
at various temperatures. The default is 1500, the value for carbon.
heat_capacity_function (Callable, optional) – A function which takes in the temperature (K) of the sorbent and
returns its specific heat capacity (J/(kg K)). If specified, this
function will override the Debye model for specific heat
calculation. The default is None.
Returns:
Class containing the properties of a sorbent material.