diff --git a/VectoCore/VectoCore/InputData/Reader/ComponentData/BatteryInternalResistanceReader.cs b/VectoCore/VectoCore/InputData/Reader/ComponentData/BatteryInternalResistanceReader.cs index b58c25fd1f8a48e7eb01a3a995443bfe863035d9..7b2d8ecac31e762d06f87506504972ae27bf36a1 100644 --- a/VectoCore/VectoCore/InputData/Reader/ComponentData/BatteryInternalResistanceReader.cs +++ b/VectoCore/VectoCore/InputData/Reader/ComponentData/BatteryInternalResistanceReader.cs @@ -13,7 +13,7 @@ namespace TUGraz.VectoCore.InputData.Reader.ComponentData { public static class BatteryInternalResistanceReader { - public static InternalResistanceMap Create(DataTable data, bool inmOhm) + public static InternalResistanceMap Create(DataTable data, bool inputInMiliOhm) { if (!(data.Columns.Count == 2 || data.Columns.Count == 4 || data.Columns.Count == 5)) { throw new VectoException( @@ -54,7 +54,7 @@ namespace TUGraz.VectoCore.InputData.Reader.ComponentData Tuple.Create(20.SI<Second>(), Fields.InternalResistance_20), }; if (data.Columns.Count == col1.Length + 1) { - return ReadInternalResistanceMap(data, col1, inmOhm); + return ReadInternalResistanceMap(data, col1, inputInMiliOhm); } var col2 = new[] { @@ -64,14 +64,14 @@ namespace TUGraz.VectoCore.InputData.Reader.ComponentData Tuple.Create(120.SI<Second>(), Fields.InternalResistance_120) }; if (data.Columns.Count == col2.Length + 1) { - return ReadInternalResistanceMap(data, col2, inmOhm); + return ReadInternalResistanceMap(data, col2, inputInMiliOhm); } throw new VectoException("Failed to read InternalResistanceMap"); } - private static InternalResistanceMap ReadInternalResistanceMap(DataTable data, Tuple<Second, string>[] col1, bool inmOhm) + private static InternalResistanceMap ReadInternalResistanceMap(DataTable data, Tuple<Second, string>[] col1, bool inputInMilliOhm) { if ((!data.Columns.Contains(Fields.StateOfCharge) || !col1.All(x => data.Columns.Contains(x.Item2)))) { for (var i = 0; i < col1.Length; i++) { @@ -83,10 +83,10 @@ namespace TUGraz.VectoCore.InputData.Reader.ComponentData data.Columns.Cast<DataColumn>().Select(c => c.ColumnName).Join()); } - var factor = inmOhm ? 1000 : 1; + var factor = inputInMilliOhm ? 1000 : 1; return new InternalResistanceMap(data.Rows.Cast<DataRow>().Select(row => { var values = col1.Select(x => - row.Table.Columns.Contains(x.Item2) ? Tuple.Create(x.Item1, row.ParseDouble(x.Item2).SI<Ohm>() * factor) : null) + row.Table.Columns.Contains(x.Item2) ? Tuple.Create(x.Item1, row.ParseDouble(x.Item2).SI<Ohm>() / factor) : null) .Where(x => x != null).ToList(); return new InternalResistanceMap.InternalResistanceMapEntry() { SoC = row.ParseDouble(Fields.StateOfCharge) / 100, @@ -111,9 +111,9 @@ namespace TUGraz.VectoCore.InputData.Reader.ComponentData } - public static InternalResistanceMap Create(Stream data, bool inmOhm) + public static InternalResistanceMap Create(Stream data, bool inputInMiliOhm) { - return Create(VectoCSVFile.ReadStream(data), inmOhm); + return Create(VectoCSVFile.ReadStream(data), inputInMiliOhm); } } } \ No newline at end of file diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs index ee811d9e572968afc42f26a29341886f4a1652df..c710e6e8973625354ae4e95ad235f02ad2cecdd3 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs @@ -461,9 +461,9 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter var fanDemand = pwrICEOn - pwrICEOffDriving; var auxList = new List<VectoRunData.AuxData>() { - new VectoRunData.AuxData { ID = Constants.Auxiliaries.IDs.ENG_AUX_MECH_BASE, DemandType = AuxiliaryDemandType.Constant, PowerDemand = baseDemand}, - new VectoRunData.AuxData { ID = Constants.Auxiliaries.IDs.ENG_AUX_MECH_STP, DemandType = AuxiliaryDemandType.Constant, PowerDemand = stpDemand}, - new VectoRunData.AuxData { ID = Constants.Auxiliaries.IDs.ENG_AUX_MECH_FAN, DemandType = AuxiliaryDemandType.Constant, PowerDemand = fanDemand}, + new VectoRunData.AuxData { ID = Constants.Auxiliaries.IDs.ENG_AUX_MECH_BASE, DemandType = AuxiliaryDemandType.Constant, PowerDemandMech = baseDemand}, + new VectoRunData.AuxData { ID = Constants.Auxiliaries.IDs.ENG_AUX_MECH_STP, DemandType = AuxiliaryDemandType.Constant, PowerDemandMech = stpDemand}, + new VectoRunData.AuxData { ID = Constants.Auxiliaries.IDs.ENG_AUX_MECH_FAN, DemandType = AuxiliaryDemandType.Constant, PowerDemandMech = fanDemand}, }; return auxList; diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/HeavyLorry/DeclarationDataAdapterHeavyLorry.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/HeavyLorry/DeclarationDataAdapterHeavyLorry.cs index 08b8fdce662830d66b48b8de62c1486049b98115..3d73aadf25344e5a9785db4802fe3726420be155 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/HeavyLorry/DeclarationDataAdapterHeavyLorry.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/HeavyLorry/DeclarationDataAdapterHeavyLorry.cs @@ -310,6 +310,9 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter.HeavyLorry private readonly GearboxDataAdapter _gearboxDataAdapter = new GearboxDataAdapter(null); private readonly ElectricStorageAdapter _electricStorageAdapter = new ElectricStorageAdapter(); private readonly ElectricMachinesDataAdapter _electricMachineAdapter = new ElectricMachinesDataAdapter(); + + private readonly HeavyLorryPEVAuxiliaryDataAdapter + _auxDataAdapter = new HeavyLorryPEVAuxiliaryDataAdapter(); public override GearboxData CreateGearboxData(IVehicleDeclarationInputData inputData, VectoRunData runData, IShiftPolygonCalculator shiftPolygonCalc) { @@ -327,7 +330,8 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter.HeavyLorry MissionType missionType, VehicleClass vehicleClass, Meter vehicleLength, int? numSteeredAxles, VectoSimulationJobType jobType) { - throw new NotImplementedException(); + return _auxDataAdapter.CreateAuxiliaryData(auxData, null, missionType, vehicleClass, vehicleLength, numSteeredAxles, + jobType); } public override IList<Tuple<PowertrainPosition, ElectricMotorData>> CreateElectricMachines(IElectricMachinesDeclarationInputData electricMachines, IDictionary<PowertrainPosition, IList<Tuple<Volt, TableData>>> torqueLimits, diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/SimulationComponents/AuxiliaryDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/SimulationComponents/AuxiliaryDataAdapter.cs index 284f1f12d3ecf4b17e1757a333e3d19dbd3ab067..b9bcede1135e54477653fb09eeee3aebd54c7003 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/SimulationComponents/AuxiliaryDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/SimulationComponents/AuxiliaryDataAdapter.cs @@ -135,6 +135,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter.SimulationComponen { DemandType = AuxiliaryDemandType.Constant, Technology = auxData.Technology, + MissionType = mission, }; mission = mission.GetNonEMSMissionType(); @@ -160,14 +161,17 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter.SimulationComponen } + + return retVal; } private static void AddElectricSystem(MissionType mission, VectoRunData.AuxData aux, IAuxiliaryDeclarationInputData auxData, List<VectoRunData.AuxData> auxDataList) { - aux.PowerDemand = DeclarationData.ElectricSystem.Lookup(mission, auxData.Technology.FirstOrDefault()).PowerDemand; + aux.PowerDemandMech = DeclarationData.ElectricSystem.Lookup(mission, auxData.Technology.FirstOrDefault()).PowerDemand; aux.ID = Constants.Auxiliaries.IDs.ElectricSystem; + auxDataList.Add(aux); } private static void AddPneumaticSystem(MissionType mission, VectoSimulationJobType jobType, @@ -179,18 +183,21 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter.SimulationComponen $"Pneumatic system technology'{auxData.Technology.FirstOrDefault()}' is not applicable for '{jobType}'"); } - aux.PowerDemand = DeclarationData.PneumaticSystem.Lookup(mission, auxData.Technology.FirstOrDefault()) + aux.PowerDemandMech = DeclarationData.PneumaticSystem.Lookup(mission, auxData.Technology.FirstOrDefault()) .PowerDemand; aux.ID = Constants.Auxiliaries.IDs.PneumaticSystem; + aux.IsFullyElectric = DeclarationData.PneumaticSystem.IsFullyElectric(auxData.Technology.FirstOrDefault()); + auxDataList.Add(aux); } private static void AddHVAC(MissionType mission, VehicleClass hdvClass, VectoRunData.AuxData aux, IAuxiliaryDeclarationInputData auxData, List<VectoRunData.AuxData> auxDataList) { - aux.PowerDemand = DeclarationData.HeatingVentilationAirConditioning.Lookup( + aux.PowerDemandMech = DeclarationData.HeatingVentilationAirConditioning.Lookup( mission, auxData.Technology.FirstOrDefault(), hdvClass).PowerDemand; aux.ID = Constants.Auxiliaries.IDs.HeatingVentilationAirCondition; + auxDataList.Add(aux); return; } @@ -218,9 +225,10 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter.SimulationComponen DemandType = AuxiliaryDemandType.Constant, Technology = auxData.Technology.Where(tech => !DeclarationData.SteeringPump.IsFullyElectric(tech)) .ToList(), - IsFullyElectric = true, + IsFullyElectric = false, ID = Constants.Auxiliaries.IDs.SteeringPump, - PowerDemand = powerDemand.mech, + PowerDemandMech = powerDemand.mech, + MissionType = mission, }; auxDataList.Add(spMech); @@ -234,7 +242,8 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter.SimulationComponen .ToList(), IsFullyElectric = true, ID = Constants.Auxiliaries.IDs.SteeringPump_el, - PowerDemand = powerDemand.electric + PowerDemandMech = powerDemand.electric, + MissionType = mission, }; auxDataList.Add(spElectric); @@ -254,7 +263,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter.SimulationComponen - aux.PowerDemand = DeclarationData.Fan.LookupPowerDemand(hdvClass, mission, auxData.Technology.FirstOrDefault()); + aux.PowerDemandMech = DeclarationData.Fan.LookupPowerDemand(hdvClass, mission, auxData.Technology.FirstOrDefault()); aux.ID = Constants.Auxiliaries.IDs.Fan; aux.IsFullyElectric = DeclarationData.Fan.IsFullyElectric(hdvClass, auxData.Technology.FirstOrDefault()); @@ -670,7 +679,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter.SimulationComponen DemandType = AuxiliaryDemandType.Constant, Technology = new List<string>() { busAuxData.FanTechnology }, ID = Constants.Auxiliaries.IDs.Fan, - PowerDemand = DeclarationData.Fan.LookupMechanicalPowerDemand(hdvClass, mission, busAuxData.FanTechnology) + PowerDemandMech = DeclarationData.Fan.LookupMechanicalPowerDemand(hdvClass, mission, busAuxData.FanTechnology) }); retVal.Add( new VectoRunData.AuxData() @@ -678,7 +687,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter.SimulationComponen DemandType = AuxiliaryDemandType.Constant, Technology = busAuxData.SteeringPumpTechnology, ID = Constants.Auxiliaries.IDs.SteeringPump, - PowerDemand = DeclarationData.SteeringPumpBus.LookupMechanicalPowerDemand( + PowerDemandMech = DeclarationData.SteeringPumpBus.LookupMechanicalPowerDemand( mission, busAuxData.SteeringPumpTechnology, vehicleLength) }); return retVal; diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/SimulationComponents/BatteryDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/SimulationComponents/BatteryDataAdapter.cs index 35e85a25fcea011c0d16ccec1b1091e9c0d8755a..2fa8be26d93d08f9160a4753749a58354866836e 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/SimulationComponents/BatteryDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/SimulationComponents/BatteryDataAdapter.cs @@ -52,7 +52,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter.SimulationComponen MaxCurrent = BatteryMaxCurrentReader.Create(b.MaxCurrentMap), Capacity = b.Capacity, InternalResistance = - BatteryInternalResistanceReader.Create(b.InternalResistanceCurve, false), + BatteryInternalResistanceReader.Create(b.InternalResistanceCurve, true), SOCMap = BatterySOCReader.Create(b.VoltageCurve), }; @@ -69,7 +69,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter.SimulationComponen private double CalculateInitialSoc(BatterySystemData battery) { var socLimits = battery.GetSocLimits(); - return (socLimits.MaxSoc - socLimits.MinSoc) / 2; + return (socLimits.MaxSoc + socLimits.MinSoc) / 2; } public SuperCapData CreateSuperCapData(IElectricStorageSystemDeclarationInputData reessInputData) diff --git a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationMode/HeavyLorryRunDataFactory/DeclarationModeHeavyLorryRunDataFactory.cs b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationMode/HeavyLorryRunDataFactory/DeclarationModeHeavyLorryRunDataFactory.cs index ad657b379bf29bf7b5fc3745263fe2b72ae7fb21..6b5698812f1afda8f5e3fd467f78fb4a14a1298e 100644 --- a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationMode/HeavyLorryRunDataFactory/DeclarationModeHeavyLorryRunDataFactory.cs +++ b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationMode/HeavyLorryRunDataFactory/DeclarationModeHeavyLorryRunDataFactory.cs @@ -392,11 +392,9 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl.DeclarationMode.HeavyLorryRunDa } - - - - result.Aux = new List<VectoRunData.AuxData>(); //TODO: Remove - + result.Aux = DataAdapter.CreateAuxiliaryData(vehicle.Components.AuxiliaryInputData, null, + mission.MissionType, _segment.VehicleClass, vehicle.Length, + vehicle.Components.AxleWheels.NumSteeredAxles, vehicle.VehicleType); diff --git a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationVTPModeVectoRunDataFactoryHeavyBusPrimary.cs b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationVTPModeVectoRunDataFactoryHeavyBusPrimary.cs index 3727c1dc0e4b9bed63bf814d350fd7c6a00db3ef..a57aeaa4201f572b87b50211de79d3b36e83fb3e 100644 --- a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationVTPModeVectoRunDataFactoryHeavyBusPrimary.cs +++ b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationVTPModeVectoRunDataFactoryHeavyBusPrimary.cs @@ -137,7 +137,7 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl DemandType = AuxiliaryDemandType.Constant, Technology = JobInputData.Vehicle.Components.BusAuxiliaries.SteeringPumpTechnology, ID = Constants.Auxiliaries.IDs.SteeringPump, - PowerDemand = spPowerDemand + PowerDemandMech = spPowerDemand }); retVal.Add( @@ -146,14 +146,14 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl DemandType = AuxiliaryDemandType.Constant, Technology = new List<string>() { "default" }, ID = Constants.Auxiliaries.IDs.ElectricSystem, - PowerDemand = Constants.BusAuxiliaries.ElectricSystem.PowernetVoltage * 32.4.SI<Ampere>() / electricEfficiency + PowerDemandMech = Constants.BusAuxiliaries.ElectricSystem.PowernetVoltage * 32.4.SI<Ampere>() / electricEfficiency }); retVal.Add(new VectoRunData.AuxData() { DemandType = AuxiliaryDemandType.Constant, Technology = new List<string>() { "default" }, ID = Constants.Auxiliaries.IDs.HeatingVentilationAirCondition, - PowerDemand = 350.SI<Watt>() + PowerDemandMech = 350.SI<Watt>() }); var busAux = vehicle.Components.BusAuxiliaries; @@ -163,7 +163,7 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl DemandType = AuxiliaryDemandType.Direct, Technology = new List<string>() { busAux.PneumaticSupply.CompressorSize + " / " + busAux.PneumaticSupply.Clutch }, ID = Constants.Auxiliaries.IDs.PneumaticSystem, - PowerDemandFunc = cycleEntry => + PowerDemandMechFunc = cycleEntry => { var cmp = psCompressor.Interpolate(cycleEntry.EngineSpeed * busAux.PneumaticSupply.Ratio); return cycleEntry.VTPPSCompressorActive ? cmp.PowerOn : cmp.PowerOff; @@ -177,7 +177,7 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl DemandType = AuxiliaryDemandType.Direct, Technology = new List<string>() { "default" }, ID = Constants.Auxiliaries.IDs.Fan, - PowerDemandFunc = cycleEntry => engineFan.PowerDemand(cycleEntry.FanSpeed) + PowerDemandMechFunc = cycleEntry => engineFan.PowerDemand(cycleEntry.FanSpeed) }); return retVal; diff --git a/VectoCore/VectoCore/Models/Declaration/Auxiliaries/AbstractAuxiliaryVehicleArchitectureLookup.cs b/VectoCore/VectoCore/Models/Declaration/Auxiliaries/AbstractAuxiliaryVehicleArchitectureLookup.cs index 2043b8635dff27b1dc15b0c6f0414f023e39b583..6d97292cf24875f10b4efa5e2a66885997612049 100644 --- a/VectoCore/VectoCore/Models/Declaration/Auxiliaries/AbstractAuxiliaryVehicleArchitectureLookup.cs +++ b/VectoCore/VectoCore/Models/Declaration/Auxiliaries/AbstractAuxiliaryVehicleArchitectureLookup.cs @@ -47,7 +47,7 @@ namespace TUGraz.VectoCore.Models.Declaration.Auxiliaries public bool IsApplicable(VectoSimulationJobType simType, string technology) { if (!GetTechnologies().Contains(technology)) { - throw new VectoException($"Auxiliary Lookup Error: Unknown technology: '{technology}'"); + throw new VectoException($"Auxiliary Lookup Error: Unknown technology: '{technology}' valid technologies are '{string.Join(",", GetTechnologies())}'"); } if (!ArchitectureNameMapping.ContainsKey(simType)) { diff --git a/VectoCore/VectoCore/Models/Declaration/Auxiliaries/SteeringPump.cs b/VectoCore/VectoCore/Models/Declaration/Auxiliaries/SteeringPump.cs index 45e9f6e6f70dc8bc3da5c309aee34bac8e01957c..d4ed26a400da29b6fe2613a47e7ae2554ea73a97 100644 --- a/VectoCore/VectoCore/Models/Declaration/Auxiliaries/SteeringPump.cs +++ b/VectoCore/VectoCore/Models/Declaration/Auxiliaries/SteeringPump.cs @@ -55,34 +55,38 @@ namespace TUGraz.VectoCore.Models.Declaration.Auxiliaries var powerEl = new SteeringPumpValues<Watt>(0.SI<Watt>(), 0.SI<Watt>(), 0.SI<Watt>()); var factorsMech = new SteeringPumpValues<double>(0, 0, 0); var factorsEl = new SteeringPumpValues<double>(0, 0, 0); - var i = 0; + var axleCount = 0; var numberMech = 0; var numberEl = 0; if (!technologies.Any()) { throw new VectoException("No technology specified for steering pump"); } foreach (var technology in technologies) { - i++; + + if (!_techLookup.GetTechnologies().Contains(technology)) + { + throw new VectoException($"Steering pump technology '{technology}' not found"); + } + axleCount++; - var axles = _axleLookup.Lookup(mission, i); + var axles = _axleLookup.Lookup(mission, axleCount); var f = _techLookup.Lookup(technology, mission); - if (!_techLookup.GetTechnologies().Contains(technology)) { - throw new VectoException($"Steering pump technology '{technology}' not found"); - } + if (_techLookup.IsFullyElectric(technology)) { numberEl++; + powerEl.UnloadedFriction += baseLine.UnloadedFriction * axles.UnloadedFriction; powerEl.Banking += baseLine.Banking * axles.Banking; powerEl.Steering += baseLine.Steering * axles.Steering; - factorsEl.UnloadedFriction += f.UnloadedFriction; factorsEl.Banking += f.Banking; factorsEl.Steering += f.Steering; } else { numberMech++; + powerMech.UnloadedFriction += baseLine.UnloadedFriction * axles.UnloadedFriction; powerMech.Banking += baseLine.Banking * axles.Banking; powerMech.Steering += baseLine.Steering * axles.Steering; @@ -104,10 +108,9 @@ namespace TUGraz.VectoCore.Models.Declaration.Auxiliaries powerEl.Banking *= factorsEl.Banking / numberEl; powerEl.Steering *= factorsEl.Steering / numberEl; } - - - return (powerMech.UnloadedFriction + powerMech.Banking + powerMech.Steering, powerEl.UnloadedFriction + powerEl.Banking + powerEl.Steering); + return (powerMech.UnloadedFriction + powerMech.Banking + powerMech.Steering, + powerEl.UnloadedFriction + powerEl.Banking + powerEl.Steering); } public bool IsApplicable(IEnumerable<string> technologies, VectoSimulationJobType jobType) diff --git a/VectoCore/VectoCore/Models/Simulation/Data/ModalResult.cs b/VectoCore/VectoCore/Models/Simulation/Data/ModalResult.cs index 25a003a7c49f2edf0b6f52342f754cb51d6f905e..85d03318d55999b61e93c11ce9a1e744be53573d 100644 --- a/VectoCore/VectoCore/Models/Simulation/Data/ModalResult.cs +++ b/VectoCore/VectoCore/Models/Simulation/Data/ModalResult.cs @@ -41,6 +41,7 @@ using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.InputData.Reader.Impl; +using TUGraz.VectoCore.Models.Connector.Ports.Impl; using TUGraz.VectoCore.Models.Simulation.DataBus; using TUGraz.VectoCore.Models.SimulationComponent; using TUGraz.VectoCore.Models.SimulationComponent.Data; @@ -319,7 +320,12 @@ namespace TUGraz.VectoCore.Models.Simulation.Data public static readonly ModalResultField[] DCDCConverterSignals = { ModalResultField.P_DCDC_In, ModalResultField.P_DCDC_Out, - ModalResultField.P_DCDC_missing + ModalResultField.P_DCDC_missing, + + //Debug + ModalResultField.DCDCStateCount_, + ModalResultField.SimIntervalCurrent_, + ModalResultField.SimIntervalPrev_ }; protected internal readonly Dictionary<IFuelProperties, Dictionary<ModalResultField, DataColumn>> FuelColumns = new Dictionary<IFuelProperties, Dictionary<ModalResultField, DataColumn>>(); @@ -407,9 +413,17 @@ namespace TUGraz.VectoCore.Models.Simulation.Data break; case IDCDCConverter _: CreateColumns(DCDCConverterSignals); break; + case ElectricAuxiliaries elAux: + CreateElectricAuxColumns(elAux); + break; } } + private void CreateElectricAuxColumns(ElectricAuxiliaries elAux) + { + + } + private void CreateBatteryColumns(VectoRunData vectoRunData) { CreateColumns(BatterySignals); diff --git a/VectoCore/VectoCore/Models/Simulation/Data/ModalResultField.cs b/VectoCore/VectoCore/Models/Simulation/Data/ModalResultField.cs index 3480f889ddd1ccf50f48a916ff4a9d4cf3c11b99..6cc8f5fbe7e1709928560c00b5a2c41d31b5dd34 100644 --- a/VectoCore/VectoCore/Models/Simulation/Data/ModalResultField.cs +++ b/VectoCore/VectoCore/Models/Simulation/Data/ModalResultField.cs @@ -414,6 +414,12 @@ namespace TUGraz.VectoCore.Models.Simulation.Data + //[ModalResultField(typeof(ulong), caption: "debug_dcdc_state")] DCDCStateCount_, + //[ModalResultField(typeof(SI), caption: "sim_interval_current")] SimIntervalCurrent_, + //[ModalResultField(typeof(SI), caption: "sim_interval_prev")] SimIntervalPrev_, + + + // only for graphDrawing Testcase [ModalResultField(typeof(SI), caption: "P_P1_mech [kW]", outputFactor: 1e-3)] diff --git a/VectoCore/VectoCore/Models/Simulation/Data/VectoRunData.cs b/VectoCore/VectoCore/Models/Simulation/Data/VectoRunData.cs index 57a83f6e68adb663d2bb4160e84a3a830ee879b9..fbd8db5c6aefa03f538d4e5709ef2a36bbde201f 100644 --- a/VectoCore/VectoCore/Models/Simulation/Data/VectoRunData.cs +++ b/VectoCore/VectoCore/Models/Simulation/Data/VectoRunData.cs @@ -183,10 +183,10 @@ namespace TUGraz.VectoCore.Models.Simulation.Data public IList<string> Technology; - [SIRange(0, 100 * Constants.Kilo)] public Watt PowerDemand; + [SIRange(0, 100 * Constants.Kilo)] public Watt PowerDemandMech; [JsonIgnore] - public Func<DrivingCycleData.DrivingCycleEntry, Watt> PowerDemandFunc; + public Func<DrivingCycleData.DrivingCycleEntry, Watt> PowerDemandMechFunc; [Required] public AuxiliaryDemandType DemandType; @@ -195,6 +195,10 @@ namespace TUGraz.VectoCore.Models.Simulation.Data [Required] public bool IsFullyElectric; public MissionType? MissionType; + + public double AlternatorEfficiency { get; } + + } // container to pass genset data from powertrain to post-processing, not filled by dataadapter/rundatafactory diff --git a/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs b/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs index e14f178d12030eb80ab4e48fb411f4c222cf8a6f..b9b5b672b39644ba4a1c36bd0f5ecfd2f90aa603 100644 --- a/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs +++ b/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs @@ -227,13 +227,13 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl switch (auxData.DemandType) { case AuxiliaryDemandType.Constant: - aux.AddConstant(id, auxData.PowerDemand); + aux.AddConstant(id, auxData.PowerDemandMech); break; case AuxiliaryDemandType.Direct: - if (auxData.PowerDemandFunc == null) { + if (auxData.PowerDemandMechFunc == null) { aux.AddCycle(id); } else { - aux.AddCycle(id, auxData.PowerDemandFunc); + aux.AddCycle(id, auxData.PowerDemandMechFunc); } break; default: @@ -765,10 +765,11 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl es.Connect(dcdc); em.BusAux = busAux; } else { - var dcdc = new DCDCConverter(container, 1); - es.Connect(dcdc); + var dcdc = new DCDCConverter(container, 1); + es.Connect(dcdc); dcdc.Connect(new ElectricAuxiliaries(container)); - } + dcdc.Initialize(); + } return container; } @@ -1451,7 +1452,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl switch (auxData.DemandType) { case AuxiliaryDemandType.Constant: - aux.AddConstant(id, auxData.PowerDemand); + aux.AddConstant(id, auxData.PowerDemandMech); break; case AuxiliaryDemandType.Direct: aux.AddCycle(id); @@ -1511,7 +1512,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl switch (auxData.DemandType) { case AuxiliaryDemandType.Constant: - aux.AddConstant(id, auxData.PowerDemand); + aux.AddConstant(id, auxData.PowerDemandMech); break; case AuxiliaryDemandType.Direct: aux.AddCycle(id); @@ -1543,14 +1544,14 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl aux.AddCycle(auxId, entry => { if (entry.VehicleTargetSpeed >= Constants.SimulationSettings.HighwaySpeedThreshold) { - return motorway.PowerDemand; + return motorway.PowerDemandMech; } if (entry.VehicleTargetSpeed >= Constants.SimulationSettings.RuralSpeedThreshold) { - return rural.PowerDemand; + return rural.PowerDemandMech; } - return urban.PowerDemand; + return urban.PowerDemandMech; }); } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/DCDCConverter.cs b/VectoCore/VectoCore/Models/SimulationComponent/DCDCConverter.cs index e5887e33cf02283b0cc81658e0774a4447ce8703..11b7126d9b8e42a556d2fd888899500d637b5279 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/DCDCConverter.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/DCDCConverter.cs @@ -2,6 +2,7 @@ using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Configuration; using TUGraz.VectoCore.Models.Connector.Ports.Impl; +using TUGraz.VectoCore.Models.Declaration; using TUGraz.VectoCore.Models.Simulation; using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.Simulation.DataBus; @@ -18,6 +19,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent { Efficiency = efficiency; PreviousState.ConsumedEnergy = 0.SI<WattSecond>(); + CurrentState.ConsumedEnergy = 0.SI<WattSecond>(); + PreviousState.stateCount = 0; + CurrentState.stateCount = 1; } @@ -33,15 +37,21 @@ namespace TUGraz.VectoCore.Models.SimulationComponent public Watt PowerDemand(Second absTime, Second dt, bool dryRun) { + var dischargeEnergy = (-DataBus.BatteryInfo.MaxDischargePower(dt) * dt); var chargeEnergy = (-DataBus.BatteryInfo.MaxChargePower(dt) * dt); var efficiency = PreviousState.ConsumedEnergy > 0 ? 1 / Efficiency : Efficiency; - PreviousState.ConsumedEnergy += _electricConsumers.Sum(aux => aux.PowerDemand(absTime, dt, dryRun)) * dt; + + + if (!dryRun) { + CurrentState.ConsumedEnergy += _electricConsumers.Sum(aux => aux.PowerDemand(absTime, dt, dryRun)).DefaultIfNull(0) * dt; + } if ((PreviousState.ConsumedEnergy * efficiency).IsBetween(chargeEnergy, dischargeEnergy)) { return PreviousState.ConsumedEnergy / dt * efficiency; + } // write in mod-file for post-processing correction @@ -63,39 +73,61 @@ namespace TUGraz.VectoCore.Models.SimulationComponent if (CurrentState.MissingEnergy.IsEqual(0)) { container[ModalResultField.P_DCDC_In] = PreviousState.ConsumedEnergy / simulationInterval / Efficiency; + container[ModalResultField.P_DCDC_Out] = PreviousState.ConsumedEnergy / simulationInterval; - container[ModalResultField.P_DCDC_missing] = 0.SI<Watt>(); + + } else { container[ModalResultField.P_DCDC_In] = 0.SI<Watt>(); container[ModalResultField.P_DCDC_Out] = 0.SI<Watt>(); container[ModalResultField.P_DCDC_missing] = CurrentState.MissingEnergy / simulationInterval; + } } protected override void DoCommitSimulationStep(Second time, Second simulationInterval) { + var prevState = CurrentState.stateCount; AdvanceState(); + CurrentState.stateCount = ++prevState; } #endregion public void ConsumerEnergy(WattSecond electricConsumerEnergy, bool dryRun) { - if (!dryRun) { - CurrentState.ConsumedEnergy = electricConsumerEnergy; - } - } + if (!dryRun) + { + CurrentState.ConsumedEnergy += electricConsumerEnergy; + } + } public class State { public State() { MissingEnergy = 0.SI<WattSecond>(); + ConsumedEnergy = 0.SI<WattSecond>(); + simInterval = 0.SI<Second>(); + } + + public WattSecond ConsumedEnergy + { + get; + set; } - public WattSecond ConsumedEnergy { get; set; } public WattSecond MissingEnergy { get; set; } + + //Debug + public ulong stateCount { get; set; } + + public Second simInterval { get;set; } + + + + // public State Clone() => (State)MemberwiseClone(); } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ElectricAuxiliaries.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ElectricAuxiliaries.cs index 7ebed76432601e5e691a624d800b5a55a571d7c0..56f86b29c8647081f34b84e808d8c2f711e76aa3 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/ElectricAuxiliaries.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/ElectricAuxiliaries.cs @@ -1,35 +1,42 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Linq; +using TUGraz.VectoCommon.Exceptions; +using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.InputData.Reader.DataObjectAdapter.PrimaryBus; using TUGraz.VectoCore.Models.Connector.Ports.Impl; using TUGraz.VectoCore.Models.Simulation; using TUGraz.VectoCore.Models.Simulation.Data; +using TUGraz.VectoCore.OutputData; namespace TUGraz.VectoCore.Models.SimulationComponent.Impl { - - public class ElectricAuxiliaries : IElectricAuxPort + /// <summary> + /// Container Class for Auxiliaries which are connected to the DCDC system. + /// </summary> + public class ElectricAuxiliaries : VectoSimulationComponent, IElectricAuxPort { private IEnumerable<VectoRunData.AuxData> _auxData; #region Implementation of IElectricAuxPort - public ElectricAuxiliaries(IVehicleContainer container) + public ElectricAuxiliaries(IVehicleContainer container) : base(container)// : base(container) { - DataBus = container; + VehicleContainer = container; } - private IVehicleContainer DataBus { get; set; } + private IVehicleContainer VehicleContainer { get; set; } public Watt Initialize() { - _auxData = DataBus.RunData.Aux.Where(aux => aux.MissionType == DataBus.RunData.Mission.MissionType); + + _auxData = VehicleContainer.RunData.Aux.Where(aux => aux.MissionType == VehicleContainer.RunData.Mission.MissionType && aux.IsFullyElectric); foreach (var auxData in _auxData) { //auxData. } @@ -39,13 +46,14 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public Watt PowerDemand(Second absTime, Second dt, bool dryRun) { - var left = DataBus.DrivingCycleInfo.CycleData.LeftSample; + var left = VehicleContainer.DrivingCycleInfo.CycleData.LeftSample; var sum = 0.SI<Watt>(); foreach (var auxData in _auxData) { if (auxData.DemandType == AuxiliaryDemandType.Constant) { - sum += auxData.PowerDemand; + sum += auxData.PowerDemandMech; } else { - sum += auxData.PowerDemandFunc(left); + sum += auxData.PowerDemandMechFunc(left); + throw new NotImplementedException("only constant electric auxiliaries implemented"); } } @@ -53,6 +61,37 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl } #endregion + + #region Overrides of VectoSimulationComponent + + //protected override void DoWriteModalResults(Second time, Second simulationInterval, IModalDataContainer container) + //{ + // return; + //} + + //protected override void DoCommitSimulationStep(Second time, Second simulationInterval) + //{ + // return; + //} + + #endregion + + #region Overrides of VectoSimulationComponent + + protected override void DoWriteModalResults(Second time, Second simulationInterval, IModalDataContainer container) + { + //foreach (var aux in _auxData) + //{ + // container[aux.ID] = aux.PowerDemand; + //} + } + + protected override void DoCommitSimulationStep(Second time, Second simulationInterval) + { + + } + + #endregion } } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Vehicle.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Vehicle.cs index 3d5576124f99d3047c1eb40808b9881fcb7e42ca..e89bcbed9a6f5810d80267e7cb853e038da0649a 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Vehicle.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Vehicle.cs @@ -193,10 +193,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl Log.Warn("Distance field is not set!"); } else { var distance = (SI)container[ModalResultField.dist]; - if (!distance.IsEqual(CurrentState.Distance)) { - Log.Warn("Vehicle Distance diverges from Cycle by {0} [m]. Distance: {1}", - (distance - CurrentState.Distance).Value(), distance); - } + //if (!distance.IsEqual(CurrentState.Distance)) { + // Log.Warn("Vehicle Distance diverges from Cycle by {0} [m]. Distance: {1}", + // (distance - CurrentState.Distance).Value(), distance); + //} } } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Strategies/ElectricComponents.cd b/VectoCore/VectoCore/Models/SimulationComponent/Strategies/ElectricComponents.cd new file mode 100644 index 0000000000000000000000000000000000000000..7b894197b9d8d79b2ad4afafc2c11c60f33c4b42 --- /dev/null +++ b/VectoCore/VectoCore/Models/SimulationComponent/Strategies/ElectricComponents.cd @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8"?> +<ClassDiagram /> \ No newline at end of file diff --git a/VectoCore/VectoCore/OutputData/IModalDataContainer.cs b/VectoCore/VectoCore/OutputData/IModalDataContainer.cs index 64fb065b5aaf05e088f3accfdd611cbba9ef8aa7..a63b6e6642e170cc466305009baa04736d880d4c 100644 --- a/VectoCore/VectoCore/OutputData/IModalDataContainer.cs +++ b/VectoCore/VectoCore/OutputData/IModalDataContainer.cs @@ -296,14 +296,17 @@ namespace TUGraz.VectoCore.OutputData public static MeterPerSquareSecond AccelerationAverage(this IModalDataContainer data) { + if (data.Duration == 0.SI<Second>()) { + return null; + } return data.TimeIntegral<MeterPerSecond>(ModalResultField.acc) / data.Duration; } public static Meter AltitudeDelta(this IModalDataContainer data) { var altitudes = data.GetValues<Meter>(ModalResultField.altitude).ToList(); - var first = altitudes.First(); - var last = altitudes.Last(); + var first = altitudes.FirstOrDefault(); + var last = altitudes.LastOrDefault(); return first == null || last == null ? null : last - first; } @@ -665,6 +668,9 @@ namespace TUGraz.VectoCore.OutputData public static Scalar CoastingTimeShare(this IModalDataContainer data) { + if (data.Duration == 0.SI<Second>()) { + return null; + } var sum = data.GetValues(x => new { DrivingBehavior = x.Field<DrivingBehavior>(ModalResultField.drivingBehavior.GetName()), dt = x.Field<Second>(ModalResultField.simulationInterval.GetName()) diff --git a/VectoCore/VectoCore/OutputData/ModalDataContainer.cs b/VectoCore/VectoCore/OutputData/ModalDataContainer.cs index 53ed0f2f3e7716162d01db23f8103b65668dacd1..c65f625778b64dbfcbe46dbe3d1fc0030c616039 100644 --- a/VectoCore/VectoCore/OutputData/ModalDataContainer.cs +++ b/VectoCore/VectoCore/OutputData/ModalDataContainer.cs @@ -546,6 +546,10 @@ namespace TUGraz.VectoCore.OutputData if (time.Count == 1) { return time.First(); } + + if (time.Count == 0) { + return 0.SI<Second>(); + } return time.Last() - time.First() + dt.First() / 2 + dt.Last() / 2; } @@ -561,7 +565,7 @@ namespace TUGraz.VectoCore.OutputData vact = r.Field<MeterPerSecond>(ModalResultField.v_act.GetName()), acc = r.Field<MeterPerSquareSecond>(ModalResultField.acc.GetName()), dt = r.Field<Second>(ModalResultField.simulationInterval.GetName()) - }).First(); + }).FirstOrDefault(); var min = 0.SI<Meter>(); if (first != null && first.vact != null && first.acc != null && first.dt != null) { min = first.dist - first.vact * first.dt - first.acc * first.dt * first.dt / 2.0; @@ -710,6 +714,11 @@ namespace TUGraz.VectoCore.OutputData ModalResultField.P_DCDC_In, ModalResultField.P_DCDC_Out, ModalResultField.P_DCDC_missing, + + //ModalResultField.SimIntervalCurrent_, + //ModalResultField.SimIntervalPrev_, + //ModalResultField.DCDCStateCount_, + // TC Operating point ModalResultField.TorqueConverterSpeedRatio, ModalResultField.TorqueConverterTorqueRatio, diff --git a/VectoCore/VectoCore/Resources/Declaration/VAUX/PS-Table.csv b/VectoCore/VectoCore/Resources/Declaration/VAUX/PS-Table.csv index fb2108bfa74efaab0b6437c5b690fd7f34d426a1..1ea3f170aa9371f7c1a19f397d4e8fa04ccb6e4c 100644 --- a/VectoCore/VectoCore/Resources/Declaration/VAUX/PS-Table.csv +++ b/VectoCore/VectoCore/Resources/Declaration/VAUX/PS-Table.csv @@ -30,10 +30,10 @@ Large Supply + mech. clutch + AMS , 1 , 1 , 1 , 0 , Vacuum pump , 1 , 1 , 1 , 0 , 0 , 190 , 160 , 130 , 130 , 130 Small + elec. driven , 1 , 1 , 1 , 1 , 1 , 1071 , 1071 , 1161 , 1161 , 1071 Small + elec. driven + AMS , 1 , 1 , 1 , 1 , 1 , 357 , 357 , 625 , 625 , 357 -Medium supply 1 stage + elec. driven , 1 , 1 , 1 , 1 , 1 , 1071 , 982 , 982 , 982 , 1071 -Medium supply 1 stage + elec. driven + AMS , 1 , 1 , 1 , 1 , 1 , 357 , 625 , 625 , 625 , 357 -Medium supply 2 stage + elec. driven , 1 , 1 , 1 , 1 , 1 , 1250 , 1161 , 1071 , 1071 , 1429 -Medium supply 2 stage + elec. driven + AMS , 1 , 1 , 1 , 1 , 1 , 536 , 804 , 714 , 714 , 536 -Large supply + elec. driven , 1 , 1 , 1 , 1 , 1 , 1429 , 1429 , 1250 , 1250 , 1607 -Large supply + elec. driven + AMS , 1 , 1 , 1 , 1 , 1 , 536 , 893 , 893 , 893 , 714 +Medium Supply 1-stage + elec. driven , 1 , 1 , 1 , 1 , 1 , 1071 , 982 , 982 , 982 , 1071 +Medium Supply 1-stage + elec. driven + AMS , 1 , 1 , 1 , 1 , 1 , 357 , 625 , 625 , 625 , 357 +Medium Supply 2-stage + elec. driven , 1 , 1 , 1 , 1 , 1 , 1250 , 1161 , 1071 , 1071 , 1429 +Medium Supply 2-stage + elec. driven + AMS , 1 , 1 , 1 , 1 , 1 , 536 , 804 , 714 , 714 , 536 +Large Supply + elec. driven , 1 , 1 , 1 , 1 , 1 , 1429 , 1429 , 1250 , 1250 , 1607 +Large Supply + elec. driven + AMS , 1 , 1 , 1 , 1 , 1 , 536 , 893 , 893 , 893 , 714 Vacuum pump + elec. driven , 1 , 1 , 1 , 1 , 1 , 339 , 286 , 232 , 232 , 232 \ No newline at end of file diff --git a/VectoCore/VectoCoreTest/Integration/Declaration/HeavyLorry/HeavyLorrySimulation.cs b/VectoCore/VectoCoreTest/Integration/Declaration/HeavyLorry/HeavyLorrySimulation.cs index 4ae8d64a6ee5fef3bb1f75708287d987f9cfec76..742ab6ace55ec24618b60cfd8c238264b99cfbef 100644 --- a/VectoCore/VectoCoreTest/Integration/Declaration/HeavyLorry/HeavyLorrySimulation.cs +++ b/VectoCore/VectoCoreTest/Integration/Declaration/HeavyLorry/HeavyLorrySimulation.cs @@ -27,15 +27,19 @@ public class HeavyLorrySimulation } [TestCase(@"HeavyLorry\PEV_heavyLorry_AMT_E2_realistic.xml"), + TestCase(@"HeavyLorry\Conventional_heavyLorry_AMT.xml"), + TestCase(@"HeavyLorry\Conventional_heavyLorry_AMT.xml", false), + TestCase(@"HeavyLorry\PEV_heavyLorry_AMT_E2_realistic.xml", false), TestCase(@"HeavyLorry\PEV_heavyLorry_E3_realistic.xml"), + TestCase(@"HeavyLorry\PEV_heavyLorry_E3_realistic.xml", false), TestCase(@"HeavyLorry\PEV_heavyLorry_E4.xml")] - public void HeavyLorrySimulationTest(string jobFile) + public void HeavyLorrySimulationTest(string jobFile, bool multiThreaded = true) { - RunSimulation(jobFile); + RunSimulation(jobFile, multiThreaded); } - public void RunSimulation(string jobFile) + public void RunSimulation(string jobFile, bool multiThreaded = true) { var filePath = Path.Combine(BASE_DIR, jobFile); var dataProvider = _xmlReader.CreateDeclaration(filePath); @@ -44,7 +48,7 @@ public class HeavyLorrySimulation var jobContainer = new JobContainer(new MockSumWriter()) { }; jobContainer.AddRuns(runsFactory); PrintRuns(jobContainer); - jobContainer.Execute(false); + jobContainer.Execute(multiThreaded); jobContainer.WaitFinished(); PrintRuns(jobContainer); diff --git a/VectoCore/VectoCoreTest/Models/EngineeringMode/EngineeringModeBusAuxTest.cs b/VectoCore/VectoCoreTest/Models/EngineeringMode/EngineeringModeBusAuxTest.cs index a5e38bcdc3fd17dfd8efe7b285a6e5b753afdaea..a6b715161857f11ad736450d885370012702599b 100644 --- a/VectoCore/VectoCoreTest/Models/EngineeringMode/EngineeringModeBusAuxTest.cs +++ b/VectoCore/VectoCoreTest/Models/EngineeringMode/EngineeringModeBusAuxTest.cs @@ -936,7 +936,7 @@ namespace TUGraz.VectoCore.Tests.Models.EngineeringMode switch (auxData.DemandType) { case AuxiliaryDemandType.Constant: - aux.AddConstant(id, auxData.PowerDemand); + aux.AddConstant(id, auxData.PowerDemandMech); break; default: throw new ArgumentOutOfRangeException("AuxiliaryDemandType", auxData.DemandType.ToString()); @@ -955,9 +955,9 @@ namespace TUGraz.VectoCore.Tests.Models.EngineeringMode var fanDemand = pwrICEOn - pwrICEOffDriving; var auxList = new List<VectoRunData.AuxData>() { - new VectoRunData.AuxData { ID = Constants.Auxiliaries.IDs.ENG_AUX_MECH_BASE, DemandType = AuxiliaryDemandType.Constant, PowerDemand = baseDemand}, - new VectoRunData.AuxData { ID = Constants.Auxiliaries.IDs.ENG_AUX_MECH_STP, DemandType = AuxiliaryDemandType.Constant, PowerDemand = stpDemand}, - new VectoRunData.AuxData { ID = Constants.Auxiliaries.IDs.ENG_AUX_MECH_FAN, DemandType = AuxiliaryDemandType.Constant, PowerDemand = fanDemand}, + new VectoRunData.AuxData { ID = Constants.Auxiliaries.IDs.ENG_AUX_MECH_BASE, DemandType = AuxiliaryDemandType.Constant, PowerDemandMech = baseDemand}, + new VectoRunData.AuxData { ID = Constants.Auxiliaries.IDs.ENG_AUX_MECH_STP, DemandType = AuxiliaryDemandType.Constant, PowerDemandMech = stpDemand}, + new VectoRunData.AuxData { ID = Constants.Auxiliaries.IDs.ENG_AUX_MECH_FAN, DemandType = AuxiliaryDemandType.Constant, PowerDemandMech = fanDemand}, }; return auxList;