[Transport] add dispersion coefficient and quadrupole polarizability
This commit is contained in:
parent
4b4128aebd
commit
b7e32e4604
7 changed files with 85 additions and 12 deletions
|
|
@ -478,6 +478,12 @@ protected:
|
|||
*/
|
||||
vector_fp m_w_ac;
|
||||
|
||||
//! Dispersion coefficient
|
||||
vector_fp m_disp;
|
||||
|
||||
//! Quadrupole polarizability
|
||||
vector_fp m_quad_polar;
|
||||
|
||||
//! Level of verbose printing during initialization
|
||||
int m_log_level;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -35,7 +35,8 @@ public:
|
|||
GasTransportData(const std::string& geometry, double diameter,
|
||||
double well_depth, double dipole=0.0,
|
||||
double polarizability=0.0, double rot_relax=0.0,
|
||||
double acentric=0.0);
|
||||
double acentric=0.0, double dispersion=0.0,
|
||||
double quad_polar=0.0);
|
||||
|
||||
//! Set the parameters using "customary" units: diameter in Angstroms, well
|
||||
//! depth in Kelvin, dipole in Debye, and polarizability in Angstroms^3.
|
||||
|
|
@ -43,7 +44,8 @@ public:
|
|||
void setCustomaryUnits(const std::string& geometry, double diameter,
|
||||
double well_depth, double dipole=0.0,
|
||||
double polarizability=0.0, double rot_relax=0.0,
|
||||
double acentric=0.0);
|
||||
double acentric=0.0, double dispersion=0.0,
|
||||
double quad_polar=0.0);
|
||||
|
||||
//! Check transport data for invalid parameters such as a geometry
|
||||
//! inconsistent with the atomic composition, non-positive diameter, or
|
||||
|
|
@ -74,6 +76,12 @@ public:
|
|||
|
||||
//! Pitzer's acentric factor [dimensionless]. Default 0.0.
|
||||
double acentric_factor;
|
||||
|
||||
//! dispersion normalized by e^2. [m^5] Default 0.0.
|
||||
double dispersion_coefficient;
|
||||
|
||||
//! quadrupole. Default 0.0.
|
||||
double quadrupole_polarizability;
|
||||
};
|
||||
|
||||
//! Create a new TransportData object from a 'transport' XML_Node.
|
||||
|
|
|
|||
|
|
@ -407,8 +407,8 @@ cdef extern from "cantera/transport/TransportData.h" namespace "Cantera":
|
|||
|
||||
cdef cppclass CxxGasTransportData "Cantera::GasTransportData" (CxxTransportData):
|
||||
CxxGasTransportData()
|
||||
CxxGasTransportData(string, double, double, double, double, double, double)
|
||||
void setCustomaryUnits(string, double, double, double, double, double, double)
|
||||
CxxGasTransportData(string, double, double, double, double, double, double, double, double)
|
||||
void setCustomaryUnits(string, double, double, double, double, double, double, double, double)
|
||||
|
||||
string geometry
|
||||
double diameter
|
||||
|
|
@ -417,6 +417,8 @@ cdef extern from "cantera/transport/TransportData.h" namespace "Cantera":
|
|||
double polarizability
|
||||
double rotational_relaxation
|
||||
double acentric_factor
|
||||
double dispersion_coefficient
|
||||
double quadrupole_polarizability
|
||||
|
||||
|
||||
cdef extern from "cantera/equil/MultiPhase.h" namespace "Cantera":
|
||||
|
|
|
|||
|
|
@ -959,7 +959,8 @@ class gas_transport(transport):
|
|||
"""
|
||||
def __init__(self, geom,
|
||||
diam = 0.0, well_depth = 0.0, dipole = 0.0,
|
||||
polar = 0.0, rot_relax = 0.0, acentric_factor = None):
|
||||
polar = 0.0, rot_relax = 0.0, acentric_factor = None,
|
||||
disp_coeff = 0.0, quad_polar = 0.0):
|
||||
"""
|
||||
:param geom:
|
||||
A string specifying the molecular geometry. One of ``atom``,
|
||||
|
|
@ -978,6 +979,12 @@ class gas_transport(transport):
|
|||
:param w_ac:
|
||||
Pitzer's acentric factor. Dimensionless.
|
||||
Default: 0.0
|
||||
:param disp_coeff:
|
||||
The dispersion coefficient in A^5
|
||||
Default: 0.0
|
||||
:param quad_polar:
|
||||
The quadrupole polarizability
|
||||
Default: 0.0
|
||||
"""
|
||||
self._geom = geom
|
||||
self._diam = diam
|
||||
|
|
@ -986,6 +993,8 @@ class gas_transport(transport):
|
|||
self._polar = polar
|
||||
self._rot_relax = rot_relax
|
||||
self._w_ac = acentric_factor
|
||||
self._disp_coeff = disp_coeff
|
||||
self._quad_polar = quad_polar
|
||||
|
||||
def build(self, t):
|
||||
#t = s.addChild("transport")
|
||||
|
|
@ -1000,6 +1009,8 @@ class gas_transport(transport):
|
|||
addFloat(t, "rotRelax", self._rot_relax,'%8.3f')
|
||||
if self._w_ac is not None:
|
||||
addFloat(t, "acentric_factor", self._w_ac, '%8.3f')
|
||||
addFloat(t, "dispersion_coefficient", (self._disp_coeff, 'A5'),'%8.3f')
|
||||
addFloat(t, "quadrupole_polarizability", (self._quad_polar, 'A5'),'%8.3f')
|
||||
|
||||
class rate_expression(object):
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -30,11 +30,13 @@ cdef class GasTransportData:
|
|||
"""
|
||||
def __cinit__(self, geometry='', diameter=-1, well_depth=-1,
|
||||
dipole=0.0, polarizability=0.0, rotational_relaxation=0.0,
|
||||
acentric_factor=0.0, *, init=True):
|
||||
acentric_factor=0.0, dispersion_coefficient=0.0,
|
||||
quadrupole_polarizability=0.0, *, init=True):
|
||||
if init:
|
||||
self._data.reset(new CxxGasTransportData(stringify(geometry),
|
||||
diameter, well_depth, dipole, polarizability,
|
||||
rotational_relaxation, acentric_factor))
|
||||
rotational_relaxation, acentric_factor,
|
||||
dispersion_coefficient, quadrupole_polarizability))
|
||||
self.data = <CxxGasTransportData*?>self._data.get()
|
||||
|
||||
cdef _assign(self, shared_ptr[CxxTransportData] other):
|
||||
|
|
@ -43,14 +45,16 @@ cdef class GasTransportData:
|
|||
|
||||
def set_customary_units(self, geometry, diameter, well_depth, dipole=0.0,
|
||||
polarizability=0.0, rotational_relaxation=0.0,
|
||||
acentric_factor=0.0):
|
||||
acentric_factor=0.0, dispersion_coefficient=0.0,
|
||||
quadrupole_polarizability=0.0):
|
||||
"""
|
||||
Set the parameters using "customary" units: diameter in Angstroms, well
|
||||
depth in Kelvin, dipole in Debye, and polarizability in Angstroms^3.
|
||||
These are the units used in in CK-style input files.
|
||||
"""
|
||||
self.data.setCustomaryUnits(stringify(geometry), diameter, well_depth,
|
||||
dipole, polarizability, rotational_relaxation, acentric_factor)
|
||||
dipole, polarizability, rotational_relaxation, acentric_factor,
|
||||
dispersion_coefficient, quadrupole_polarizability)
|
||||
|
||||
property geometry:
|
||||
"""
|
||||
|
|
@ -108,6 +112,20 @@ cdef class GasTransportData:
|
|||
def __set__(self, acentric_factor):
|
||||
self.data.acentric_factor = acentric_factor
|
||||
|
||||
property dispersion_coefficient:
|
||||
""" Get/Set dispersion coefficient. [m^5] """
|
||||
def __get__(self):
|
||||
return self.data.dispersion_coefficient
|
||||
def __set__(self, dispersion_coefficient):
|
||||
self.data.dispersion_coefficient = dispersion_coefficient
|
||||
|
||||
property quadrupole_polarizability:
|
||||
""" Get/Set quadrupole polarizability. [m^5] """
|
||||
def __get__(self):
|
||||
return self.data.quadrupole_polarizability
|
||||
def __set__(self, quadrupole_polarizability):
|
||||
self.data.quadrupole_polarizability = quadrupole_polarizability
|
||||
|
||||
|
||||
cdef class Transport(_SolutionBase):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -322,6 +322,8 @@ void GasTransport::setupMM()
|
|||
m_sigma.resize(m_nsp);
|
||||
m_eps.resize(m_nsp);
|
||||
m_w_ac.resize(m_nsp);
|
||||
m_disp.resize(m_nsp, 0.0);
|
||||
m_quad_polar.resize(m_nsp, 0.0);
|
||||
|
||||
const vector_fp& mw = m_thermo->molecularWeights();
|
||||
getTransportData();
|
||||
|
|
@ -414,6 +416,8 @@ void GasTransport::getTransportData()
|
|||
m_alpha[k] = sptran->polarizability;
|
||||
m_zrot[k] = sptran->rotational_relaxation;
|
||||
m_w_ac[k] = sptran->acentric_factor;
|
||||
m_disp[k] = sptran->dispersion_coefficient;
|
||||
m_quad_polar[k] = sptran->quadrupole_polarizability;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,13 +18,16 @@ GasTransportData::GasTransportData()
|
|||
, polarizability(0.0)
|
||||
, rotational_relaxation(0.0)
|
||||
, acentric_factor(0.0)
|
||||
, dispersion_coefficient(0.0)
|
||||
, quadrupole_polarizability(0.0)
|
||||
{
|
||||
}
|
||||
|
||||
GasTransportData::GasTransportData(
|
||||
const std::string& geometry_,
|
||||
double diameter_, double well_depth_, double dipole_,
|
||||
double polarizability_, double rot_relax, double acentric)
|
||||
double polarizability_, double rot_relax, double acentric,
|
||||
double dispersion, double quad_polar)
|
||||
: geometry(geometry_)
|
||||
, diameter(diameter_)
|
||||
, well_depth(well_depth_)
|
||||
|
|
@ -32,13 +35,16 @@ GasTransportData::GasTransportData(
|
|||
, polarizability(polarizability_)
|
||||
, rotational_relaxation(rot_relax)
|
||||
, acentric_factor(acentric)
|
||||
, dispersion_coefficient(dispersion)
|
||||
, quadrupole_polarizability(quad_polar)
|
||||
{
|
||||
}
|
||||
|
||||
void GasTransportData::setCustomaryUnits(
|
||||
const std::string& geometry_,
|
||||
double diameter_, double well_depth_, double dipole_,
|
||||
double polarizability_, double rot_relax, double acentric)
|
||||
double polarizability_, double rot_relax, double acentric,
|
||||
double dispersion, double quad_polar)
|
||||
{
|
||||
geometry = geometry_;
|
||||
diameter = 1e-10 * diameter_; // convert from Angstroms to m
|
||||
|
|
@ -47,6 +53,8 @@ void GasTransportData::setCustomaryUnits(
|
|||
polarizability = 1e-30 * polarizability_; // convert from Angstroms^3 to m^3
|
||||
rotational_relaxation = rot_relax; // pure number
|
||||
acentric_factor = acentric; // dimensionless
|
||||
dispersion_coefficient = 1e-50 * dispersion; // convert from Angstroms^5 to m^5
|
||||
quadrupole_polarizability = 1e-50 * quad_polar; // convert from Angstroms^5 to m^5
|
||||
}
|
||||
|
||||
void GasTransportData::validate(const Species& sp)
|
||||
|
|
@ -105,6 +113,16 @@ void GasTransportData::validate(const Species& sp)
|
|||
throw CanteraError("GasTransportData::validate",
|
||||
"negative rotation relaxation number for species '{}'.", sp.name);
|
||||
}
|
||||
|
||||
if (dispersion_coefficient < 0.0) {
|
||||
throw CanteraError("GasTransportData::validate",
|
||||
"negative dispersion coefficient for species '{}'.", sp.name);
|
||||
}
|
||||
|
||||
if (quadrupole_polarizability < 0.0) {
|
||||
throw CanteraError("GasTransportData::validate",
|
||||
"negative quadrupole polarizability for species '{}'.", sp.name);
|
||||
}
|
||||
}
|
||||
|
||||
void setupGasTransportData(GasTransportData& tr, const XML_Node& tr_node)
|
||||
|
|
@ -126,8 +144,14 @@ void setupGasTransportData(GasTransportData& tr, const XML_Node& tr_node)
|
|||
double acentric = 0.0;
|
||||
getOptionalFloat(tr_node, "acentric_factor", acentric);
|
||||
|
||||
double dispersion = 0.0;
|
||||
getOptionalFloat(tr_node, "dispersion_coefficient", dispersion);
|
||||
|
||||
double quad = 0.0;
|
||||
getOptionalFloat(tr_node, "quadrupole_polarizability", quad);
|
||||
|
||||
tr.setCustomaryUnits(geometry, diam, welldepth, dipole, polar,
|
||||
rot, acentric);
|
||||
rot, acentric, dispersion, quad);
|
||||
}
|
||||
|
||||
shared_ptr<TransportData> newTransportData(const XML_Node& transport_node)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue