diff --git a/VECTOAux/VectoAuxiliaries/DownstreamModules/M10.vb b/VECTOAux/VectoAuxiliaries/DownstreamModules/M10.vb deleted file mode 100644 index ab015bf56a68c660f17ab9a24d0bb94f8f1014a1..0000000000000000000000000000000000000000 --- a/VECTOAux/VectoAuxiliaries/DownstreamModules/M10.vb +++ /dev/null @@ -1,189 +0,0 @@ -' Copyright 2017 European Union. -' Licensed under the EUPL (the 'Licence'); -' -' * You may not use this work except in compliance with the Licence. -' * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl -' * Unless required by applicable law or agreed to in writing, -' software distributed under the Licence is distributed on an "AS IS" basis, -' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -' -' See the LICENSE.txt for the specific language governing permissions and limitations. - -Imports TUGraz.VectoCommon.Utils -Imports VectoAuxiliaries.Pneumatics - -Namespace DownstreamModules - Public Class M10 - Implements IM10 - - 'Aggregators - Private _AverageAirConsumedLitre As NormLiter - - 'Diagnostics - Private x1 As NormLiter - Private y1 As Kilogram - Private x2 As NormLiter - Private y2 As Kilogram - Private x3 As NormLiter - Private y3 As Kilogram - Private xTA As NormLiter - Private interp1 As Kilogram - Private interp2 As Kilogram - - Public ReadOnly Property P1X As NormLiter Implements IM10.P1X - Get - Return x1 - End Get - End Property - - Public ReadOnly Property P1Y As Kilogram Implements IM10.P1Y - Get - Return y1 - End Get - End Property - - Public ReadOnly Property P2X As NormLiter Implements IM10.P2X - Get - Return x2 - End Get - End Property - - Public ReadOnly Property P2Y As Kilogram Implements IM10.P2Y - Get - Return y2 - End Get - End Property - - Public ReadOnly Property P3X As NormLiter Implements IM10.P3X - Get - Return x3 - End Get - End Property - - Public ReadOnly Property P3Y As Kilogram Implements IM10.P3Y - Get - Return y3 - End Get - End Property - - Public ReadOnly Property XTAIN As NormLiter Implements IM10.XTAIN - Get - Return xTA - End Get - End Property - - Public ReadOnly Property INTRP1 As Kilogram Implements IM10.INTRP1 - Get - Return interp1 - End Get - End Property - - Public ReadOnly Property INTRP2 As Kilogram Implements IM10.INTRP2 - Get - Return interp2 - End Get - End Property - - - 'Private - -#Region "Private Fields = > Constructor Requirements" - - Private m3 As IM3_AveragePneumaticLoadDemand - Private m9 As IM9 - 'Not Currently used but there for ease of refactoring in future. - Private signals As ISignals - -#End Region - - Private Enum InterpolationType - NonSmartPneumtaics - SmartPneumtaics - End Enum - - Private Function Interpolate(interpType As InterpolationType) As Kilogram - - Dim returnValue As Kilogram = 0.SI(Of Kilogram)() - ' Dim x1,y1,x2,y2,x3,y3, xTA As Single - - x1 = m9.LitresOfAirCompressorOnContinually - y1 = m9.TotalCycleFuelConsumptionCompressorOnContinuously - x2 = 0.SI(Of NormLiter)() - y2 = m9.TotalCycleFuelConsumptionCompressorOffContinuously - x3 = m9.LitresOfAirCompressorOnOnlyInOverrun - y3 = m9.TotalCycleFuelConsumptionCompressorOffContinuously - - - xTA = _AverageAirConsumedLitre 'm3.AverageAirConsumedPerSecondLitre - - - Select Case interpType - - 'Non-Smart Pneumatics ( OUT 1 ) - Case InterpolationType.NonSmartPneumtaics - 'returnValue = (y2 + (((y1 - y2) * xTA) / x1)) - returnValue = VectoMath.Interpolate(x1, x2, y1, y2, xTA) - interp1 = returnValue - - 'Smart Pneumatics ( OUT 2 ) - Case InterpolationType.SmartPneumtaics - 'returnValue = (y3 + (((y1 - y3) / (x1 - x3)) * (xTA - x3))) - returnValue = VectoMath.Interpolate(x1, x3, y1, y3, xTA) - interp2 = returnValue - End Select - - - Return returnValue - End Function - - 'Public - -#Region "Public Properties" - - Public ReadOnly Property AverageLoadsFuelConsumptionInterpolatedForPneumatics As Kilogram _ - Implements IM10.AverageLoadsFuelConsumptionInterpolatedForPneumatics - Get - - 'SCHM 3_02 - Dim intrp1 As Kilogram = Interpolate(InterpolationType.NonSmartPneumtaics) - 'intrp1 = If(Not Single.IsNaN(intrp1), intrp1, 0) - Return intrp1 - End Get - End Property - - Public ReadOnly Property FuelConsumptionSmartPneumaticsAndAverageElectricalPowerDemand As Kilogram _ - Implements IM10.FuelConsumptionSmartPneumaticsAndAverageElectricalPowerDemand - Get - - 'SCHM 3_02 - Dim intrp2 As Kilogram = Interpolate(InterpolationType.SmartPneumtaics) - 'intrp2 = If(Not Single.IsNaN(intrp2), intrp2, 0) - Return intrp2 - End Get - End Property - -#End Region - -#Region "Contructors" - - Public Sub New(m3 As IM3_AveragePneumaticLoadDemand, m9 As IM9, signals As ISignals) - - Me.m3 = m3 - Me.m9 = m9 - Me.signals = signals - _AverageAirConsumedLitre = 0.SI(Of NormLiter)() - End Sub - -#End Region - - Public Sub CycleStep(stepTimeInSeconds As Second) Implements IM10.CycleStep - - _AverageAirConsumedLitre += - If _ - (Double.IsNaN(m3.AverageAirConsumedPerSecondLitre.Value()), 0.SI(Of NormLiter), - m3.AverageAirConsumedPerSecondLitre * stepTimeInSeconds) - End Sub - End Class -End Namespace - - diff --git a/VECTOAux/VectoAuxiliaries/DownstreamModules/M11.vb b/VECTOAux/VectoAuxiliaries/DownstreamModules/M11.vb deleted file mode 100644 index 8bd593943fc8297b1a1512bfe885e764d4b61661..0000000000000000000000000000000000000000 --- a/VECTOAux/VectoAuxiliaries/DownstreamModules/M11.vb +++ /dev/null @@ -1,250 +0,0 @@ -' Copyright 2017 European Union. -' Licensed under the EUPL (the 'Licence'); -' -' * You may not use this work except in compliance with the Licence. -' * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl -' * Unless required by applicable law or agreed to in writing, -' software distributed under the Licence is distributed on an "AS IS" basis, -' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -' -' See the LICENSE.txt for the specific language governing permissions and limitations. - -Imports TUGraz.VectoCommon.Utils -Imports VectoAuxiliaries.Electrics -Imports VectoAuxiliaries.Pneumatics -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 Joule - Private AG2 As Joule - Private AG3 As Joule - Private AG4 As Kilogram - Private AG5 As Kilogram - Private AG6 As Joule - Private AG7 As Kilogram - -#End Region - -#Region "Private Fields Assigned by Constructor." - - Private M1 As IM1_AverageHVACLoadDemand - Private M3 As IM3_AveragePneumaticLoadDemand - Private M6 As IM6 - Private M8 As IM8 - Private fmap As IFuelConsumptionMap - Private signals As ISignals - -#End Region - - - 'Staging Calculations - Private Function Sum0(ByVal rpm As PerSecond) As PerSecond - - If rpm < 1 Then rpm = 1.RPMtoRad() - - Return rpm ' / RPM_to_RadiansPerSecond - End Function - - Private ReadOnly Property Sum1 As Watt - Get - Return If(M6.OverrunFlag, M8.SmartElectricalAlternatorPowerGenAtCrank, SIBase(Of Watt).Create(0.0)) - 'Return M6.OverrunFlag*M8.SmartElectricalAlternatorPowerGenAtCrank - End Get - End Property - - Private ReadOnly Property Sum2 As Watt - Get - Return M3.GetAveragePowerDemandAtCrankFromPneumatics + M1.AveragePowerDemandAtCrankFromHVACMechanicalsWatts - End Get - End Property - - Private ReadOnly Property Sum3 As NewtonMeter - Get - Return M8.SmartElectricalAlternatorPowerGenAtCrank / Sum0(signals.EngineSpeed) - End Get - End Property - - Private ReadOnly Property Sum4 As NewtonMeter - Get - Return Sum2 / Sum0(signals.EngineSpeed) - End Get - End Property - - Private ReadOnly Property Sum5 As NewtonMeter - Get - Return Sum4 + Sum9 - End Get - End Property - - Private ReadOnly Property Sum6 As NewtonMeter - Get - Return Sum3 + Sum5 - End Get - End Property - - Private ReadOnly Property Sum7 As KilogramPerSecond - Get - - 'SCM 3_02 - Dim intrp1 As KilogramPerSecond = fmap.GetFuelConsumption(Sum6, signals.EngineSpeed) - intrp1 = If(Not Double.IsNaN(intrp1.Value()) AndAlso intrp1 > 0, intrp1, 0.SI(Of KilogramPerSecond)) - Return intrp1 - End Get - End Property - - Private ReadOnly Property Sum8 As KilogramPerSecond - Get - - 'SCHM 3_2 - Dim intrp2 As KilogramPerSecond = fmap.GetFuelConsumption(Sum5, signals.EngineSpeed) - intrp2 = If(Not Double.IsNaN(intrp2.Value()) AndAlso intrp2 > 0, intrp2, 0.SI(Of KilogramPerSecond)) - Return intrp2 - End Get - End Property - - Private ReadOnly Property Sum9 As NewtonMeter - Get - - Return _ - signals.EngineDrivelineTorque + - (signals.PreExistingAuxPower / Sum0(signals.EngineSpeed)) - End Get - End Property - - Private ReadOnly Property Sum10 As NewtonMeter - Get - - Return M6.AvgPowerDemandAtCrankFromElectricsIncHVAC / Sum0(signals.EngineSpeed) - End Get - End Property - - Private ReadOnly Property Sum11 As NewtonMeter - Get - - Return Sum5 + Sum10 - End Get - End Property - - Private ReadOnly Property Sum12 As KilogramPerSecond - Get - - 'SCHM 3_2 - Dim intrp3 As KilogramPerSecond = fmap.GetFuelConsumption(Sum11, signals.EngineSpeed) - intrp3 = If(Not Double.IsNaN(intrp3.Value()) AndAlso intrp3 > 0, intrp3, 0.SI(Of KilogramPerSecond)) - Return intrp3 - End Get - End Property - - 'OUT1 - Public ReadOnly Property SmartElectricalTotalCycleElectricalEnergyGeneratedDuringOverrunOnly As Joule _ - Implements IM11.SmartElectricalTotalCycleElectricalEnergyGeneratedDuringOverrunOnly - Get - Return AG1 - End Get - End Property - 'OUT2 - Public ReadOnly Property SmartElectricalTotalCycleEletricalEnergyGenerated As Joule _ - Implements IM11.SmartElectricalTotalCycleEletricalEnergyGenerated - Get - Return AG2 - End Get - End Property - 'OUT3 - Public ReadOnly Property TotalCycleElectricalDemand As Joule Implements IM11.TotalCycleElectricalDemand - Get - Return AG3 - End Get - End Property - 'OUT4 - Public ReadOnly Property TotalCycleFuelConsumptionSmartElectricalLoad As Kilogram _ - Implements IM11.TotalCycleFuelConsumptionSmartElectricalLoad - Get - Return AG4 - End Get - End Property - 'OUT5 - Public ReadOnly Property TotalCycleFuelConsumptionZeroElectricalLoad As Kilogram _ - Implements IM11.TotalCycleFuelConsumptionZeroElectricalLoad - Get - Return AG5 - End Get - End Property - 'OUT6 - Public ReadOnly Property StopStartSensitiveTotalCycleElectricalDemand As Joule _ - Implements IM11.StopStartSensitiveTotalCycleElectricalDemand - Get - Return AG6 - End Get - End Property - 'OUT7 - Public ReadOnly Property TotalCycleFuelConsuptionAverageLoads As Kilogram _ - Implements IM11.TotalCycleFuelConsuptionAverageLoads - Get - Return AG7 - End Get - End Property - - Private ReadOnly Property SW1 As Boolean - Get - Return Not signals.EngineStopped - End Get - End Property - - 'Clear at the beginning of cycle - Sub ClearAggregates() Implements IM11.ClearAggregates - - AG1 = 0.SI(Of Joule)() - AG2 = 0.SI(Of Joule)() - AG3 = 0.SI(Of Joule)() - AG4 = 0.SI(Of Kilogram)() - AG5 = 0.SI(Of Kilogram)() - AG6 = 0.SI(Of Joule)() - AG7 = 0.SI(Of Kilogram)() - End Sub - - 'Add to Aggregates dependent on cycle step time. - Sub CycleStep(stepTimeInSeconds As Second) Implements IM11.CycleStep - - 'S/S Insensitive - AG3 += (M6.AvgPowerDemandAtCrankFromElectricsIncHVAC * stepTimeInSeconds) - - - If signals.EngineStopped Then Return - - 'S/S Sensitive - If (SW1) Then - AG1 += (Sum1 * stepTimeInSeconds) - AG2 += (M8.SmartElectricalAlternatorPowerGenAtCrank * stepTimeInSeconds) - - AG6 += (M6.AvgPowerDemandAtCrankFromElectricsIncHVAC * stepTimeInSeconds) - - 'MQ: No longer needed - already per Second 'These need to be divided by 3600 as the Fuel Map output is in Grams/Second. - AG4 += (Sum7 * stepTimeInSeconds) '/ 3600 - AG5 += (Sum8 * stepTimeInSeconds) ' / 3600 - AG7 += (Sum12 * stepTimeInSeconds) '/ 3600 - End If - End Sub - - 'Constructor - Public Sub New(m1 As IM1_AverageHVACLoadDemand, m3 As IM3_AveragePneumaticLoadDemand, m6 As IM6, m8 As IM8, - fmap As IFuelConsumptionMap, signals As ISignals) - - Me.M1 = m1 - Me.M3 = m3 - Me.M6 = m6 - Me.M8 = m8 - Me.fmap = fmap - Me.signals = signals - ClearAggregates() - End Sub - End Class -End Namespace - - diff --git a/VECTOAux/VectoAuxiliaries/DownstreamModules/M12.vb b/VECTOAux/VectoAuxiliaries/DownstreamModules/M12.vb deleted file mode 100644 index 03d948b6e718e44329efb1101d50df772bc46156..0000000000000000000000000000000000000000 --- a/VECTOAux/VectoAuxiliaries/DownstreamModules/M12.vb +++ /dev/null @@ -1,199 +0,0 @@ -' Copyright 2017 European Union. -' Licensed under the EUPL (the 'Licence'); -' -' * You may not use this work except in compliance with the Licence. -' * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl -' * Unless required by applicable law or agreed to in writing, -' software distributed under the Licence is distributed on an "AS IS" basis, -' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -' -' See the LICENSE.txt for the specific language governing permissions and limitations. - -Imports TUGraz.VectoCommon.Utils -Imports VectoAuxiliaries.Electrics -Imports VectoAuxiliaries.Pneumatics -Imports VectoAuxiliaries.Hvac - -Namespace DownstreamModules - Public Class M12 - Implements IM12 - - Private Class Point - Public X As Joule - Public Y As Kilogram - End Class - - Private M11 As IM11 - Private M10 As IM10 - Private Signals As ISignals - Private _P1X As Joule - Private _P1Y As Kilogram - Private _P2X As Joule - Private _P2Y As Kilogram - Private _P3X As Joule - Private _P3Y As Kilogram - Private _XT As Joule - Private _INTERP1 As Kilogram - Private _INTERP2 As Kilogram - - Private Sub setPoints() - - _P1X = 0.SI(Of Joule)() - _P1Y = M11.TotalCycleFuelConsumptionZeroElectricalLoad - _P2X = M11.SmartElectricalTotalCycleEletricalEnergyGenerated - _P2Y = M11.TotalCycleFuelConsumptionSmartElectricalLoad - _P3X = M11.StopStartSensitiveTotalCycleElectricalDemand - _P3Y = M10.AverageLoadsFuelConsumptionInterpolatedForPneumatics - _XT = M11.TotalCycleElectricalDemand - End Sub - - 'Interpolation - Private Function Sum1() As Kilogram - - Dim P1 As Point = New Point With {.X = 0.SI(Of Joule)(), .Y = M11.TotalCycleFuelConsumptionZeroElectricalLoad} - Dim P2 As Point = New Point _ - With {.X = M11.SmartElectricalTotalCycleEletricalEnergyGenerated * Signals.StoredEnergyEfficiency, - .Y = M11.TotalCycleFuelConsumptionSmartElectricalLoad} - - Dim IP5x As Joule = M11.TotalCycleElectricalDemand - - - Dim TanTeta As double = ((P2.Y - P1.Y).Value() / (P2.X - P1.X).Value()) - - Dim IP5y As Kilogram = (P1.Y.Value() + (TanTeta * IP5x.Value())).SI(of Kilogram) - - _INTERP1 = IP5y - - setPoints() - - Return If(Double.IsNaN(IP5y.Value()), 0.SI(Of Kilogram), IP5y) - End Function - - Private Function Sum2() As Kilogram - - Dim P1 As Point = New Point With {.X = 0.SI(Of Joule)(), .Y = M11.TotalCycleFuelConsumptionZeroElectricalLoad} - Dim P3 As Point = New Point _ - With {.X = M11.StopStartSensitiveTotalCycleElectricalDemand, - .Y = M10.AverageLoadsFuelConsumptionInterpolatedForPneumatics} - - Dim IP5x As Joule = M11.TotalCycleElectricalDemand - Dim IP5y As Kilogram - - Dim TanTeta As Double = (P3.Y - P1.Y).Value() / (P3.X - P1.X).Value() - - IP5y = P1.Y + (TanTeta * IP5x.Value()).SI(Of Kilogram)() - - _INTERP2 = IP5y - - Return If(Double.IsNaN(IP5y.Value()), 0.SI(Of Kilogram), IP5y) - End Function - - 'Constructor - Public Sub New(m10 As IM10, m11 As IM11, signals As ISignals) - - Me.M10 = m10 - Me.M11 = m11 - Me.Signals = signals - End Sub - - 'Main Class Outputs - Public ReadOnly Property FuelconsumptionwithsmartElectricsandAveragePneumaticPowerDemand As Kilogram _ - Implements IM12.FuelconsumptionwithsmartElectricsandAveragePneumaticPowerDemand - Get - - 'SCHM 3_2 - Dim interp1 As Kilogram = Sum1() - - interp1 = - If _ - (Not Double.IsNaN(interp1.Value()) AndAlso M11.StopStartSensitiveTotalCycleElectricalDemand > 0, interp1, - M11.TotalCycleFuelConsumptionZeroElectricalLoad) - Return interp1 - End Get - End Property - - Public ReadOnly Property BaseFuelConsumptionWithTrueAuxiliaryLoads As Kilogram _ - Implements IM12.BaseFuelConsumptionWithTrueAuxiliaryLoads - Get - - 'SCM 3_02 - Dim interp2 As Kilogram = Sum2() - - interp2 = - If _ - (Not Double.IsNaN(interp2.Value()) AndAlso M11.StopStartSensitiveTotalCycleElectricalDemand > 0, interp2, - M10.AverageLoadsFuelConsumptionInterpolatedForPneumatics) - Return interp2 - End Get - End Property - - Public ReadOnly Property StopStartCorrection As Double Implements IM12.StopStartCorrection - Get - - Dim _stopStartCorrection As Scalar = BaseFuelConsumptionWithTrueAuxiliaryLoads() / - If _ - (M10.AverageLoadsFuelConsumptionInterpolatedForPneumatics > 0, - M10.AverageLoadsFuelConsumptionInterpolatedForPneumatics, 1.SI(Of Kilogram)) - - Return If(_stopStartCorrection > 0, _stopStartCorrection.Value(), 1) - End Get - End Property - - 'Diagnostics Signal Exposure only. Does not materially affect class operation. - Public ReadOnly Property INTRP1 As Kilogram Implements IM12.INTRP1 - Get - Return _INTERP1 - End Get - End Property - - Public ReadOnly Property INTRP2 As Kilogram Implements IM12.INTRP2 - Get - Return _INTERP2 - End Get - End Property - - Public ReadOnly Property P1X As Joule Implements IM12.P1X - Get - Return _P1X - End Get - End Property - - Public ReadOnly Property P1Y As Kilogram Implements IM12.P1Y - Get - Return _P1Y - End Get - End Property - - Public ReadOnly Property P2X As Joule Implements IM12.P2X - Get - Return _P2X - End Get - End Property - - Public ReadOnly Property P2Y As Kilogram Implements IM12.P2Y - Get - Return _P2Y - End Get - End Property - - Public ReadOnly Property P3X As Joule Implements IM12.P3X - Get - Return _P3X - End Get - End Property - - Public ReadOnly Property P3Y As Kilogram Implements IM12.P3Y - Get - Return _P3Y - End Get - End Property - - Public ReadOnly Property XTAIN As Joule Implements IM12.XTAIN - Get - Return _XT - End Get - End Property - End Class -End Namespace - - diff --git a/VECTOAux/VectoAuxiliaries/DownstreamModules/M13.vb b/VECTOAux/VectoAuxiliaries/DownstreamModules/M13.vb deleted file mode 100644 index 109eb23d446fed74f6f75f2449f81920bfde902d..0000000000000000000000000000000000000000 --- a/VECTOAux/VectoAuxiliaries/DownstreamModules/M13.vb +++ /dev/null @@ -1,126 +0,0 @@ -' Copyright 2017 European Union. -' Licensed under the EUPL (the 'Licence'); -' -' * You may not use this work except in compliance with the Licence. -' * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl -' * Unless required by applicable law or agreed to in writing, -' software distributed under the Licence is distributed on an "AS IS" basis, -' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -' -' See the LICENSE.txt for the specific language governing permissions and limitations. - -Imports TUGraz.VectoCommon.Utils -Imports VectoAuxiliaries.Electrics -Imports VectoAuxiliaries.Pneumatics -Imports VectoAuxiliaries.Hvac - -Namespace DownstreamModules - Public Class M13 - Implements IM13 - - Private m10 As IM10 - Private m11 As IM11 - Private m12 As IM12 - Private signals As ISignals - - 'Internal Staging Calculations - - Private ReadOnly Property Sum1 As Kilogram - Get - Return m11.TotalCycleFuelConsuptionAverageLoads * m12.StopStartCorrection - End Get - End Property - - Private ReadOnly Property Sum2 As Kilogram - Get - Return m10.AverageLoadsFuelConsumptionInterpolatedForPneumatics * m12.StopStartCorrection - End Get - End Property - - Private ReadOnly Property Sum3 As Kilogram - Get - Return m10.FuelConsumptionSmartPneumaticsAndAverageElectricalPowerDemand * m12.StopStartCorrection - End Get - End Property - - Private ReadOnly Property Sum4 As Kilogram - Get - Return -m12.FuelconsumptionwithsmartElectricsandAveragePneumaticPowerDemand() + Sum1 - End Get - End Property - - Private ReadOnly Property Sum5 As Kilogram - Get - Return Sum2 - Sum3 - End Get - End Property - - Private ReadOnly Property Sum6 As Kilogram - Get - Return m12.BaseFuelConsumptionWithTrueAuxiliaryLoads() - Sum4 - End Get - End Property - - Private ReadOnly Property Sum7 As Kilogram - Get - Return m12.BaseFuelConsumptionWithTrueAuxiliaryLoads() - Sum5 - End Get - End Property - - Private ReadOnly Property Sum8 As Kilogram - Get - Return -Sum4 + Sum7 - End Get - End Property - - Private ReadOnly Property Sum9 As Kilogram - Get - Return SW4 * SW3 - End Get - End Property - - 'Internal Staging Switches - Private ReadOnly Property SW1 As Kilogram - Get - Return If(signals.SmartPneumatics, Sum8, Sum6) - End Get - End Property - - Private ReadOnly Property SW2 As Kilogram - Get - Return If(signals.SmartPneumatics, Sum3, m12.BaseFuelConsumptionWithTrueAuxiliaryLoads()) - End Get - End Property - - Private ReadOnly Property SW3 As Kilogram - Get - Return If(signals.SmartElectrics, SW1, SW2) - End Get - End Property - - Private ReadOnly Property SW4 As Double - Get - Return If(signals.DeclarationMode, signals.WHTC, 1) - End Get - End Property - - 'Constructor - Public Sub New(m10 As IM10, m11 As IM11, m12 As IM12, signals As ISignals) - - Me.m10 = m10 - Me.m11 = m11 - Me.m12 = m12 - Me.signals = signals - End Sub - - 'Public class outputs - Public ReadOnly Property WHTCTotalCycleFuelConsumptionGrams As Kilogram _ - Implements IM13.WHTCTotalCycleFuelConsumptionGrams - Get - Return Sum9 - End Get - End Property - End Class -End Namespace - - diff --git a/VECTOAux/VectoAuxiliaries/DownstreamModules/M14.vb b/VECTOAux/VectoAuxiliaries/DownstreamModules/M14.vb deleted file mode 100644 index f1d7b4cfe3b77f0d088e568ef62813f5e6c8e35c..0000000000000000000000000000000000000000 --- a/VECTOAux/VectoAuxiliaries/DownstreamModules/M14.vb +++ /dev/null @@ -1,94 +0,0 @@ -Imports TUGraz.VectoCommon.Utils -Imports VectoAuxiliaries.Electrics -Imports VectoAuxiliaries.Pneumatics -Imports VectoAuxiliaries.Hvac - -Namespace DownstreamModules - Public Class M14 - Implements IM14 - - Private m13 As IM13 - Private signals As ISignals - Private constants As IHVACConstants - Private ssm As ISSMTOOL - - - Public Sub New(m13 As IM13, hvacSSM As ISSMTOOL, constants As IHVACConstants, signals As ISignals) - - If m13 Is Nothing Then Throw New ArgumentException("M14, No M13 Supplied in arguments") - If hvacSSM Is Nothing Then Throw New ArgumentException("M14, No SSMTOOL constants Supplied in arguments") - If constants Is Nothing Then Throw New ArgumentException("M14, No signals Supplied in arguments") - If signals Is Nothing Then Throw New ArgumentException("M14, No signals constants Supplied in arguments") - - - Me.m13 = m13 - Me.signals = signals - Me.constants = constants - Me.ssm = hvacSSM - End Sub - - 'Staging Calculations - Private ReadOnly Property S1 As Joule - Get - Return m13.WHTCTotalCycleFuelConsumptionGrams * constants.DieselGCVJperGram - End Get - End Property - - Private ReadOnly Property S2 As Joule - Get - Return ssm.GenInputs.AH_FuelEnergyToHeatToCoolant * S1 - End Get - End Property - - Private ReadOnly Property S3 As Joule - Get - Return S2 * ssm.GenInputs.AH_CoolantHeatTransferredToAirCabinHeater - End Get - End Property - - Private ReadOnly Property S4 As Watt 'kW - Get - Return (S3 / signals.CurrentCycleTimeInSeconds.SI(Of Second)()) - End Get - End Property - - Private ReadOnly Property S5 As Second ' hour - Get - Return signals.CurrentCycleTimeInSeconds.SI(Of Second)() ' / 3600 - End Get - End Property - - Private ReadOnly Property S6 As Kilogram - Get - 'Return (S5.Value() * ssm.FuelPerHBaseAsjusted(S4.Value() / 1000) / 3600 * (constants.FuelDensity)).SI(Of Kilogram)() - Return _ - (S5 * ssm.FuelPerHBaseAsjusted(S4.Value() / 1000).SI(Unit.SI.Liter.Per.Hour)).Cast(Of Liter)() * constants.FuelDensity - End Get - End Property - - Private ReadOnly Property S7 As Kilogram - Get - Return m13.WHTCTotalCycleFuelConsumptionGrams + S6 - End Get - End Property - - Private ReadOnly Property S8 As Liter - Get - Return (S7 / (constants.FuelDensity)).Cast(Of Liter) - End Get - End Property - - Public ReadOnly Property TotalCycleFCGrams As Kilogram Implements IM14.TotalCycleFCGrams - Get - Return S7 - End Get - End Property - - Public ReadOnly Property TotalCycleFCLitres As Liter Implements IM14.TotalCycleFCLitres - Get - Return S8 - End Get - End Property - End Class -End Namespace - diff --git a/VECTOAux/VectoAuxiliaries/DownstreamModules/M6.vb b/VECTOAux/VectoAuxiliaries/DownstreamModules/M6.vb deleted file mode 100644 index 4f4f332602a4c5b1a6fe531e9cf13762608d5007..0000000000000000000000000000000000000000 --- a/VECTOAux/VectoAuxiliaries/DownstreamModules/M6.vb +++ /dev/null @@ -1,291 +0,0 @@ -' Copyright 2017 European Union. -' Licensed under the EUPL (the 'Licence'); -' -' * You may not use this work except in compliance with the Licence. -' * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl -' * Unless required by applicable law or agreed to in writing, -' software distributed under the Licence is distributed on an "AS IS" basis, -' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -' -' See the LICENSE.txt for the specific language governing permissions and limitations. - -Imports TUGraz.VectoCommon.Utils -Imports VectoAuxiliaries.Electrics -Imports VectoAuxiliaries.Pneumatics -Imports VectoAuxiliaries.Hvac - -Namespace DownstreamModules - Public Class M6 - Implements IM6 - -#Region "Private Field - Constructor requirements" - - Private _m1 As IM1_AverageHVACLoadDemand - Private _m2 As IM2_AverageElectricalLoadDemand - Private _m3 As IM3_AveragePneumaticLoadDemand - Private _m4 As IM4_AirCompressor - Private _m5 As IM5_SmartAlternatorSetGeneration - Private _signals As ISignals - -#End Region - - 'OUT1 - Public ReadOnly Property OverrunFlag As Boolean Implements IM6.OverrunFlag - - Get - Return VC0 - End Get - End Property - 'OUT2 - Public ReadOnly Property SmartElecAndPneumaticsCompressorFlag As Boolean _ - Implements IM6.SmartElecAndPneumaticsCompressorFlag - Get - Return VC2 - End Get - End Property - 'OUT3 - Public ReadOnly Property SmartElecAndPneumaticAltPowerGenAtCrank As Watt _ - Implements IM6.SmartElecAndPneumaticAltPowerGenAtCrank - Get - 'Multiply * 1 @ Engineering Request - Return Max1 * -1 - End Get - End Property - 'OUT4 - Public ReadOnly Property SmartElecAndPneumaticAirCompPowerGenAtCrank As Watt _ - Implements IM6.SmartElecAndPneumaticAirCompPowerGenAtCrank - Get - Return Sum16 - End Get - End Property - 'OUT5 - Public ReadOnly Property SmartElecOnlyAltPowerGenAtCrank As Watt Implements IM6.SmartElecOnlyAltPowerGenAtCrank - Get - 'Multiply * -1 @ Engineering request. - Return Max2 * -1 - End Get - End Property - 'OUT6 - Public ReadOnly Property AveragePowerDemandAtCrankFromPneumatics As Watt _ - Implements IM6.AveragePowerDemandAtCrankFromPneumatics - Get - Return _m3.GetAveragePowerDemandAtCrankFromPneumatics - End Get - End Property - 'OUT7 - Public ReadOnly Property SmartPneumaticOnlyAirCompPowerGenAtCrank As Watt _ - Implements IM6.SmartPneumaticOnlyAirCompPowerGenAtCrank - Get - Return Sum19 - End Get - End Property - 'OUT8 - Public ReadOnly Property AvgPowerDemandAtCrankFromElectricsIncHVAC As Watt _ - Implements IM6.AvgPowerDemandAtCrankFromElectricsIncHVAC - Get - - Return Sum1 - End Get - End Property - 'OUT9 - Public ReadOnly Property SmartPneumaticsOnlyCompressorFlag As Boolean Implements IM6.SmartPneumaticsOnlyCompressorFlag - Get - Return VC4 - End Get - End Property - - 'Internal Staging Calculations - 'switches - Private ReadOnly Property SW1 As Watt - Get - - Return If(_signals.SmartElectrics, _m5.AlternatorsGenerationPowerAtCrankTractionOnWatts, Sum1) - End Get - End Property - - 'Max of Sum5 vs Sum10 - Public ReadOnly Property Max1 As Watt - Get - Return If(Sum5 > Sum10, Sum5, Sum10) - End Get - End Property - 'Max of Sum10 vs Sum7 - Public ReadOnly Property Max2 As Watt - Get - Return If(Sum7 > Sum10, Sum7, Sum10) - End Get - End Property - - 'Value Choices - Public ReadOnly Property VC0 As Boolean - Get - Return Sum3 <= 0 - End Get - End Property - - Public ReadOnly Property VC1 As Boolean - Get - Return Sum12 > 0 - End Get - End Property - - Public ReadOnly Property VC2 As Boolean - Get - Return Sum12 < 0 OrElse Sum12.IsEqual(0) - End Get - End Property - - Public ReadOnly Property VC3 As Boolean - Get - Return Sum13 > 0 - End Get - End Property - - Public ReadOnly Property VC4 As Boolean - Get - Return Sum13 < 0 OrElse Sum13.IsEqual(0) - End Get - End Property - - 'Sums - Public ReadOnly Property Sum1 As Watt - Get - Return _m1.AveragePowerDemandAtCrankFromHVACElectricsWatts() + _m2.GetAveragePowerAtCrankFromElectrics() - End Get - End Property - - Public ReadOnly Property Sum2 As Watt - Get - - Dim returnValue As Watt = _m1.AveragePowerDemandAtCrankFromHVACMechanicalsWatts + SW1 + - _m3.GetAveragePowerDemandAtCrankFromPneumatics - - Return returnValue - End Get - End Property - - Public ReadOnly Property Sum3 As Watt - Get - Return (_signals.EngineMotoringPower) + - (_signals.InternalEnginePower) + - Sum2 - End Get - End Property - - Public ReadOnly Property Sum4 As Watt - Get - - Return Sum3 - SW1 - _m3.GetAveragePowerDemandAtCrankFromPneumatics + _m4.GetPowerCompressorOff - End Get - End Property - - Public ReadOnly Property Sum5 As Watt - Get - Return If(OverrunFlag, Sum4, 0.SI(Of Watt)) - End Get - End Property - - Public ReadOnly Property Sum6 As Watt - Get - Return Sum4 - _m4.GetPowerCompressorOff + _m3.GetAveragePowerDemandAtCrankFromPneumatics - End Get - End Property - - Public ReadOnly Property Sum7 As Watt - Get - Return If(VC0, Sum6, 0.SI(Of Watt)) - End Get - End Property - - Public ReadOnly Property Sum8 As Watt - Get - Return Sum4 + SW1 - End Get - End Property - - Public ReadOnly Property Sum9 As Watt - Get - Return If(VC0, Sum8, 0.SI(Of Watt)) - End Get - End Property - - Public ReadOnly Property Sum10 As Watt - Get - Return _m5.AlternatorsGenerationPowerAtCrankOverrunWatts * -1.0 - End Get - End Property - - Public ReadOnly Property Sum11 As Watt - Get - Return Sum5 - Max1 - End Get - End Property - - Public ReadOnly Property Sum12 As Watt - Get - Return _m4.GetPowerDifference + Sum11 - End Get - End Property - - Public ReadOnly Property Sum13 As Watt - Get - Return Sum9 + _m4.GetPowerDifference - End Get - End Property - - Public ReadOnly Property Sum14 As Watt - Get - Return If(VC1, _m4.GetPowerCompressorOff, 0.SI(Of Watt)) - End Get - End Property - - Public ReadOnly Property Sum15 As Watt - Get - Return If(VC2, (_m4.GetPowerCompressorOn * _signals.PneumaticOverrunUtilisation), 0.SI(Of Watt)) - End Get - End Property - - Public ReadOnly Property Sum16 As Watt - Get - Return Sum14 + Sum15 - End Get - End Property - - Public ReadOnly Property Sum17 As Watt - Get - Return If(VC3, _m4.GetPowerCompressorOff, 0.SI(Of Watt)) - End Get - End Property - - Public ReadOnly Property Sum18 As Watt - Get - Return If(VC4, (_m4.GetPowerCompressorOn * _signals.PneumaticOverrunUtilisation), 0.SI(Of Watt)) - End Get - End Property - - Public ReadOnly Property Sum19 As Watt - Get - Return Sum17 + Sum18 - End Get - End Property - - - 'Constructor - Public Sub New(m1 As IM1_AverageHVACLoadDemand, - m2 As IM2_AverageElectricalLoadDemand, - m3 As IM3_AveragePneumaticLoadDemand, - m4 As IM4_AirCompressor, - m5 As IM5_SmartAlternatorSetGeneration, - signals As ISignals) - - _m1 = m1 - _m2 = m2 - _m3 = m3 - _m4 = m4 - _m5 = m5 - _signals = signals - End Sub - End Class -End Namespace - - diff --git a/VECTOAux/VectoAuxiliaries/DownstreamModules/M7.vb b/VECTOAux/VectoAuxiliaries/DownstreamModules/M7.vb deleted file mode 100644 index 714bcce9c895a4e2f0812057e67e7f3d93937d4f..0000000000000000000000000000000000000000 --- a/VECTOAux/VectoAuxiliaries/DownstreamModules/M7.vb +++ /dev/null @@ -1,109 +0,0 @@ -' Copyright 2017 European Union. -' Licensed under the EUPL (the 'Licence'); -' -' * You may not use this work except in compliance with the Licence. -' * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl -' * Unless required by applicable law or agreed to in writing, -' software distributed under the Licence is distributed on an "AS IS" basis, -' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -' -' See the LICENSE.txt for the specific language governing permissions and limitations. - -Imports TUGraz.VectoCommon.Utils -Imports VectoAuxiliaries.Electrics -Imports VectoAuxiliaries.Pneumatics -Imports VectoAuxiliaries.Hvac - -Namespace DownstreamModules - Public Class M7 - Implements IM7 - - Private _m5 As IM5_SmartAlternatorSetGeneration - Private _m6 As IM6 - Private _signals As ISignals - - 'Boolean Conditions - Private ReadOnly Property C1 As Boolean - Get - Return _m6.OverrunFlag AndAlso _signals.ClutchEngaged AndAlso _signals.InNeutral = False - End Get - End Property - - 'Internal Switched Outputs - Private ReadOnly Property SW1 As Watt - Get - - Dim idle As Boolean = _signals.EngineSpeed <= _signals.EngineIdleSpeed AndAlso - (Not _signals.ClutchEngaged OrElse _signals.InNeutral) - - Return _ - If(idle, _m5.AlternatorsGenerationPowerAtCrankIdleWatts, _m5.AlternatorsGenerationPowerAtCrankTractionOnWatts) - End Get - End Property - - Private ReadOnly Property SW2 As Watt - Get - Return If(C1, _m6.SmartElecAndPneumaticAltPowerGenAtCrank, SW1) - End Get - End Property - - Private ReadOnly Property SW3 As Watt - Get - Return If(C1, _m6.SmartElecAndPneumaticAirCompPowerGenAtCrank, _m6.AveragePowerDemandAtCrankFromPneumatics) - End Get - End Property - - Private ReadOnly Property SW4 As Watt - Get - Return If(C1, _m6.SmartElecOnlyAltPowerGenAtCrank, SW1) - End Get - End Property - - Private ReadOnly Property SW5 As Watt - Get - Return If(C1, _m6.SmartPneumaticOnlyAirCompPowerGenAtCrank, _m6.AveragePowerDemandAtCrankFromPneumatics) - End Get - End Property - - 'Public readonly properties ( Outputs ) - Public ReadOnly Property SmartElectricalAndPneumaticAuxAltPowerGenAtCrank As Watt _ - Implements IM7.SmartElectricalAndPneumaticAuxAltPowerGenAtCrank - Get - Return SW2 - End Get - End Property - - Public ReadOnly Property SmartElectricalAndPneumaticAuxAirCompPowerGenAtCrank As Watt _ - Implements IM7.SmartElectricalAndPneumaticAuxAirCompPowerGenAtCrank - Get - Return SW3 - End Get - End Property - - Public ReadOnly Property SmartElectricalOnlyAuxAltPowerGenAtCrank As Watt _ - Implements IM7.SmartElectricalOnlyAuxAltPowerGenAtCrank - Get - Return SW4 - End Get - End Property - - Public ReadOnly Property SmartPneumaticOnlyAuxAirCompPowerGenAtCrank As Watt _ - Implements IM7.SmartPneumaticOnlyAuxAirCompPowerGenAtCrank - Get - Return SW5 - End Get - End Property - - 'Constructor - Public Sub New(m5 As IM5_SmartAlternatorSetGeneration, - m6 As IM6, - signals As ISignals) - - _m5 = m5 - _m6 = m6 - _signals = signals - End Sub - End Class -End Namespace - - diff --git a/VECTOAux/VectoAuxiliaries/DownstreamModules/M8.vb b/VECTOAux/VectoAuxiliaries/DownstreamModules/M8.vb deleted file mode 100644 index 3ac82eb359692df3bdf47524b034c2afd98ea7e2..0000000000000000000000000000000000000000 --- a/VECTOAux/VectoAuxiliaries/DownstreamModules/M8.vb +++ /dev/null @@ -1,144 +0,0 @@ -' Copyright 2017 European Union. -' Licensed under the EUPL (the 'Licence'); -' -' * You may not use this work except in compliance with the Licence. -' * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl -' * Unless required by applicable law or agreed to in writing, -' software distributed under the Licence is distributed on an "AS IS" basis, -' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -' -' See the LICENSE.txt for the specific language governing permissions and limitations. - - -Imports TUGraz.VectoCommon.Utils -Imports VectoAuxiliaries.Electrics -Imports VectoAuxiliaries.Pneumatics -Imports VectoAuxiliaries.Hvac - -Namespace DownstreamModules - Public Class M8 - Implements IM8 - -#Region "Private Fields" - - Private _m1 As IM1_AverageHVACLoadDemand - Private _m6 As IM6 - Private _m7 As IM7 - Private _signals As ISignals - -#End Region - -#Region "Internal Sums and Switches" - - 'Internal Staged Sums and Switches - Private ReadOnly Property Sum1 As Watt - Get - Return _ - _m7.SmartElectricalAndPneumaticAuxAltPowerGenAtCrank() + _m7.SmartElectricalAndPneumaticAuxAirCompPowerGenAtCrank() - End Get - End Property - - Private ReadOnly Property Sum2 As Watt - Get - Return _m7.SmartElectricalOnlyAuxAltPowerGenAtCrank() + _m6.AveragePowerDemandAtCrankFromPneumatics - End Get - End Property - - Private ReadOnly Property Sum3 As Watt - Get - Return _m7.SmartPneumaticOnlyAuxAirCompPowerGenAtCrank + _m6.AvgPowerDemandAtCrankFromElectricsIncHVAC - End Get - End Property - - Private ReadOnly Property Sum4 As Watt - Get - Return _m6.AvgPowerDemandAtCrankFromElectricsIncHVAC + _m6.AveragePowerDemandAtCrankFromPneumatics - End Get - End Property - - Private ReadOnly Property Sum5 As Watt - Get - Return _m1.AveragePowerDemandAtCrankFromHVACMechanicalsWatts + SW5 - End Get - End Property - - Private ReadOnly Property Sum6 As Watt - Get - Return If(SW6, Sum5, SIBase(Of Watt).Create(0)) - End Get - End Property - - Private ReadOnly Property SW1 As Watt - Get - Return If(_signals.SmartPneumatics, Sum1, Sum2) - End Get - End Property - - Private ReadOnly Property SW2 As Watt - Get - Return If(_signals.SmartPneumatics, Sum3, Sum4) - End Get - End Property - - Private ReadOnly Property SW3 As Watt - Get - Return _ - If _ - (_signals.SmartPneumatics, _m7.SmartElectricalAndPneumaticAuxAltPowerGenAtCrank(), - _m7.SmartElectricalOnlyAuxAltPowerGenAtCrank()) - End Get - End Property - - Private ReadOnly Property SW4 As Boolean - Get - Return If(_signals.SmartElectrics, _m6.SmartElecAndPneumaticsCompressorFlag, _m6.SmartPneumaticsOnlyCompressorFlag) - End Get - End Property - - Private ReadOnly Property SW5 As Watt - Get - Return If(_signals.SmartElectrics, SW1, SW2) - End Get - End Property - - Private ReadOnly Property SW6 As Boolean - Get - Return Not _signals.EngineStopped - End Get - End Property - -#End Region - - 'OUT1 - Public ReadOnly Property AuxPowerAtCrankFromElectricalHVACAndPneumaticsAncillaries As Watt _ - Implements IM8.AuxPowerAtCrankFromElectricalHVACAndPneumaticsAncillaries - Get - Return Sum6 - End Get - End Property - 'OUT2 - Public ReadOnly Property SmartElectricalAlternatorPowerGenAtCrank As Watt _ - Implements IM8.SmartElectricalAlternatorPowerGenAtCrank - Get - Return SW3 - End Get - End Property - 'OUT3 - Public ReadOnly Property CompressorFlag As Boolean Implements IM8.CompressorFlag - Get - Return SW4 - End Get - End Property - - 'Constructor - Public Sub New(m1 As IM1_AverageHVACLoadDemand, m6 As IM6, m7 As IM7, signals As ISignals) - - _m1 = m1 - _m6 = m6 - _m7 = m7 - _signals = signals - End Sub - End Class -End Namespace - - diff --git a/VECTOAux/VectoAuxiliaries/DownstreamModules/M9.vb b/VECTOAux/VectoAuxiliaries/DownstreamModules/M9.vb deleted file mode 100644 index 39908f12dd77c1d7af4b2aa3e48c87361a75cb08..0000000000000000000000000000000000000000 --- a/VECTOAux/VectoAuxiliaries/DownstreamModules/M9.vb +++ /dev/null @@ -1,236 +0,0 @@ -' Copyright 2017 European Union. -' Licensed under the EUPL (the 'Licence'); -' -' * You may not use this work except in compliance with the Licence. -' * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl -' * Unless required by applicable law or agreed to in writing, -' software distributed under the Licence is distributed on an "AS IS" basis, -' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -' -' See the LICENSE.txt for the specific language governing permissions and limitations. - -Imports TUGraz.VectoCommon.Utils -Imports VectoAuxiliaries.Electrics -Imports VectoAuxiliaries.Pneumatics -Imports VectoAuxiliaries.Hvac - -Namespace DownstreamModules - Public Class M9 - Implements IM9 - Private Const RPM_TO_RADS_PER_SECOND As Single = 60 / (2 * Math.PI) '9.55F - -#Region "Aggregates" - - 'AG1 - Private _LitresOfAirCompressorOnContinuallyAggregate As NormLiter - 'AG2 - Private _LitresOfAirCompressorOnOnlyInOverrunAggregate As NormLiter - 'AG3 - Private _TotalCycleFuelConsumptionCompressorOffContinuouslyAggregate As Kilogram - 'AG4 - Private _TotalCycleFuelConsumptionCompressorOnContinuouslyAggregate As Kilogram - -#End Region - -#Region "Constructor Requirements" - - Private M1 As IM1_AverageHVACLoadDemand - Private M4 As IM4_AirCompressor - Private M6 As IM6 - Private M8 As IM8 - Private FMAP As IFuelConsumptionMap - Private PSAC As IPneumaticsAuxilliariesConfig - Private Signals As ISignals - -#End Region - - -#Region "Class Outputs" - 'OUT 1 - Public ReadOnly Property LitresOfAirCompressorOnContinually As NormLiter _ - Implements IM9.LitresOfAirCompressorOnContinually - Get - Return _LitresOfAirCompressorOnContinuallyAggregate - End Get - End Property - 'OUT 2 - Public ReadOnly Property LitresOfAirCompressorOnOnlyInOverrun As NormLiter _ - Implements IM9.LitresOfAirCompressorOnOnlyInOverrun - Get - Return _LitresOfAirCompressorOnOnlyInOverrunAggregate - End Get - End Property - 'OUT 3 - Public ReadOnly Property TotalCycleFuelConsumptionCompressorOffContinuously As Kilogram _ - Implements IM9.TotalCycleFuelConsumptionCompressorOffContinuously - Get - Return _TotalCycleFuelConsumptionCompressorOffContinuouslyAggregate - End Get - End Property - 'OUT 4 - Public ReadOnly Property TotalCycleFuelConsumptionCompressorOnContinuously As Kilogram _ - Implements IM9.TotalCycleFuelConsumptionCompressorOnContinuously - Get - Return _TotalCycleFuelConsumptionCompressorOnContinuouslyAggregate - End Get - End Property - -#End Region - - 'Staging Calculations - Private Function S0(ByVal rpm As PerSecond) As PerSecond - - If rpm < 1 Then rpm = 1.RPMtoRad() - - Return rpm ' / RPM_TO_RADS_PER_SECOND - End Function - - Private ReadOnly Property S1 As Watt - Get - Return M6.AvgPowerDemandAtCrankFromElectricsIncHVAC + M1.AveragePowerDemandAtCrankFromHVACMechanicalsWatts - End Get - End Property - - Private ReadOnly Property S2 As NewtonMeter - Get - If S0(Signals.EngineSpeed).IsEqual(0) Then _ - Throw New DivideByZeroException("Engine speed is zero and cannot be used as a divisor.") - Return M4.GetPowerCompressorOn / S0(Signals.EngineSpeed) - End Get - End Property - - Private ReadOnly Property S3 As NewtonMeter - Get - If S0(Signals.EngineSpeed).IsEqual(0) Then _ - Throw New DivideByZeroException("Engine speed is zero and cannot be used as a divisor.") - Return M4.GetPowerCompressorOff / S0(Signals.EngineSpeed) - End Get - End Property - - Private ReadOnly Property S4 As NewtonMeter - Get - If S0(Signals.EngineSpeed).IsEqual(0) Then _ - Throw New DivideByZeroException("Engine speed is zero and cannot be used as a divisor.") - Return S1 / S0(Signals.EngineSpeed) - End Get - End Property - - Private ReadOnly Property S5 As NewtonMeter - Get - Return S2 + S14 - End Get - End Property - - Private ReadOnly Property S6 As NewtonMeter - Get - Return S14 + S3 - End Get - End Property - - Private ReadOnly Property S7 As NewtonMeter - Get - Return S4 + S5 - End Get - End Property - - Private ReadOnly Property S8 As NewtonMeter - Get - Return S4 + S6 - End Get - End Property - - Private ReadOnly Property S9 As NormLiterPerSecond - Get - Return If(M6.OverrunFlag AndAlso M8.CompressorFlag, M4.GetFlowRate, SIBase(Of NormLiterPerSecond).Create(0)) - End Get - End Property - - Private ReadOnly Property S10 As NormLiterPerSecond - Get - Return S13 * PSAC.OverrunUtilisationForCompressionFraction - End Get - End Property - - Private ReadOnly Property S11 As KilogramPerSecond - Get - 'SCHM 3_02 - Dim int1 As KilogramPerSecond = FMAP.GetFuelConsumption(S7, Signals.EngineSpeed) - int1 = If(int1 > 0 AndAlso Not Double.IsNaN(int1.Value()), int1, 0.SI(Of KilogramPerSecond)) - - Return int1 - End Get - End Property - - Private ReadOnly Property S12 As KilogramPerSecond - Get - - 'SCHM 3_02 - Dim int2 As KilogramPerSecond = FMAP.GetFuelConsumption(S8, Signals.EngineSpeed) - int2 = If(int2 > 0 AndAlso Not Double.IsNaN(int2.Value()), int2, 0.SI(Of KilogramPerSecond)) - - Return int2 - End Get - End Property - - Private ReadOnly Property S13 As NormLiterPerSecond - Get - Return If(Signals.ClutchEngaged AndAlso Not (Signals.InNeutral), S9, SIBase(Of NormLiterPerSecond).Create(0)) - End Get - End Property - - Private ReadOnly Property S14 As NewtonMeter - Get - Return _ - Signals.EngineDrivelineTorque + - Signals.PreExistingAuxPower / S0(Signals.EngineSpeed) - End Get - End Property - - Private ReadOnly Property SW1 As Boolean - Get - Return Not Signals.EngineStopped - End Get - End Property - - 'Utility Methods - Public Sub ClearAggregates() Implements IM9.ClearAggregates - - _LitresOfAirCompressorOnContinuallyAggregate = SIBase(Of NormLiter).Create(0) - _LitresOfAirCompressorOnOnlyInOverrunAggregate = SIBase(Of NormLiter).Create(0) - _TotalCycleFuelConsumptionCompressorOffContinuouslyAggregate = SIBase(Of Kilogram).Create(0) - _TotalCycleFuelConsumptionCompressorOnContinuouslyAggregate = SIBase(Of Kilogram).Create(0) - End Sub - - Public Sub CycleStep(stepTimeInSeconds As Second) Implements IM9.CycleStep - - If Signals.EngineStopped Then Return - - If (SW1) Then - _LitresOfAirCompressorOnContinuallyAggregate += M4.GetFlowRate * stepTimeInSeconds - _LitresOfAirCompressorOnOnlyInOverrunAggregate += S10 * stepTimeInSeconds - _TotalCycleFuelConsumptionCompressorOnContinuouslyAggregate += S11 * stepTimeInSeconds - _TotalCycleFuelConsumptionCompressorOffContinuouslyAggregate += S12 * stepTimeInSeconds - End If - End Sub - - 'Constructor - Public Sub New(m1 As IM1_AverageHVACLoadDemand, m4 As IM4_AirCompressor, m6 As IM6, m8 As IM8, - fmap As IFuelConsumptionMap, psac As IPneumaticsAuxilliariesConfig, signals As ISignals) - Me.M1 = m1 - Me.M4 = m4 - Me.M6 = m6 - Me.M8 = m8 - Me.FMAP = fmap - Me.PSAC = psac - Me.Signals = signals - - ClearAggregates() - End Sub - - 'Auxiliary Event - Public Event AuxiliaryEvent(ByRef sender As Object, message As String, messageType As AdvancedAuxiliaryMessageType) _ - Implements IAuxiliaryEvent.AuxiliaryEvent - End Class -End Namespace - - diff --git a/VECTOAux/VectoAuxiliaries/Electrics/M0_5_SmartAlternatorSetEfficiency.vb b/VECTOAux/VectoAuxiliaries/Electrics/M0_5_SmartAlternatorSetEfficiency.vb deleted file mode 100644 index c964dbc28dc5f23e07cc1768ad68a2b58764ab85..0000000000000000000000000000000000000000 --- a/VECTOAux/VectoAuxiliaries/Electrics/M0_5_SmartAlternatorSetEfficiency.vb +++ /dev/null @@ -1,121 +0,0 @@ -' Copyright 2017 European Union. -' Licensed under the EUPL (the 'Licence'); -' -' * You may not use this work except in compliance with the Licence. -' * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl -' * Unless required by applicable law or agreed to in writing, -' software distributed under the Licence is distributed on an "AS IS" basis, -' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -' -' See the LICENSE.txt for the specific language governing permissions and limitations. - -Imports System.Diagnostics.CodeAnalysis -Imports TUGraz.VectoCommon.Utils - -Namespace Electrics - Public Class M0_5_SmartAlternatorSetEfficiency - Implements IM0_5_SmartAlternatorSetEfficiency - - 'Fields - Private _m0 As IM0_NonSmart_AlternatorsSetEfficiency - Private _electricalConsumables As IElectricalConsumerList - Private _alternatorMap As IAlternatorMap - Private _resultCardIdle As IResultCard - Private _resultCardTraction As IResultCard - Private _resultCardOverrun As IResultCard - Private _signals As ISignals - - 'Constructor - Public Sub New(m0 As IM0_NonSmart_AlternatorsSetEfficiency, - electricalConsumables As IElectricalConsumerList, - alternatorMap As IAlternatorMap, - resultCardIdle As IResultCard, - resultCardTraction As IResultCard, - resultCardOverrun As IResultCard, - signals As ISignals) - - 'Sanity Check on supplied arguments, throw an argument exception - If m0 Is Nothing Then Throw New ArgumentException("Module 0 must be supplied") - If electricalConsumables Is Nothing Then _ - Throw New ArgumentException("ElectricalConsumablesList must be supplied even if empty") - If alternatorMap Is Nothing Then Throw New ArgumentException("Must supply a valid alternator map") - If resultCardIdle Is Nothing Then _ - Throw New ArgumentException("Result Card 'IDLE' must be supplied even if it has no contents") - If resultCardTraction Is Nothing Then _ - Throw New ArgumentException("Result Card 'TRACTION' must be supplied even if it has no contents") - If resultCardOverrun Is Nothing Then _ - Throw New ArgumentException("Result Card 'OVERRUN' must be supplied even if it has no contents") - If signals Is Nothing Then Throw New ArgumentException("No Signals Reference object was provided ") - - 'Assignments to private variables. - _m0 = m0 - _electricalConsumables = electricalConsumables - _alternatorMap = alternatorMap - _resultCardIdle = resultCardIdle - _resultCardTraction = resultCardTraction - _resultCardOverrun = resultCardOverrun - _signals = signals - End Sub - - - 'Public Class Outputs (Properties) - Public ReadOnly Property SmartIdleCurrent() As Ampere Implements IM0_5_SmartAlternatorSetEfficiency.SmartIdleCurrent - Get - Dim hvac_Plus_None_Base As Ampere = HvacPlusNonBaseCurrents() - Dim smart_idle_current As Ampere = _resultCardIdle.GetSmartCurrentResult(hvac_Plus_None_Base) - - Return smart_idle_current - End Get - End Property - - Public ReadOnly Property AlternatorsEfficiencyIdleResultCard() As Double _ - Implements IM0_5_SmartAlternatorSetEfficiency.AlternatorsEfficiencyIdleResultCard - Get - Return _alternatorMap.GetEfficiency(_signals.EngineSpeed.AsRPM, SmartIdleCurrent()).Efficiency - End Get - End Property - - Public ReadOnly Property SmartTractionCurrent As Ampere _ - Implements IM0_5_SmartAlternatorSetEfficiency.SmartTractionCurrent - Get - Return _resultCardTraction.GetSmartCurrentResult(HvacPlusNonBaseCurrents()) - End Get - End Property - - Public ReadOnly Property AlternatorsEfficiencyTractionOnResultCard() As Double _ - Implements IM0_5_SmartAlternatorSetEfficiency.AlternatorsEfficiencyTractionOnResultCard - Get - Return _alternatorMap.GetEfficiency(CType(_signals.EngineSpeed.AsRPM, Single), SmartTractionCurrent()).Efficiency - End Get - End Property - - Public ReadOnly Property SmartOverrunCurrent As Ampere _ - Implements IM0_5_SmartAlternatorSetEfficiency.SmartOverrunCurrent - Get - Return _resultCardOverrun.GetSmartCurrentResult(HvacPlusNonBaseCurrents()) - End Get - End Property - - Public ReadOnly Property AlternatorsEfficiencyOverrunResultCard() As Double _ - Implements IM0_5_SmartAlternatorSetEfficiency.AlternatorsEfficiencyOverrunResultCard - Get - Return _alternatorMap.GetEfficiency(CType(_signals.EngineSpeed.AsRPM, Single), SmartOverrunCurrent()).Efficiency - End Get - End Property - - 'Helpers - ''' <summary> - ''' Returns Non Base Currents (A) - ''' </summary> - ''' <returns></returns> - ''' <remarks></remarks> - <ExcludeFromCodeCoverage> - Private Function HvacPlusNonBaseCurrents() As Ampere - 'Stored Energy Efficience removed from V8.0 21/4/15 by Mike Preston //tb - Return _m0.GetHVACElectricalPowerDemandAmps() + _electricalConsumables.GetTotalAverageDemandAmps(True) _ - '/ElectricConstants.StoredEnergyEfficiency) - End Function - End Class -End Namespace - - diff --git a/VECTOAux/VectoAuxiliaries/Electrics/M0_NonSmart_AlternatorsSetEfficiency.vb b/VECTOAux/VectoAuxiliaries/Electrics/M0_NonSmart_AlternatorsSetEfficiency.vb deleted file mode 100644 index a57e0abf23f7dab739e9d4cc96f587b15b47ecbf..0000000000000000000000000000000000000000 --- a/VECTOAux/VectoAuxiliaries/Electrics/M0_NonSmart_AlternatorsSetEfficiency.vb +++ /dev/null @@ -1,73 +0,0 @@ -' Copyright 2017 European Union. -' Licensed under the EUPL (the 'Licence'); -' -' * You may not use this work except in compliance with the Licence. -' * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl -' * Unless required by applicable law or agreed to in writing, -' software distributed under the Licence is distributed on an "AS IS" basis, -' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -' -' See the LICENSE.txt for the specific language governing permissions and limitations. - -Imports TUGraz.VectoCommon.Utils -Imports VectoAuxiliaries.Hvac - -Namespace Electrics - Public Class M0_NonSmart_AlternatorsSetEfficiency - Implements IM0_NonSmart_AlternatorsSetEfficiency - - Private _electricalConsumersList As IElectricalConsumerList - Private _alternatorEfficiencyMap As IAlternatorMap - Private _powernetVoltage As Volt - Private _signals As ISignals - Private _steadyStateModelHVAC As ISSMTOOL - - - Private _ElectricalPowerW As Watt - Private _MechanicalPowerW As Watt - Private _FuelingLPerH As LiterPerSecond - - 'Constructor - Public Sub New(electricalConsumers As IElectricalConsumerList, alternatorEfficiencyMap As IAlternatorMap, - powernetVoltage As Volt, signals As ISignals, ssmHvac As ISSMTOOL) - - If electricalConsumers Is Nothing Then Throw New ArgumentException("No ElectricalConsumersList Supplied") - If alternatorEfficiencyMap Is Nothing Then Throw New ArgumentException("No Alternator Efficiency Map Supplied") - If (powernetVoltage < ElectricConstants.PowenetVoltageMin Or powernetVoltage > ElectricConstants.PowenetVoltageMax) _ - Then Throw New ArgumentException("Powernet Voltage out of range") - If signals Is Nothing Then Throw New ArgumentException("No Signals reference was supplied.") - - Me._electricalConsumersList = electricalConsumers - Me._alternatorEfficiencyMap = alternatorEfficiencyMap - Me._powernetVoltage = powernetVoltage - Me._signals = signals - Me._steadyStateModelHVAC = ssmHvac - - _ElectricalPowerW = ssmHvac.ElectricalWAdjusted.SI(Of Watt)() - _MechanicalPowerW = ssmHvac.MechanicalWBaseAdjusted.SI(Of Watt)() - _FuelingLPerH = ssmHvac.FuelPerHBaseAdjusted.SI(Of LiterPerSecond)() - End Sub - - 'Public class outputs (Properties) - Public ReadOnly Property AlternatorsEfficiency As Double _ - Implements IM0_NonSmart_AlternatorsSetEfficiency.AlternatorsEfficiency - - Get - 'Stored Energy Efficience removed from V8.0 21/4/15 by Mike Preston //tb - Dim baseCurrentDemandAmps As Ampere = _electricalConsumersList.GetTotalAverageDemandAmps(False) _ - ' ElectricConstants.StoredEnergyEfficiency - Dim totalDemandAmps As Ampere = baseCurrentDemandAmps + GetHVACElectricalPowerDemandAmps - Return _alternatorEfficiencyMap.GetEfficiency(_signals.EngineSpeed.AsRPM, totalDemandAmps).Efficiency - End Get - End Property - - Public ReadOnly Property GetHVACElectricalPowerDemandAmps As Ampere _ - Implements IM0_NonSmart_AlternatorsSetEfficiency.GetHVACElectricalPowerDemandAmps - Get - Return _ElectricalPowerW / _powernetVoltage - End Get - End Property - End Class -End Namespace - - diff --git a/VECTOAux/VectoAuxiliaries/Electrics/M2_AverageElectricalLoadDemand.vb b/VECTOAux/VectoAuxiliaries/Electrics/M2_AverageElectricalLoadDemand.vb deleted file mode 100644 index 956eda52d38efe9180f3ff3053e18f88d7ee4f43..0000000000000000000000000000000000000000 --- a/VECTOAux/VectoAuxiliaries/Electrics/M2_AverageElectricalLoadDemand.vb +++ /dev/null @@ -1,69 +0,0 @@ -' Copyright 2017 European Union. -' Licensed under the EUPL (the 'Licence'); -' -' * You may not use this work except in compliance with the Licence. -' * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl -' * Unless required by applicable law or agreed to in writing, -' software distributed under the Licence is distributed on an "AS IS" basis, -' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -' -' See the LICENSE.txt for the specific language governing permissions and limitations. -Imports TUGraz.VectoCommon.Utils - -Namespace Electrics - Public Class M2_AverageElectricalLoadDemand - Implements IM2_AverageElectricalLoadDemand - - Public _powerNetVoltage As Volt = 26.3.SI(Of Volt)() - Private _electricalConsumers As IElectricalConsumerList - Private _module0 As IM0_NonSmart_AlternatorsSetEfficiency - Private _alternatorPulleyEffiency As Double - Private _signals As Signals - - - 'Constructor - Public Sub New(ByVal electricalConsumers As IElectricalConsumerList, m0 As IM0_NonSmart_AlternatorsSetEfficiency, - altPulleyEfficiency As Double, powerNetVoltage As Volt, signals As ISignals) - - If electricalConsumers Is Nothing Then Throw New ArgumentException("Electrical Consumer List must be supplied") - If m0 Is Nothing Then Throw New ArgumentException("Must supply module 0") - If altPulleyEfficiency = 0 OrElse altPulleyEfficiency > 1 Then _ - Throw New ArgumentException("Alternator Gear efficiency out of range.") - If powerNetVoltage < ElectricConstants.PowenetVoltageMin OrElse powerNetVoltage > ElectricConstants.PowenetVoltageMax _ - Then - Throw New ArgumentException("Powernet Voltage out of known range.") - End If - - - _powerNetVoltage = powerNetVoltage - _electricalConsumers = electricalConsumers - _module0 = m0 - _alternatorPulleyEffiency = altPulleyEfficiency - End Sub - - 'Public class outputs (Properties) - Public Function GetAveragePowerDemandAtAlternator() As Watt _ - Implements IM2_AverageElectricalLoadDemand.GetAveragePowerDemandAtAlternator - - 'Stored Energy Efficience removed from V8.0 21/4/15 by Mike Preston //tb - 'Return ( _electricalConsumers.GetTotalAverageDemandAmps(False)/ElectricConstants.StoredEnergyEfficiency) * _powerNetVoltage - Return _powerNetVoltage * _electricalConsumers.GetTotalAverageDemandAmps(False) - End Function - - Public Function GetAveragePowerAtCrankFromElectrics() As Watt _ - Implements IM2_AverageElectricalLoadDemand.GetAveragePowerAtCrankFromElectrics - - Dim ElectricalPowerDemandsWatts As Watt = GetAveragePowerDemandAtAlternator() - Dim alternatorsEfficiency As Double = _module0.AlternatorsEfficiency - Dim ElectricalPowerDemandsWattsDividedByAlternatorEfficiency As Watt = ElectricalPowerDemandsWatts * (1 / - alternatorsEfficiency) - - Dim averagePowerDemandAtCrankFromElectricsWatts As Watt - - averagePowerDemandAtCrankFromElectricsWatts = ElectricalPowerDemandsWattsDividedByAlternatorEfficiency * (1 / - _alternatorPulleyEffiency) - - Return averagePowerDemandAtCrankFromElectricsWatts - End Function - End Class -End Namespace \ No newline at end of file diff --git a/VECTOAux/VectoAuxiliaries/Electrics/M5__SmartAlternatorSetGeneration.vb b/VECTOAux/VectoAuxiliaries/Electrics/M5__SmartAlternatorSetGeneration.vb deleted file mode 100644 index c2535205c05c7e7859be31113d3ae6d20fee150c..0000000000000000000000000000000000000000 --- a/VECTOAux/VectoAuxiliaries/Electrics/M5__SmartAlternatorSetGeneration.vb +++ /dev/null @@ -1,65 +0,0 @@ -' Copyright 2017 European Union. -' Licensed under the EUPL (the 'Licence'); -' -' * You may not use this work except in compliance with the Licence. -' * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl -' * Unless required by applicable law or agreed to in writing, -' software distributed under the Licence is distributed on an "AS IS" basis, -' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -' -' See the LICENSE.txt for the specific language governing permissions and limitations. -Imports TUGraz.VectoCommon.Utils - -Namespace Electrics - Public Class M5__SmartAlternatorSetGeneration - Implements IM5_SmartAlternatorSetGeneration - - Private _powerNetVoltage As Volt - Private _m05 As M0_5_SmartAlternatorSetEfficiency - Private _alternatorGearEfficiency As Double - - 'Constructor - Public Sub New(m05 As M0_5_SmartAlternatorSetEfficiency, ByVal powernetVoltage As Volt, - alternatorGearEfficiency As Double) - - 'sanity check - If m05 Is Nothing Then Throw New ArgumentException("Please supply a valid module M05") - If powernetVoltage < ElectricConstants.PowenetVoltageMin OrElse powernetVoltage > ElectricConstants.PowenetVoltageMax _ - Then Throw New ArgumentException("Powernet Voltage out of range") - If alternatorGearEfficiency < 0 Or alternatorGearEfficiency > 1 Then _ - Throw New ArgumentException("AlternatorGearEfficiency Out of bounds, should be 0 to 1") - - 'assign private variables. - _m05 = m05 - _powerNetVoltage = powernetVoltage - _alternatorGearEfficiency = alternatorGearEfficiency - End Sub - - 'Public class outputs (Functions) - Public Function AlternatorsGenerationPowerAtCrankIdleWatts() As Watt _ - Implements IM5_SmartAlternatorSetGeneration.AlternatorsGenerationPowerAtCrankIdleWatts - - Return _ - (_m05.SmartIdleCurrent() * _powerNetVoltage) * - (1 / (_m05.AlternatorsEfficiencyIdleResultCard() * _alternatorGearEfficiency)) - End Function - - Public Function AlternatorsGenerationPowerAtCrankOverrunWatts() As Watt _ - Implements IM5_SmartAlternatorSetGeneration.AlternatorsGenerationPowerAtCrankOverrunWatts - - Return _ - (_m05.SmartOverrunCurrent() * _powerNetVoltage) * (1 / - (_m05.AlternatorsEfficiencyOverrunResultCard() * _alternatorGearEfficiency)) - End Function - - Public Function AlternatorsGenerationPowerAtCrankTractionOnWatts() As Watt _ - Implements IM5_SmartAlternatorSetGeneration.AlternatorsGenerationPowerAtCrankTractionOnWatts - - Return _ - (_m05.SmartTractionCurrent() * _powerNetVoltage) * (1 / - (_m05.AlternatorsEfficiencyTractionOnResultCard() * _alternatorGearEfficiency)) - End Function - End Class -End Namespace - - diff --git a/VECTOAux/VectoAuxiliaries/Hvac/M1_AverageHVACLoadDemand.vb b/VECTOAux/VectoAuxiliaries/Hvac/M1_AverageHVACLoadDemand.vb deleted file mode 100644 index 92e1b2606fb0795310616fb081433c9d93df4e57..0000000000000000000000000000000000000000 --- a/VECTOAux/VectoAuxiliaries/Hvac/M1_AverageHVACLoadDemand.vb +++ /dev/null @@ -1,98 +0,0 @@ -' Copyright 2017 European Union. -' Licensed under the EUPL (the 'Licence'); -' -' * You may not use this work except in compliance with the Licence. -' * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl -' * Unless required by applicable law or agreed to in writing, -' software distributed under the Licence is distributed on an "AS IS" basis, -' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -' -' See the LICENSE.txt for the specific language governing permissions and limitations. - -Imports TUGraz.VectoCommon.Utils -Imports VectoAuxiliaries.Electrics -Imports VectoAuxiliaries.Pneumatics - -Namespace Hvac - Public Class M1_AverageHVACLoadDemand - Implements IM1_AverageHVACLoadDemand - - Private _m0 As IM0_NonSmart_AlternatorsSetEfficiency - Private _alternatorGearEfficiency As Double - Private _compressorGearEfficiency As Double - Private _signals As ISignals - Private _powernetVoltage As Volt - Private _steadyStateModel As ISSMTOOL - - Private _ElectricalPowerW As Watt - Private _MechanicalPowerW As Watt - Private _FuelingLPerH As LiterPerSecond - - - 'Constructor - Public Sub New(m0 As IM0_NonSmart_AlternatorsSetEfficiency, altGearEfficiency As Double, - compressorGearEfficiency As Double, powernetVoltage As Volt, signals As ISignals, ssm As ISSMTOOL) - - 'Sanity Check - Illegal operations without all params. - If m0 Is Nothing Then Throw New ArgumentException("Module0 as supplied is null") - - If _ - altGearEfficiency < ElectricConstants.AlternatorPulleyEfficiencyMin OrElse - altGearEfficiency > ElectricConstants.AlternatorPulleyEfficiencyMax Then _ - Throw _ - New ArgumentException(String.Format("Gear efficiency must be between {0} and {1}", - ElectricConstants.AlternatorPulleyEfficiencyMin, ElectricConstants.AlternatorPulleyEfficiencyMax)) - - If signals Is Nothing Then Throw New Exception("Signals object as supplied is null") - If powernetVoltage < ElectricConstants.PowenetVoltageMin OrElse powernetVoltage > ElectricConstants.PowenetVoltageMax _ - Then _ - Throw _ - New ArgumentException(String.Format("PowenetVoltage supplied must be in the range {0} to {1}", - ElectricConstants.PowenetVoltageMin, ElectricConstants.PowenetVoltageMax)) - If ssm Is Nothing Then Throw New ArgumentException("Steady State model was not supplied") - If compressorGearEfficiency < 0 OrElse altGearEfficiency > 1 Then _ - Throw New ArgumentException(String.Format("Compressor Gear efficiency must be between {0} and {1}", 0, 1)) - - - 'Assign - _m0 = m0 - _alternatorGearEfficiency = altGearEfficiency - _signals = signals - - _compressorGearEfficiency = compressorGearEfficiency - _powernetVoltage = powernetVoltage - - - _steadyStateModel = ssm - - _ElectricalPowerW = ssm.ElectricalWAdjusted.SI(Of Watt)() - _MechanicalPowerW = ssm.MechanicalWBaseAdjusted.SI(Of Watt)() - _FuelingLPerH = ssm.FuelPerHBaseAdjusted.SI(Unit.SI.Liter.Per.Hour).Cast(Of LiterPerSecond)() ' SI(Of LiterPerHour)() - End Sub - - 'Public Methods - Implementation - Public Function AveragePowerDemandAtCrankFromHVACMechanicalsWatts() As Watt _ - Implements IM1_AverageHVACLoadDemand.AveragePowerDemandAtCrankFromHVACMechanicalsWatts - - Return _MechanicalPowerW * (1 / _compressorGearEfficiency) - End Function - - Public Function AveragePowerDemandAtAlternatorFromHVACElectricsWatts() As Watt _ - Implements IM1_AverageHVACLoadDemand.AveragePowerDemandAtAlternatorFromHVACElectricsWatts - - Return _ElectricalPowerW - End Function - - Public Function AveragePowerDemandAtCrankFromHVACElectricsWatts() As Watt _ - Implements IM1_AverageHVACLoadDemand.AveragePowerDemandAtCrankFromHVACElectricsWatts - - Return _ElectricalPowerW * (1 / _m0.AlternatorsEfficiency() / _alternatorGearEfficiency) - End Function - - Public Function HVACFuelingLitresPerHour() As LiterPerSecond _ - Implements IM1_AverageHVACLoadDemand.HVACFuelingLitresPerHour - - Return _FuelingLPerH - End Function - End Class -End Namespace \ No newline at end of file diff --git a/VECTOAux/VectoAuxiliaries/Pneumatics/M3_AveragePneumaticLoadDemand.vb b/VECTOAux/VectoAuxiliaries/Pneumatics/M3_AveragePneumaticLoadDemand.vb deleted file mode 100644 index 7e5a23a3db4880e08019b78618cda70338501aa1..0000000000000000000000000000000000000000 --- a/VECTOAux/VectoAuxiliaries/Pneumatics/M3_AveragePneumaticLoadDemand.vb +++ /dev/null @@ -1,220 +0,0 @@ -' Copyright 2017 European Union. -' Licensed under the EUPL (the 'Licence'); -' -' * You may not use this work except in compliance with the Licence. -' * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl -' * Unless required by applicable law or agreed to in writing, -' software distributed under the Licence is distributed on an "AS IS" basis, -' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -' -' See the LICENSE.txt for the specific language governing permissions and limitations. - -Imports TUGraz.VectoCommon.Utils -Imports VectoAuxiliaries.Pneumatics - -Namespace Pneumatics - Public Class M3_AveragePneumaticLoadDemand - Implements IM3_AveragePneumaticLoadDemand - - Private _pneumaticUserInputsConfig As IPneumaticUserInputsConfig - Private _pneumaticAuxillariesConfig As IPneumaticsAuxilliariesConfig - Private _pneumaticsActuationsMap As IPneumaticActuationsMAP - Private _pneumaticsCompressorFlowRateMap As ICompressorMap - Private _averagePowerDemandPerCompressorUnitFlowRateInWPerLitresPerSecond As SI - Private _vehicleMassKG As Kilogram - Private _cycleName As String - Private _cycleDurationMinutes As Double - Private _totalAirDemand As NormLiter - Private _signals As ISignals - - - Private ReadOnly Property Sum1 As NormLiterPerSecond - Get - Return _totalAirDemand / _signals.TotalCycleTimeSeconds.SI(Of Second)() - End Get - End Property - - Private ReadOnly Property Sum2 As Watt - Get - Return (Sum7.Value() / Sum6.Value() * Sum1.Value()).SI(Of Watt)() ' Watt / Nl/s * Nl/s = Watt - End Get - End Property - - Private ReadOnly Property Sum3 As Watt - Get - Return _ - Sum2 + - _pneumaticsCompressorFlowRateMap.GetPowerCompressorOff( - _signals.EngineSpeed.AsRPM * _pneumaticUserInputsConfig.CompressorGearRatio) - End Get - End Property - - Private ReadOnly Property Sum4 As Watt - Get - Return Sum3 * (1 / _pneumaticUserInputsConfig.CompressorGearEfficiency) - End Get - End Property - - 'Private ReadOnly Property Sum5 As Single - ' Get - ' 'NOT USED. - ' End Get - 'End Property - - Private ReadOnly Property Sum6 As NormLiterPerSecond - Get - Return _ - _pneumaticsCompressorFlowRateMap.GetFlowRate( - _signals.EngineSpeed.AsRPM * _pneumaticUserInputsConfig.CompressorGearRatio) / - 60 - End Get - End Property - - Private ReadOnly Property Sum7 As Watt - Get - - Dim pon As Watt = - _pneumaticsCompressorFlowRateMap.GetPowerCompressorOn( - _signals.EngineSpeed.AsRPM * _pneumaticUserInputsConfig.CompressorGearRatio) - Dim poff As Watt = - _pneumaticsCompressorFlowRateMap.GetPowerCompressorOff( - _signals.EngineSpeed.AsRPM * _pneumaticUserInputsConfig.CompressorGearRatio) - Dim diff As Watt = pon - poff - Return diff - End Get - End Property - - - Public ReadOnly Property TotalAirDemand As NormLiter - Get - Return _totalAirDemand - End Get - End Property - - - 'Constructors - Public Sub New( - ByRef pneumaticsUserInputConfig As IPneumaticUserInputsConfig, - ByRef pneumaticsAuxillariesConfig As IPneumaticsAuxilliariesConfig, - ByRef pneumaticsActuationsMap As IPneumaticActuationsMAP, - ByRef pneumaticsCompressorFlowRateMap As ICompressorMap, - vehicleMassKG As Kilogram, - cycleName As String, - signals As ISignals - ) - - - _pneumaticUserInputsConfig = pneumaticsUserInputConfig - _pneumaticAuxillariesConfig = pneumaticsAuxillariesConfig - _pneumaticsActuationsMap = pneumaticsActuationsMap - _pneumaticsCompressorFlowRateMap = pneumaticsCompressorFlowRateMap - _vehicleMassKG = vehicleMassKG - _cycleName = cycleName - _signals = signals - - - 'Total up the blow demands from compressor map - _averagePowerDemandPerCompressorUnitFlowRateInWPerLitresPerSecond = - (_pneumaticsCompressorFlowRateMap.GetAveragePowerDemandPerCompressorUnitFlowRate() / 60).SI() - - 'Calculate the Total Required Air Delivery Rate L / S - _totalAirDemand = TotalAirDemandCalculation() - End Sub - - - Private Function TotalAirDemandCalculation() As NormLiter - - 'These calculation are done directly from formulae provided from a supplied spreadsheet. - - Dim numActuationsPerCycle As Double - Dim airConsumptionPerActuationNI As Double - Dim TotalAirDemand As NormLiter - - 'Consumers - Dim Breaks As NormLiter - Dim ParkBrakesplus2Doors As NormLiter - Dim Kneeling As NormLiter - Dim AdBlue As NormLiter - Dim Regeneration As NormLiter - Dim DeadVolBlowOuts As NormLiter - Dim AirSuspension As NormLiter - - - '** Breaks ** - numActuationsPerCycle = _pneumaticsActuationsMap.GetNumActuations(New ActuationsKey("Brakes", _cycleName)) - '=IF(K10 = "yes", IF(COUNTBLANK(F33),G33,F33), IF(COUNTBLANK(F34),G34,F34))*K16 - airConsumptionPerActuationNI = - If _ - (_pneumaticUserInputsConfig.RetarderBrake, _pneumaticAuxillariesConfig.BrakingWithRetarderNIperKG, - _pneumaticAuxillariesConfig.BrakingNoRetarderNIperKG) - Breaks = (numActuationsPerCycle * airConsumptionPerActuationNI * _vehicleMassKG.Value()).SI(Of NormLiter)() - - '** ParkBrakesBreakplus2Doors ** Park break + 2 doors - numActuationsPerCycle = _pneumaticsActuationsMap.GetNumActuations(New ActuationsKey("Park brake + 2 doors", - _cycleName)) - '=SUM(IF(K14="electric",0,IF(COUNTBLANK(F36),G36,F36)),PRODUCT(K16*IF(COUNTBLANK(F37),G37,F37))) - airConsumptionPerActuationNI = - If(_pneumaticUserInputsConfig.Doors = "Electric", 0, _pneumaticAuxillariesConfig.PerDoorOpeningNI) - airConsumptionPerActuationNI += (_pneumaticAuxillariesConfig.PerStopBrakeActuationNIperKG * _vehicleMassKG.Value()) - ParkBrakesplus2Doors = (numActuationsPerCycle * airConsumptionPerActuationNI).SI(Of NormLiter)() - - '** Kneeling ** - numActuationsPerCycle = _pneumaticsActuationsMap.GetNumActuations(New ActuationsKey("Kneeling", _cycleName)) - '=IF(COUNTBLANK(F35),G35,F35)*K11*K16 - airConsumptionPerActuationNI = _pneumaticAuxillariesConfig.BreakingPerKneelingNIperKGinMM * _vehicleMassKG.Value() * - _pneumaticUserInputsConfig.KneelingHeightMillimeters - Kneeling = (numActuationsPerCycle * airConsumptionPerActuationNI).SI(Of NormLiter)() - - '** AdBlue ** - '=IF(K13="electric",0,G39*F54)- Supplied Spreadsheet - AdBlue = - If _ - (_pneumaticUserInputsConfig.AdBlueDosing = "Electric", 0, - _pneumaticAuxillariesConfig.AdBlueNIperMinute * (_signals.TotalCycleTimeSeconds / 60)).SI(Of NormLiter)() - - '** Regeneration ** - '=SUM(R6:R9)*IF(K9="yes",IF(COUNTBLANK(F41),G41,F41),IF(COUNTBLANK(F40),G40,F40)) - Supplied SpreadSheet - Regeneration = (Breaks + ParkBrakesplus2Doors + Kneeling + AdBlue) - Dim regenFraction As Double = - If(_pneumaticUserInputsConfig.SmartRegeneration, _pneumaticAuxillariesConfig.SmartRegenFractionTotalAirDemand, - _pneumaticAuxillariesConfig.NonSmartRegenFractionTotalAirDemand) - Regeneration = Regeneration * regenFraction - - '** DeadVolBlowOuts ** - '=IF(COUNTBLANK(F43),G43,F43)/(F54/60) - Supplied SpreadSheet - numActuationsPerCycle = _pneumaticAuxillariesConfig.DeadVolBlowOutsPerLitresperHour / - (60 / (_signals.TotalCycleTimeSeconds / 60)) - airConsumptionPerActuationNI = _pneumaticAuxillariesConfig.DeadVolumeLitres - DeadVolBlowOuts = (numActuationsPerCycle * airConsumptionPerActuationNI).SI(Of NormLiter)() - - '** AirSuspension ** - '=IF(K12="electrically",0,G38*F54) - Suplied Spreadsheet - AirSuspension = - If _ - (_pneumaticUserInputsConfig.AirSuspensionControl = "Electrically", 0, - _pneumaticAuxillariesConfig.AirControlledSuspensionNIperMinute * _cycleDurationMinutes).SI(Of NormLiter)() - - '** Total Air Demand ** - TotalAirDemand = Breaks + ParkBrakesplus2Doors + Kneeling + AdBlue + Regeneration + DeadVolBlowOuts + AirSuspension - - - Return TotalAirDemand - End Function - - - 'Get Average Power Demand @ Crank From Pneumatics - Public Function GetAveragePowerDemandAtCrankFromPneumatics() As Watt _ - Implements IM3_AveragePneumaticLoadDemand.GetAveragePowerDemandAtCrankFromPneumatics - - Return Sum4 - End Function - - 'Get Total Required Air Delivery Rate - Public Function AverageAirConsumedPerSecondLitre() As NormLiterPerSecond _ - Implements IM3_AveragePneumaticLoadDemand.AverageAirConsumedPerSecondLitre - - Return Sum1 - End Function - End Class -End Namespace - diff --git a/VECTOAux/VectoAuxiliaries/Pneumatics/M4_AirCompressor.vb b/VECTOAux/VectoAuxiliaries/Pneumatics/M4_AirCompressor.vb deleted file mode 100644 index 547aaf8b9ba1cb5247870fd9ac90463d8c352dbf..0000000000000000000000000000000000000000 --- a/VECTOAux/VectoAuxiliaries/Pneumatics/M4_AirCompressor.vb +++ /dev/null @@ -1,175 +0,0 @@ -' Copyright 2017 European Union. -' Licensed under the EUPL (the 'Licence'); -' -' * You may not use this work except in compliance with the Licence. -' * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl -' * Unless required by applicable law or agreed to in writing, -' software distributed under the Licence is distributed on an "AS IS" basis, -' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -' -' See the LICENSE.txt for the specific language governing permissions and limitations. -Imports TUGraz.VectoCommon.Utils - -Namespace Pneumatics - Public Class M4_AirCompressor - Implements IM4_AirCompressor - - Private Const MinRatio As Double = 1 - Private Const MaxRatio As Double = 10 - Private Const MinEff As Double = 0 - Private Const MaxEff As Double = 1 - - Private _pulleyGearRatio As Double - Private _pulleyGearEfficiency As Double - Private _map As ICompressorMap - Private _signals As ISignals - - - ''' <summary> - ''' Ratio of Gear or Pulley used to drive the compressor - ''' </summary> - ''' <value></value> - ''' <returns></returns> - ''' <remarks></remarks> - Public Property PulleyGearRatio() As Double Implements IM4_AirCompressor.PulleyGearRatio - Get - Return _pulleyGearRatio - End Get - Set(value As Double) - If (value < MinRatio OrElse value > MaxRatio) Then - Throw _ - New ArgumentOutOfRangeException("pulleyGearRatio", value, - String.Format("Invalid value, should be in the range {0} to {1}", MinRatio, MaxRatio)) - Else - _pulleyGearRatio = value - End If - End Set - End Property - - ''' <summary> - ''' Efficiency of the Pulley or Gear used to drive the compressor - ''' </summary> - ''' <value></value> - ''' <returns></returns> - ''' <remarks></remarks> - Public Property PulleyGearEfficiency() As Double Implements IM4_AirCompressor.PulleyGearEfficiency - Get - Return _pulleyGearEfficiency - End Get - Set(value As Double) - If (value < MinEff OrElse value > MaxEff) Then - Throw _ - New ArgumentOutOfRangeException("pulleyGearEfficiency", value, - String.Format("Invalid value, should be in the range {0} to {1}", MinEff, MaxEff) - ) - Else - _pulleyGearEfficiency = value - End If - End Set - End Property - - - '''<summary> - ''' Creates a new instance of the AirCompressor Class - ''' </summary> - ''' <param name="map">map of compressor values against compressor rpm</param> - ''' <param name="pulleyGearRatio">Ratio of Pulley/Gear</param> - ''' <param name="pulleyGearEfficiency">Efficiency of Pulley/Gear</param> - ''' <remarks></remarks> - Public Sub New(ByVal map As ICompressorMap, ByRef pulleyGearRatio As Double, ByRef pulleyGearEfficiency As Double, - signals As ISignals) - - _map = map - _pulleyGearRatio = pulleyGearRatio - _pulleyGearEfficiency = pulleyGearEfficiency - _signals = signals - End Sub - - ''' <summary> - ''' Initialises the AirCompressor Class - ''' </summary> - ''' <returns></returns> - ''' <remarks></remarks> - Public Function Initialise() As Boolean Implements IM4_AirCompressor.Initialise - Return _map.Initialise() - End Function - - 'Queryable Compressor Methods - ' - 'Compressor ( Speed ) Flow Rate - 'Power @ Crank From Pnumatics compressor off ( A ) - 'Power @ Crank From Pnumatics compressor On ( B ) - 'Power Delta ( A ) vs ( B ) - - - 'Return Average Power Demand Per Compressor Unit Flow Rate - - - ''' <summary> - ''' Returns the flow rate [litres/second] of compressor for the given engine rpm - ''' </summary> - ''' <returns></returns> - ''' <remarks></remarks> - Public Function GetFlowRate() As NormLiterPerSecond Implements IM4_AirCompressor.GetFlowRate - Dim compressorRpm As Double = _signals.EngineSpeed.AsRPM * PulleyGearRatio - - ''Flow Rate in the map is Litres/min so divide by 60 to get Units per second. - Return _map.GetFlowRate(compressorRpm) / 60 - End Function - - ''' <summary> - ''' Returns the power consumed for the given engine rpm when compressor is off - ''' </summary> - ''' <returns></returns> - ''' <remarks></remarks> - Public Function GetPowerCompressorOff() As Watt Implements IM4_AirCompressor.GetPowerCompressorOff - Return GetCompressorPower(False) - End Function - - ''' <summary> - ''' Returns the power consumed for the given engine rpm when compressor is on - ''' </summary> - ''' <returns></returns> - ''' <remarks></remarks> - Public Function GetPowerCompressorOn() As Watt Implements IM4_AirCompressor.GetPowerCompressorOn - Return GetCompressorPower(True) - End Function - - ''' <summary> - ''' Returns the difference in power between compressonr on and compressor off operation at the given engine rpm - ''' </summary> - ''' <returns></returns> - ''' <remarks></remarks> - Public Function GetPowerDifference() As Watt Implements IM4_AirCompressor.GetPowerDifference - Dim powerOn As Watt = GetPowerCompressorOn() - Dim powerOff As Watt = GetPowerCompressorOff() - Return powerOn - powerOff - End Function - - ''' <summary> - ''' Looks up the compressor power from the map at given engine speed - ''' </summary> - ''' <param name="compressorOn">Is compressor on</param> - ''' <returns></returns> - ''' <remarks></remarks> - Private Function GetCompressorPower(ByVal compressorOn As Boolean) As Watt - Dim compressorRpm As Double = _signals.EngineSpeed.AsRPM * PulleyGearRatio - If compressorOn Then - Return _map.GetPowerCompressorOn(compressorRpm) - Else - Return _map.GetPowerCompressorOff(compressorRpm) - End If - End Function - - ''' <summary> - ''' Aver - ''' </summary> - ''' <returns></returns> - ''' <remarks></remarks> - Public Function GetAveragePowerDemandPerCompressorUnitFlowRate() As SI _ - Implements IM4_AirCompressor.GetAveragePowerDemandPerCompressorUnitFlowRate - - Return _map.GetAveragePowerDemandPerCompressorUnitFlowRate().SI() - End Function - End Class -End Namespace \ No newline at end of file