Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 5ec31dc6 authored by Glenn Zarb's avatar Glenn Zarb Committed by Kostis ANAGNOSTOPOULOS
Browse files
parent 996124f4
No related branches found
No related tags found
No related merge requests found
......@@ -18,66 +18,74 @@ Namespace DownstreamModules
Public Interface IM11
''' <summary>
''' Smart Electrical Total Cycle Electrical Energy Generated During Overrun Only(J)
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
ReadOnly Property SmartElectricalTotalCycleElectricalEnergyGeneratedDuringOverrunOnly As Single
''' <summary>
''' Smart Electrical Total Cycle Eletrical EnergyGenerated (J)
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
ReadOnly Property SmartElectricalTotalCycleEletricalEnergyGenerated As single
''' <summary>
''' Total Cycle Electrical Demand (J)
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
ReadOnly Property TotalCycleElectricalDemand As single
''' <summary>
''' Total Cycle Fuel Consumption: Smart Electrical Load (g)
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
ReadOnly Property TotalCycleFuelConsumptionSmartElectricalLoad As single
''' <summary>
''' Total Cycle Fuel Consumption: Zero Electrical Load (g)
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
ReadOnly Property TotalCycleFuelConsumptionZeroElectricalLoad As single
''' <summary>
''' Stop Start Sensitive: Total Cycle Electrical Demand (J)
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
ReadOnly Property StopStartSensitiveTotalCycleElectricalDemand As Single
''' <summary>
''' Clears aggregated values ( Sets them to zero ).
''' </summary>
''' <remarks></remarks>
Sub ClearAggregates()
''' <summary>
''' Increments all aggregated outputs
''' </summary>
''' <param name="stepTimeInSeconds">Single : Mutiplies the values to be aggregated by number of seconds</param>
''' <remarks></remarks>
Sub CycleStep(Optional stepTimeInSeconds As Single = 0.0)
''' <summary>
''' Smart Electrical Total Cycle Electrical Energy Generated During Overrun Only(J)
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
ReadOnly Property SmartElectricalTotalCycleElectricalEnergyGeneratedDuringOverrunOnly As Single
''' <summary>
''' Smart Electrical Total Cycle Eletrical EnergyGenerated (J)
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
ReadOnly Property SmartElectricalTotalCycleEletricalEnergyGenerated As Single
''' <summary>
''' Total Cycle Electrical Demand (J)
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
ReadOnly Property TotalCycleElectricalDemand As Single
''' <summary>
''' Total Cycle Fuel Consumption: Smart Electrical Load (g)
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
ReadOnly Property TotalCycleFuelConsumptionSmartElectricalLoad As Single
''' <summary>
''' Total Cycle Fuel Consumption: Zero Electrical Load (g)
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
ReadOnly Property TotalCycleFuelConsumptionZeroElectricalLoad As Single
''' <summary>
''' Stop Start Sensitive: Total Cycle Electrical Demand (J)
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
ReadOnly Property StopStartSensitiveTotalCycleElectricalDemand As Single
''' <summary>
''' Total Cycle Fuel Consuption : Average Loads (g)
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
ReadOnly Property TotalCycleFuelConsuptionAverageLoads As Single
''' <summary>
''' Clears aggregated values ( Sets them to zero ).
''' </summary>
''' <remarks></remarks>
Sub ClearAggregates()
''' <summary>
''' Increments all aggregated outputs
''' </summary>
''' <param name="stepTimeInSeconds">Single : Mutiplies the values to be aggregated by number of seconds</param>
''' <remarks></remarks>
Sub CycleStep(Optional stepTimeInSeconds As Single = 0.0)
End Interface
......
......@@ -15,181 +15,221 @@ Imports VectoAuxiliaries.Hvac
Namespace DownstreamModules
Public Class M11
Implements IM11
Private Const RPM_to_RadiansPerSecond as single= 9.55
#Region "Private Aggregates"
'Private Aggregations
Private AG1 As Single
Private AG2 As Single
Private AG3 As Single
Private AG4 As single
Private AG5 As single
Private AG6 As single
#End Region
Public Class M11
Implements IM11
#Region "Private Fields Assigned by Constructor."
Private Const RPM_to_RadiansPerSecond As Single = 9.55
Private M1 As IM1_AverageHVACLoadDemand
Private M3 As IM3_AveragePneumaticLoadDemand
Private M6 As IM6
Private M8 As IM8
Private fmap As IFUELMAP
Private signals As ISignals
#Region "Private Aggregates"
'Private Aggregations
Private AG1 As Single
Private AG2 As Single
Private AG3 As Single
Private AG4 As Single
Private AG5 As Single
Private AG6 As Single
Private AG7 As Single
#End Region
#End Region
#Region "Private Fields Assigned by Constructor."
'Staging Calculations
Private Function Sum0( byval rpm As Single ) As Single
Private M1 As IM1_AverageHVACLoadDemand
Private M3 As IM3_AveragePneumaticLoadDemand
Private M6 As IM6
Private M8 As IM8
Private fmap As IFUELMAP
Private signals As ISignals
If rpm<1 then rpm=1
#End Region
Return rpm/RPM_to_RadiansPerSecond
'Staging Calculations
Private Function Sum0(ByVal rpm As Single) As Single
If rpm < 1 Then rpm = 1
End Function
Private ReadOnly Property Sum1 As single
Get
Return m6.OverrunFlag * m8.SmartElectricalAlternatorPowerGenAtCrank
End Get
End Property
Private ReadOnly Property Sum2 As Single
Get
Return m3.GetAveragePowerDemandAtCrankFromPneumatics + m1.AveragePowerDemandAtCrankFromHVACMechanicalsWatts
End Get
End Property
Private ReadOnly Property Sum3 As Single
Get
Return m8.SmartElectricalAlternatorPowerGenAtCrank / Sum0(signals.EngineSpeed)
End Get
End Property
Private ReadOnly Property Sum4 As Single
Get
Return Sum2 / Sum0(signals.EngineSpeed)
End Get
End Property
Private ReadOnly Property Sum5 As Single
Get
Return Sum4 + signals.EngineDrivelineTorque
End Get
End Property
Private ReadOnly Property Sum6 As Single
Get
Return Sum3 + Sum5
End Get
End Property
Private readonly Property Sum7 As Single
Get
Return rpm / RPM_to_RadiansPerSecond
'SCM 3_02
Dim intrp1 As Single = fmap.fFCdelaunay_Intp(signals.EngineSpeed, sum6)
intrp1 = If( Not Single.IsNaN( intrp1) andAlso intrp1>0,intrp1,0)
Return intrp1
End Get
End Property
Private ReadOnly Property Sum8 As Single
Get
End Function
Private ReadOnly Property Sum1 As Single
Get
Return m6.OverrunFlag * m8.SmartElectricalAlternatorPowerGenAtCrank
End Get
End Property
Private ReadOnly Property Sum2 As Single
Get
Return m3.GetAveragePowerDemandAtCrankFromPneumatics + m1.AveragePowerDemandAtCrankFromHVACMechanicalsWatts
End Get
End Property
Private ReadOnly Property Sum3 As Single
Get
Return m8.SmartElectricalAlternatorPowerGenAtCrank / Sum0(signals.EngineSpeed)
End Get
End Property
Private ReadOnly Property Sum4 As Single
Get
Return Sum2 / Sum0(signals.EngineSpeed)
End Get
End Property
Private ReadOnly Property Sum5 As Single
Get
Return Sum4 + Sum9
End Get
End Property
Private ReadOnly Property Sum6 As Single
Get
Return Sum3 + Sum5
End Get
End Property
Private ReadOnly Property Sum7 As Single
Get
'SCM 3_02
Dim intrp1 As Single = fmap.fFCdelaunay_Intp(signals.EngineSpeed, sum6)
intrp1 = If(Not Single.IsNaN(intrp1) AndAlso intrp1 > 0, intrp1, 0)
Return intrp1
End Get
End Property
Private ReadOnly Property Sum8 As Single
Get
'SCHM 3_2
Dim intrp2 As Single = fmap.fFCdelaunay_Intp(signals.EngineSpeed, sum5)
intrp2 = If(Not Single.IsNaN(intrp2) AndAlso intrp2 > 0, intrp2, 0)
Return intrp2
End Get
End Property
Private ReadOnly Property Sum9 As Single
Get
Return signals.EngineDrivelineTorque + signals.PreExistingAuxPower
End Get
End Property
Private ReadOnly Property Sum10 As Single
Get
Return M6.AvgPowerDemandAtCrankFromElectricsIncHVAC \ Sum0(signals.EngineSpeed)
End Get
End Property
Private ReadOnly Property Sum11 As Single
Get
Return Sum5 + Sum10
End Get
End Property
Private ReadOnly Property Sum12 As Single
Get
'SCHM 3_2
Dim intrp2 As Single = fmap.fFCdelaunay_Intp(signals.EngineSpeed, sum5)
intrp2 = If( Not Single.IsNaN( intrp2) andAlso intrp2>0,intrp2,0)
Return intrp2
'SCHM 3_2
Dim intrp3 As Single = fmap.fFCdelaunay_Intp(signals.EngineSpeed, Sum11)
intrp3 = If(Not Single.IsNaN(intrp3) AndAlso intrp3 > 0, intrp3, 0)
Return intrp3
End Get
End Property
End Get
End Property
'OUT1
Public ReadOnly Property SmartElectricalTotalCycleElectricalEnergyGeneratedDuringOverrunOnly As Single Implements IM11.SmartElectricalTotalCycleElectricalEnergyGeneratedDuringOverrunOnly
'OUT1
Public ReadOnly Property SmartElectricalTotalCycleElectricalEnergyGeneratedDuringOverrunOnly As Single Implements IM11.SmartElectricalTotalCycleElectricalEnergyGeneratedDuringOverrunOnly
Get
Return AG1
End Get
End Property
'OUT2
Public ReadOnly Property SmartElectricalTotalCycleEletricalEnergyGenerated As Single Implements IM11.SmartElectricalTotalCycleEletricalEnergyGenerated
Get
Return AG1
Return AG2
End Get
End Property
'OUT2
Public ReadOnly Property SmartElectricalTotalCycleEletricalEnergyGenerated As Single Implements IM11.SmartElectricalTotalCycleEletricalEnergyGenerated
'OUT3
Public ReadOnly Property TotalCycleElectricalDemand As Single Implements IM11.TotalCycleElectricalDemand
Get
Return AG2
Return AG3
End Get
End Property
'OUT3
Public ReadOnly Property TotalCycleElectricalDemand As Single Implements IM11.TotalCycleElectricalDemand
'OUT4
Public ReadOnly Property TotalCycleFuelConsumptionSmartElectricalLoad As Single Implements IM11.TotalCycleFuelConsumptionSmartElectricalLoad
Get
Return AG3
Return AG4
End Get
End Property
'OUT4
Public ReadOnly Property TotalCycleFuelConsumptionSmartElectricalLoad As Single Implements IM11.TotalCycleFuelConsumptionSmartElectricalLoad
'OUT5
Public ReadOnly Property TotalCycleFuelConsumptionZeroElectricalLoad As Single Implements IM11.TotalCycleFuelConsumptionZeroElectricalLoad
Get
Return AG4
Return AG5
End Get
End Property
'OUT5
Public ReadOnly Property TotalCycleFuelConsumptionZeroElectricalLoad As Single Implements IM11.TotalCycleFuelConsumptionZeroElectricalLoad
'OUT6
Public ReadOnly Property StopStartSensitiveTotalCycleElectricalDemand As Single Implements IM11.StopStartSensitiveTotalCycleElectricalDemand
Get
Return AG5
Return AG6
End Get
End Property
'OUT6
Public ReadOnly Property StopStartSensitiveTotalCycleElectricalDemand As Single Implements IM11.StopStartSensitiveTotalCycleElectricalDemand
'OUT7
Public ReadOnly Property TotalCycleFuelConsuptionAverageLoads As Single Implements IM11.TotalCycleFuelConsuptionAverageLoads
Get
Return AG6
Return AG7
End Get
End Property
Private ReadOnly Property SW1 As single
Get
Return If( signals.EngineStopped,0, 1)
End Get
End Property
Private ReadOnly Property SW1 As Single
Get
Return If(signals.EngineStopped, 0, 1)
End Get
End Property
'Clear at the beginning of cycle
Sub ClearAggregates() Implements IM11.ClearAggregates
AG1 = 0
AG2 = 0
AG3 = 0
AG4 = 0
AG5 = 0
AG6 = 0
AG7 = 0
End Sub
'Add to Aggregates dependent on cycle step time.
Sub CycleStep(Optional stepTimeInSeconds As Single = 0.0) Implements IM11.CycleStep
'Clear at the beginning of cycle
Sub ClearAggregates() Implements IM11.ClearAggregates
AG1=0
AG2=0
AG3=0
AG4=0
AG5=0
ag6=0
'S/S Insensitive
AG3 += (stepTimeInSeconds * m6.AvgPowerDemandAtCrankFromElectricsIncHVAC)
End Sub
'Add to Aggregates dependent on cycle step time.
Sub CycleStep(Optional stepTimeInSeconds As Single = 0.0) Implements IM11.CycleStep
'S/S Insensitive
AG3+= ( stepTimeInSeconds * m6.AvgPowerDemandAtCrankFromElectricsIncHVAC )
If Signals.EngineStopped Then Return
'S/S Sensitive
AG1 += (stepTimeInSeconds * sum1 * SW1)
AG2 += (stepTimeInSeconds * M8.SmartElectricalAlternatorPowerGenAtCrank * SW1)
If Signals.EngineStopped then return
AG6 += (stepTimeInSeconds * m6.AvgPowerDemandAtCrankFromElectricsIncHVAC * SW1)
'S/S Sensitive
AG1+= ( stepTimeInSeconds * sum1 * SW1 )
AG2+= ( stepTimeInSeconds * M8.SmartElectricalAlternatorPowerGenAtCrank * SW1 )
'These need to be divided by 3600 as the Fuel Map output is in Grams/Second.
AG4 += (stepTimeInSeconds * sum7 / 3600 * SW1)
AG5 += (stepTimeInSeconds * Sum8 / 3600 * SW1)
AG7 += (stepTimeInSeconds * Sum12 / 3600 * SW1)
AG6+= ( stepTimeInSeconds * m6.AvgPowerDemandAtCrankFromElectricsIncHVAC * SW1 )
End Sub
'These need to be divided by 3600 as the Fuel Map output is in Grams/Second.
AG4+= ( stepTimeInSeconds * sum7 / 3600 * SW1 )
AG5+= ( stepTimeInSeconds * Sum8 / 3600 * SW1 )
End Sub
'Constructor
Public Sub new ( m1 As IM1_AverageHVACLoadDemand, m3 As IM3_AveragePneumaticLoadDemand, m6 As IM6, m8 As IM8, fmap As IFUELMAP, signals As ISignals)
'Constructor
Public Sub New(m1 As IM1_AverageHVACLoadDemand, m3 As IM3_AveragePneumaticLoadDemand, m6 As IM6, m8 As IM8, fmap As IFUELMAP, signals As ISignals)
me.M1 = m1
me.M3 = m3
me.M6 = m6
me.M8 = m8
Me.fmap = fmap
Me.signals = signals
Me.M1 = m1
Me.M3 = m3
Me.M6 = m6
Me.M8 = m8
Me.fmap = fmap
Me.signals = signals
End Sub
End Sub
End Class
End Class
End Namespace
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment