当前位置: 首页>>代码示例>>Python>>正文


Python Data.thrust_force_vector方法代码示例

本文整理汇总了Python中SUAVE.Core.Data.thrust_force_vector方法的典型用法代码示例。如果您正苦于以下问题:Python Data.thrust_force_vector方法的具体用法?Python Data.thrust_force_vector怎么用?Python Data.thrust_force_vector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SUAVE.Core.Data的用法示例。


在下文中一共展示了Data.thrust_force_vector方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: evaluate_thrust

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import thrust_force_vector [as 别名]
    def evaluate_thrust(self,state):
        """ Calculate thrust given the current state of the vehicle
    
            Assumptions:
            None
    
            Source:
            N/A
    
            Inputs:
            state [state()]
    
            Outputs:
            results.thrust_force_vector [newtons]
            results.vehicle_mass_rate   [kg/s]
    
            Properties Used:
            Defaulted values
        """             
        
        # Unpack the surrogate
        sfc_surrogate = self.sfc_surrogate
        thr_surrogate = self.thrust_surrogate
        
        # Unpack the conditions
        conditions = state.conditions
        altitude   = conditions.freestream.altitude
        mach       = conditions.freestream.mach_number
        throttle   = conditions.propulsion.throttle
        
        cond = np.hstack([altitude,mach,throttle])
        
        # Run the surrogate for a range of altitudes
        data_len = len(altitude)
        sfc = np.zeros([data_len,1])  
        thr = np.zeros([data_len,1]) 
        for ii,_ in enumerate(altitude):            
            sfc[ii] = sfc_surrogate.predict([np.array([altitude[ii][0],mach[ii][0],throttle[ii][0]])])    
            thr[ii] = thr_surrogate.predict([np.array([altitude[ii][0],mach[ii][0],throttle[ii][0]])])   #This is the fix when sklearn is update.

        
        F    = thr
        mdot = thr*sfc*self.number_of_engines
        
        # Save the output
        results = Data()
        results.thrust_force_vector = self.number_of_engines * F * [np.cos(self.thrust_angle),0,-np.sin(self.thrust_angle)]     
        results.vehicle_mass_rate   = mdot
    
        return results          
开发者ID:suavecode,项目名称:SUAVE,代码行数:52,代码来源:Propulsor_Surrogate.py

示例2: evaluate_thrust

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import thrust_force_vector [as 别名]

#.........这里部分代码省略.........
        #link the high pressure compressor to the low pressure compressor
        high_pressure_compressor.inputs.stagnation_temperature = low_pressure_compressor.outputs.stagnation_temperature
        high_pressure_compressor.inputs.stagnation_pressure    = low_pressure_compressor.outputs.stagnation_pressure
        
        #Flow through the high pressure compressor
        high_pressure_compressor(conditions)
        
        
        
        #link the combustor to the high pressure compressor
        combustor.inputs.stagnation_temperature                = high_pressure_compressor.outputs.stagnation_temperature
        combustor.inputs.stagnation_pressure                   = high_pressure_compressor.outputs.stagnation_pressure
        #combustor.inputs.nozzle_exit_stagnation_temperature = inlet_nozzle.outputs.stagnation_temperature
        
        #flow through the high pressor comprresor
        combustor(conditions)
        
        

        #link the high pressure turbione to the combustor
        high_pressure_turbine.inputs.stagnation_temperature    = combustor.outputs.stagnation_temperature
        high_pressure_turbine.inputs.stagnation_pressure       = combustor.outputs.stagnation_pressure
        high_pressure_turbine.inputs.fuel_to_air_ratio         = combustor.outputs.fuel_to_air_ratio
        #link the high pressuer turbine to the high pressure compressor
        high_pressure_turbine.inputs.compressor                = high_pressure_compressor.outputs
        
        #flow through the high pressure turbine
        high_pressure_turbine(conditions)
                
        
        
        #link the low pressure turbine to the high pressure turbine
        low_pressure_turbine.inputs.stagnation_temperature     = high_pressure_turbine.outputs.stagnation_temperature
        low_pressure_turbine.inputs.stagnation_pressure        = high_pressure_turbine.outputs.stagnation_pressure
        #link the low pressure turbine to the low_pressure_compresor
        low_pressure_turbine.inputs.compressor                 = low_pressure_compressor.outputs
        #link the low pressure turbine to the combustor
        low_pressure_turbine.inputs.fuel_to_air_ratio          = combustor.outputs.fuel_to_air_ratio
        #get the bypass ratio from the thrust component
        low_pressure_turbine.inputs.bypass_ratio               = 0.0
        
        #flow through the low pressure turbine
        low_pressure_turbine(conditions)
        
        
        
        #link the core nozzle to the low pressure turbine
        core_nozzle.inputs.stagnation_temperature              = low_pressure_turbine.outputs.stagnation_temperature
        core_nozzle.inputs.stagnation_pressure                 = low_pressure_turbine.outputs.stagnation_pressure
        
        #flow through the core nozzle
        core_nozzle(conditions)
        
        
        ##link the core nozzle to the expansion nozzle
        #expansion_nozzle.inputs.stagnation_temperature         = core_nozzle.inputs.stagnation_temperature
        #expansion_nozzle.inputs.stagnation_pressure            = core_nozzle.inputs.stagnation_pressure
        
        ## flow through the expansion nozzle
        #expansion_nozzle(conditions)


        # compute the thrust using the thrust component
        
        #link the thrust component to the core nozzle
        thrust.inputs.core_exit_velocity                       = core_nozzle.outputs.velocity
        thrust.inputs.core_area_ratio                          = core_nozzle.outputs.area_ratio
        thrust.inputs.core_nozzle                              = core_nozzle.outputs
        #link the thrust component to the combustor
        thrust.inputs.fuel_to_air_ratio                        = combustor.outputs.fuel_to_air_ratio
        #link the thrust component to the low pressure compressor 
        thrust.inputs.stag_temp_lpt_exit                       = low_pressure_compressor.outputs.stagnation_temperature
        thrust.inputs.stag_press_lpt_exit                      = low_pressure_compressor.outputs.stagnation_pressure
        thrust.inputs.number_of_engines                        = number_of_engines
	thrust.inputs.flow_through_core                        =  1.0 #scaled constant to turn on core thrust computation
	thrust.inputs.flow_through_fan                         =  0.0 #scaled constant to turn on fan thrust computation        

        

        #compute the trust
        thrust(conditions)
 
        
        
        
        #getting the network outputs from the thrust outputs
        
        F            = thrust.outputs.thrust*[1,0,0]
        mdot         = thrust.outputs.fuel_flow_rate
        Isp          = thrust.outputs.specific_impulse
        output_power = thrust.outputs.power
        F_vec        = conditions.ones_row(3) * 0.0
        F_vec[:,0]   = F[:,0]
        F            = F_vec

        results = Data()
        results.thrust_force_vector = F
        results.vehicle_mass_rate   = mdot
        
        return results
开发者ID:Alexandrovich,项目名称:SUAVE,代码行数:104,代码来源:Turbojet_Super.py

示例3: evaluate_thrust

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import thrust_force_vector [as 别名]
    def evaluate_thrust(self,state):
        """ Calculate thrust given the current state of the vehicle

        	Assumptions:
        	None

        	Source:
        	N/A

        	Inputs:
        	state [state()]

        	Outputs:
        	results.thrust_force_vector                      [newtons]
        	results.vehicle_mass_rate                        [kg/s]
        	results.specific_impulse                         [s]
        	conditions.propulsion.acoustic_outputs:
        	    core:
        		exit_static_temperature                  [K]
        		exit_static_pressure                     [K]
        		exit_stagnation_temperature              [K]
        		exit_stagnation_pressure                 [Pa]
        		exit_velocity                            [m/s]

        	Properties Used:
        	Defaulted values
            """

        # unpack
        conditions                = state.conditions
        ram                       = self.ram
        inlet_nozzle              = self.inlet_nozzle
        combustor                 = self.combustor
        core_nozzle               = self.core_nozzle
        thrust                    = self.thrust
        number_of_engines         = self.number_of_engines

        # creating the network by manually linking the different components

        # set the working fluid to determine the fluid properties
        ram.inputs.working_fluid                               = self.working_fluid

        # flow through the ram
        ram(conditions)

        # link inlet nozzle to ram
        inlet_nozzle.inputs          = ram.outputs

        # flow through the inlet nozzle
        inlet_nozzle(conditions)

        # link the combustor to the inlet nozzle
        combustor.inputs             = inlet_nozzle.outputs

        # flow through the combustor
        combustor.compute_rayleigh(conditions)

        #link the core nozzle to the combustor
        core_nozzle.inputs           = combustor.outputs

        # flow through the core nozzle
        core_nozzle.compute_limited_geometry(conditions)

        # compute the thrust using the thrust component

        # link the thrust component to the core nozzle
        thrust.inputs.core_nozzle                              = core_nozzle.outputs
        thrust.inputs.total_temperature_reference              = core_nozzle.outputs.stagnation_temperature
        thrust.inputs.total_pressure_reference                 = core_nozzle.outputs.stagnation_pressure

        # link the thrust component to the combustor
        thrust.inputs.fuel_to_air_ratio                        = combustor.outputs.fuel_to_air_ratio

        # link the thrust component 
        thrust.inputs.number_of_engines                        = number_of_engines
        thrust.inputs.flow_through_core                        =  1.0 #scaled constant to turn on core thrust computation
        thrust.inputs.flow_through_fan                         =  0.0 #scaled constant to turn on fan thrust computation

        # compute the thrust
        thrust(conditions)

        # getting the network outputs from the thrust outputs
        F            = thrust.outputs.thrust*[1,0,0]
        mdot         = thrust.outputs.fuel_flow_rate
        Isp          = thrust.outputs.specific_impulse
        output_power = thrust.outputs.power
        F_vec        = conditions.ones_row(3) * 0.0
        F_vec[:,0]   = F[:,0]
        F            = F_vec

        results                     = Data()
        results.thrust_force_vector = F
        results.vehicle_mass_rate   = mdot
        results.specific_impulse    = Isp

        return results
开发者ID:suavecode,项目名称:SUAVE,代码行数:98,代码来源:Ramjet.py

示例4: evaluate_thrust

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import thrust_force_vector [as 别名]
 def evaluate_thrust(self,state):
     """ Calculate thrust given the current state of the vehicle
 
         Assumptions:
         Caps the throttle at 110% and linearly interpolates thrust off that
 
         Source:
         N/A
 
         Inputs:
         state [state()]
 
         Outputs:
         results.thrust_force_vector [Newtons]
         results.vehicle_mass_rate   [kg/s]
         conditions.propulsion:
             rpm_lift                 [radians/sec]
             rpm _forward             [radians/sec]
             current_lift             [amps]
             current_forward          [amps]
             battery_draw             [watts]
             battery_energy           [joules]
             voltage_open_circuit     [volts]
             voltage_under_load       [volts]
             motor_torque_lift        [N-M]
             motor_torque_forward     [N-M]
             propeller_torque_lift    [N-M]
             propeller_torque_forward [N-M]
 
         Properties Used:
         Defaulted values
     """          
     
     # unpack
     conditions        = state.conditions
     numerics          = state.numerics
     motor_lift        = self.motor_lift 
     motor_forward     = self.motor_forward
     propeller_lift    = self.propeller_lift 
     propeller_forward = self.propeller_forward
     esc_lift          = self.esc_lift
     esc_forward       = self.esc_forward        
     avionics          = self.avionics
     payload           = self.payload
     battery           = self.battery
     num_lift          = self.number_of_engines_lift
     num_forward       = self.number_of_engines_forward
     
     ###
     # Setup batteries and ESC's
     ###
     
     # Set battery energy
     battery.current_energy = conditions.propulsion.battery_energy    
     
     volts = state.unknowns.battery_voltage_under_load   
     volts[volts>self.voltage] = self.voltage
     
     # ESC Voltage
     esc_lift.inputs.voltagein    = volts      
     esc_forward.inputs.voltagein = volts 
     
     ###
     # Evaluate thrust from the forward propulsors
     ###
     
     # Throttle the voltage
     esc_forward.voltageout(conditions)       
     # link
     motor_forward.inputs.voltage = esc_forward.outputs.voltageout
     
     # Run the motor
     motor_forward.omega(conditions)
     # link
     propeller_forward.inputs.omega =  motor_forward.outputs.omega
     propeller_forward.thrust_angle = self.thrust_angle_forward   
     
     # Run the propeller
     F_forward, Q_forward, P_forward, Cp_forward = propeller_forward.spin(conditions)
         
     # Check to see if magic thrust is needed, the ESC caps throttle at 1.1 already
     eta = conditions.propulsion.throttle[:,0,None]
     P_forward[eta>1.0] = P_forward[eta>1.0]*eta[eta>1.0]
     F_forward[eta>1.0] = F_forward[eta>1.0]*eta[eta>1.0]        
     
     # Run the motor for current
     motor_forward.current(conditions)  
     # link
     esc_forward.inputs.currentout =  motor_forward.outputs.current     
     
     # Run the esc
     esc_forward.currentin(conditions)        
    
     ###
     # Evaluate thrust from the lift propulsors
     ###
     
     # Make a new set of konditions, since there are differences for the esc and motor
     konditions                 = Data()
     konditions.propulsion      = Data()
#.........这里部分代码省略.........
开发者ID:suavecode,项目名称:SUAVE,代码行数:103,代码来源:Lift_Forward_Propulsor.py

示例5: evaluate_thrust

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import thrust_force_vector [as 别名]

#.........这里部分代码省略.........
        #flow through the high pressure turbine
        high_pressure_turbine(conditions)
                
        
        
        #link the low pressure turbine to the high pressure turbine
        low_pressure_turbine.inputs.stagnation_temperature     = high_pressure_turbine.outputs.stagnation_temperature
        low_pressure_turbine.inputs.stagnation_pressure        = high_pressure_turbine.outputs.stagnation_pressure
        #link the low pressure turbine to the low_pressure_compresor
        low_pressure_turbine.inputs.compressor                 = low_pressure_compressor.outputs
        #link the low pressure turbine to the combustor
        low_pressure_turbine.inputs.fuel_to_air_ratio          = combustor.outputs.fuel_to_air_ratio
        #link the low pressure turbine to the fan
        low_pressure_turbine.inputs.fan                        = fan.outputs
        #get the bypass ratio from the thrust component
        low_pressure_turbine.inputs.bypass_ratio               = bypass_ratio
        
        #flow through the low pressure turbine
        low_pressure_turbine(conditions)
        
        
        
        #link the core nozzle to the low pressure turbine
        core_nozzle.inputs.stagnation_temperature              = low_pressure_turbine.outputs.stagnation_temperature
        core_nozzle.inputs.stagnation_pressure                 = low_pressure_turbine.outputs.stagnation_pressure
        
        #flow through the core nozzle
        core_nozzle(conditions)
        
        

        #link the dan nozzle to the fan
        fan_nozzle.inputs.stagnation_temperature               = fan.outputs.stagnation_temperature
        fan_nozzle.inputs.stagnation_pressure                  = fan.outputs.stagnation_pressure
        
         # flow through the fan nozzle
        fan_nozzle(conditions)
        


        # compute the thrust using the thrust component
        
        #link the thrust component to the fan nozzle
        thrust.inputs.fan_exit_velocity                        = fan_nozzle.outputs.velocity
        thrust.inputs.fan_area_ratio                           = fan_nozzle.outputs.area_ratio
        thrust.inputs.fan_nozzle                               = fan_nozzle.outputs
        #link the thrust component to the core nozzle
        thrust.inputs.core_exit_velocity                       = core_nozzle.outputs.velocity
        thrust.inputs.core_area_ratio                          = core_nozzle.outputs.area_ratio
        thrust.inputs.core_nozzle                              = core_nozzle.outputs
        #link the thrust component to the combustor
        thrust.inputs.fuel_to_air_ratio                        = combustor.outputs.fuel_to_air_ratio
        #link the thrust component to the low pressure compressor 
        thrust.inputs.total_temperature_reference              = low_pressure_compressor.outputs.stagnation_temperature
        thrust.inputs.total_pressure_reference                 = low_pressure_compressor.outputs.stagnation_pressure
        thrust.inputs.number_of_engines                        = number_of_engines
        thrust.inputs.bypass_ratio                             = bypass_ratio
        thrust.inputs.flow_through_core                        = 1./(1.+bypass_ratio) #scaled constant to turn on core thrust computation
        thrust.inputs.flow_through_fan                         = bypass_ratio/(1.+bypass_ratio) #scaled constant to turn on fan thrust computation        

        

        #compute the trust
        thrust(conditions)
 
        
        
        
        #getting the network outputs from the thrust outputs
        
        F            = thrust.outputs.thrust*[1,0,0]
        mdot         = thrust.outputs.fuel_flow_rate
        output_power = thrust.outputs.power
        F_vec        = conditions.ones_row(3) * 0.0
        F_vec[:,0]   = F[:,0]
        F            = F_vec

        results = Data()
        results.thrust_force_vector = F
        results.vehicle_mass_rate   = mdot
        
        # store data
        results_conditions = Results
        conditions.propulsion.acoustic_outputs.core = results_conditions(
        exit_static_temperature             = core_nozzle.outputs.static_temperature,
        exit_static_pressure                = core_nozzle.outputs.static_pressure,
        exit_stagnation_temperature         = core_nozzle.outputs.stagnation_temperature,
        exit_stagnation_pressure            = core_nozzle.outputs.static_pressure,
        exit_velocity                       = core_nozzle.outputs.velocity
        )
        
        conditions.propulsion.acoustic_outputs.fan = results_conditions(
        exit_static_temperature             = fan_nozzle.outputs.static_temperature,
        exit_static_pressure                = fan_nozzle.outputs.static_pressure,
        exit_stagnation_temperature         = fan_nozzle.outputs.stagnation_temperature,
        exit_stagnation_pressure            = fan_nozzle.outputs.static_pressure,
        exit_velocity                       = fan_nozzle.outputs.velocity
        )
        
        return results
开发者ID:Alexandrovich,项目名称:SUAVE,代码行数:104,代码来源:Turbofan.py

示例6: evaluate_thrust

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import thrust_force_vector [as 别名]

#.........这里部分代码省略.........
        numerics    = state.numerics
        solar_flux  = self.solar_flux
        solar_panel = self.solar_panel
        motor       = self.motor
        propeller   = self.propeller
        esc         = self.esc
        avionics    = self.avionics
        payload     = self.payload
        solar_logic = self.solar_logic
        battery     = self.battery
       
        # Set battery energy
        battery.current_energy = conditions.propulsion.battery_energy
        
        # step 1
        solar_flux.solar_radiation(conditions)
        # link
        solar_panel.inputs.flux = solar_flux.outputs.flux
        # step 2
        solar_panel.power()
        # link
        solar_logic.inputs.powerin = solar_panel.outputs.power
        # step 3
        solar_logic.voltage()
        # link
        esc.inputs.voltagein =  solar_logic.outputs.system_voltage
        # Step 4
        esc.voltageout(conditions)
        # link
        motor.inputs.voltage = esc.outputs.voltageout 
        # step 5
        motor.omega(conditions)
        # link
        propeller.inputs.omega =  motor.outputs.omega
        # step 6
        F, Q, P, Cplast = propeller.spin(conditions)
       
        # iterate the Cp here
        diff = abs(Cplast-motor.propeller_Cp)
        tol = 1e-6
        while (np.any(diff>tol)):
            motor.propeller_Cp  = Cplast # Change the Cp
            motor.omega(conditions) # Rerun the motor
            propeller.inputs.omega =  motor.outputs.omega # Relink the motor
            F, Q, P, Cplast        = propeller.spin(conditions) # Run the motor again
            diff                   = abs(Cplast-motor.propeller_Cp) # Check to see if it converged          
        
            
        # Check to see if magic thrust is needed, the ESC caps throttle at 1.1 already
        eta = conditions.propulsion.throttle[:,0,None]
        P[eta>1.0] = P[eta>1.0]*eta[eta>1.0]
        F[eta>1.0] = F[eta>1.0]*eta[eta>1.0]
        
        # Run the avionics
        avionics.power()
        # link
        solar_logic.inputs.pavionics =  avionics.outputs.power
        
        # Run the payload
        payload.power()
        # link
        solar_logic.inputs.ppayload = payload.outputs.power
        
        # Run the motor for current
        motor.current(conditions)
        # link
        esc.inputs.currentout =  motor.outputs.current
        
        # Run the esc
        esc.currentin()
        # link
        solar_logic.inputs.currentesc  = esc.outputs.currentin*self.number_of_engines
        solar_logic.inputs.volts_motor = esc.outputs.voltageout 
        #
        solar_logic.logic(conditions,numerics)
        # link
        battery.inputs = solar_logic.outputs
        battery.energy_calc(numerics)
        
        #Pack the conditions for outputs
        rpm                                  = motor.outputs.omega*60./(2.*np.pi)
        current                              = solar_logic.inputs.currentesc
        battery_draw                         = battery.inputs.power_in 
        battery_energy                       = battery.current_energy
        
        conditions.propulsion.solar_flux     = solar_flux.outputs.flux  
        conditions.propulsion.rpm            = rpm
        conditions.propulsion.current        = current
        conditions.propulsion.battery_draw   = battery_draw
        conditions.propulsion.battery_energy = battery_energy
        
        #Create the outputs
        F    = self.number_of_engines * F * [1,0,0]      
        mdot = np.zeros_like(F)

        results = Data()
        results.thrust_force_vector = F
        results.vehicle_mass_rate   = mdot

        return results
开发者ID:Alexandrovich,项目名称:SUAVE,代码行数:104,代码来源:Solar.py

示例7: evaluate_thrust

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import thrust_force_vector [as 别名]

#.........这里部分代码省略.........
        
        #if bli
        
        
        #fan exit conditions
        
        #etapolf=Feta(pif,pif,1,1)  
        #etapolf=1  #if available for engine use that
        
        pt2_1=pt2*pif
        Tt2_1=Tt2*pif**((gamma-1)/(gamma*etapolf))
        ht2_1=Cpp*Tt2_1#h(Tt2_1)
        
        
        #fan nozzle exit conditions
        
        pt7=pt2_1*pifn
        Tt7=Tt2_1*pifn**((gamma-1)/(gamma)*etapolfn)
        ht7=Cpp*Tt7#h(Tt7)
        
    
        #Fan exhaust quantities
        
        pt8=pt7
        Tt8=Tt7
        ht8=Cpp*Tt8#h(Tt8)
        
        M8=numpy.sqrt((((pt8/po)**((gamma-1)/gamma))-1)*2/(gamma-1))
        T8=Tt8/(1+(gamma-1)/2*M8**2)
        h8=Cpp*T8#h(T8)
        u8=numpy.sqrt(2*(ht8-h8))
    
    
        if numpy.linalg.norm(M8) < 1.0:
       
        
            p7=po
            
            M7=numpy.sqrt((((pt7/po)**((gamma-1)/gamma))-1)*2/(gamma-1))
            T7=Tt7/(1+(gamma-1)/2*M7**2)
            h7=Cpp*T7
        
        else:
            M7=1
            T7=Tt7/(1+(gamma-1)/2*M7**2)
            p7=pt7/(1+(gamma-1)/2*M7**2)**(gamma/(gamma-1))
            h7=Cpp*T7
          
        # 
        u7=numpy.sqrt(2*(ht7-h7))
        rho7=p7/(R*T7)
        
        A1e_b_A1o=(fm_id(Mo)/fm_id(M7))*(1/(pt7/pto))*numpy.sqrt(Tt7/Tto)
         
        Thrust_nd=gamma*Mo**2*((u7/uo-1))+A1e_b_A1o*(p7/po-1)
        
        #calculate actual value of thrust 
        
        Fsp=1/(gamma*Mo)*Thrust_nd
    
     
      
        #fan nozzle area
           
        M8=u8/numpy.sqrt(Cp(T8)*R/(Cp(8)-R)*T8)
      
        if numpy.linalg.norm(M8)<1: # nozzle unchoked
        
            p7=po
            M7=numpy.sqrt((((pt7/po)**((gamma-1)/gamma))-1)*2/(gamma-1))
            T7=Tt7/(1+(gamma-1)/2*M7**2)
            h7=Cpp*T7
      
        else:
          
            M7=1
            T7=Tt7/(1+(gamma-1)/2*M7**2)
            p7=pt7/(1+(gamma-1)/2*M7**2)**(gamma/(gamma-1))
            h7=Cpp*T7
         
      
        u7=numpy.sqrt(2*(ht7-h7))
        rho7=p7/(R*T7)
 ###############################################################################################################################       
        mdot_df=Ao*rhoo*uo
        FD=Fsp*ao*mdot_df*no_eng*throttle
        thrust=FD*[1,0,0]
        eta_motor=1
        P=uo*FD
        F_vec        = conditions.ones_row(3) * 0.0
        F_vec[:,0]   = thrust[:,0]
        F            =F_vec          
 
        CF = FD/(conditions.freestream.dynamic_pressure*self.A2)
        results = Data()
        results.thrust_force_vector = F
        results.vehicle_mass_rate   = 0.0

      
        return results 
开发者ID:aerialhedgehog,项目名称:SUAVE,代码行数:104,代码来源:Ducted_Fan.py

