diff --git a/VECTO/Input Files/cGBX.vb b/VECTO/Input Files/cGBX.vb index 4f64001b20d1f124cacca23cef32468151d22d7d..984ad3466000168246f385883e2c98cde5d1a840 100644 --- a/VECTO/Input Files/cGBX.vb +++ b/VECTO/Input Files/cGBX.vb @@ -495,14 +495,14 @@ Public Class cGBX AAUX_Gobal.ClutchEngaged = (Gear > 0) - AAUX_Gobal.Idle = False' (Gear = 0 And Not Pplus And Not Pminus) + AAUX_Gobal.Idle = False'(Gear = 0 And Not Pplus And Not Pminus) AAUX_Gobal.InNeutral = (Gear = 0) 'Driveline Power = required power at clutch = power at wheels plus powertrain losses '[kW] - '**** THIS IS NOT CORRECT< BUT NO PKU Variable is available at this point **** - AAUX_Gobal.EngineDrivelinePower = 0 + '**** RL 7-7-15 **** + AAUX_Gobal.EngineDrivelinePower = PeOut '[1/min] AAUX_Gobal.EngineSpeed = nU diff --git a/VECTO/MODcalc/cMOD.vb b/VECTO/MODcalc/cMOD.vb index b2e31f9ab29a42277d5763cdd073f94f8f4ed113..33270d5b6497a811fb1e789d5ca269a81110011a 100644 --- a/VECTO/MODcalc/cMOD.vb +++ b/VECTO/MODcalc/cMOD.vb @@ -742,19 +742,19 @@ Public Class cMOD 'AA-TB 'Advanced Auxiliaries - s.Append(Sepp & AA_NonSmartAlternatorsEfficiency(t).ToString()) - s.Append(Sepp & AA_SmartIdleCurrent_Amps(t).ToString()) - s.Append(Sepp & AA_SmartIdleAlternatorsEfficiency(t).ToString()) - s.Append(Sepp & AA_SmartTractionCurrent_Amps(t).ToString()) - s.Append(Sepp & AA_SmartTractionAlternatorEfficiency(t).ToString()) - s.Append(Sepp & AA_SmartOverrunCurrent_Amps(t).ToString()) - s.Append(Sepp & AA_SmartOverrunAlternatorEfficiency(t).ToString()) - s.Append(Sepp & AA_CompressorFlowRate_LitrePerSec(t).ToString()) - s.Append(Sepp & AA_OverrunFlag(t).ToString()) - s.Append(Sepp & AA_EngineIdleFlag(t).ToString()) - s.Append(Sepp & AA_CompressorFlag(t).ToString()) - s.Append(Sepp & AA_TotalCycleFC_BeforeSSandWHTCcorrection_Grams(t).ToString()) - s.Append(Sepp & AA_TotalCycleFC_BeforeSSandWHTCcorrection_Litres(t).ToString()) + s.Append(Sepp & if(vecto_global.VEC.AuxiliaryAssembly<>"CLASSIC",AA_NonSmartAlternatorsEfficiency(t).ToString(),"")) + s.Append(Sepp & if(vecto_global.VEC.AuxiliaryAssembly<>"CLASSIC",AA_SmartIdleCurrent_Amps(t).ToString(),"")) + s.Append(Sepp & if(vecto_global.VEC.AuxiliaryAssembly<>"CLASSIC",AA_SmartIdleAlternatorsEfficiency(t).ToString(),"")) + s.Append(Sepp & if(vecto_global.VEC.AuxiliaryAssembly<>"CLASSIC",AA_SmartTractionCurrent_Amps(t).ToString(),"")) + s.Append(Sepp & if(vecto_global.VEC.AuxiliaryAssembly<>"CLASSIC",AA_SmartTractionAlternatorEfficiency(t).ToString(),"")) + s.Append(Sepp & if(vecto_global.VEC.AuxiliaryAssembly<>"CLASSIC",AA_SmartOverrunCurrent_Amps(t).ToString(),"")) + s.Append(Sepp & if(vecto_global.VEC.AuxiliaryAssembly<>"CLASSIC",AA_SmartOverrunAlternatorEfficiency(t).ToString(),"")) + s.Append(Sepp & if(vecto_global.VEC.AuxiliaryAssembly<>"CLASSIC",AA_CompressorFlowRate_LitrePerSec(t).ToString(),"")) + s.Append(Sepp & if(vecto_global.VEC.AuxiliaryAssembly<>"CLASSIC",AA_OverrunFlag(t).ToString(),"")) + s.Append(Sepp & if(vecto_global.VEC.AuxiliaryAssembly<>"CLASSIC",AA_EngineIdleFlag(t).ToString(),"")) + s.Append(Sepp & if(vecto_global.VEC.AuxiliaryAssembly<>"CLASSIC",AA_CompressorFlag(t).ToString(),"")) + s.Append(Sepp & if(vecto_global.VEC.AuxiliaryAssembly<>"CLASSIC",AA_TotalCycleFC_BeforeSSandWHTCcorrection_Grams(t).ToString(),"")) + s.Append(Sepp & if(vecto_global.VEC.AuxiliaryAssembly<>"CLASSIC",AA_TotalCycleFC_BeforeSSandWHTCcorrection_Litres(t).ToString(),"")) End If diff --git a/VECTO/MODcalc/cPower.vb b/VECTO/MODcalc/cPower.vb index 815b8a581e79d6af95540cb2d60b8ad6de0dec84..f9404aa0e5ddb88f4a855410f56d0947c95fea36 100644 --- a/VECTO/MODcalc/cPower.vb +++ b/VECTO/MODcalc/cPower.vb @@ -1442,9 +1442,24 @@ lb_nOK: 'AA-TB 'Aggregate Fuel On Last Known Signals. If Not AAUX_Gobal.advancedAuxModel is nothing + + 'EngineState ( used for start stop fueling adjustment ) + + If EngState0 = tEngState.Stopped then + advancedAuxModel.Signals.EngineStopped =true + else + advancedAuxModel.Signals.EngineStopped = false + End If + + + + advancedAuxModel.CycleStep(1,message) + + try + 'Add Mod Data ModData.AA_NonSmartAlternatorsEfficiency .Add( advancedAuxModel.AA_NonSmartAlternatorsEfficiency) ModData.AA_SmartIdleCurrent_Amps .Add( advancedAuxModel.AA_SmartIdleCurrent_Amps) @@ -1460,6 +1475,15 @@ lb_nOK: ModData.AA_TotalCycleFC_BeforeSSandWHTCcorrection_Grams .Add( advancedAuxModel.AA_TotalCycleFC_BeforeSSandWHTCcorrection_Grams) ModData.AA_TotalCycleFC_BeforeSSandWHTCcorrection_Litres .Add( advancedAuxModel.AA_TotalCycleFC_BeforeSSandWHTCcorrection_Litres) + Catch ex as Exception + + Dim dummy = 0 + + + End try + + + End if Loop Until jz >= MODdata.tDim @@ -1754,38 +1778,41 @@ lb_nOK: 'Do not allow positive road gradients Grad = MODdata.Vh.fGrad(s) - 'AA-TB - 'Recalculate for Advanced Auxiliaries. + + Pwheel = fPwheel(t, v, a, Grad) + Pe = Pwheel + fPlossGB(Pwheel, v, Gear, True) + fPlossDiff(Pwheel, v, True) + fPaG(v, a) + fPlossRt(v, Gear) + fPaux(t, nU) + fPaMotSimple(t, Gear, v, a) - AAUX_Gobal.ClutchEngaged = (Gear > 0) - AAUX_Gobal.Idle = (Gear = 0 And Not Pplus And Not Pminus) + 'AA-TB + 'Recalculate for Advanced Auxiliaries. - AAUX_Gobal.InNeutral = (Gear = 0) + AAUX_Gobal.ClutchEngaged = (Gear > 0) - 'Driveline Power = required power at clutch = power at wheels plus powertrain losses - '[kW] - '**** THIS IS NOT CORRECT< BUT NO PKU Variable is available at this point **** - AAUX_Gobal.EngineDrivelinePower = 0 + AAUX_Gobal.Idle = (Gear = 0 And Not Pplus And Not Pminus) - '[1/min] - AAUX_Gobal.EngineSpeed = nU + AAUX_Gobal.InNeutral = (Gear = 0) - '[Nm] (using Power => Torque conversion) - AAUX_Gobal.EngineDrivelineTorque = nPeToM(EngineSpeed, EngineDrivelinePower) + 'Driveline Power = required power at clutch = power at wheels plus powertrain losses + '[kW] + '**** THIS IS NOT CORRECT< BUT NO PKU Variable is available at this point **** + AAUX_Gobal.EngineDrivelinePower = Pwheel + fPlossGB(Pwheel, v, Gear, True) + fPlossDiff(Pwheel, v, True) + fPaG(v, a) + fPlossRt(v, Gear) - 'Motoring power (< 0 !!!) - '[kW] - '** MULTIPLIED BY - TO GET POSITIVE VALUE - AAUX_Gobal.EngineMotoringPower = - FLD(Gear).Pdrag(EngineSpeed) + '[1/min] + AAUX_Gobal.EngineSpeed = nU - 'Additional aux power from driving cycle (optional user input) - '[kW] - AAUX_Gobal.PreExistingAuxPower = MODdata.Vh.Padd(t) + '[Nm] (using Power => Torque conversion) + AAUX_Gobal.EngineDrivelineTorque = nPeToM(EngineSpeed, EngineDrivelinePower) + + 'Motoring power (< 0 !!!) + '[kW] + '** MULTIPLIED BY - TO GET POSITIVE VALUE + AAUX_Gobal.EngineMotoringPower = - FLD(Gear).Pdrag(EngineSpeed) + + 'Additional aux power from driving cycle (optional user input) + '[kW] + AAUX_Gobal.PreExistingAuxPower = MODdata.Vh.Padd(t) - Pwheel = fPwheel(t, v, a, Grad) - Pe = Pwheel + fPlossGB(Pwheel, v, Gear, True) + fPlossDiff(Pwheel, v, True) + fPaG(v, a) + fPlossRt(v, Gear) + fPaux(t, nU) + fPaMotSimple(t, Gear, v, a) Diff = Math.Abs(Pdrag - Pe) @@ -1833,8 +1860,8 @@ lb_nOK: 'Driveline Power = required power at clutch = power at wheels plus powertrain losses '[kW] - '**** THIS IS NOT CORRECT< BUT NO PKU Variable is available at this point **** - AAUX_Gobal.EngineDrivelinePower = 0 + '**** RL-7/1/15 **** + AAUX_Gobal.EngineDrivelinePower = Pwheel + fPlossGB(Pwheel, v, Gear, True) + fPlossDiff(Pwheel, v, True) + fPaG(v, a) + fPlossRt(v, Gear) '[1/min] AAUX_Gobal.EngineSpeed = nU @@ -2543,6 +2570,7 @@ lb10: AAUX_Gobal.advancedAuxModel.Signals.Idle = AAUX_Gobal.Idle AAUX_Gobal.advancedAuxModel.Signals.InNeutral = AAUX_Gobal.InNeutral + 'Power coming out of Advanced Model is in Watts. power = (advancedAuxModel.AuxiliaryPowerAtCrankWatts /1000) diff --git a/VECTOAux/VectoAuxiliaries/AdvancedAuxiliaries.vb b/VECTOAux/VectoAuxiliaries/AdvancedAuxiliaries.vb index e360aa0647ff04010cb51ba47ecfcea129902819..668658a806856e807881c998fb7c3256ef673807 100644 --- a/VECTOAux/VectoAuxiliaries/AdvancedAuxiliaries.vb +++ b/VECTOAux/VectoAuxiliaries/AdvancedAuxiliaries.vb @@ -195,7 +195,20 @@ End Sub M11.CycleStep( seconds ) 'Used in the fuel aggregated output on M13 ( Sum 5 ) + + try + Signals.CurrentCycleTimeInSeconds+=1 + + + Catch ex As Exception + + MessageBox.Show("Im an exception") + Return false + + end try + + Return true @@ -209,8 +222,15 @@ End Sub Public Function RunStart( ByVal auxFilePath As String,byval vectoFilePath as string , ByRef message As String) As Boolean Implements VectoAuxiliaries.IAdvancedAuxiliaries.RunStart + Try + Initialise(auxFilePath, vectoFilePath) + + Catch ex As Exception + + Return false - Initialise(auxFilePath, vectoFilePath) + End Try + 'TODO:Modify Initialise to return a Bool. Return true diff --git a/VECTOAux/VectoAuxiliaries/DownstreamModules/M9.vb b/VECTOAux/VectoAuxiliaries/DownstreamModules/M9.vb index fff4049db14ec0013368e5680aae22b9c03b0e08..f57d61c95b4cd0f39f36f9c148e3f815b1eb566f 100644 --- a/VECTOAux/VectoAuxiliaries/DownstreamModules/M9.vb +++ b/VECTOAux/VectoAuxiliaries/DownstreamModules/M9.vb @@ -71,7 +71,7 @@ Private Signals As ISignals Private Function S0( rpm As Single ) As Single If rpm=0 then - Return 0 + Return 0.00001 End If Return rpm / RPM_TO_RADS_PER_SECOND