コード例 #1
0
ファイル: engine.py プロジェクト: calbaker/TE_Model
    def __init__(self,**kwargs):
        
        """Sets constants

        Methods:
        
        self.air.set_TempPress_dependents()

        Instantiated in hx.py in HX class

        """

        if 'RPM' in kwargs:
            self.RPM = kwargs['kwargs']
        else:
            self.RPM = 2000. # engine speed (RPM)
        if 'torque' in kwargs:
            self.torque = kwargs['torque']
        else:
            self.torque = 300. # brake torque (lb-ft)
        self.displacement = 6.7e-3 # engine swept displacement (m**3)
        self.cylinders = 6. # number of cylinders
        self.eta_V = 1. # volumetric efficiency of engine. Can exceed unity for
        # turbo-charged unthrottled engine. Accounts for error
        # in intake manifold pressure estimate.
        self.T_intake = 300. # engine intake temperature (K)
        self.P_intake = 101.325 # pressure (kPa) at intake manifold
        self.air = prop.ideal_gas() # engine working fluid is ideal gas with
        # the properties of air
        self.air.T = self.T_intake
        self.air.P = self.P_intake
        self.air.set_TempPres_dependents()
コード例 #2
0
ファイル: exp_data.py プロジェクト: calbaker/TE_Model
    def __init__(self):
        """nothing to do here yet"""

        self.folder = '../../../Heat Exchanger Experiments/gen2/'
        self.file = '2012-09-04'
        self.exh = prop.ideal_gas()
        self.exh.P = 101.325
        self.cool = DataPoint()
        self.set_fit_params()
コード例 #3
0
ファイル: test_units.py プロジェクト: calbaker/Python
from scimath.units import *
from scimath.units.api import *

import properties as prop
reload(prop)

