Added physical constants to the new Python module

This commit is contained in:
Ray Speth 2012-09-06 19:55:40 +00:00
parent 3a838018fc
commit eabb46b9e7
3 changed files with 51 additions and 0 deletions

View file

@ -1 +1,2 @@
from .solution import *
from .constants import *

View file

@ -0,0 +1,49 @@
cdef extern from "cantera/base/ct_defs.h" namespace "Cantera":
cdef double CxxAvogadro "Cantera::Avogadro"
cdef double CxxGasConstant "Cantera::GasConstant"
cdef double CxxOneAtm "Cantera::OneAtm"
cdef double CxxBoltzmann "Cantera::Boltzmann"
cdef double CxxPlanck "Cantera::Planck"
cdef double CxxStefanBoltz "Cantera::StefanBoltz"
cdef double CxxFaraday "Cantera::Faraday"
cdef double CxxElectronCharge "Cantera::ElectronCharge"
cdef double CxxElectronMass "Cantera::ElectronMass"
cdef double CxxLightSpeed "Cantera::lightSpeed"
cdef double CxxPermeability_0 "Cantera::permeability_0"
cdef double CxxEpsilon_0 "Cantera::epsilon_0"
#: Avogadro's Number, /kmol
Avogadro = CxxAvogadro
#: The ideal gas constant in J/kmo-K
GasConstant = CxxGasConstant
#: One atmosphere in Pascals
OneAtm = CxxOneAtm
#: Boltzmann constant
Boltzmann = CxxBoltzmann
#: Planck constant (J/s)
Planck = CxxPlanck
#: The Stefan-Boltzmann constant, W/m^2K^4
StefanBoltz = CxxStefanBoltz
#: The charge on an electron (C)
ElectronCharge = CxxElectronCharge
#: The mass of an electron (kg)
ElectronMass = CxxElectronMass
#: Faraday constant, C/kmol
Faraday = CxxFaraday
#: Speed of Light (m/s).
lightSpeed = CxxLightSpeed
#: Permeability of free space :math:`\mu_0` in N/A^2.
permeability_0 = CxxPermeability_0
#: Permittivity of free space (Farads/m = C^2/N/m^2)
epsilon_0 = CxxEpsilon_0

View file

@ -22,6 +22,7 @@ def addExtension(name):
addExtension('solution')
addExtension('utils')
addExtension('constants')
setup(name="Cantera",
version="@cantera_version@",