diff --git a/VECTO3GUI/ViewModel/Adapter/Declaration/VehicleDeclarationAdapter.cs b/VECTO3GUI/ViewModel/Adapter/Declaration/VehicleDeclarationAdapter.cs index 30ef4c6b78d52d33eca7fb31f74f346a8ed98411..b44c0e8e4a82326bae79549efa0d2d266a20169b 100644 --- a/VECTO3GUI/ViewModel/Adapter/Declaration/VehicleDeclarationAdapter.cs +++ b/VECTO3GUI/ViewModel/Adapter/Declaration/VehicleDeclarationAdapter.cs @@ -117,6 +117,7 @@ namespace VECTO3GUI.ViewModel.Adapter.Declaration public Meter Length { get; } public Meter Width { get; } public Meter EntranceHeight { get; } + public ConsumerTechnology DoorDriveTechnology { get; } public IAirdragDeclarationInputData AirdragInputData { get { return GetComponentViewModel<IAirdragViewModel>(Component.Airdrag)?.ModelData; diff --git a/VECTO3GUI/ViewModel/Impl/AuxiliariesViewModel.cs b/VECTO3GUI/ViewModel/Impl/AuxiliariesViewModel.cs index 9c7d0be1ae18d6ec30895243287ad460ee4b04d3..92f92c0277f753a6768237f5283a32b212e1c2cd 100644 --- a/VECTO3GUI/ViewModel/Impl/AuxiliariesViewModel.cs +++ b/VECTO3GUI/ViewModel/Impl/AuxiliariesViewModel.cs @@ -296,7 +296,7 @@ namespace VECTO3GUI.ViewModel.Impl BrakelightsLED = busAux.ElectricConsumers.BrakelightsLED; InteriorLightsLED = busAux.ElectricConsumers.InteriorLightsLED; - DoorDriveTechnology = busAux.PneumaticConsumers.DoorDriveTechnology; + //DoorDriveTechnology = busAux.PneumaticConsumers.DoorDriveTechnology; SystemConfiguration = busAux.HVACAux.SystemConfiguration; CompressorTypeDriver = busAux.HVACAux.CompressorTypeDriver; diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterCompletedBusSpecific.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterCompletedBusSpecific.cs index e94967478afcdedb6fe085993fc195c27f656d2f..b4599d515eb95292102ba95db5f3750a2ba0debe 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterCompletedBusSpecific.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterCompletedBusSpecific.cs @@ -25,7 +25,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter public VehicleData CreateVehicleData(IVehicleDeclarationInputData primaryVehicle, IVehicleDeclarationInputData completedVehicle, Mission mission, - KeyValuePair<LoadingType, Kilogram> loading) + KeyValuePair<LoadingType, Tuple<Kilogram, double?>> loading) { var passengers = GetNumberOfPassengers( mission, completedVehicle.Length, completedVehicle.Width, @@ -42,6 +42,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter vehicleData.CurbMass = completedVehicle.CurbMassChassis; vehicleData.Loading = passengers * mission.MissionType.GetAveragePassengerMass(); + vehicleData.PassengerCount = passengers; vehicleData.GrossVehicleMass = completedVehicle.GrossVehicleMassRating; vehicleData.DigestValueInput = completedVehicle.DigestValue?.DigestValue ?? ""; @@ -109,7 +110,11 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter retVal.AlternatorMap = new SimpleAlternator( CalculateAlternatorEfficiency( primaryBusAuxiliaries.ElectricSupply.Alternators - .Concat(completedVehicle.Components.BusAuxiliaries.ElectricSupply.Alternators).ToList())); + .Concat(completedVehicle.Components.BusAuxiliaries.ElectricSupply.Alternators).ToList())) { + Technologies = primaryBusAuxiliaries.ElectricSupply.Alternators + .Concat(completedVehicle.Components.BusAuxiliaries.ElectricSupply.Alternators).Select(x => x.Technology) + .ToList() + }; retVal.MaxAlternatorPower = primaryBusAuxiliaries.ElectricSupply.MaxAlternatorPower; retVal.ElectricStorageCapacity = primaryBusAuxiliaries.ElectricSupply.ElectricStorageCapacity ?? 0.SI<WattSecond>(); @@ -129,7 +134,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter completedVehicle.EntranceHeight - Constants.BusParameters.EntranceHeight), AirSuspensionControl = primaryBusAuxiliaries.PneumaticConsumers.AirsuspensionControl, AdBlueDosing = primaryBusAuxiliaries.PneumaticConsumers.AdBlueDosing, - Doors = completedVehicle.Components.BusAuxiliaries.PneumaticConsumers.DoorDriveTechnology + Doors = completedVehicle.DoorDriveTechnology }; } @@ -150,7 +155,6 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter var busAux = completedVehicle.Components.BusAuxiliaries.HVACAux; var floorType = completedVehicle.VehicleCode.GetFloorType(); - var ssmInputs =GetDefaulSSMInputs(FuelData.Diesel); ssmInputs.BusFloorType = completedVehicle.VehicleCode.GetFloorType(); @@ -165,12 +169,15 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter ssmInputs.UValue = DeclarationData.BusAuxiliaries.UValue(completedVehicle.VehicleCode.GetFloorType()); ssmInputs.NumberOfPassengers = GetNumberOfPassengers( mission, hvacBusLength, hvacBusWidth, - completedVehicle.NumberOfPassengersLowerDeck + completedVehicle.NumberOfPassengersUpperDeck, loadingType); + completedVehicle.NumberOfPassengersLowerDeck + completedVehicle.NumberOfPassengersUpperDeck, loadingType) + 1; // add driver for 'heat input' ssmInputs.VentilationRate = DeclarationData.BusAuxiliaries.VentilationRate(hvacConfiguration, false); ssmInputs.VentilationRateHeating = DeclarationData.BusAuxiliaries.VentilationRate(hvacConfiguration, true); ssmInputs.HVACMaxCoolingPower = coolingPower.Item1 + coolingPower.Item2; ssmInputs.HVACCompressorType = busAux.CompressorTypePassenger; // use passenger compartment + ssmInputs.HVACTechnology = string.Format( + "{0} ({1})", busAux.SystemConfiguration.GetName(), + string.Join(", ", new[] { busAux.CompressorTypePassenger.GetName(), busAux.CompressorTypeDriver.GetName() })); ; ssmInputs.COP = DeclarationData.BusAuxiliaries.CalculateCOP( coolingPower.Item1, busAux.CompressorTypeDriver, coolingPower.Item2, busAux.CompressorTypePassenger, floorType); diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterPrimaryBus.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterPrimaryBus.cs index 2b1c742cf33af4c2b01963fc00acc4476f4ddf91..3434093cbfb82cd11ade00a6d1d662936999318c 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterPrimaryBus.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterPrimaryBus.cs @@ -95,7 +95,9 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter retVal.SmartElectrical = busAux.ElectricSupply.SmartElectrics; retVal.ElectricalConsumers = currentDemand; - retVal.AlternatorMap = new SimpleAlternator(CalculateAlternatorEfficiency(busAux.ElectricSupply.Alternators)); + retVal.AlternatorMap = new SimpleAlternator(CalculateAlternatorEfficiency(busAux.ElectricSupply.Alternators)) { + Technologies = busAux.ElectricSupply.Alternators.Select(x => x.Technology).ToList() + }; retVal.MaxAlternatorPower = busAux.ElectricSupply.MaxAlternatorPower; retVal.ElectricStorageCapacity = busAux.ElectricSupply.ElectricStorageCapacity ?? 0.SI<WattSecond>(); @@ -133,7 +135,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter (actuations.ParkBrakeAndDoors * Constants.BusAuxiliaries.ElectricalConsumers.DoorActuationTimeSecond) / actuations.CycleTime; var busAux = vehicleData.Components.BusAuxiliaries; - var electricDoors = vehicleData.Components.BusAuxiliaries.PneumaticConsumers.DoorDriveTechnology == ConsumerTechnology.Electrically; + var electricDoors = vehicleData.DoorDriveTechnology == ConsumerTechnology.Electrically; foreach (var consumer in DeclarationData.BusAuxiliaries.DefaultElectricConsumerList.Items) { @@ -169,9 +171,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter } return 0; - avgWithoutBase += (spPower + fanPower) / Constants.BusAuxiliaries.ElectricSystem.PowernetVoltage; - } @@ -180,7 +180,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter switch (consumerName) { case "Day running lights LED bonus": case "Position lights LED bonus": - case "Brake lights LED bonus": return false; + case "Brake lights LED bonus": // return false; case "Interior lights LED bonus": case "Headlights LED bonus": return true; default: return false; @@ -317,9 +317,12 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter retVal.HVACMaxCoolingPower = coolingPower.Item1 + coolingPower.Item2; retVal.HVACCompressorType = busParams.HVACCompressorType; // use passenger compartment retVal.COP = DeclarationData.BusAuxiliaries.CalculateCOP( - HVACTechnology = string.Format("{0} ({1})", busParams.HVACConfiguration.GetName(), string.Join(", ", new[] {busParams.HVACCompressorType.GetName(), ACCompressorType.None.GetName()})), + coolingPower.Item1, ACCompressorType.None, coolingPower.Item2, busParams.HVACCompressorType, busParams.FloorType); + retVal.HVACTechnology = string.Format( + "{0} ({1})", busParams.HVACConfiguration.GetName(), + string.Join(", ", new[] { busParams.HVACCompressorType.GetName(), ACCompressorType.None.GetName() })); //SetHVACParameters(retVal, vehicleData, mission); diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterSingleBus.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterSingleBus.cs index a767bc78ab214010b6a33c9b5e9c156628325848..3716679a8463a6dec866c366dc781eea601ffcf2 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterSingleBus.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterSingleBus.cs @@ -93,13 +93,12 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter protected override ElectricsUserInputsConfig GetElectricalUserConfig( Mission mission, IVehicleDeclarationInputData vehicleData, IActuations actuations, VehicleClass vehicleClass) { - var currentDemand = CalculateAverageCurrent(mission, vehicleData, actuations, vehicleClass); + var currentDemand = GetElectricConsumers(mission, vehicleData, actuations); var busAux = vehicleData.Components.BusAuxiliaries; return new ElectricsUserInputsConfig() { SmartElectrical = busAux.ElectricSupply.SmartElectrics, - AverageCurrentDemandInclBaseLoad = currentDemand.Item1, - AverageCurrentDemandWithoutBaseLoad = currentDemand.Item2, + ElectricalConsumers = currentDemand, AlternatorMap = new SimpleAlternator( CalculateAlternatorEfficiency( @@ -265,7 +264,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter protected bool IsDoubleDecker { - get { return CompletedVehicle.NuberOfPassengersUpperDeck > 0; } + get { return CompletedVehicle.NumberOfPassengersUpperDeck > 0; } } } } diff --git a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeCompletedBusVectoRunDataFactory.cs b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeCompletedBusVectoRunDataFactory.cs index 377b46d4324e301c09499f150055388dd35cc5d5..478ac7486ecd6b1715e083a6e67a60544bc2a8da 100644 --- a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeCompletedBusVectoRunDataFactory.cs +++ b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeCompletedBusVectoRunDataFactory.cs @@ -165,7 +165,7 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl m.MissionType == mission.MissionType; }).First(); simulationRunData = CreateVectoRunDataGeneric( - primaryMission, new KeyValuePair<LoadingType, Kilogram>(loading.Key, primaryMission.Loadings[loading.Key]), + primaryMission, new KeyValuePair<LoadingType, Tuple<Kilogram, double?>>(loading.Key, primaryMission.Loadings[loading.Key]), primarySegment); yield return simulationRunData; } @@ -205,7 +205,7 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl } - protected VectoRunData CreateVectoRunDataSpecific(Mission mission, KeyValuePair<LoadingType, Kilogram> loading) + protected VectoRunData CreateVectoRunDataSpecific(Mission mission, KeyValuePair<LoadingType, Tuple<Kilogram, double?>> loading) { DrivingCycleData cycle; lock (CyclesCacheLock) { @@ -251,7 +251,7 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl } - protected VectoRunData CreateVectoRunDataGeneric(Mission mission, KeyValuePair<LoadingType, Kilogram> loading, Segment primarySegment) + protected VectoRunData CreateVectoRunDataGeneric(Mission mission, KeyValuePair<LoadingType, Tuple<Kilogram, double?>> loading, Segment primarySegment) { DrivingCycleData cycle; lock (CyclesCacheLock) { diff --git a/VectoCore/VectoCore/Models/Declaration/CompletedBusSegments.cs b/VectoCore/VectoCore/Models/Declaration/CompletedBusSegments.cs index af64b43f02ea4ee4a7dd6b782a1644454716c057..4af7eda6e6a3f54ec0f0c044bb7f088e5c67d458 100644 --- a/VectoCore/VectoCore/Models/Declaration/CompletedBusSegments.cs +++ b/VectoCore/VectoCore/Models/Declaration/CompletedBusSegments.cs @@ -134,6 +134,8 @@ namespace TUGraz.VectoCore.Models.Declaration MaxLoad = null, LowLoad = 10.SI<Kilogram>(), // dummy value to trigger simulation with low load RefLoad = 100.SI<Kilogram>(), // dummy value to trigger simulation with ref load + PassengersLowLoad = 1, // dummy value + PassengersRefLoad = 10, // dummy value TotalCargoVolume = 0.SI<CubicMeter>(), DefaultCDxA = row.ParseDouble("cdxastandard").SI<SquareMeter>(), BusParameter = new BusParameters { diff --git a/VectoCore/VectoCore/OutputData/SummaryDataContainer.cs b/VectoCore/VectoCore/OutputData/SummaryDataContainer.cs index 3cd17e539b149dec05b428189cb4bcb8df10b61a..a12c526af71560d3491015c7cf42219ecee47811 100644 --- a/VectoCore/VectoCore/OutputData/SummaryDataContainer.cs +++ b/VectoCore/VectoCore/OutputData/SummaryDataContainer.cs @@ -491,7 +491,7 @@ namespace TUGraz.VectoCore.OutputData if (passengers != null) { // subtract driver! row[FcCol(Fields.FCFINAL_LiterPer100PassengerKM, suffix)] = - (fcVolumePerMeter / (passengers.Value - 1)).ConvertToLiterPer100Kilometer(); + (fcVolumePerMeter / passengers.Value).ConvertToLiterPer100Kilometer(); } } diff --git a/VectoCore/VectoCoreTest/Integration/CompletedBus/CompletedBusFactorMethodTest.cs b/VectoCore/VectoCoreTest/Integration/CompletedBus/CompletedBusFactorMethodTest.cs index b0ef9fe28b6806bd3b1098ec282bae731cfea9f9..afbf33095835f5a78d700d9c08099bca6f5a2a81 100644 --- a/VectoCore/VectoCoreTest/Integration/CompletedBus/CompletedBusFactorMethodTest.cs +++ b/VectoCore/VectoCoreTest/Integration/CompletedBus/CompletedBusFactorMethodTest.cs @@ -37,6 +37,10 @@ namespace TUGraz.VectoCore.Tests.Integration.CompletedBus { const string JobFile_Group41 = @"TestData\Integration\Buses\FactorMethod\CompletedBus_41-32b.vecto"; const string JobFile_Group42 = @"TestData\Integration\Buses\FactorMethod\CompletedBus_42-33b.vecto"; + + const string JobFilePrimary41 = @"TestData\Integration\Buses\FactorMethod\primary_heavyBus group41_nonSmart.xml"; + const string JobFilePrimary42 = @"ETestData\Integration\Buses\FactorMethod\primary_heavyBus group42_SmartPS.xml"; + protected IXMLInputDataReader xmlInputReader; class RelatedRun @@ -920,7 +924,7 @@ namespace TUGraz.VectoCore.Tests.Integration.CompletedBus TestCase(JobFile_Group42, 1, TestName = "PrintVectoRunData CompletedBus Group 42/33b HU/RL")] public void PrintModelParametersCompletedBus(string jobFile, int pairIdx) { - var runs = GetVectoRunDatas(jobFile); + var runs = GetVectoRunData(jobFile); SetRelatedVehicleParts(runs); var pair = relatedRuns[pairIdx]; @@ -935,7 +939,7 @@ namespace TUGraz.VectoCore.Tests.Integration.CompletedBus TestCase(@"TestData\Integration\Buses\FactorMethod\primary_heavyBus group42_SmartPS.xml", 1, TestName = "PrintVectoRunData PrimaryBus Group42 SD HU RL")] public void PrintModelParametersPrimaryBus(string jobFile, int runIdx) { - var runs = GetVectoRunDatas(jobFile); + var runs = GetVectoRunData(jobFile); SetRelatedVehicleParts(runs); var run = runs[runIdx]; @@ -945,7 +949,7 @@ namespace TUGraz.VectoCore.Tests.Integration.CompletedBus - private List<VectoRunData> GetVectoRunDatas(string jobFile) + private List<VectoRunData> GetVectoRunData(string jobFile) { var writer = new FileOutputWriter(Path.Combine(Path.GetDirectoryName(JobFile_Group41), Path.GetFileName(JobFile_Group41))); var inputData = Path.GetExtension(jobFile).Equals(".xml") @@ -964,7 +968,9 @@ namespace TUGraz.VectoCore.Tests.Integration.CompletedBus } [TestCase(JobFile_Group41, TestName = "RunCompletedBusSimulation Group41/32b"), - TestCase(JobFile_Group42, TestName = "RunCompletedBusSimulation Group42/33b"),] + TestCase(JobFile_Group42, TestName = "RunCompletedBusSimulation Group42/33b"), + TestCase(JobFilePrimary41, TestName = "RunPrimaryBusSimulation Group41"), + TestCase(JobFilePrimary42, TestName = "RunPrimaryBusSimulation Group42")] public void TestRunCompletedBusSimulation(string jobName) { var relativeJobPath = jobName; diff --git a/VectoCore/VectoCoreTest/XML/XMLCompleteBusReaderTest.cs b/VectoCore/VectoCoreTest/XML/XMLCompleteBusReaderTest.cs index 9767df655c8a5f6496b8b1634fb41a3a991bce00..5d8b6424ce705aa30b59874dd50ca6e25dd3177e 100644 --- a/VectoCore/VectoCoreTest/XML/XMLCompleteBusReaderTest.cs +++ b/VectoCore/VectoCoreTest/XML/XMLCompleteBusReaderTest.cs @@ -97,7 +97,7 @@ namespace TUGraz.VectoCore.Tests.XML Assert.AreEqual(1, electricSupl.Alternators.Count); Assert.AreEqual("default", electricSupl.Alternators.First().Technology); - Assert.AreEqual(ConsumerTechnology.Pneumatically, components.BusAuxiliaries.PneumaticConsumers.DoorDriveTechnology); + //Assert.AreEqual(ConsumerTechnology.Pneumatically, components.BusAuxiliaries.PneumaticConsumers.DoorDriveTechnology); var havacAux = components.BusAuxiliaries.HVACAux; Assert.IsNotNull(havacAux);