Esempio n. 1
0
    def __init__(self, params=None, **kwargs):
        if params == None:
            params = AttributeDict(kwargs)

        self.fluid = params.fluid

        self.fStateIn = CP.FluidState(self.fluid)
        self.fStateOut = CP.FluidState(self.fluid)
        self.fStateDown = CP.FluidState(self.fluid)
        self.fStateTmp = CP.FluidState(self.fluid)

        self.flowOut = DMS.FluidFlow()
        self.heatOut = DMS.HeatFlow()
        self.portIn = DMS.FluidPort('C', self.fStateDown)
        self.portOut = DMS.FluidPort('R', self.flowOut)
        self.thermalPort = DMS.ThermalPort('R', self.heatOut)
Esempio n. 2
0
    def __init__(self, params=None, **kwargs):
        if params == None:
            params = AttributeDict(kwargs)

        self.fluid = params.fluid
        self.fState = CP.FluidState(self.fluid)
        self.port1 = DMS.FluidPort('C', self.fState)
Esempio n. 3
0
 def test():
     c = ConvectionHeatTransfer()
     c.fluidPort.state = CP.FluidState('ParaHydrogen')
     c.fluidPort.state.update_Tp(288, 1e5)
     c.wallPort.state.T = 350.0
     c.compute()
     print("qDotFluid = {}, qDotWall = {}".format(c.fluidPort.flow.HDot,
                                                  c.wallPort.flow.QDot))
Esempio n. 4
0
	def setUp(self):
		fState = CP.FluidState('Oxygen')
		tState = DMS.ThermalState()
		self.fp1 = DMS.FluidPort('C', fState)
		self.fp2 = DMS.FluidPort('R')
		self.fp3 = DMS.DynamicCPort(DMS.FluidPort, CP.FluidState('Oxygen'))
		self.fp4 = DMS.FluidPort('R')
		self.tp1 = DMS.ThermalPort('C', tState)
		self.tp2 = DMS.ThermalPort('R')
		self.tp3 = DMS.ThermalPort('R')
		
		self.fp1.state.update_Tp(300, 2e5)
		self.fp2.flow.mDot = 3.0
		self.fp2.flow.HDot = 4.0e3
		self.fp4.flow.mDot = 5.0
		self.fp4.flow.HDot = 7.0e3
		self.tp1.state.T = 23
		self.tp2.flow.QDot = 2.0e3
Esempio n. 5
0
    def __init__(self, params=None, **kwargs):
        if params == None:
            params = AttributeDict(kwargs)

        self.fluid = params.fluid
        self.fState = CP.FluidState(self.fluid)
        self.TOutModel = lambda obj: params.TOut
        self.mDot = params.mDot
        self.flow = DMS.FluidFlow(mDot=self.mDot)
        self.port1 = DMS.FluidPort('R', self.flow)
Esempio n. 6
0
	def __init__(self, params = None, **kwargs):
		if params == None:
			params = AttributeDict(kwargs)
			
		self.V = params.V
		if (isinstance(params.fluid, CP.Fluid)):
			self.fluid = params.fluid
		else:
			self.fluid = CP.Fluid(params.fluid)
			
		self.fState = CP.FluidState(self.fluid)
		self.fluidPort = DMS.DynamicCPort(DMS.FluidPort, state = self.fState)
Esempio n. 7
0
    def __init__(self, params=None, **kwargs):
        if params == None:
            params = AttributeDict(kwargs)

        self.fluid = params.fluid  #fluid
        self.etaS = params.etaS  #isentropic efficiency
        self.fQ = params.fQ  #fraction of heat loss to ambient
        self.V = params.V  #displacement volume

        self.n = 0.0  #number of revolutions per second
        self.fStateOut = CP.FluidState(self.fluid)

        self.flow = DMS.FluidFlow()
        self.portOut = DMS.FluidPort('R', self.flow)
        self.portIn = DMS.FluidPort('R', -self.flow)
Esempio n. 8
0
 def createFluidState(self):
     return CP.FluidState(self.fluidName)