diff --git a/VECTOAux/VectoAuxiliariesTests/IntegrationTests/AuxDemandTest.vb b/VECTOAux/VectoAuxiliariesTests/IntegrationTests/AuxDemandTest.vb index e8a71da67a22ba440f80570bd3e21563021ca03d..f52e846fe2b96e6a53186854db9559c8a307cea3 100644 --- a/VECTOAux/VectoAuxiliariesTests/IntegrationTests/AuxDemandTest.vb +++ b/VECTOAux/VectoAuxiliariesTests/IntegrationTests/AuxDemandTest.vb @@ -5,7 +5,6 @@ Imports TUGraz.VectoCore.InputData.FileIO.JSON Imports TUGraz.VectoCore.InputData.Reader.ComponentData Imports TUGraz.VectoCore.Models.BusAuxiliaries Imports TUGraz.VectoCore.Models.BusAuxiliaries.Interfaces -Imports TUGraz.VectoCore.Models.Declaration Namespace IntegrationTests <TestFixture> @@ -41,19 +40,23 @@ Namespace IntegrationTests dim auxConfig = BusAuxiliaryInputData.ReadBusAuxiliaries(auxFilePath, Utils.GetDefaultVehicleData(vehicleWeight.SI(Of Kilogram))) - aux.Initialise(auxConfig, FuelData.Diesel) ', Path.GetDirectoryName(Path.GetFullPath(auxFilePath)) + "\") + aux.Initialise(auxConfig) ', Path.GetDirectoryName(Path.GetFullPath(auxFilePath)) + "\") aux.Signals.ClutchEngaged = True - aux.Signals.EngineDrivelinePower = (driveLinePower * 1000).SI(Of Watt)() 'kW + 'aux.Signals.EngineDrivelinePower = (driveLinePower * 1000).SI(Of Watt)() 'kW aux.Signals.EngineSpeed = engineSpeed.RPMtoRad() 'rpm aux.Signals.EngineDrivelineTorque = (driveLinePower * 1000).SI(Of Watt)() / (engineSpeed.RPMtoRad()) - aux.Signals.EngineMotoringPower = (24 * 1000).SI(Of Watt)() 'kW - has to be positive + 'aux.Signals.EngineMotoringPower = (24 * 1000).SI(Of Watt)() 'kW - has to be positive + Dim engineMotoringPower = (24 * 1000).SI(Of Watt)() 'kW - has to be positive aux.Signals.PreExistingAuxPower = (6.1 * 1000).SI(Of Watt)() aux.Signals.Idle = False aux.Signals.InNeutral = False 'aux.Signals.RunningCalc = True - aux.Signals.InternalEnginePower = (internalPower * 1000).SI(Of Watt)() 'kW + 'aux.Signals.InternalEnginePower = (internalPower * 1000).SI(Of Watt)() 'kW + Dim internalEnginePower = (internalPower * 1000).SI(Of Watt)() 'kW + + aux.Signals.ExcessiveDragPower = engineMotoringPower + internalEnginePower Dim power As Watt = aux.AuxiliaryPowerAtCrankWatts() @@ -87,21 +90,24 @@ Namespace IntegrationTests Dim auxCfg = BusAuxiliaryInputData.ReadBusAuxiliaries(auxFilePath, Utils.GetDefaultVehicleData(12000.SI(Of Kilogram)())) CType(auxCfg, AuxiliaryConfig).FuelMap = fuelMap - CType(aux, BusAuxiliaries).Initialise(auxCfg, FuelData.Diesel) ', Path.GetDirectoryName(Path.GetFullPath(auxFilePath)) + "\") + CType(aux, BusAuxiliaries).Initialise(auxCfg) ', Path.GetDirectoryName(Path.GetFullPath(auxFilePath)) + "\") aux.Signals.ClutchEngaged = True - aux.Signals.EngineDrivelinePower = (driveLinePower * 1000).SI(Of Watt)() 'kW + 'aux.Signals.EngineDrivelinePower = (driveLinePower * 1000).SI(Of Watt)() 'kW aux.Signals.EngineSpeed = engineSpeed.RPMtoRad() 'rpm aux.Signals.EngineDrivelineTorque = (driveLinePower * 1000).SI(Of Watt)() / (1256.RPMtoRad()) - aux.Signals.EngineMotoringPower = (24 * 1000).SI(Of Watt)() 'kW - has to be positive + 'aux.Signals.EngineMotoringPower = (24 * 1000).SI(Of Watt)() 'kW - has to be positive + Dim engineMotoringPower = (24 * 1000).SI(Of Watt)() 'kW - has to be positive aux.Signals.PreExistingAuxPower = 0.SI(Of Watt)() aux.Signals.Idle = False aux.Signals.InNeutral = False 'aux.Signals.RunningCalc = True - aux.Signals.InternalEnginePower = (internalPower * 1000).SI(Of Watt)() 'kW + 'aux.Signals.InternalEnginePower = (internalPower * 1000).SI(Of Watt)() 'kW + Dim internalEnginePower = (internalPower * 1000).SI(Of Watt)() 'kW + aux.Signals.ExcessiveDragPower = engineMotoringPower + internalEnginePower - Dim msg As String = String.Empty + 'Dim msg As String = String.Empty For i As Integer = 0 To 9 aux.ResetCalculations() Assert.AreEqual(6087.0317, aux.AuxiliaryPowerAtCrankWatts().Value(), 0.001) @@ -111,9 +117,11 @@ Namespace IntegrationTests 'Assert.AreEqual(79.303.SI(Unit.SI.Gramm).Value(), aux.AA_TotalCycleFC_Grams().Value(), 0.0001) - aux.Signals.EngineDrivelinePower = (-15 * 1000).SI(Of Watt)() - aux.Signals.EngineDrivelineTorque = aux.Signals.EngineDrivelinePower / (1256.RPMtoRad()) - aux.Signals.InternalEnginePower = (-50 * 1000).SI(Of Watt)() + 'aux.Signals.EngineDrivelinePower = (-15 * 1000).SI(Of Watt)() + aux.Signals.EngineDrivelineTorque = (-15 * 1000).SI(Of Watt)() / (1256.RPMtoRad()) + 'aux.Signals.InternalEnginePower = (-50 * 1000).SI(Of Watt)() + internalEnginePower = (-50 * 1000).SI(Of Watt)() + aux.Signals.ExcessiveDragPower = engineMotoringPower + internalEnginePower For i As Integer = 0 To 9 aux.ResetCalculations() @@ -124,9 +132,11 @@ Namespace IntegrationTests 'Assert.AreEqual(82.5783.SI(Unit.SI.Gramm).Value(), aux.AA_TotalCycleFC_Grams().Value(), 0.0001) - aux.Signals.EngineDrivelinePower = (driveLinePower * 1000).SI(Of Watt)() - aux.Signals.EngineDrivelineTorque = aux.Signals.EngineDrivelinePower / (1256.RPMtoRad()) - aux.Signals.InternalEnginePower = (internalPower * 1000).SI(Of Watt)() 'kW + 'aux.Signals.EngineDrivelinePower = (driveLinePower * 1000).SI(Of Watt)() + aux.Signals.EngineDrivelineTorque = (driveLinePower * 1000).SI(Of Watt)() / (1256.RPMtoRad()) + 'aux.Signals.InternalEnginePower = (internalPower * 1000).SI(Of Watt)() 'kW + internalEnginePower = (internalPower * 1000).SI(Of Watt)() 'kW + aux.Signals.ExcessiveDragPower = engineMotoringPower + internalEnginePower For i As Integer = 0 To 9 aux.ResetCalculations() diff --git a/VECTOAux/VectoAuxiliariesTests/UnitTests/M13Tests.vb b/VECTOAux/VectoAuxiliariesTests/UnitTests/M13Tests.vb index 1be551a81e9dd6d3722379f33f09168016432bb6..c554fa645b5ccc6be244532ae96f683dd3d418cb 100644 --- a/VECTOAux/VectoAuxiliariesTests/UnitTests/M13Tests.vb +++ b/VECTOAux/VectoAuxiliariesTests/UnitTests/M13Tests.vb @@ -48,7 +48,7 @@ Namespace UnitTests 'Signals.Setup(Function(x) x.SmartPneumatics).Returns(IP4) 'Signals.Setup(Function(x) x.SmartElectrics).Returns(IP5) Signals.Setup(Function(x) x.WHTC).Returns(IP7) - Signals.Setup(Function(x) x.DeclarationMode).Returns(IP8) + 'Signals.Setup(Function(x) x.DeclarationMode).Returns(IP8) 'Signals.Setup(Function(x) x.TotalCycleTimeSeconds).Returns(3114) Signals.Setup(Function(x) x.CurrentCycleTimeInSeconds).Returns(3114) diff --git a/VECTOAux/VectoAuxiliariesTests/UnitTests/M6Tests.vb b/VECTOAux/VectoAuxiliariesTests/UnitTests/M6Tests.vb index 5b937d3dc23d01cd9adc7aff3d80236c3505d414..017ade70292e357e5aed3e9951e4e681b7c88c8e 100644 --- a/VECTOAux/VectoAuxiliariesTests/UnitTests/M6Tests.vb +++ b/VECTOAux/VectoAuxiliariesTests/UnitTests/M6Tests.vb @@ -114,7 +114,7 @@ Namespace UnitTests signals.InternalEnginePower = 0.SI(Of Watt)() signals.PreExistingAuxPower = (AUX * 1000).SI(Of Watt)() signals.EngineDrivelinePower = (EDP * 1000).SI(Of Watt)() - signals.SmartElectrics = SM + 'signals.SmartElectrics = SM Dim target As New M06Impl(GetAuxConfigDummy().ElectricalUserInputsConfig, M1, M2, M3, M4, M5, signals) diff --git a/VectoCommon/VectoCommon/BusAuxiliaries/ISignals.cs b/VectoCommon/VectoCommon/BusAuxiliaries/ISignals.cs index f4e5ed86076ce64dee6a0d8578eae56601dabc91..8561393d2c4ed70da323e8f34af973434df1d17b 100644 --- a/VectoCommon/VectoCommon/BusAuxiliaries/ISignals.cs +++ b/VectoCommon/VectoCommon/BusAuxiliaries/ISignals.cs @@ -22,21 +22,21 @@ namespace TUGraz.VectoCommon.BusAuxiliaries { /// <remarks>Vecto Input</remarks> Watt PreExistingAuxPower { get; set; } - /// <summary> - /// Engine Motoring Power (KW) - /// </summary> - /// <value></value> - /// <returns></returns> - /// <remarks>Vecto Input</remarks> - Watt EngineMotoringPower { get; set; } + ///// <summary> + ///// Engine Motoring Power (KW) + ///// </summary> + ///// <value></value> + ///// <returns></returns> + ///// <remarks>Vecto Input</remarks> + //Watt EngineMotoringPower { get; set; } - /// <summary> - /// Engine Driveline Power (KW) - /// </summary> - /// <value></value> - /// <returns></returns> - /// <remarks></remarks> - Watt EngineDrivelinePower { get; set; } + ///// <summary> + ///// Engine Driveline Power (KW) + ///// </summary> + ///// <value></value> + ///// <returns></returns> + ///// <remarks></remarks> + //Watt EngineDrivelinePower { get; set; } /// <summary> /// Smart Electrics @@ -134,13 +134,13 @@ namespace TUGraz.VectoCommon.BusAuxiliaries { /// <remarks>'Vecto Input</remarks> double WHTC { get; set; } - /// <summary> - /// Declaration Mode - /// </summary> - /// <value></value> - /// <returns></returns> - /// <remarks>Vecto Input - Used to decide if to apply WHTC/Possiblye other things in future</remarks> - bool DeclarationMode { get; set; } + ///// <summary> + ///// Declaration Mode + ///// </summary> + ///// <value></value> + ///// <returns></returns> + ///// <remarks>Vecto Input - Used to decide if to apply WHTC/Possiblye other things in future</remarks> + //bool DeclarationMode { get; set; } /// <summary> /// Engine Idle Speed ( Associated with the vehicle bein tested ) @@ -159,14 +159,9 @@ namespace TUGraz.VectoCommon.BusAuxiliaries { ///// <remarks></remarks> //bool RunningCalc { get; set; } - /// <summary> - /// Running Calc - /// </summary> - /// <value></value> - /// <returns></returns> - /// <remarks></remarks> - Watt InternalEnginePower { get; set; } + //Watt InternalEnginePower { get; set; } Second SimulationInterval { get; set; } + Watt ExcessiveDragPower { get; set; } } } diff --git a/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs b/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs index b9e9b961e00112af66648380e2fdcf74e40fe3c6..f5612da621ab43a183afb31b961694fec490d16e 100644 --- a/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs +++ b/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs @@ -699,9 +699,11 @@ namespace TUGraz.VectoCommon.InputData { IList<IAlternatorDeclarationInputData> Alternators { get; } - IResultCardDeclarationInputData ResultCards { get; } - bool SmartElectrics { get; } + + Watt MaxAlternatorPower { get; } + + WattSecond ElectricStorageCapacity { get; } } public interface IElectricConsumersDeclarationData diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONVehicleData.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONVehicleData.cs index e67fea80e07abc4cea5adc9b978b62a7748af858..22b65685608a1df9904f35a1c22e680853cbeeda 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONVehicleData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONVehicleData.cs @@ -48,7 +48,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON { public class JSONVehicleDataV9 : JSONVehicleDataV7, IBusAuxiliariesDeclarationData, IElectricSupplyDeclarationData, IElectricConsumersDeclarationData, IPneumaticSupplyDeclarationData, IPneumaticConsumersDeclarationData, - IHVACBusAuxiliariesDeclarationData, IResultCardDeclarationInputData + IHVACBusAuxiliariesDeclarationData { public JSONVehicleDataV9(JObject data, string fileName, IJSONVehicleComponents job, bool tolerateMissing = false) : base(data, fileName, job, tolerateMissing) { } @@ -67,9 +67,11 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON get { return Body.GetEx<bool>("Articulated"); } } - public override bool? ATEcoRollReleaseLockupClutch { get { - return Body["ATEcoRollReleaseLockupClutch"]?.Value<bool>(); - } } + public override bool? ATEcoRollReleaseLockupClutch + { + get { return Body["ATEcoRollReleaseLockupClutch"]?.Value<bool>(); } + } + #endregion #endregion @@ -119,26 +121,54 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON { get { return Body["Aux"]?["ElectricSupply"]?["Alternators"] - .Select(x => new AlternatorInputData(x.GetEx<string>("Technology"), x.GetEx<double>("Ratio"))) - .Cast<IAlternatorDeclarationInputData>().ToList() ?? new List<IAlternatorDeclarationInputData>(); + .Select(x => new AlternatorInputData(x.GetEx<string>("Technology"), x.GetEx<double>("Ratio"))) + .Cast<IAlternatorDeclarationInputData>().ToList() ?? new List<IAlternatorDeclarationInputData>(); } } - public virtual IResultCardDeclarationInputData ResultCards + #endregion + + #region Implementation of IElectricConsumersDeclarationData + + public virtual bool InteriorLightsLED { - get { return Body["Aux"]?["ElectricSupply"]?["ResultCards"] != null ? this : null; } + get { return false; } } - #endregion + public virtual bool DayrunninglightsLED + { + get { return false; } + } - #region Implementation of IElectricConsumersDeclarationData + public virtual bool PositionlightsLED + { + get { return false; } + } + + public virtual bool HeadlightsLED + { + get { return false; } + } + + public virtual bool BrakelightsLED + { + get { return false; } + } - public virtual bool InteriorLightsLED { get { return false; } } - public virtual bool DayrunninglightsLED { get { return false; } } - public virtual bool PositionlightsLED { get { return false; } } - public virtual bool HeadlightsLED { get { return false; } } - public virtual bool BrakelightsLED { get { return false; } } - public virtual bool SmartElectrics { get { return Body["Aux"]?["ElectricSupply"]?.GetEx<bool>("SmartElectrics") ?? false; } } + public virtual bool SmartElectrics + { + get { return Body["Aux"]?["ElectricSupply"]?.GetEx<bool>("SmartElectrics") ?? false; } + } + + public Watt MaxAlternatorPower + { + get { return Body["Aux"]?["ElectricSupply"]?.GetEx<double>("MaxAlternatorPower").SI<Watt>() ?? null; } + } + + public WattSecond ElectricStorageCapacity + { + get { return Body["Aux"]?["ElectricSupply"]?.GetEx<double>("ElectricStorageCapacity").SI(Unit.SI.Watt.Hour).Cast<WattSecond>() ?? null; } + } #endregion @@ -185,36 +215,6 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON #endregion - #region Implementation of IResultCardDeclarationInputData - - public virtual IList<IResultCardEntry> Idle - { - get { - return Body["Aux"]?["ElectricSupply"]?["ResultCards"]?["Idle"] - .Select(x => new ResultCardEntry(x.GetEx<double>("Current").SI<Ampere>(), x.GetEx<double>("SmartCurrent").SI<Ampere>())) - .Cast<IResultCardEntry>().ToList() ?? new List<IResultCardEntry>(); - } - } - - public virtual IList<IResultCardEntry> Traction - { - get { - return Body["Aux"]?["ElectricSupply"]?["ResultCards"]?["Traction"] - .Select(x => new ResultCardEntry(x.GetEx<double>("Current").SI<Ampere>(), x.GetEx<double>("SmartCurrent").SI<Ampere>())) - .Cast<IResultCardEntry>().ToList() ?? new List<IResultCardEntry>(); - } - } - - public virtual IList<IResultCardEntry> Overrun - { - get { - return Body["Aux"]?["ElectricSupply"]?["ResultCards"]?["Overrun"] - .Select(x => new ResultCardEntry(x.GetEx<double>("Current").SI<Ampere>(), x.GetEx<double>("SmartCurrent").SI<Ampere>())) - .Cast<IResultCardEntry>().ToList() ?? new List<IResultCardEntry>(); - } - } - - #endregion } // ################################################################### diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationBusAuxiliariesDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationBusAuxiliariesDataProvider.cs index 2dacbc884d0989fcf746ea5906358cb5d32b8721..9712369c87be6464790deccd8c225fa1d7c8ae16 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationBusAuxiliariesDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationBusAuxiliariesDataProvider.cs @@ -14,7 +14,7 @@ using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider { public class XMLDeclarationPrimaryBusAuxiliariesDataProviderV26 : AbstractXMLType, IXMLBusAuxiliariesDeclarationData, - IElectricSupplyDeclarationData, IResultCardDeclarationInputData, IPneumaticConsumersDeclarationData, + IElectricSupplyDeclarationData, IPneumaticConsumersDeclarationData, IPneumaticSupplyDeclarationData, IHVACBusAuxiliariesDeclarationData { public static XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V26; @@ -66,7 +66,10 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider get { return this; } } - public IHVACBusAuxiliariesDeclarationData HVACAux { get { return this; } } + public IHVACBusAuxiliariesDeclarationData HVACAux + { + get { return this; } + } #endregion @@ -83,77 +86,28 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider } } - public IResultCardDeclarationInputData ResultCards - { - get { - return ElementExists(new[] { XMLNames.BusAux_ElectricSystem, XMLNames.BusAux_ElectricSystem_ResultCards }) - ? this - : null; - } - } - public bool SmartElectrics { get { return GetBool(new[] { XMLNames.BusAux_ElectricSystem, XMLNames.BusAux_ElectricSystem_SmartElectrics }); } } - #endregion - - #region Implementation of IResultCardDeclarationInputData - - public IList<IResultCardEntry> Idle + public Watt MaxAlternatorPower { - get { - return GetNodes( - new[] { - XMLNames.BusAux_ElectricSystem, XMLNames.BusAux_ElectricSystem_ResultCards, XMLNames.BusAux_ResultCard_Idle, - XMLNames.BusAux_ResultCard_Entry - }) - .Cast<XmlNode>().Select( - x => new ResultCardEntry( - GetAttribute(x, XMLNames.ResultCard_Entry_CurrentAttr).ToDouble().SI<Ampere>(), - GetAttribute(x, XMLNames.ResultCard_Entry_SmartCurrent_Attr).ToDouble().SI<Ampere>())) - .Cast<IResultCardEntry>() - .ToList(); - } - } - - public IList<IResultCardEntry> Traction - { - get { - return GetNodes( - new[] { - XMLNames.BusAux_ElectricSystem, XMLNames.BusAux_ElectricSystem_ResultCards, XMLNames.BusAux_ResultCard_Traction, - XMLNames.BusAux_ResultCard_Entry - }) - .Cast<XmlNode>().Select( - x => new ResultCardEntry( - GetAttribute(x, XMLNames.ResultCard_Entry_CurrentAttr).ToDouble().SI<Ampere>(), - GetAttribute(x, XMLNames.ResultCard_Entry_SmartCurrent_Attr).ToDouble().SI<Ampere>())) - .Cast<IResultCardEntry>() - .ToList(); - } + get { return ElementExists("MaxAlternatorPower") ? GetDouble("MaxAlternatorPower").SI<Watt>() : null; } } - public IList<IResultCardEntry> Overrun + public WattSecond ElectricStorageCapacity { get { - return GetNodes( - new[] { - XMLNames.BusAux_ElectricSystem, XMLNames.BusAux_ElectricSystem_ResultCards, XMLNames.BusAux_ResultCard_Overrun, - XMLNames.BusAux_ResultCard_Entry - }) - .Cast<XmlNode>().Select( - x => new ResultCardEntry( - GetAttribute(x, XMLNames.ResultCard_Entry_CurrentAttr).ToDouble().SI<Ampere>(), - GetAttribute(x, XMLNames.ResultCard_Entry_SmartCurrent_Attr).ToDouble().SI<Ampere>())) - .Cast<IResultCardEntry>() - .ToList(); + return ElementExists("ElectricStorageCapacity") + ? GetDouble("ElectricStorageCapacity").SI(Unit.SI.Watt.Hour).Cast<WattSecond>() + : null; } } #endregion + #region Implementation of IPneumaticConsumersDeclarationData public ConsumerTechnology AirsuspensionControl @@ -213,16 +167,55 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider #region Implementation of IHVACBusAuxiliariesDeclarationData - public BusHVACSystemConfiguration SystemConfiguration { get { return BusHVACSystemConfiguration.Unknown; } } - public ACCompressorType CompressorTypeDriver { get { return ACCompressorType.None; } } - public ACCompressorType CompressorTypePassenger { get { return ACCompressorType.None; } } - public Watt AuxHeaterPower { get { return 0.SI<Watt>(); } } - public bool DoubleGlasing { get { return false; } } - public bool HeatPump { get { return false; } } - public bool AdjustableCoolantThermostat { get { return GetBool(new[] { "HVAC", "AdjustableCoolantThermostat" }); } } - public bool AdjustableAuxiliaryHeater { get { return false; } } - public bool EngineWasteGasHeatExchanger { get { return GetBool(new[] { "HVAC", "EngineWasteGasHeatExchanger" }); } } - public bool SeparateAirDistributionDucts { get { return false; } } + public BusHVACSystemConfiguration SystemConfiguration + { + get { return BusHVACSystemConfiguration.Unknown; } + } + + public ACCompressorType CompressorTypeDriver + { + get { return ACCompressorType.None; } + } + + public ACCompressorType CompressorTypePassenger + { + get { return ACCompressorType.None; } + } + + public Watt AuxHeaterPower + { + get { return 0.SI<Watt>(); } + } + + public bool DoubleGlasing + { + get { return false; } + } + + public bool HeatPump + { + get { return false; } + } + + public bool AdjustableCoolantThermostat + { + get { return GetBool(new[] { "HVAC", "AdjustableCoolantThermostat" }); } + } + + public bool AdjustableAuxiliaryHeater + { + get { return false; } + } + + public bool EngineWasteGasHeatExchanger + { + get { return GetBool(new[] { "HVAC", "EngineWasteGasHeatExchanger" }); } + } + + public bool SeparateAirDistributionDucts + { + get { return false; } + } #endregion } diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterPrimaryBus.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterPrimaryBus.cs index b7a3231c30228281731d16723bde36ad6c012ddb..71b4b48708608c9273037df31ebc7938e62eab0d 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterPrimaryBus.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterPrimaryBus.cs @@ -106,18 +106,9 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter AlternatorMap = new SimpleAlternator(CalculateAlternatorEfficiency(busAux.ElectricSupply.Alternators)), PowerNetVoltage = Constants.BusAuxiliaries.ElectricSystem.PowernetVoltage, StoredEnergyEfficiency = Constants.BusAuxiliaries.ElectricSystem.StoredEnergyEfficiency, - ResultCardIdle = busAux.ElectricSupply.ResultCards != null - ? new ResultCard( - busAux.ElectricSupply.ResultCards.Idle.Select(x => new SmartResult(x.Current, x.SmartCurrent)).ToList()) - : (IResultCard)new DummyResultCard(), - ResultCardOverrun = busAux.ElectricSupply.ResultCards != null - ? new ResultCard( - busAux.ElectricSupply.ResultCards.Overrun.Select(x => new SmartResult(x.Current, x.SmartCurrent)).ToList()) - : (IResultCard)new DummyResultCard(), - ResultCardTraction = busAux.ElectricSupply.ResultCards != null - ? new ResultCard( - busAux.ElectricSupply.ResultCards.Traction.Select(x => new SmartResult(x.Current, x.SmartCurrent)).ToList()) - : (IResultCard)new DummyResultCard(), + ResultCardIdle = new DummyResultCard(), + ResultCardOverrun = new DummyResultCard(), + ResultCardTraction = new DummyResultCard(), AlternatorGearEfficiency = Constants.BusAuxiliaries.ElectricSystem.AlternatorGearEfficiency, }; } diff --git a/VectoCore/VectoCore/Models/BusAuxiliaries/BusAuxiliaries.cs b/VectoCore/VectoCore/Models/BusAuxiliaries/BusAuxiliaries.cs index abd4c09068860820c6aa120421064cc31e74779b..cddcc893d694ec12e667436a70ee1a27dc18f895 100644 --- a/VectoCore/VectoCore/Models/BusAuxiliaries/BusAuxiliaries.cs +++ b/VectoCore/VectoCore/Models/BusAuxiliaries/BusAuxiliaries.cs @@ -67,32 +67,13 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries Signals = new Signals(); } - public void Initialise( - IAuxiliaryConfig auxCfg, IFuelProperties fuelProperties /*string IAuxPath, string vectoFilePath*/) + public void Initialise(IAuxiliaryConfig auxCfg) { Signals.CurrentCycleTimeInSeconds = 0; auxConfig = auxCfg; //new AuxiliaryConfig(auxPath); - // Pass some signals from config to Signals. ( These are stored in the configuration but shared in the signal distribution around modules ) - //Signals.SmartElectrics = auxConfig.ElectricalUserInputsConfig.SmartElectrical; - - //Signals.StoredEnergyEfficiency = auxConfig.ElectricalUserInputsConfig.StoredEnergyEfficiency; - //Signals.SmartPneumatics = auxConfig.PneumaticUserInputsConfig.SmartAirCompression; - - //Signals.PneumaticOverrunUtilisation = auxConfig.PneumaticAuxillariesConfig.OverrunUtilisationForCompressionFraction; - - //var alternatorMap = auxConfig.ElectricalUserInputsConfig.AlternatorMap; var compressorMap = auxConfig.PneumaticUserInputsConfig.CompressorMap; - // fuelMap = New cMAP() - // fuelMap.FilePath = FilePathUtils.ResolveFilePath(vectoDirectory, VectoInputs.FuelMap) - // If Not fuelMap.ReadFile() Then - // MessageBox.Show("Unable to read fuel map, aborting.") - // Return - // End If - // fuelMap.Triangulate() - //fuelMap = auxCfg.FuelMap; - // SSM HVAC //var ssmPath = FilePathUtils.ResolveFilePath(vectoDirectory, auxConfig.HvacUserInputsConfig.SSMFilePath); //var BusDatabase = FilePathUtils.ResolveFilePath(vectoDirectory, auxConfig.HvacUserInputsConfig.BusDatabasePath); diff --git a/VectoCore/VectoCore/Models/BusAuxiliaries/DownstreamModules/Impl/M06Impl.cs b/VectoCore/VectoCore/Models/BusAuxiliaries/DownstreamModules/Impl/M06Impl.cs index b085d47db0a710d79e76de39cb1df145796c887d..e06af4bd881bec4612ea061a2aa83c1ce4b45f9a 100644 --- a/VectoCore/VectoCore/Models/BusAuxiliaries/DownstreamModules/Impl/M06Impl.cs +++ b/VectoCore/VectoCore/Models/BusAuxiliaries/DownstreamModules/Impl/M06Impl.cs @@ -39,11 +39,15 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl protected override void DoCalculate() { var sum1 = _m1.AveragePowerDemandAtCrankFromHVACElectrics + _m2.GetAveragePowerAtCrankFromElectrics(); - var sw1 = _smartElectrics ? _m5.AlternatorsGenerationPowerAtCrankTractionOn() : sum1; + var sw1 = _smartElectrics + ? _m5.AlternatorsGenerationPowerAtCrankTractionOn() + : sum1; var sum2 = _m1.AveragePowerDemandAtCrankFromHVACMechanicals + sw1 + _m3.GetAveragePowerDemandAtCrankFromPneumatics(); - var sum3 = _signals.EngineMotoringPower + _signals.InternalEnginePower + sum2; - var vc0 = sum3 <= 0; + //var sum3 = _signals.EngineMotoringPower + _signals.InternalEnginePower + sum2; + var sum3 = _signals.ExcessiveDragPower + sum2; + //VC0: prinzipiell reserve vorhanden - unter schleppkurve mit durchschnittlichen aux + var vc0 = sum3.IsSmallerOrEqual(0); //sum3 <= 0; var sum4 = sum3 - sw1 - _m3.GetAveragePowerDemandAtCrankFromPneumatics() + _m4.GetPowerCompressorOff(); var sum5 = vc0 ? sum4 : 0.SI<Watt>(); @@ -51,8 +55,13 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl var max1 = sum5 > sum10 ? sum5 : sum10; var sum11 = sum5 - max1; var sum12 = _m4.GetPowerDifference() + sum11; + + // VC2: Smart Compressor Overrun and Smart Electrics overrun var vc2 = sum12 < 0 || sum12.IsEqual(0); + // VC1: Pneumatics Compressor Off and Smart Electrics + // compressor off power can be provided + // smart alternator can be provided (max possible) var vc1 = sum12 > 0; var sum14 = vc1 ? _m4.GetPowerCompressorOff() : 0.SI<Watt>(); var sum15 = vc2 @@ -67,7 +76,11 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl var sum8 = sum4 + sw1; var sum9 = vc0 ? sum8 : 0.SI<Watt>(); var sum13 = sum9 + _m4.GetPowerDifference(); + + // VC3: Pneumatics compressor off, average elctric power (no overrun) var vc3 = sum13 > 0; + + // VC4: smart compressor overrun and average electrics (no overrun) var vc4 = sum13 < 0 || sum13.IsEqual(0); var sum17 = vc3 ? _m4.GetPowerCompressorOff() : 0.SI<Watt>(); var sum18 = vc4 diff --git a/VectoCore/VectoCore/Models/BusAuxiliaries/DownstreamModules/Impl/Pneumatics/M03Impl.cs b/VectoCore/VectoCore/Models/BusAuxiliaries/DownstreamModules/Impl/Pneumatics/M03Impl.cs index 7e96e4561d82c9e3bdc29c69bbd1cb65a8846202..b217d23fc005f1e0fe3be0a4dd46f05df03a8628 100644 --- a/VectoCore/VectoCore/Models/BusAuxiliaries/DownstreamModules/Impl/Pneumatics/M03Impl.cs +++ b/VectoCore/VectoCore/Models/BusAuxiliaries/DownstreamModules/Impl/Pneumatics/M03Impl.cs @@ -7,89 +7,91 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl.Pneumati { public class M03Impl : AbstractModule, IM3_AveragePneumaticLoadDemand { - protected IPneumaticUserInputsConfig _pneumaticUserInputsConfig; - protected IPneumaticsConsumersDemand _pneumaticAuxillariesConfig; protected ICompressorMap _pneumaticsCompressorFlowRateMap; - protected Kilogram _vehicleMassKG; protected ISignals _signals; + protected double _compressorGearEfficiency; + protected double _compressorGearRatio; //public M03Impl(IPneumaticUserInputsConfig pneumaticsUserInputConfig, IPneumaticsAuxilliariesConfig pneumaticsAuxillariesConfig, IPneumaticActuationsMap pneumaticsActuationsMap, ICompressorMap pneumaticsCompressorFlowRateMap, Kilogram vehicleMassKG, string cycleName, ISignals signals) public M03Impl(IAuxiliaryConfig auxConfig, ICompressorMap compressorMap, IActuations actuations, ISignals signals) { - _pneumaticUserInputsConfig = auxConfig.PneumaticUserInputsConfig; - _pneumaticAuxillariesConfig = auxConfig.PneumaticAuxillariesConfig; _pneumaticsCompressorFlowRateMap = compressorMap; - _vehicleMassKG = auxConfig.VehicleData.TotalVehicleMass; - + _compressorGearEfficiency = auxConfig.PneumaticUserInputsConfig.CompressorGearEfficiency; + _compressorGearRatio = auxConfig.PneumaticUserInputsConfig.CompressorGearRatio; + _signals = signals; //'Calculate the Total Required Air Delivery Rate L / S - TotalAirDemand = TotalAirDemandCalculation(actuations); + TotalAirDemand = TotalAirDemandCalculation(auxConfig, actuations); AverageAirConsumed = TotalAirDemand / actuations.CycleTime; } - public NormLiter TotalAirDemandCalculation(IActuations actuations) + public static NormLiter TotalAirDemandCalculation(IAuxiliaryConfig auxConfig, IActuations actuations) { + var psUserConfig = auxConfig.PneumaticUserInputsConfig; + var psAuxconfig = auxConfig.PneumaticAuxillariesConfig; + var vehicleMass = auxConfig.VehicleData.TotalVehicleMass; + //'* * Breaks * * - var airConsumptionPerActuation = _pneumaticAuxillariesConfig.Braking * _vehicleMassKG; - var breaks = actuations.Braking * airConsumptionPerActuation ; + var airConsumptionPerActuation = psAuxconfig.Braking * vehicleMass; + var breaks = actuations.Braking * airConsumptionPerActuation; //'* * ParkBrakesBreakplus2Doors * *Park break +2 doors - airConsumptionPerActuation = _pneumaticUserInputsConfig.Doors == ConsumerTechnology.Electrically + airConsumptionPerActuation = psUserConfig.Doors == ConsumerTechnology.Electrically ? 0.SI<NormLiter>() - : _pneumaticAuxillariesConfig.DoorOpening; - airConsumptionPerActuation += _pneumaticAuxillariesConfig.StopBrakeActuation * _vehicleMassKG; - var parkBrakesplus2Doors = (actuations.ParkBrakeAndDoors * airConsumptionPerActuation); + : psAuxconfig.DoorOpening; + airConsumptionPerActuation += psAuxconfig.StopBrakeActuation * vehicleMass; + var parkBrakesplus2Doors = actuations.ParkBrakeAndDoors * airConsumptionPerActuation; //'* * Kneeling * * - airConsumptionPerActuation = _pneumaticAuxillariesConfig.BreakingWithKneeling * - _pneumaticUserInputsConfig.KneelingHeight * _vehicleMassKG; - var kneeling = (actuations.Kneeling * airConsumptionPerActuation); + airConsumptionPerActuation = psAuxconfig.BreakingWithKneeling * + psUserConfig.KneelingHeight * vehicleMass; + var kneeling = actuations.Kneeling * airConsumptionPerActuation; //'* * AdBlue * * - var adBlue = _pneumaticUserInputsConfig.AdBlueDosing == ConsumerTechnology.Electrically + var adBlue = psUserConfig.AdBlueDosing == ConsumerTechnology.Electrically ? 0.SI<NormLiter>() - : _pneumaticAuxillariesConfig.AdBlueInjection * actuations.CycleTime; + : psAuxconfig.AdBlueInjection * actuations.CycleTime; //'* * Regeneration * * var regeneration = breaks + parkBrakesplus2Doors + kneeling + adBlue; - var regenFraction = _pneumaticUserInputsConfig.SmartRegeneration - ? _pneumaticAuxillariesConfig.SmartRegenFractionTotalAirDemand - : _pneumaticAuxillariesConfig.NonSmartRegenFractionTotalAirDemand; + var regenFraction = psUserConfig.SmartRegeneration + ? psAuxconfig.SmartRegenFractionTotalAirDemand + : psAuxconfig.NonSmartRegenFractionTotalAirDemand; regeneration = regeneration * regenFraction; //'* * DeadVolBlowOuts * * - airConsumptionPerActuation = _pneumaticAuxillariesConfig.DeadVolume; - var deadVolBlowOuts = (airConsumptionPerActuation * _pneumaticAuxillariesConfig.DeadVolBlowOuts * + airConsumptionPerActuation = psAuxconfig.DeadVolume; + var deadVolBlowOuts = (airConsumptionPerActuation * psAuxconfig.DeadVolBlowOuts * actuations.CycleTime).Cast<NormLiter>(); //'* * AirSuspension * * - var airSuspension = _pneumaticUserInputsConfig.AirSuspensionControl == ConsumerTechnology.Electrically + var airSuspension = psUserConfig.AirSuspensionControl == ConsumerTechnology.Electrically ? 0.SI<NormLiter>() - : _pneumaticAuxillariesConfig.AirControlledSuspension * actuations.CycleTime; + : psAuxconfig.AirControlledSuspension * actuations.CycleTime; //'* * Total Air Demand** var totalAirDemand = breaks + parkBrakesplus2Doors + kneeling + adBlue + regeneration + deadVolBlowOuts + airSuspension; - + return totalAirDemand; } - + #region Implementation of IM3_AveragePneumaticLoadDemand public Watt GetAveragePowerDemandAtCrankFromPneumatics() { var cmp = _pneumaticsCompressorFlowRateMap.Interpolate( - _signals.EngineSpeed * _pneumaticUserInputsConfig.CompressorGearRatio); + _signals.EngineSpeed * _compressorGearRatio); var sum6 = cmp.FlowRate; var sum7 = cmp.PowerOn - cmp.PowerOff; - var sum2 = (sum7 / sum6 * AverageAirConsumed); // ' Watt / Nl/s * Nl/s = Watt + var sum2 = sum7 / sum6 * AverageAirConsumed; // ' Watt / Nl/s * Nl/s = Watt var sum3 = sum2 + cmp.PowerOff; - var sum4 = sum3 * (1 / _pneumaticUserInputsConfig.CompressorGearEfficiency); + var sum4 = sum3 * (1 / _compressorGearEfficiency); return sum4; } diff --git a/VectoCore/VectoCore/Models/BusAuxiliaries/Interfaces/Signals.cs b/VectoCore/VectoCore/Models/BusAuxiliaries/Interfaces/Signals.cs index 82a511835af874814fa232cbe9e83e49cd8414b8..0f27b302b181e712d812b448f0cfb68a57b5c20e 100644 --- a/VectoCore/VectoCore/Models/BusAuxiliaries/Interfaces/Signals.cs +++ b/VectoCore/VectoCore/Models/BusAuxiliaries/Interfaces/Signals.cs @@ -15,7 +15,6 @@ using TUGraz.VectoCommon.Utils; namespace TUGraz.VectoCore.Models.BusAuxiliaries.Interfaces { public class Signals : ISignals { - // Backing variables public bool ClutchEngaged { get; set; } @@ -23,22 +22,20 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.Interfaces { public NewtonMeter EngineDrivelineTorque { get; set; } public Watt EngineMotoringPower { get; set; } public PerSecond EngineSpeed { get; set; } - - public bool SmartElectrics { get; set; } - - public bool SmartPneumatics { get; set; } + public double CurrentCycleTimeInSeconds { get; set; } public Watt PreExistingAuxPower { get; set; } public bool Idle { get; set; } public bool InNeutral { get; set; } public bool EngineStopped { get; set; } - public bool DeclarationMode { get; set; } + //public bool DeclarationMode { get; set; } public double WHTC { set; get; } = 1; public PerSecond EngineIdleSpeed { get; set; } public Watt InternalEnginePower { get; set; } public Second SimulationInterval { get; set; } + public Watt ExcessiveDragPower { get; set; } } } diff --git a/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs b/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs index b277fb80d4f1a57e1364163a8365b49b99401215..879220173e3d4fe9c7976c3a190b4076e4f05d2e 100644 --- a/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs +++ b/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs @@ -353,8 +353,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl { var conventionalAux = CreateAuxiliaries(data, container); // TODO: MQ 2019-07-30 -- which fuel map for advanced auxiliaries?! - var busAux = new BusAuxiliariesAdapter(container, data.BusAuxiliaries, data.Cycle.Name, - data.VehicleData.TotalVehicleMass, data.EngineData.Fuels[0].ConsumptionMap, data.EngineData.IdleSpeed, conventionalAux); + var busAux = new BusAuxiliariesAdapter(container, data.BusAuxiliaries, conventionalAux); return busAux; } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/BusAuxiliariesAdapter.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/BusAuxiliariesAdapter.cs index fa6d9becf14af26ec80d85063fad8a2bfd014ad2..a9bdd2c1e85dc8f105decb3bebf950a0572f97cc 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/BusAuxiliariesAdapter.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/BusAuxiliariesAdapter.cs @@ -30,7 +30,6 @@ */ using System; -using System.Linq; using TUGraz.VectoCommon.BusAuxiliaries; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; @@ -44,132 +43,116 @@ using TUGraz.VectoCore.OutputData; namespace TUGraz.VectoCore.Models.SimulationComponent.Impl { - public class BusAuxiliariesAdapter : LoggingObject, IAuxInProvider, IAuxPort - { - protected readonly IDataBus DataBus; - protected internal BusAuxState CurrentState; - protected internal BusAuxState PreviousState; + public class BusAuxiliariesAdapter : LoggingObject, IAuxInProvider, IAuxPort + { + protected readonly IDataBus DataBus; + protected internal BusAuxState CurrentState; + protected internal BusAuxState PreviousState; - protected internal readonly IAuxPort AdditionalAux; + protected internal readonly IAuxPort AdditionalAux; - protected IBusAuxiliaries Auxiliaries; - private readonly FuelConsumptionAdapter _fcMapAdapter; + protected IBusAuxiliaries Auxiliaries; - public BusAuxiliariesAdapter(IVehicleContainer container, IAuxiliaryConfig auxiliaryConfig, string cycleName, Kilogram vehicleWeight, - FuelConsumptionMap fcMap, PerSecond engineIdleSpeed, IAuxPort additionalAux = null) - { - // mAAUX_Global.advancedAuxModel.Signals.DeclarationMode = Cfg.DeclMode - // mAAUX_Global.advancedAuxModel.Signals.WHTC = Declaration.WHTCcorrFactor - CurrentState = new BusAuxState(); - PreviousState = new BusAuxState { AngularSpeed = engineIdleSpeed }; + //private readonly FuelConsumptionAdapter _fcMapAdapter; - AdditionalAux = additionalAux; + public BusAuxiliariesAdapter( + IVehicleContainer container, IAuxiliaryConfig auxiliaryConfig, IAuxPort additionalAux = null) + { + CurrentState = new BusAuxState(); + PreviousState = new BusAuxState { AngularSpeed = container.EngineIdleSpeed }; - DataBus = container; + AdditionalAux = additionalAux; + + DataBus = container; var tmpAux = new BusAuxiliaries.BusAuxiliaries(); - // VectoInputs = { - // Cycle = DetermineCycle(cycleName), - // VehicleWeightKG = vehicleWeight - // } - //}; - - _fcMapAdapter = new FuelConsumptionAdapter() { FcMap = fcMap }; - //tmpAux.VectoInputs.FuelMap = _fcMapAdapter; - // TODO: MQ 2019-07-30: how to handle fuel in aaux? - //tmpAux.VectoInputs.FuelDensity = FuelData.Instance().Lookup((container as IVehicleContainer).RunData.EngineData.Fuels.First().FuelData.FuelType).FuelDensity; - - //'Set Signals - tmpAux.Signals.EngineIdleSpeed = engineIdleSpeed; - - //tmpAux.Signals.TotalCycleTimeSeconds = - // auxiliaryConfig.ActuationsMap.GetNumActuations(new ActuationsKey("CycleTime", tmpAux.VectoInputs.Cycle)); - ; - - // call initialize _after_ setting the cycle time to get the correct consumtions - - tmpAux.Initialise(auxiliaryConfig, container.RunData.EngineData.Fuels.First().FuelData); - - - Auxiliaries = tmpAux; - } - - private static string DetermineCycle(string cycleName) - { - var cycle = cycleName.ToLower(); - - if (cycle.Contains("bus")) { - if (cycle.Contains("heavy_urban")) { - return "Heavy urban"; - } - if (cycle.Contains("suburban")) { - return "Suburban"; - } - if (cycle.Contains("interurban")) { - return "Interurban"; - } - if (cycle.Contains("urban")) { - return "Urban"; - } - } - if (cycle.Contains("coach")) { - return "Coach"; - } - Logger<BusAuxiliariesAdapter>() - .Warn("UnServiced Cycle Name '{0}' in Pneumatics Actuations Map 0 Actuations returned", cycleName); - return cycleName; - } - - public IAuxPort Port() - { - return this; - } - - public NewtonMeter Initialize(NewtonMeter torque, PerSecond angularSpeed) - { - //PreviousState.TotalFuelConsumption = 0.SI<Kilogram>(); - PreviousState.AngularSpeed = angularSpeed; - CurrentState.AngularSpeed = angularSpeed; - if (AdditionalAux != null) { - AdditionalAux.Initialize(torque, angularSpeed); - } - PreviousState.PowerDemand = GetBusAuxPowerDemand(0.SI<Second>(), 1.SI<Second>(), torque, torque, angularSpeed); - return PreviousState.PowerDemand / angularSpeed; - } - - - public NewtonMeter TorqueDemand(Second absTime, Second dt, NewtonMeter torquePowerTrain, NewtonMeter torqueEngine, - PerSecond angularSpeed, bool dryRun = false) - { - CurrentState.AngularSpeed = angularSpeed; - CurrentState.dt = dt; - CurrentState.PowerDemand = GetBusAuxPowerDemand(absTime, dt, torquePowerTrain, torqueEngine, angularSpeed, dryRun); - - var avgAngularSpeed = (CurrentState.AngularSpeed + PreviousState.AngularSpeed) / 2.0; - return CurrentState.PowerDemand / avgAngularSpeed; - } - - public Watt PowerDemandEngineOn(PerSecond engineSpeed) - { - throw new NotImplementedException(); - } - - public Watt PowerDemandEngineOff() - { - throw new NotImplementedException(); - } - - - protected internal void DoWriteModalResults(IModalDataContainer container) - { - _fcMapAdapter.AllowExtrapolation = true; - // cycleStep has to be called here and not in DoCommit, write is called before Commit! - var message = String.Empty; - Auxiliaries.CycleStep(CurrentState.dt); - Log.Warn(message); - - //CurrentState.TotalFuelConsumption = Auxiliaries.TotalFuel; - container[ModalResultField.P_aux] = CurrentState.PowerDemand; + + //'Set Signals + tmpAux.Signals.EngineIdleSpeed = container.EngineIdleSpeed; + tmpAux.Initialise(auxiliaryConfig); + + Auxiliaries = tmpAux; + } + + private static string DetermineCycle(string cycleName) + { + var cycle = cycleName.ToLower(); + + if (cycle.Contains("bus")) { + if (cycle.Contains("heavy_urban")) { + return "Heavy urban"; + } + if (cycle.Contains("suburban")) { + return "Suburban"; + } + if (cycle.Contains("interurban")) { + return "Interurban"; + } + if (cycle.Contains("urban")) { + return "Urban"; + } + } + + if (cycle.Contains("coach")) { + return "Coach"; + } + + Logger<BusAuxiliariesAdapter>() + .Warn("UnServiced Cycle Name '{0}' in Pneumatics Actuations Map 0 Actuations returned", cycleName); + return cycleName; + } + + public IAuxPort Port() + { + return this; + } + + public NewtonMeter Initialize(NewtonMeter torque, PerSecond angularSpeed) + { + //PreviousState.TotalFuelConsumption = 0.SI<Kilogram>(); + PreviousState.AngularSpeed = angularSpeed; + CurrentState.AngularSpeed = angularSpeed; + if (AdditionalAux != null) { + AdditionalAux.Initialize(torque, angularSpeed); + } + PreviousState.PowerDemand = GetBusAuxPowerDemand(0.SI<Second>(), 1.SI<Second>(), torque, torque, angularSpeed); + return PreviousState.PowerDemand / angularSpeed; + } + + + public NewtonMeter TorqueDemand( + Second absTime, Second dt, NewtonMeter torquePowerTrain, NewtonMeter torqueEngine, + PerSecond angularSpeed, bool dryRun = false) + { + CurrentState.AngularSpeed = angularSpeed; + CurrentState.dt = dt; + CurrentState.PowerDemand = GetBusAuxPowerDemand(absTime, dt, torquePowerTrain, torqueEngine, angularSpeed, dryRun); + + var avgAngularSpeed = (CurrentState.AngularSpeed + PreviousState.AngularSpeed) / 2.0; + return CurrentState.PowerDemand / avgAngularSpeed; + } + + public Watt PowerDemandEngineOn(PerSecond engineSpeed) + { + throw new NotImplementedException(); + } + + public Watt PowerDemandEngineOff() + { + throw new NotImplementedException(); + } + + + protected internal void DoWriteModalResults(IModalDataContainer container) + { + //_fcMapAdapter.AllowExtrapolation = true; + // cycleStep has to be called here and not in DoCommit, write is called before Commit! + var message = String.Empty; + Auxiliaries.CycleStep(CurrentState.dt); + Log.Warn(message); + + //CurrentState.TotalFuelConsumption = Auxiliaries.TotalFuel; + container[ModalResultField.P_aux] = CurrentState.PowerDemand; container[ModalResultField.P_busAux_ES_HVAC] = Auxiliaries.HVACElectricalPowerConsumer; container[ModalResultField.P_busAux_ES_other] = Auxiliaries.ElectricPowerConsumer; @@ -187,131 +170,99 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl container[ModalResultField.P_busAux_HVACmech_consumer] = Auxiliaries.HVACMechanicalPowerConsumer; container[ModalResultField.P_busAux_HVACmech_gen] = Auxiliaries.HVACMechanicalPowerGenerated; + } + protected internal void DoCommitSimulationStep() + { + PreviousState = CurrentState; + CurrentState = new BusAuxState(); + } - //container[ModalResultField.AA_NonSmartAlternatorsEfficiency] = Auxiliaries.AA_NonSmartAlternatorsEfficiency; - //if (Auxiliaries.AA_SmartIdleCurrent_Amps != null) { - // container[ModalResultField.AA_SmartIdleCurrent_Amps] = Auxiliaries.AA_SmartIdleCurrent_Amps; - //} - //container[ModalResultField.AA_SmartIdleAlternatorsEfficiency] = Auxiliaries.AA_SmartIdleAlternatorsEfficiency; - //if (Auxiliaries.AA_SmartTractionCurrent_Amps != null) { - // container[ModalResultField.AA_SmartTractionCurrent_Amps] = - // Auxiliaries.AA_SmartTractionCurrent_Amps; - //} - //container[ModalResultField.AA_SmartTractionAlternatorEfficiency] = Auxiliaries.AA_SmartTractionAlternatorEfficiency; - //if (Auxiliaries.AA_SmartOverrunCurrent_Amps != null) { - // container[ModalResultField.AA_SmartOverrunCurrent_Amps] = Auxiliaries.AA_SmartOverrunCurrent_Amps; - //} - //container[ModalResultField.AA_SmartOverrunAlternatorEfficiency] = Auxiliaries.AA_SmartOverrunAlternatorEfficiency; - //if (Auxiliaries.AA_CompressorFlowRate_LitrePerSec != null) { - // container[ModalResultField.AA_CompressorFlowRate_LitrePerSec] = - // Auxiliaries.AA_CompressorFlowRate_LitrePerSec; - //} - //container[ModalResultField.BusAux_OverrunFlag] = Auxiliaries.AA_OverrunFlag; - //container[ModalResultField.AA_EngineIdleFlag] = Auxiliaries.AA_EngineIdleFlag; - //container[ModalResultField.AA_CompressorFlag] = Auxiliaries.AA_CompressorFlag; - //if (Auxiliaries.AA_TotalCycleFC_Grams != null) { - // container[ModalResultField.AA_TotalCycleFC_Grams] = Auxiliaries.AA_TotalCycleFC_Grams; - //} - //if (Auxiliaries.AA_AveragePowerDemandCrankHVACMechanicals != null) { - // container[ModalResultField.AA_AveragePowerDemandCrankHVACMechanicals] = - // Auxiliaries.AA_AveragePowerDemandCrankHVACMechanicals; - //} - //if (Auxiliaries.AA_AveragePowerDemandCrankHVACElectricals != null) { - // container[ModalResultField.AA_AveragePowerDemandCrankHVACElectricals] = - // Auxiliaries.AA_AveragePowerDemandCrankHVACElectricals; - //} - //if (Auxiliaries.AA_AveragePowerDemandCrankElectrics != null) { - // container[ModalResultField.AA_AveragePowerDemandCrankElectrics] = - // Auxiliaries.AA_AveragePowerDemandCrankElectrics; - //} - //if (Auxiliaries.AA_AveragePowerDemandCrankPneumatics != null) { - // container[ModalResultField.AA_AveragePowerDemandCrankPneumatics] = - // Auxiliaries.AA_AveragePowerDemandCrankPneumatics; + //protected internal KilogramPerSecond AAuxFuelConsumption + //{ + // get { return (CurrentState.TotalFuelConsumption - PreviousState.TotalFuelConsumption) / CurrentState.dt; } + //} + + private Watt GetBusAuxPowerDemand( + Second absTime, Second dt, NewtonMeter torquePowerTrain, NewtonMeter torqueEngine, + PerSecond angularSpeed, bool dryRun = false) + { + Auxiliaries.ResetCalculations(); + + //_fcMapAdapter.AllowExtrapolation = true; + + var signals = Auxiliaries.Signals; + + signals.SimulationInterval = dt; + signals.ClutchEngaged = DataBus.ClutchClosed(absTime); + signals.EngineDrivelineTorque = torquePowerTrain; + //Auxiliaries.Signals.EngineDrivelinePower = torquePowerTrain * angularSpeed; + //Auxiliaries.Signals.InternalEnginePower = torqueEngine * angularSpeed - DataBus.BrakePower; + //if (DataBus.DriverBehavior == DrivingBehavior.Coasting) { + // make sure smart aux are _not_ enabled for now + // set internal_engine_power a little bit lower so there is no excessive power for smart aux + //Auxiliaries.Signals.InternalEnginePower = 3 * torqueEngine * angularSpeed /*- DataBus.BrakePower*/; + + // if smart aux should be on during coasting use the following line + // set internal_engine_power to a large value (*10) so that there's excessive power for smart aux (alreadin during search operating point) + //(float)DataBus.EngineDragPower(angularSpeed).Value() / 100; + //} else { + // Toodo: change to driveraction + //if (DataBus.DriverBehavior != DrivingBehavior.Braking) { + // Auxiliaries.Signals.InternalEnginePower = 0.SI<Watt>(); + + // //(float)((0.9 * torqueEngine * angularSpeed - DataBus.BrakePower) / 1000).Value(); + //} else { + // // smart aux should be on during braking //} - //if (Auxiliaries.AA_TotalCycleFuelConsumptionCompressorOff != null) { - // container[ModalResultField.AA_TotalCycleFuelConsumptionCompressorOff] = - // Auxiliaries.AA_TotalCycleFuelConsumptionCompressorOff; //} - //container[ModalResultField.AA_TotalCycleFuelConsumptionCompressorOn] = - // Auxiliaries.AA_TotalCycleFuelConsumptionCompressorOn; + //Auxiliaries.Signals.EngineMotoringPower = -DataBus.EngineDragPower(angularSpeed); + + signals.EngineSpeed = angularSpeed; + var avgAngularSpeed = (PreviousState.AngularSpeed + CurrentState.AngularSpeed) / 2; + signals.PreExistingAuxPower = AdditionalAux != null + ? AdditionalAux.TorqueDemand(absTime, dt, torquePowerTrain, torqueEngine, angularSpeed, dryRun) * avgAngularSpeed + : 0.SI<Watt>(); + + //var avgEngineSpeed = (DataBus.EngineSpeed + angularSpeed) / 2.0; + var drivetrainPower = torquePowerTrain * avgAngularSpeed; + + signals.ExcessiveDragPower = DataBus.DrivingAction == DrivingAction.Brake ? + drivetrainPower - (DataBus.EngineDragPower(avgAngularSpeed) - signals.PreExistingAuxPower) - DataBus.BrakePower: + 0.SI<Watt>(); + + + + //mAAUX_Global.PreExistingAuxPower; + signals.Idle = DataBus.VehicleStopped; + signals.InNeutral = DataBus.Gear == 0; + + //Auxiliaries.Signals.RunningCalc = true; + + //mAAUX_Global.Internal_Engine_Power; + //'Power coming out of Advanced Model is in Watts. + + return Auxiliaries.AuxiliaryPowerAtCrankWatts + signals.PreExistingAuxPower; } - protected internal void DoCommitSimulationStep() - { - PreviousState = CurrentState; - CurrentState = new BusAuxState(); - } - - //protected internal KilogramPerSecond AAuxFuelConsumption - //{ - // get { return (CurrentState.TotalFuelConsumption - PreviousState.TotalFuelConsumption) / CurrentState.dt; } - //} - - private Watt GetBusAuxPowerDemand(Second absTime, Second dt, NewtonMeter torquePowerTrain, NewtonMeter torqueEngine, - PerSecond angularSpeed, bool dryRun = false) - { - Auxiliaries.ResetCalculations(); - - _fcMapAdapter.AllowExtrapolation = true; - - Auxiliaries.Signals.SimulationInterval = dt; - Auxiliaries.Signals.ClutchEngaged = DataBus.ClutchClosed(absTime); - Auxiliaries.Signals.EngineDrivelinePower = torquePowerTrain * angularSpeed; - Auxiliaries.Signals.EngineDrivelineTorque = torquePowerTrain; - Auxiliaries.Signals.InternalEnginePower = torqueEngine * angularSpeed - DataBus.BrakePower; - if (DataBus.DriverBehavior == DrivingBehavior.Coasting) { - // make sure smart aux are _not_ enabled for now - // set internal_engine_power a little bit lower so there is no excessive power for smart aux - Auxiliaries.Signals.InternalEnginePower = 0.9 * torqueEngine * angularSpeed /*- DataBus.BrakePower*/; - // if smart aux should be on during coasting use the following line - // set internal_engine_power to a large value (*10) so that there's excessive power for smart aux (alreadin during search operating point) - //(float)DataBus.EngineDragPower(angularSpeed).Value() / 100; - } else { - // Toodo: change to driveraction - if (DataBus.DriverBehavior != DrivingBehavior.Braking) { - Auxiliaries.Signals.InternalEnginePower = 0.SI<Watt>(); - //(float)((0.9 * torqueEngine * angularSpeed - DataBus.BrakePower) / 1000).Value(); - } else { - // smart aux should be on during braking - } - } - Auxiliaries.Signals.EngineMotoringPower = -DataBus.EngineDragPower(angularSpeed); - Auxiliaries.Signals.EngineSpeed = angularSpeed; - var avgAngularSpeed = (PreviousState.AngularSpeed + CurrentState.AngularSpeed) / 2; - Auxiliaries.Signals.PreExistingAuxPower = AdditionalAux != null - ? AdditionalAux.TorqueDemand(absTime, dt, torquePowerTrain, torqueEngine, angularSpeed, dryRun) * avgAngularSpeed - : 0.SI<Watt>(); - //mAAUX_Global.PreExistingAuxPower; - Auxiliaries.Signals.Idle = DataBus.VehicleStopped; - Auxiliaries.Signals.InNeutral = DataBus.Gear == 0; - //Auxiliaries.Signals.RunningCalc = true; - - //mAAUX_Global.Internal_Engine_Power; - //'Power coming out of Advanced Model is in Watts. - - return Auxiliaries.AuxiliaryPowerAtCrankWatts + Auxiliaries.Signals.PreExistingAuxPower; - } - - protected class FuelConsumptionAdapter : IFuelConsumptionMap - { - protected internal FuelConsumptionMap FcMap; + protected class FuelConsumptionAdapter : IFuelConsumptionMap + { + protected internal FuelConsumptionMap FcMap; public bool AllowExtrapolation { get; set; } - public KilogramPerSecond GetFuelConsumptionValue(NewtonMeter torque, PerSecond angularVelocity) - { - return FcMap.GetFuelConsumption(torque, angularVelocity, AllowExtrapolation).Value; - } - + public KilogramPerSecond GetFuelConsumptionValue(NewtonMeter torque, PerSecond angularVelocity) + { + return FcMap.GetFuelConsumption(torque, angularVelocity, AllowExtrapolation).Value; + } } - public class BusAuxState - { - public Second dt; - public PerSecond AngularSpeed; - public Watt PowerDemand; - public Kilogram TotalFuelConsumption = 0.SI<Kilogram>(); - } - } -} \ No newline at end of file + public class BusAuxState + { + public Second dt; + public PerSecond AngularSpeed; + public Watt PowerDemand; + public Kilogram TotalFuelConsumption = 0.SI<Kilogram>(); + } + } +} diff --git a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport.cs b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport.cs index 1fb2632afec68830ab3d1f31567993c3da781206..4850ec9a210ef3ccec8e1a4e7bfeeb770e04e72d 100644 --- a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport.cs +++ b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport.cs @@ -312,6 +312,8 @@ namespace TUGraz.VectoCore.OutputData.XML { Tuple.Create(MissionType.HeavyUrban, LoadingType.ReferenceLoad), 0 }, { Tuple.Create(MissionType.Urban, LoadingType.LowLoading), 0 }, { Tuple.Create(MissionType.Urban, LoadingType.ReferenceLoad), 0 }, + { Tuple.Create(MissionType.Suburban, LoadingType.LowLoading), 0 }, + { Tuple.Create(MissionType.Suburban, LoadingType.ReferenceLoad), 0 }, { Tuple.Create(MissionType.Interurban, LoadingType.LowLoading), 0 }, { Tuple.Create(MissionType.Interurban, LoadingType.ReferenceLoad), 0 }, { Tuple.Create(MissionType.Coach, LoadingType.LowLoading), 0 }, diff --git a/VectoCore/VectoCore/Resources/XSD/VectoDeclarationDefinitions.2.6_Buses.xsd b/VectoCore/VectoCore/Resources/XSD/VectoDeclarationDefinitions.2.6_Buses.xsd index f9eb90d2914a18fdb583c1637108656aacfcb9e8..07e7ca455602c0ec9b01da2652a032936502cd98 100644 --- a/VectoCore/VectoCore/Resources/XSD/VectoDeclarationDefinitions.2.6_Buses.xsd +++ b/VectoCore/VectoCore/Resources/XSD/VectoDeclarationDefinitions.2.6_Buses.xsd @@ -266,33 +266,22 @@ </xs:complexType> </xs:element> <xs:element name="SmartElectrics" type="xs:boolean"/> - <xs:element name="ResultCards" minOccurs="0"> - <xs:complexType> - <xs:sequence> - <xs:element name="Idle"> - <xs:complexType> - <xs:sequence> - <xs:element name="Entry" type="tns:ResultCardEntryType" minOccurs="2" maxOccurs="unbounded"/> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:element name="Traction"> - <xs:complexType> - <xs:sequence> - <xs:element name="Entry" type="tns:ResultCardEntryType" minOccurs="2" maxOccurs="unbounded"/> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:element name="Overrun"> - <xs:complexType> - <xs:sequence> - <xs:element name="Entry" type="tns:ResultCardEntryType" minOccurs="2" maxOccurs="unbounded"/> - </xs:sequence> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - </xs:element> + <xs:sequence minOccurs="0"> + <xs:element name="MaxAlternatorPower"> + <xs:simpleType> + <xs:restriction base="xs:int"> + <xs:minExclusive value="0"/> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="ElectricStorageCapacity"> + <xs:simpleType> + <xs:restriction base="xs:int"> + <xs:minExclusive value="0"/> + </xs:restriction> + </xs:simpleType> + </xs:element> + </xs:sequence> </xs:sequence> </xs:complexType> </xs:element> @@ -632,4 +621,29 @@ <xs:enumeration value="mechanically"/> </xs:restriction> </xs:simpleType> + <xs:complexType name="ResultCardsType"> + <xs:sequence> + <xs:element name="Idle"> + <xs:complexType> + <xs:sequence> + <xs:element name="Entry" type="tns:ResultCardEntryType" minOccurs="2" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="Traction"> + <xs:complexType> + <xs:sequence> + <xs:element name="Entry" type="tns:ResultCardEntryType" minOccurs="2" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="Overrun"> + <xs:complexType> + <xs:sequence> + <xs:element name="Entry" type="tns:ResultCardEntryType" minOccurs="2" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> </xs:schema> diff --git a/VectoCore/VectoCoreTest/FileIO/JsonReadTest.cs b/VectoCore/VectoCoreTest/FileIO/JsonReadTest.cs index f1d73bf4186bcda2901705bea0ce404788a30da3..b9975eb8c17d448f54a547c0d6e98c223855a0a0 100644 --- a/VectoCore/VectoCoreTest/FileIO/JsonReadTest.cs +++ b/VectoCore/VectoCoreTest/FileIO/JsonReadTest.cs @@ -493,13 +493,13 @@ namespace TUGraz.VectoCore.Tests.FileIO Assert.AreEqual(1, busAux.ElectricSupply.Alternators[0].Ratio); Assert.AreEqual(false, busAux.ElectricSupply.SmartElectrics); - Assert.AreEqual(3, busAux.ElectricSupply.ResultCards.Idle.Count); - Assert.AreEqual(0, busAux.ElectricSupply.ResultCards.Idle[0].Current.Value()); - Assert.AreEqual(20, busAux.ElectricSupply.ResultCards.Idle[1].Current.Value()); - Assert.AreEqual(50, busAux.ElectricSupply.ResultCards.Idle[2].Current.Value()); - Assert.AreEqual(0, busAux.ElectricSupply.ResultCards.Idle[0].SmartCurrent.Value()); - Assert.AreEqual(25, busAux.ElectricSupply.ResultCards.Idle[1].SmartCurrent.Value()); - Assert.AreEqual(60, busAux.ElectricSupply.ResultCards.Idle[2].SmartCurrent.Value()); + //Assert.AreEqual(3, busAux.ElectricSupply.ResultCards.Idle.Count); + //Assert.AreEqual(0, busAux.ElectricSupply.ResultCards.Idle[0].Current.Value()); + //Assert.AreEqual(20, busAux.ElectricSupply.ResultCards.Idle[1].Current.Value()); + //Assert.AreEqual(50, busAux.ElectricSupply.ResultCards.Idle[2].Current.Value()); + //Assert.AreEqual(0, busAux.ElectricSupply.ResultCards.Idle[0].SmartCurrent.Value()); + //Assert.AreEqual(25, busAux.ElectricSupply.ResultCards.Idle[1].SmartCurrent.Value()); + //Assert.AreEqual(60, busAux.ElectricSupply.ResultCards.Idle[2].SmartCurrent.Value()); Assert.AreEqual("", busAux.PneumaticSupply.CompressorSize); Assert.AreEqual(1.0, busAux.PneumaticSupply.Ratio); diff --git a/VectoCore/VectoCoreTest/Integration/BusAuxiliaries/AuxDemandTest.cs b/VectoCore/VectoCoreTest/Integration/BusAuxiliaries/AuxDemandTest.cs index a85bdaa0bb23d7c3c7574659dbb72cd100d5305f..8066b93f442f812e2da4de588bc4111f23a0c50e 100644 --- a/VectoCore/VectoCoreTest/Integration/BusAuxiliaries/AuxDemandTest.cs +++ b/VectoCore/VectoCoreTest/Integration/BusAuxiliaries/AuxDemandTest.cs @@ -164,8 +164,7 @@ namespace TUGraz.VectoCore.Tests.Integration.BusAuxiliaries var brakes = new MockBrakes(vehicle); var veh = new MockVehicle(vehicle) { MyVehicleSpeed = 50.KMPHtoMeterPerSecond() }; var auxConfig = BusAuxiliaryInputData.ReadBusAuxiliaries(auxFilePath, vehicle.RunData.VehicleData); - var busAux = new BusAuxiliariesAdapter(vehicle, auxConfig, "Coach", vehicle.RunData.VehicleData.TotalVehicleMass, - fcMap, modelData.IdleSpeed); + var busAux = new BusAuxiliariesAdapter(vehicle, auxConfig); return busAux; } } diff --git a/VectoCore/VectoCoreTest/Integration/CoachAdvancedAuxPowertrain.cs b/VectoCore/VectoCoreTest/Integration/CoachAdvancedAuxPowertrain.cs index f8af554f2366893939cd626ce3d9bb46b5873ac8..b51daed36a931570a49d7ab7d0f5aa21953173e4 100644 --- a/VectoCore/VectoCoreTest/Integration/CoachAdvancedAuxPowertrain.cs +++ b/VectoCore/VectoCoreTest/Integration/CoachAdvancedAuxPowertrain.cs @@ -115,8 +115,7 @@ namespace TUGraz.VectoCore.Tests.Integration .AddComponent(new Clutch(container, engineData)) .AddComponent(engine); - var aux = new BusAuxiliariesAdapter(container, runData.BusAuxiliaries, "Coach", - vehicleData.TotalVehicleMass, engineData.Fuels.First().ConsumptionMap, engineData.IdleSpeed); + var aux = new BusAuxiliariesAdapter(container, runData.BusAuxiliaries); engine.Connect(aux.Port()); diff --git a/VectoCore/VectoCoreTest/Models/Declaration/BusFactoryTest.cs b/VectoCore/VectoCoreTest/Models/Declaration/BusFactoryTest.cs index de7dbf47475bec28a796e0fcb720c5a37b92b3bb..593509ca199c4019a4068f8e8ccd8bb942562e92 100644 --- a/VectoCore/VectoCoreTest/Models/Declaration/BusFactoryTest.cs +++ b/VectoCore/VectoCoreTest/Models/Declaration/BusFactoryTest.cs @@ -29,7 +29,7 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration [TestCase()] public void CreateRunDataPrimaryBus() { - var runIdx = 2; + var runIdx = 4; var jobFile = @"TestData\XML\XMLReaderDeclaration\SchemaVersion2.6_Buses\vecto_vehicle-primary_heavyBus.xml"; var writer = new FileOutputWriter(jobFile);