示例8: evaluate_thrust

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import thrust_force_vector [as 别名]
    def evaluate_thrust(self,state):
        """ Calculate thrust given the current state of the vehicle
    
            Assumptions:
            None
    
            Source:
            N/A
    
            Inputs:
            state [state()]
    
            Outputs:
            results.thrust_force_vector [newtons]
            results.vehicle_mass_rate   [kg/s]
            results.power               [Watts]
            conditions.propulsion.acoustic_outputs:
                fan:
                    exit_static_temperature      
                    exit_static_pressure       
                    exit_stagnation_temperature 
                    exit_stagnation_pressure
                    exit_velocity 
    
            Properties Used:
            Defaulted values
        """          

        #Unpack
        conditions                = state.conditions
        ram                       = self.ram
        inlet_nozzle              = self.inlet_nozzle
        fan                       = self.fan
        fan_nozzle                = self.fan_nozzle
        thrust                    = self.thrust
        
        #Creating the network by manually linking the different components
        #set the working fluid to determine the fluid properties
        ram.inputs.working_fluid                               = self.working_fluid
        
        #Flow through the ram , this computes the necessary flow quantities and stores it into conditions
        ram(conditions)
        
        #link inlet nozzle to ram 
        inlet_nozzle.inputs.stagnation_temperature             = ram.outputs.stagnation_temperature 
        inlet_nozzle.inputs.stagnation_pressure                = ram.outputs.stagnation_pressure 
        
        #Flow through the inlet nozzle
        inlet_nozzle(conditions)
        
        #Link the fan to the inlet nozzle
        fan.inputs.stagnation_temperature                      = inlet_nozzle.outputs.stagnation_temperature
        fan.inputs.stagnation_pressure                         = inlet_nozzle.outputs.stagnation_pressure
        
        #flow through the fan
        fan(conditions)

        #link the fan nozzle to the fan
        fan_nozzle.inputs.stagnation_temperature               = fan.outputs.stagnation_temperature
        fan_nozzle.inputs.stagnation_pressure                  = fan.outputs.stagnation_pressure
        thrust.inputs.fuel_to_air_ratio                        = 0.
        
         # flow through the fan nozzle
        fan_nozzle(conditions)
        
        # compute the thrust using the thrust component
        #link the thrust component to the fan nozzle
        thrust.inputs.fan_exit_velocity                        = fan_nozzle.outputs.velocity
        thrust.inputs.fan_area_ratio                           = fan_nozzle.outputs.area_ratio
        thrust.inputs.fan_nozzle                               = fan_nozzle.outputs
        thrust.inputs.bypass_ratio                             = self.bypass_ratio  #0.0
        
        #compute the thrust
        thrust(conditions)

        #obtain the network outputs from the thrust outputs
        
        u0                    = conditions.freestream.velocity
        u8                    = fan_nozzle.outputs.velocity
       
        propulsive_efficiency =2./(1+u8/u0)
        F               = thrust.outputs.thrust*[1,0,0]
        mdot            = thrust.outputs.fuel_flow_rate
        Isp             = thrust.outputs.specific_impulse
        output_power    = thrust.outputs.power
        F_vec           = conditions.ones_row(3) * 0.0
        F_vec[:,0]      = F[:,0]
        F               = F_vec
      
        #pack outputs
        results = Data()
        results.thrust_force_vector = F
        results.vehicle_mass_rate   = mdot
        results.power               = np.divide(output_power[:,0],propulsive_efficiency[:,0])
        
        # store data
        results_conditions = Data
        
        conditions.propulsion.acoustic_outputs.fan = results_conditions(
        exit_static_temperature             = fan_nozzle.outputs.static_temperature,
#.........这里部分代码省略.........
开发者ID:suavecode,项目名称:SUAVE,代码行数:103,代码来源:Ducted_Fan.py

示例9: evaluate_thrust

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import thrust_force_vector [as 别名]
    def evaluate_thrust(self,state):
        """ Calculate thrust given the current state of the vehicle
    
            Assumptions:
            Caps the throttle at 110% and linearly interpolates thrust off that
    
            Source:
            N/A
    
            Inputs:
            state [state()]
    
            Outputs:
            results.thrust_force_vector [newtons]
            results.vehicle_mass_rate   [kg/s]
            conditions.propulsion:
                rpm                  [radians/sec]
                current              [amps]
                battery_draw         [watts]
                battery_energy       [joules]
                voltage_open_circuit [volts]
                voltage_under_load   [volts]
                motor_torque         [N-M]
                propeller_torque     [N-M]
    
            Properties Used:
            Defaulted values
        """          
    
        # unpack
        conditions = state.conditions
        numerics   = state.numerics
        motor      = self.motor
        propeller  = self.propeller
        esc        = self.esc
        avionics   = self.avionics
        payload    = self.payload
        battery    = self.battery
        
        # Set battery energy
        battery.current_energy = conditions.propulsion.battery_energy  

        # Step 1 battery power
        esc.inputs.voltagein = state.unknowns.battery_voltage_under_load
        # Step 2
        esc.voltageout(conditions)
        # link
        motor.inputs.voltage = esc.outputs.voltageout 
        # step 3
        motor.omega(conditions)
        # link
        propeller.inputs.omega =  motor.outputs.omega
        propeller.thrust_angle = self.thrust_angle
        # step 4
        F, Q, P, Cp = propeller.spin(conditions)
        
        # Check to see if magic thrust is needed, the ESC caps throttle at 1.1 already
        eta        = conditions.propulsion.throttle[:,0,None]
        P[eta>1.0] = P[eta>1.0]*eta[eta>1.0]
        F[eta>1.0] = F[eta>1.0]*eta[eta>1.0]

        # Run the avionics
        avionics.power()

        # Run the payload
        payload.power()
        
        # Run the motor for current
        motor.current(conditions)
        # link
        esc.inputs.currentout =  motor.outputs.current
        
        # Run the esc
        esc.currentin()

        # Calculate avionics and payload power
        avionics_payload_power = avionics.outputs.power + payload.outputs.power

        # Calculate avionics and payload current
        avionics_payload_current = avionics_payload_power/self.voltage

        # link
        battery.inputs.current  = esc.outputs.currentin*self.number_of_engines + avionics_payload_current
        battery.inputs.power_in = -(esc.outputs.voltageout*esc.outputs.currentin*self.number_of_engines + avionics_payload_power)
        battery.energy_calc(numerics)        
    
        # Pack the conditions for outputs
        rpm                  = motor.outputs.omega*60./(2.*np.pi)
        current              = esc.outputs.currentin
        battery_draw         = battery.inputs.power_in 
        battery_energy       = battery.current_energy
        voltage_open_circuit = battery.voltage_open_circuit
        voltage_under_load   = battery.voltage_under_load    
          
        conditions.propulsion.rpm                  = rpm
        conditions.propulsion.current              = current
        conditions.propulsion.battery_draw         = battery_draw
        conditions.propulsion.battery_energy       = battery_energy
        conditions.propulsion.voltage_open_circuit = voltage_open_circuit
        conditions.propulsion.voltage_under_load   = voltage_under_load  
#.........这里部分代码省略.........
开发者ID:michK,项目名称:SUAVE,代码行数:103,代码来源:Battery_Propeller.py

示例10: evaluate_thrust

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import thrust_force_vector [as 别名]
    def evaluate_thrust(self,state):
        """ Calculate thrust given the current state of the vehicle
    
            Assumptions:
            Caps the throttle at 110% and linearly interpolates thrust off that
    
            Source:
            N/A
    
            Inputs:
            state [state()]
    
            Outputs:
            results.thrust_force_vector [newtons]
            results.vehicle_mass_rate   [kg/s]
            conditions.propulsion:
                solar_flux           [watts/m^2] 
                rpm                  [radians/sec]
                current              [amps]
                battery_draw         [watts]
                battery_energy       [joules]
                motor_torque         [N-M]
                propeller_torque     [N-M]
    
            Properties Used:
            Defaulted values
        """          
    
        # unpack
        conditions  = state.conditions
        numerics    = state.numerics
        solar_flux  = self.solar_flux
        solar_panel = self.solar_panel
        motor       = self.motor
        propeller   = self.propeller
        esc         = self.esc
        avionics    = self.avionics
        payload     = self.payload
        solar_logic = self.solar_logic
        battery     = self.battery
       
        # Set battery energy
        battery.current_energy = conditions.propulsion.battery_energy
        
        # step 1
        solar_flux.solar_radiation(conditions)
        # link
        solar_panel.inputs.flux = solar_flux.outputs.flux
        # step 2
        solar_panel.power()
        # link
        solar_logic.inputs.powerin = solar_panel.outputs.power
        # step 3
        solar_logic.voltage()
        # link
        esc.inputs.voltagein =  solar_logic.outputs.system_voltage
        # Step 4
        esc.voltageout(conditions)
        # link
        motor.inputs.voltage = esc.outputs.voltageout 
        # step 5
        motor.omega(conditions)
        # link
        propeller.inputs.omega =  motor.outputs.omega
        # step 6
        F, Q, P, Cplast = propeller.spin(conditions)
     
        # Check to see if magic thrust is needed, the ESC caps throttle at 1.1 already
        eta = conditions.propulsion.throttle[:,0,None]
        P[eta>1.0] = P[eta>1.0]*eta[eta>1.0]
        F[eta>1.0] = F[eta>1.0]*eta[eta>1.0]
        
        # Run the avionics
        avionics.power()
        # link
        solar_logic.inputs.pavionics =  avionics.outputs.power
        
        # Run the payload
        payload.power()
        # link
        solar_logic.inputs.ppayload = payload.outputs.power
        
        # Run the motor for current
        motor.current(conditions)
        # link
        esc.inputs.currentout =  motor.outputs.current
        
        # Run the esc
        esc.currentin()
        # link
        solar_logic.inputs.currentesc  = esc.outputs.currentin*self.number_of_engines
        solar_logic.inputs.volts_motor = esc.outputs.voltageout 
        #
        solar_logic.logic(conditions,numerics)
        # link
        battery.inputs = solar_logic.outputs
        battery.energy_calc(numerics)
        
        #Pack the conditions for outputs
        rpm                                  = motor.outputs.omega*60./(2.*np.pi)
#.........这里部分代码省略.........
开发者ID:michK,项目名称:SUAVE,代码行数:103,代码来源:Solar.py

示例11: evaluate_thrust

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import thrust_force_vector [as 别名]
    def evaluate_thrust(self,state): 
        """ Calculate thrust given the current state of the vehicle 

        Assumptions: 
        None 

        Source: 
        N/A 

        Inputs: 
        state [state()] 

        Outputs: 
        results.thrust_force_vector                   [N] 
        results.vehicle_mass_rate                     [kg/s] 

        conditions.propulsion.acoustic_outputs: 
        core: 
        exit_static_temperature                  [K]  
        exit_static_pressure                     [K]  
        exit_stagnation_temperature              [K]  
        exit_stagnation_pressure                 [Pa]  
        exit_velocity                            [m/s]  
        fan: 
        exit_static_temperature                  [K]   
        exit_static_pressure                     [K]  
        exit_stagnation_temperature              [K]  
        exit_stagnation_pressure                 [Pa]  
        exit_velocity                            [m/s]  

        Properties Used: 
        Defaulted values 
        """  	 

        #Unpack 
        conditions = state.conditions  
        ram                       = self.ram 
        inlet_nozzle              = self.inlet_nozzle 
        combustor                 = self.combustor 
        core_nozzle               = self.core_nozzle 
        thrust                    = self.thrust 
        number_of_engines         = self.number_of_engines         

        #Creating the network by manually linking the different components        

        #set the working fluid to determine the fluid properties 
        ram.inputs.working_fluid                               = self.working_fluid 

        #Flow through the ram , this computes the necessary flow quantities and stores it into conditions 
        ram(conditions)  

        #link inlet nozzle to ram  
        inlet_nozzle.inputs.stagnation_temperature             = ram.outputs.stagnation_temperature 
        inlet_nozzle.inputs.stagnation_pressure                = ram.outputs.stagnation_pressure 

        #Flow through the inlet nozzle 
        inlet_nozzle.compute_scramjet(conditions) 

        #link the combustor to nozzle 
        combustor.inputs.stagnation_temperature                = inlet_nozzle.outputs.stagnation_temperature 
        combustor.inputs.stagnation_pressure                   = inlet_nozzle.outputs.stagnation_pressure 
        combustor.inputs.inlet_nozzle                          = inlet_nozzle.outputs 

        #flow through the combustor 
        combustor.compute_supersonic_combustion(conditions) 

        #link the core nozzle to the combustor 
        core_nozzle.inputs.stagnation_temperature              = combustor.outputs.stagnation_temperature 
        core_nozzle.inputs.stagnation_pressure                 = combustor.outputs.stagnation_pressure 
        core_nozzle.inputs.static_temperature                  = combustor.outputs.static_temperature 
        core_nozzle.inputs.static_pressure                     = combustor.outputs.static_pressure 
        core_nozzle.inputs.velocity                            = combustor.outputs.velocity 
        core_nozzle.inputs.fuel_to_air_ratio                   = combustor.outputs.fuel_to_air_ratio  

        #flow through the core nozzle 
        core_nozzle.compute_scramjet(conditions)   

        #link the thrust component to the core nozzle 
        thrust.inputs.core_exit_pressure                       = core_nozzle.outputs.pressure 
        thrust.inputs.core_exit_temperature                    = core_nozzle.outputs.temperature  
        thrust.inputs.core_exit_velocity                       = core_nozzle.outputs.velocity 
        thrust.inputs.core_area_ratio                          = core_nozzle.outputs.area_ratio 
        thrust.inputs.core_nozzle                              = core_nozzle.outputs 

        #link the thrust component to the combustor 
        thrust.inputs.fuel_to_air_ratio                        = combustor.outputs.fuel_to_air_ratio 

        #link the thrust component to the low pressure compressor  
        thrust.inputs.stag_temp_lpt_exit                       = core_nozzle.outputs.stagnation_temperature 
        thrust.inputs.stag_press_lpt_exit                      = core_nozzle.outputs.stagnation_pressure 
        thrust.inputs.number_of_engines                        = number_of_engines 

        thrust.inputs.flow_through_core                        = 1.0 #scaled constant to turn on core thrust computation 

        #compute the thrust 
        thrust.compute_stream_thrust(conditions) 

        #getting the network outputs from the thrust outputs 
        F            = thrust.outputs.thrust*[1,0,0] 
        mdot         = thrust.outputs.fuel_flow_rate 
#.........这里部分代码省略.........
开发者ID:suavecode,项目名称:SUAVE,代码行数:103,代码来源:Scramjet.py

示例12: evaluate_thrust

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import thrust_force_vector [as 别名]
    def evaluate_thrust(self,state):
        """ Calculate thrust given the current state of the vehicle
    
            Assumptions:
            None
    
            Source:
            N/A
    
            Inputs:
            state [state()]
    
            Outputs:
            results.thrust_force_vector [newtons]
            results.vehicle_mass_rate   [kg/s]
            conditions.propulsion.acoustic_outputs:
                core:
                    exit_static_temperature      
                    exit_static_pressure       
                    exit_stagnation_temperature 
                    exit_stagnation_pressure
                    exit_velocity 
                fan:
                    exit_static_temperature      
                    exit_static_pressure       
                    exit_stagnation_temperature 
                    exit_stagnation_pressure
                    exit_velocity 
    
            Properties Used:
            Defaulted values
        """           

        #Unpack
        conditions = state.conditions
        
        ram                       = self.ram
        inlet_nozzle              = self.inlet_nozzle
        low_pressure_compressor   = self.low_pressure_compressor
        high_pressure_compressor  = self.high_pressure_compressor
        fan                       = self.fan
        combustor                 = self.combustor
        high_pressure_turbine     = self.high_pressure_turbine
        low_pressure_turbine      = self.low_pressure_turbine
        core_nozzle               = self.core_nozzle
        fan_nozzle                = self.fan_nozzle
        thrust                    = self.thrust
        bypass_ratio              = self.bypass_ratio
        number_of_engines         = self.number_of_engines   
        
        #Creating the network by manually linking the different components
        
        #set the working fluid to determine the fluid properties
        ram.inputs.working_fluid                               = self.working_fluid
        
        #Flow through the ram , this computes the necessary flow quantities and stores it into conditions
        ram(conditions) 
        
        #link inlet nozzle to ram 
        inlet_nozzle.inputs.stagnation_temperature             = ram.outputs.stagnation_temperature 
        inlet_nozzle.inputs.stagnation_pressure                = ram.outputs.stagnation_pressure
        
        #Flow through the inlet nozzle
        inlet_nozzle(conditions)

        #--link low pressure compressor to the inlet nozzle
        low_pressure_compressor.inputs.stagnation_temperature  = inlet_nozzle.outputs.stagnation_temperature
        low_pressure_compressor.inputs.stagnation_pressure     = inlet_nozzle.outputs.stagnation_pressure
        
        #Flow through the low pressure compressor
        low_pressure_compressor(conditions)

        #link the high pressure compressor to the low pressure compressor
        high_pressure_compressor.inputs.stagnation_temperature = low_pressure_compressor.outputs.stagnation_temperature
        high_pressure_compressor.inputs.stagnation_pressure    = low_pressure_compressor.outputs.stagnation_pressure
        
        #Flow through the high pressure compressor
        high_pressure_compressor(conditions)
        
        #Link the fan to the inlet nozzle
        fan.inputs.stagnation_temperature                      = inlet_nozzle.outputs.stagnation_temperature
        fan.inputs.stagnation_pressure                         = inlet_nozzle.outputs.stagnation_pressure
        
        #flow through the fan
        fan(conditions)
        
        #link the combustor to the high pressure compressor
        combustor.inputs.stagnation_temperature                = high_pressure_compressor.outputs.stagnation_temperature
        combustor.inputs.stagnation_pressure                   = high_pressure_compressor.outputs.stagnation_pressure
        
        #flow through the high pressor comprresor
        combustor(conditions)

        # link the shaft power output to the low pressure compressor
        try:
            shaft_power = self.Shaft_Power_Off_Take       
            shaft_power.inputs.mdhc                            = thrust.compressor_nondimensional_massflow
            shaft_power.inputs.Tref                            = thrust.reference_temperature
            shaft_power.inputs.Pref                            = thrust.reference_pressure
            shaft_power.inputs.total_temperature_reference     = low_pressure_compressor.outputs.stagnation_temperature
#.........这里部分代码省略.........
开发者ID:michK,项目名称:SUAVE,代码行数:103,代码来源:Turbofan.py

示例13: evaluate_thrust

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import thrust_force_vector [as 别名]
    def evaluate_thrust(self,state):
        """ Calculate thrust given the current state of the vehicle

        	Assumptions:
        	None

        	Source:
        	N/A

        	Inputs:
        	state [state()]

        	Outputs:
        	results.thrust_force_vector                      [newtons]
        	results.vehicle_mass_rate                        [kg/s]
        	results.specific_impulse                         [s]
        	conditions.propulsion.acoustic_outputs:
        	    core:
        		exit_static_temperature                  [K]
        		exit_static_pressure                     [K]
        		exit_stagnation_temperature              [K]
        		exit_stagnation_pressure                 [Pa]
        		exit_velocity                            [m/s]

        	Properties Used:
        	Defaulted values
            """

        # unpack
        conditions                = state.conditions
        combustor                 = self.combustor
        core_nozzle               = self.core_nozzle
        thrust                    = self.thrust
        number_of_engines         = self.number_of_engines

        # creating the network by manually linking the different components

        # flow through the combustor
        combustor.compute(conditions)

        # link the core nozzle to the low pressure turbine
        core_nozzle.inputs        = combustor.outputs

        # flow through the core nozzle
        core_nozzle.compute(conditions)

        # compute the thrust using the thrust component

        # link the thrust component to the core nozzle
        thrust.inputs                                          = core_nozzle.outputs

        # link the thrust component 
        thrust.inputs.number_of_engines                        = number_of_engines

        # compute the thrust
        thrust(conditions)

        # getting the network outputs from the thrust outputs
        F            = thrust.outputs.thrust*[1,0,0]
        mdot         = thrust.outputs.vehicle_mass_rate
        Isp          = thrust.outputs.specific_impulse
        F_vec        = conditions.ones_row(3) * 0.0
        F_vec[:,0]   = F[:,0]
        F            = F_vec

        results                     = Data()
        results.thrust_force_vector = F
        results.vehicle_mass_rate   = mdot
        results.specific_impulse    = Isp

        return results
开发者ID:suavecode,项目名称:SUAVE,代码行数:73,代码来源:Liquid_Rocket.py

示例14: evaluate

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import thrust_force_vector [as 别名]
    def evaluate(self, state):

        # unpack
        conditions = state.conditions
        numerics = state.numerics
        solar_flux = self.solar_flux
        solar_panel = self.solar_panel
        motor = self.motor
        propeller = self.propeller
        esc = self.esc
        avionics = self.avionics
        payload = self.payload
        solar_logic = self.solar_logic
        battery = self.battery

        # Set battery energy
        battery.current_energy = conditions.propulsion.battery_energy

        # step 1
        solar_flux.solar_radiation(conditions)
        # link
        solar_panel.inputs.flux = solar_flux.outputs.flux
        # step 2
        solar_panel.power()
        # link
        solar_logic.inputs.powerin = solar_panel.outputs.power
        # step 3
        solar_logic.voltage()
        # link
        esc.inputs.voltagein = solar_logic.outputs.system_voltage
        # Step 4
        esc.voltageout(conditions)
        # link
        motor.inputs.voltage = esc.outputs.voltageout
        # step 5
        motor.omega(conditions)
        # link
        propeller.inputs.omega = motor.outputs.omega
        propeller.inputs.torque = motor.outputs.torque
        # step 6
        F, Q, P, Cplast = propeller.spin(conditions)

        # Check to see if magic thrust is needed, the ESC caps throttle at 1.1 already
        eta = conditions.propulsion.throttle[:, 0, None]
        P[eta > 1.0] = P[eta > 1.0] * eta[eta > 1.0]
        F[eta > 1.0] = F[eta > 1.0] * eta[eta > 1.0]

        # Run the avionics
        avionics.power()
        # link
        solar_logic.inputs.pavionics = avionics.outputs.power

        # Run the payload
        payload.power()
        # link
        solar_logic.inputs.ppayload = payload.outputs.power

        # Run the motor for current
        motor.current(conditions)
        # link
        esc.inputs.currentout = motor.outputs.current

        # Run the esc
        esc.currentin()
        # link
        solar_logic.inputs.currentesc = esc.outputs.currentin * self.number_motors
        solar_logic.inputs.volts_motor = esc.outputs.voltageout
        #
        solar_logic.logic(conditions, numerics)
        # link
        battery.inputs.batlogic = solar_logic.outputs.batlogic
        battery.energy_calc(numerics)

        # Pack the conditions for outputs
        rpm = motor.outputs.omega * 60.0 / (2.0 * np.pi)
        current = solar_logic.inputs.currentesc
        battery_draw = battery.inputs.batlogic.pbat
        battery_energy = battery.current_energy

        conditions.propulsion.solar_flux = solar_flux.outputs.flux
        conditions.propulsion.rpm = rpm
        conditions.propulsion.current = current
        conditions.propulsion.battery_draw = battery_draw
        conditions.propulsion.battery_energy = battery_energy

        # Create the outputs
        F = self.number_motors * F * [1, 0, 0]
        F_vec = conditions.ones_row(3) * 0.0
        F_vec[:, 0] = F[:, 0]
        F = F_vec
        mdot = np.zeros_like(F)

        results = Data()
        results.thrust_force_vector = F
        results.vehicle_mass_rate = mdot

        return results
开发者ID:Lamenoire67,项目名称:SUAVE,代码行数:99,代码来源:Solar_Low_Fidelity.py

示例15: evaluate_thrust

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import thrust_force_vector [as 别名]
    def evaluate_thrust(self,state):
    
        # unpack
        conditions  = state.conditions
        numerics    = state.numerics
        motor       = self.motor
        propeller   = self.propeller
        esc         = self.esc
        avionics    = self.avionics
        payload     = self.payload
        battery     = self.battery
        
        # Set battery energy
        battery.current_energy = conditions.propulsion.battery_energy        
       
        # Step 1 battery power
        esc.inputs.voltagein = self.voltage
        # Step 2
        esc.voltageout(conditions)
        # link
        motor.inputs.voltage = esc.outputs.voltageout 
        # step 3
        motor.omega(conditions)
        # link
        propeller.inputs.omega =  motor.outputs.omega
        # step 4
        F, Q, P, Cplast = propeller.spin(conditions)
       
        # iterate the Cp here
        diff = abs(Cplast-motor.propeller_Cp)
        tol = 1e-6
        while (np.any(diff>tol)):
            motor.propeller_Cp  = Cplast # Change the Cp
            motor.omega(conditions) # Rerun the motor
            propeller.inputs.omega =  motor.outputs.omega # Relink the motor
            F, Q, P, Cplast        = propeller.spin(conditions) # Run the motor again
            diff                   = abs(Cplast-motor.propeller_Cp) # Check to see if it converged          
        
            
        # Check to see if magic thrust is needed, the ESC caps throttle at 1.1 already
        eta        = conditions.propulsion.throttle[:,0,None]
        P[eta>1.0] = P[eta>1.0]*eta[eta>1.0]
        F[eta>1.0] = F[eta>1.0]*eta[eta>1.0]

        # Run the avionics
        avionics.power()

        # Run the payload
        payload.power()
        
        # Run the motor for current
        motor.current(conditions)
        # link
        esc.inputs.currentout =  motor.outputs.current
        
        # Run the esc
        esc.currentin()

        # Calculate avionics and payload power
        avionics_payload_power = avionics.outputs.power + payload.outputs.power

        # Calculate avionics and payload current
        avionics_payload_current = avionics_payload_power/self.voltage

        # link
        battery.inputs.current  = esc.outputs.currentin*self.number_of_engines + avionics_payload_current
        battery.inputs.power_in = -(esc.outputs.voltageout*esc.outputs.currentin*self.number_of_engines + avionics_payload_power)
        battery.energy_calc(numerics)
        
        #Pack the conditions for outputs
        rpm                                  = motor.outputs.omega*60./(2.*np.pi)
        current                              = esc.outputs.currentin
        battery_draw                         = battery.inputs.power_in 
        battery_energy                       = battery.current_energy
         
        conditions.propulsion.rpm            = rpm
        conditions.propulsion.current        = current
        conditions.propulsion.battery_draw   = battery_draw
        conditions.propulsion.battery_energy = battery_energy
        
        #Create the outputs
        F    = self.number_of_engines * F * [1,0,0]      
        mdot = np.zeros_like(F)

        results = Data()
        results.thrust_force_vector = F
        results.vehicle_mass_rate   = mdot
        
        return results
开发者ID:Alexandrovich,项目名称:SUAVE,代码行数:91,代码来源:Battery_Propeller.py


注:本文中的SUAVE.Core.Data.thrust_force_vector方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。