From 4ff9e61e0de903803c53f29ccd58bfe831481035 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Thu, 6 Sep 2012 19:59:58 +0000 Subject: [PATCH] Added docstrings for Cython Transport class --- doc/sphinx/cython/index.rst | 1 + doc/sphinx/cython/transport.rst | 7 ++++ interfaces/cython/cantera/transport.pyx | 44 +++++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 doc/sphinx/cython/transport.rst diff --git a/doc/sphinx/cython/index.rst b/doc/sphinx/cython/index.rst index 9bfa4f5a2..caf27fbaf 100644 --- a/doc/sphinx/cython/index.rst +++ b/doc/sphinx/cython/index.rst @@ -8,3 +8,4 @@ Contents: thermo kinetics + transport diff --git a/doc/sphinx/cython/transport.rst b/doc/sphinx/cython/transport.rst new file mode 100644 index 000000000..2c2242f8d --- /dev/null +++ b/doc/sphinx/cython/transport.rst @@ -0,0 +1,7 @@ +.. py:currentmodule:: cantera + +Transport Properties +==================== + +.. autoclass:: Transport +.. autoclass:: DustyGasTransport diff --git a/interfaces/cython/cantera/transport.pyx b/interfaces/cython/cantera/transport.pyx index fe8ecc82c..2297f0545 100644 --- a/interfaces/cython/cantera/transport.pyx +++ b/interfaces/cython/cantera/transport.pyx @@ -20,12 +20,23 @@ cdef np.ndarray get_transport_2d(Transport tran, transportMethod2d method): cdef class Transport(_SolutionBase): + """ + This class is used to compute transport properties for a phase of matter. + + Not all transport properties are implemented in all transport models. + """ def __init__(self, *args, **kwargs): if self.transport == NULL: self.transport = newDefaultTransportMgr(self.thermo) super().__init__(*args, **kwargs) property transportModel: + """ + Get/Set the transport model associated with this transport model. + + Setting a new transport model deletes the underlying C++ Transport + object and replaces it with a new one implementing the specified model. + """ def __get__(self): return pystr(transportModelName(self.transport.model())) @@ -35,59 +46,92 @@ cdef class Transport(_SolutionBase): del old # only if the new transport manager was successfully created property viscosity: + """Viscosity [Pa-s]""" def __get__(self): return self.transport.viscosity() property thermalConductivity: + """Thermal conductivity. [W/m/K]""" def __get__(self): return self.transport.thermalConductivity() property mixDiffCoeffs: + """ + Mixture-averaged diffusion coefficients [m^2/s] relating the + mass-averaged diffusive fluxes (with respect to the mass averaged + velocity) to gradients in the species mole fractions. + """ def __get__(self): return get_transport_1d(self, tran_getMixDiffCoeffs) property mixDiffCoeffsMass: + """ + Mixture-averaged diffusion coefficients [m^2/s] relating the + diffusive mass fluxes to gradients in the species mass fractions. + """ def __get__(self): return get_transport_1d(self, tran_getMixDiffCoeffsMass) property mixDiffCoeffsMole: + """ + Mixture-averaged diffusion coefficients [m^2/s] relating the + molar diffusive fluxes to gradients in the species mole fractions. + """ def __get__(self): return get_transport_1d(self, tran_getMixDiffCoeffsMole) property thermalDiffCoeffs: + """ + Return a one-dimensional array of the species thermal diffusion + coefficients [kg/m/s]. + """ def __get__(self): return get_transport_1d(self, tran_getThermalDiffCoeffs) property multiDiffCoeffs: + """Multicomponent diffusion coefficients [m^2/s]""" def __get__(self): return get_transport_2d(self, tran_getMultiDiffCoeffs) property binaryDiffCoeffs: + """Binary diffusion coefficients [m^2/s]""" def __get__(self): return get_transport_2d(self, tran_getBinaryDiffCoeffs) cdef class DustyGasTransport(Transport): + """ + Implements the "dusty gas" model for transport in porous media. + + As implemented here, only species transport (`~Transport.multiDiffCoeffs`) + is handled. The viscosity, thermal conductivity, and thermal diffusion + coefficients are not implemented. + """ def __init__(self, *args, **kwargs): self.transport = newTransportMgr(stringify("DustyGas"), self.thermo) super().__init__(*args, **kwargs) property porosity: + """Porosity of the porous medium [dimensionless]""" def __set__(self, value): (self.transport).setPorosity(value) property tortuosity: + """Tortuosity of the porous medium [dimensionless]""" def __set__(self, value): (self.transport).setTortuosity(value) property meanPoreRadius: + """Mean pore radius of the porous medium [m]""" def __set__(self, value): (self.transport).setMeanPoreRadius(value) property meanParticleDiameter: + """Mean particle diameter of the porous medium [m]""" def __set__(self, value): (self.transport).setMeanParticleDiameter(value) property permeability: + """Permeability of the porous medium [m^2]""" def __set__(self, value): (self.transport).setPermeability(value)