air = prop.ideal_gas()
air.T = UnitScalar(300., units=temperature.K)
air.P = UnitScalar(101., units=pressure.kPa)
air.c_p_air = air.get_c_p_air(air.T)
air.set_TempPres_dependents()
コード例 #4
0
ファイル: catalyst.py プロジェクト: calbaker/Catalyst
    def __init__(self, **kwargs):
        """Sets values of constants"""

        self.init_analytical()
        self.init_numerical()
        self.init_prop_functions()
        self.init_experimental()

        self.P = 101.325  # Pressure of flow (kPa)

        self.lambda_and_Da = np.array(
            [
                [1e-5, 3.16e-03, 3.14e+00, 6.28e+00, 9.42e+00,
            1.25e+01, 1.57e+01, 1.88e+01, 2.19e+01, 2.51e+01,
            2.82e+01],
                [1e-4, 9.99e-03, 3.14e+00, 6.28e+00, 9.42e+00,
            1.25e+01, 1.57e+01, 1.88e+01, 2.19e+01,  2.51e+01,
            2.82e+01],
                [1e-3, 0.03, 3.14, 6.28, 9.42, 12.6, 15.7, 18.8, 22.0,
            25.1, 28.3],
                [2e-3, 0.044, 3.14, 6.30, 9.42, 12.6, 15.7, 18.8,
            22.0, 25.1, 28.3],
                [3e-3, 0.055, 3.14, 6.28, 9.43, 12.6, 15.7, 18.8,
            22.0, 25.1, 28.3],
                [4e-3, 0.063, 3.14, 6.28, 9.43, 12.6, 15.7, 18.8,
            22.0, 25.1, 28.3],
                [5e-3, 0.071, 3.14, 6.28, 9.43, 12.6, 15.7, 18.9,
            22.0, 25.1, 28.3],
                [6e-3, 0.0773, 3.14, 6.28, 9.43, 12.6, 15.7, 18.8,
            22.0, 25.1, 28.3],
                [7e-3, 0.0836, 3.14, 6.28, 9.43, 12.6, 15.7, 18.8,
            22.0, 25.1, 28.3],
                [8e-3, 0.0893, 3.14, 6.28, 9.43, 12.6, 15.7, 18.8,
            22.0, 25.1, 28.3],
                [9e-3, 0.0947, 3.14, 6.28, 9.43, 12.6, 15.7, 18.9,
            22.0, 25.1, 28.3],
                [0.01, 0.010, 3.14, 6.28, 9.43, 12.6, 15.7, 18.9,
            22.0, 25.1, 28.3], 
                [0.015, 0.122, 3.15, 6.29, 9.43, 12.6, 15.7, 18.9,
            22.0, 25.1, 28.3],
                [0.02,  0.141, 3.15, 6.29, 9.43, 12.6, 15.7, 18.9,
            22.0, 25.1, 28.3],
                [0.025, 0.157, 3.15, 6.29, 9.43, 12.6, 15.7, 18.9,
            22.0, 25.1, 28.3],
                [0.03,  0.172, 3.15, 6.29, 9.43, 12.6, 15.7, 18.9,
            22.0, 25.1, 28.2],
                [0.04, 0.199, 3.15, 6.29, 9.43, 12.6, 15.7, 18.9,
            22.0, 25.1, 28.3],
                [0.05, 0.222, 3.16, 6.29, 9.43, 12.6, 15.7, 18.9,
            22.0, 25.1, 28.3],
                [0.09, 0.300, 3.17, 6.30, 9.43, 12.6, 15.7, 18.9,
            22.0, 25.1, 28.3], 
                [0.1, 0.311, 3.17, 6.30, 9.44, 12.6, 15.7, 18.9, 22.0,
            25.1, 28.3],
                [0.11, 0.326, 3.18, 6.30, 9.44, 12.6, 15.7, 18.9,
            22.0, 25.1, 28.3],
                [0.2,  0.433, 3.20, 6.31, 9.45, 12.6, 15.7, 18.9,
            22.0, 25.1, 28.3],
                [0.3,  0.522, 3.23, 6.33, 9.46, 12.6, 15.7, 18.9,
            22.0, 25.1, 28.3],
                [0.4, 0.593, 3.26, 6.35, 9.47, 12.6, 15.7, 18.9, 22.0,
            25.1, 28.3],
                [0.5, 0.653, 3.29, 6.36, 9.48, 12.6, 15.7, 18.9, 22.0,
            25.2, 28.3],
                [1.0, 0.860, 3.43, 6.44, 9.53, 12.6, 15.8, 18.9, 22.0,
            25.2, 28.3],
                [5.,  1.31, 4.03, 6.91, 9.89, 12.9, 16.0, 19.1, 22.2,
            25.3, 28.4],
                [10.0,  1.43, 4.31, 7.23, 10.2, 13.2, 16.3, 19.3,
            22.4, 25.5, 28.6]
                ]
            )
        # Graphically determined eigenvalues corresponding to Da.
        # First column is Da, second column is lamba_0, third column
        # is lambda_1, and so on...

        self.init_lambda_splines()

        if 'terms' in kwargs:
            self.terms = kwargs['terms']
        else:
            self.terms = 4

        self.A_arr = 2.015e5
        # Arrhenius coefficient (1/s)
        self.T_a = 5.739e3  # activation temperature (K)

        # Nanowire morphology
        self.porosity = 0.97  # porosity of nanowires
        self.tortuosity = self.porosity ** -1
        # tortuosity of nanowires
        self.Kn_length = 100e-9
        # Knudsen length (m) scale
        self.thickness = 5.e-6
        # Thickness of wash coat or height of porous media (m).  This
        # was h_{pore} in the pdf.

        # Channel geometry
        self.height = 0.0025
        # channel height (m)
        self.length = 76.2e-3 * 2.
        # channel length (m)
        self.width = 20e-3  # channel width (m)

        self.x_ = self.length / self.height
        # dimensionless x.  this will need to be reevaluated if length
        # or height is changed.

        self.y_ = 1.

        self.x_array = np.linspace(0, self.x_, 100)
        self.y_array = np.linspace(0, self.y_ * 51 / 50, 50)

        self.T_ambient = 300. + 273.15
        # ambient temperature (K) at which flow rate is measured

        self.fuel = prop.ideal_gas(species='C3H8')
        self.air = prop.ideal_gas()
        self.air.P = self.P
        self.fuel.P = self.P