diff --git a/VECTO/Input Files/Gearbox.vb b/VECTO/Input Files/Gearbox.vb index a3e5b96701378851c2da10518748c330c2978472..c943f2a06c725d3794f1b69847ce43743dbbabfc 100644 --- a/VECTO/Input Files/Gearbox.vb +++ b/VECTO/Input Files/Gearbox.vb @@ -889,6 +889,7 @@ Public Class MockJobInputData Implements IEngineeringJobInputData.Vehicle Public Property Vehicle As IVehicleDeclarationInputData Implements IDeclarationJobInputData.Vehicle + Public ReadOnly Property HybridStrategyParameters As IHybridStrategyParameters Implements IEngineeringJobInputData.HybridStrategyParameters Public Property Cycles As IList(Of ICycleData) Implements IEngineeringJobInputData.Cycles Public Property EngineOnlyMode As Boolean Implements IEngineeringJobInputData.EngineOnlyMode Public Property EngineOnly As IEngineEngineeringInputData Implements IEngineeringJobInputData.EngineOnly diff --git a/VECTO/Input Files/VectoJob.vb b/VECTO/Input Files/VectoJob.vb index 7a2be139a8bccac5040963dc62a4c0ef85c35b45..f344902cdeb0ca54990639fef998e34106ba09fc 100644 --- a/VECTO/Input Files/VectoJob.vb +++ b/VECTO/Input Files/VectoJob.vb @@ -602,6 +602,12 @@ Public Class VectoJob End Get End Property + Public ReadOnly Property HybridStrategyParameters As IHybridStrategyParameters Implements IEngineeringJobInputData.HybridStrategyParameters + Get + Return Nothing + End Get + End Property + Public ReadOnly Property Cycles As IList(Of ICycleData) Implements IEngineeringJobInputData.Cycles Get Dim retVal As ICycleData() = New ICycleData(CycleFiles.Count - 1) {} diff --git a/VectoCommon/VectoCommon/InputData/EngineeringInputData.cs b/VectoCommon/VectoCommon/InputData/EngineeringInputData.cs index bab13c84d5990fa86b654edd5ab062cf755db2dc..ed83cbc1466f53918e1b3ea65d6e4fa71a7cdd69 100644 --- a/VectoCommon/VectoCommon/InputData/EngineeringInputData.cs +++ b/VectoCommon/VectoCommon/InputData/EngineeringInputData.cs @@ -40,11 +40,14 @@ namespace TUGraz.VectoCommon.InputData { new IVehicleEngineeringInputData Vehicle { get; } - /// <summary> - /// P008 Cycles - /// cf. VECTO Input Parameters.xlsx - /// </summary> - IList<ICycleData> Cycles { get; } + + IHybridStrategyParameters HybridStrategyParameters { get; } + + /// <summary> + /// P008 Cycles + /// cf. VECTO Input Parameters.xlsx + /// </summary> + IList<ICycleData> Cycles { get; } /// <summary> /// P001 @@ -56,6 +59,17 @@ namespace TUGraz.VectoCommon.InputData } + public interface IHybridStrategyParameters + { + double EquivalenceFactor { get; } + + double MinSoC { get; } + + double MaxSoC { get; } + + double TargetSoC { get; } + } + public interface IVehicleEngineeringInputData : IVehicleDeclarationInputData { /// <summary> diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONComponentInputData.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONComponentInputData.cs index ee26b45594c5633ac551241cc24c0a01e634fc25..204a5ab87d998ec2bf5cf10f4859ca4d62647b24 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONComponentInputData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONComponentInputData.cs @@ -168,6 +168,11 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON get { return Vehicle; } } + public IHybridStrategyParameters HybridStrategyParameters + { + get { return null; } + } + public IVehicleEngineeringInputData Vehicle { get { return VehicleData ?? this; } diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs index 38b0921505ba8e3d7e53821fa31729a0774f3d97..54f740f649d06870fb0747649330b12c09d82718 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs @@ -273,6 +273,11 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON get { return VehicleInputData; } } + public virtual IHybridStrategyParameters HybridStrategyParameters + { + get { return null; } + } + public virtual IEngineeringJobInputData JobInputData { get { return this; } @@ -1029,6 +1034,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON #endregion } + + public class EcoRollInputData : IEcoRollEngineeringInputData { #region Implementation of IEcoRollEngineeringInputData @@ -1181,4 +1188,20 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON #endregion } + + public class JSONInputDataV8 : JSONInputDataV5 + { + public JSONInputDataV8(JObject data, string filename, bool tolerateMissing = false) : base(data, filename, tolerateMissing) { } + + public override IHybridStrategyParameters HybridStrategyParameters + { + get + { + return Body["HybridStrategyParams"] == null + ? null : JSONInputDataFactory.ReadHybridStrategyParameters( + Path.Combine(BasePath, Body.GetEx<string>("HybridStrategyParams")), false); + } + } + + } } diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputDataFactory.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputDataFactory.cs index b1e48b577e4f58834e40a5ba4fa55bbcf59199e1..bf6abf0a181fe1dbb8874f574261279d81ec8e60 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputDataFactory.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputDataFactory.cs @@ -97,6 +97,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON return new JSONInputDataSingleBusV6(json, filename, tolerateMissing); case 7: return new JSONInputDataComptededBusFactorMethodV7(json, filename, tolerateMissing); + case 8: + return new JSONInputDataV8(json, filename, tolerateMissing); default: throw new VectoException("Job-File: Unsupported FileVersion. Got: {0} ", version); } @@ -170,7 +172,21 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON } } - public static IBatteryPackEngineeringInputData ReadBatteryData(string filename, bool tolerateMissing) + public static IHybridStrategyParameters ReadHybridStrategyParameters(string filename, bool tolerateMissing) + { + var json = ReadFile(filename); + var version = ReadVersion(json); + switch (version) { + case 1: + return new JSONHybridStrategyParameters(json, filename, tolerateMissing); + default: + throw new VectoException("HybridStrategyParameter-File: Unsupported FileVersion. Got {0}", version); + + } + } + + + public static IBatteryPackEngineeringInputData ReadBatteryData(string filename, bool tolerateMissing) { var json = ReadFile(filename); var version = ReadVersion(json); diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONVehicleData.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONVehicleData.cs index beb68ceb63676f6191e484855b9e81748787b5b4..3c244bf7e44e2567d153dc7001b18638315c978d 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONVehicleData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONVehicleData.cs @@ -79,6 +79,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON var tmp = new ElectricMachineEntry<IElectricMotorEngineeringInputData>() { Position = PowertrainPositionHelper.Parse(entry.GetEx<string>("Position")), + Ratio = entry.GetEx<double>("Ratio"), + MechanicalEfficiency = entry.GetEx<double>("MechanicalEfficiency"), Count = entry.GetEx<int>("Count"), ElectricMachine = JSONInputDataFactory.ReadElectricMotorData(Path.Combine(BasePath, entry.GetEx<string>("MotorFile")), false) }; diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/DataProvider/XMLEngineeringJobInputDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/DataProvider/XMLEngineeringJobInputDataProvider.cs index 775423b377cfb2ebe68a819ee8bcb23896f9ee55..92b9170d5ce8aa15ba98c64f30cd2d398ef408c9 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/DataProvider/XMLEngineeringJobInputDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/DataProvider/XMLEngineeringJobInputDataProvider.cs @@ -39,6 +39,11 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering.DataProvider } + public virtual IHybridStrategyParameters HybridStrategyParameters + { + get { return null; } + } + public virtual IList<ICycleData> Cycles { get { return (_cycles ?? (_cycles = Reader.CreateCycles)).Cycles; } diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs index 6fd194084fed707bce4df8b550ebbc9cfaf093dd..bf6b3c3c09e2c47861b61169e9d442fd6cce862f 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/EngineeringDataAdapter.cs @@ -663,5 +663,16 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter Inertia = motorData.Inertia, }; } + + public HybridStrategyParameters CreateHybridStrategyParameters(IHybridStrategyParameters hybridStrategyParameters) + { + var retVal = new HybridStrategyParameters() { + EquivalenceFactor = hybridStrategyParameters.EquivalenceFactor, + MinSoC = hybridStrategyParameters.MinSoC, + MaxSoC = hybridStrategyParameters.MaxSoC, + TargetSoC = hybridStrategyParameters.TargetSoC + }; + return retVal; + } } } diff --git a/VectoCore/VectoCore/InputData/Reader/Impl/EngineeringModeVectoRunDataFactory.cs b/VectoCore/VectoCore/InputData/Reader/Impl/EngineeringModeVectoRunDataFactory.cs index 0e123a83d3dd97d4c4da66e8aff75606f5eec48e..eca20e7248b51a4f7b5e1a41f34023d3b2ea6f68 100644 --- a/VectoCore/VectoCore/InputData/Reader/Impl/EngineeringModeVectoRunDataFactory.cs +++ b/VectoCore/VectoCore/InputData/Reader/Impl/EngineeringModeVectoRunDataFactory.cs @@ -115,6 +115,7 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl Cycle = new DrivingCycleProxy(drivingCycle, cycle.Name), ExecutionMode = ExecutionMode.Engineering, ElectricMachinesData = dao.CreateElectricMachines(vehicle.Components.ElectricMachines), + HybridStrategyParameters = dao.CreateHybridStrategyParameters(InputDataProvider.JobInputData.HybridStrategyParameters), BatteryData = dao.CreateBatteryData(vehicle.Components.ElectricStorage, vehicle.InitialSOC), SimulationType = SimulationType.DistanceCycle | SimulationType.MeasuredSpeedCycle | SimulationType.PWheel, GearshiftParameters = dao.CreateGearshiftData( diff --git a/VectoCore/VectoCore/VectoCore.csproj b/VectoCore/VectoCore/VectoCore.csproj index 448800c4c9dcc4d54c24b6b752a75f27a9174fa2..3f4d2b81f380d2f5f37bec2a11825af96f4aaf44 100644 --- a/VectoCore/VectoCore/VectoCore.csproj +++ b/VectoCore/VectoCore/VectoCore.csproj @@ -144,6 +144,7 @@ <Compile Include="InputData\FileIO\JSON\JSONComponentInputData.cs" /> <Compile Include="InputData\FileIO\JSON\JSONElectricMotor.cs" /> <Compile Include="InputData\FileIO\JSON\JsonExtensionMethods.cs" /> + <Compile Include="InputData\FileIO\JSON\JSONHybridStrategyParameters.cs" /> <Compile Include="InputData\FileIO\JSON\JSONTCUData.cs" /> <Compile Include="InputData\FileIO\JSON\SSMInputData.cs" /> <Compile Include="InputData\FileIO\XML\Declaration\DataProvider\AbstractCommonComponentType.cs" /> diff --git a/VectoCore/VectoCoreTest/FileIO/JsonReadTest.cs b/VectoCore/VectoCoreTest/FileIO/JsonReadTest.cs index 190bc0df3e6d2a99e06b1ffb08e8ee4685b004ac..af65fd243ac9ab44a71b76b67bddf02ad976dfef 100644 --- a/VectoCore/VectoCoreTest/FileIO/JsonReadTest.cs +++ b/VectoCore/VectoCoreTest/FileIO/JsonReadTest.cs @@ -528,6 +528,7 @@ namespace TUGraz.VectoCore.Tests.FileIO public bool SavedInDeclarationMode { get; set; } public IVehicleEngineeringInputData Vehicle { get; set; } + public IHybridStrategyParameters HybridStrategyParameters { get; } public IList<ICycleData> Cycles { get; set; } public bool EngineOnlyMode { get; set; } public IEngineEngineeringInputData EngineOnly { get; set; } diff --git a/VectoCore/VectoCoreTest/Integration/Hybrid/ParallelHybridTest.cs b/VectoCore/VectoCoreTest/Integration/Hybrid/ParallelHybridTest.cs index 99c43ad99f277da0702b2efda609ec344875cafa..1428da91e85172c108fc3eaf22bce14e9dab1451 100644 --- a/VectoCore/VectoCoreTest/Integration/Hybrid/ParallelHybridTest.cs +++ b/VectoCore/VectoCoreTest/Integration/Hybrid/ParallelHybridTest.cs @@ -38,9 +38,9 @@ namespace TUGraz.VectoCore.Tests.Integration.Hybrid public const string BatFile = @"TestData\Hybrids\Battery\GenericBattery.vbat"; public const string AccelerationFile = @"TestData\Components\Truck.vacc"; - public const string MotorFile240kW = @"TestData\Hybrids\ElectricMotor\GenericEMotor240kW.vem"; + public const string MotorFile240kW = @"TestData\Hybrids\ElectricMotor\GenericEMotor240kW.vem"; - public const string GearboxIndirectLoss = @"TestData\Components\Indirect Gear.vtlm"; + public const string GearboxIndirectLoss = @"TestData\Components\Indirect Gear.vtlm"; public const string GearboxDirectLoss = @"TestData\Components\Direct Gear.vtlm"; [OneTimeSetUp] diff --git a/VectoCore/VectoCoreTest/TestData/Hybrids/GenericVehicle_Group2_P2/Class2_RigidTruck.vveh b/VectoCore/VectoCoreTest/TestData/Hybrids/GenericVehicle_Group2_P2/Class2_RigidTruck.vveh index f59250f537cfb7b201f097d1db55cd851afc8149..e43f461144013b10af0118426d23d43ab4661a42 100644 --- a/VectoCore/VectoCoreTest/TestData/Hybrids/GenericVehicle_Group2_P2/Class2_RigidTruck.vveh +++ b/VectoCore/VectoCoreTest/TestData/Hybrids/GenericVehicle_Group2_P2/Class2_RigidTruck.vveh @@ -34,14 +34,16 @@ }, "ElectricMotors": [ { - "Count": 1, - "Position": "P2", - "MotorFile": "GenericEMotor240kW.vem" + "Count": 1, + "Ratio": 1, + "MechanicalEfficiency": 1, + "Position": "P2", + "MotorFile": "GenericEMotor240kW.vem" } - ], + ], "Battery": { "NumPacks": 2, - "BatteryFile": "GenericBattery.vbat", + "BatteryFile": "GenericBattery.vbat" }, "InitialSoC": 80, "TorqueLimits": {}, diff --git a/VectoCore/VectoCoreTest/TestData/Hybrids/GenericVehicle_Group2_P2/Class2_RigidTruck_ParHyb_ENG.vecto b/VectoCore/VectoCoreTest/TestData/Hybrids/GenericVehicle_Group2_P2/Class2_RigidTruck_ParHyb_ENG.vecto index 3c0afab2b0677336afe9d0c478c7c756b9940aba..f774a5866971f769583c25677d35b95ef01be765 100644 --- a/VectoCore/VectoCoreTest/TestData/Hybrids/GenericVehicle_Group2_P2/Class2_RigidTruck_ParHyb_ENG.vecto +++ b/VectoCore/VectoCoreTest/TestData/Hybrids/GenericVehicle_Group2_P2/Class2_RigidTruck_ParHyb_ENG.vecto @@ -3,7 +3,7 @@ "CreatedBy": " ()", "Date": "2016-10-13T08:55:18.2100810Z", "AppVersion": "3", - "FileVersion": 4 + "FileVersion": 8 }, "Body": { "SavedInDeclMode": false, @@ -16,8 +16,7 @@ "AuxiliaryVersion": "CLASSIC", "AdvancedAuxiliaryFilePath": "", - "HybridStrategy": "SimpleParallelHybridStrategy", - "HybridCtlFile": "HybridStrategyParams.vctl", + "HybridStrategyParams": "HybridStrategyParams.vctl", "Aux": [], "Padd": 3540.0, @@ -47,7 +46,7 @@ }, "Cycles": [ "RegionalDelivery", - "UrbanDelivery" + ] } } \ No newline at end of file diff --git a/VectoCore/VectoCoreTest/TestData/Hybrids/GenericVehicle_Group2_P2/GenericBattery.vbat b/VectoCore/VectoCoreTest/TestData/Hybrids/GenericVehicle_Group2_P2/GenericBattery.vbat index 1aa2c2ac9574cafaff597b8ebcac266c5343918f..fe2e69719a6f34fa259e6adf71b53f63d4fe8d53 100644 --- a/VectoCore/VectoCoreTest/TestData/Hybrids/GenericVehicle_Group2_P2/GenericBattery.vbat +++ b/VectoCore/VectoCoreTest/TestData/Hybrids/GenericVehicle_Group2_P2/GenericBattery.vbat @@ -7,17 +7,17 @@ }, "Body": { "SavedInDeclMode": false, - "Model": "Generic Battery", - "InternalResistance": 0.12, - "SOC_min": 20, - "SOC_max": 80, - "MaxCurrentFactor": 5, - "Capacity": 14, + "Model": "Generic Battery", + "SOC_min": 20, + "SOC_max": 80, + "Capacity": 7.5, + "InternalResistance": 0.4986666, + "MaxCurrentFactor": 50, "SOC": [ [ 0, 590 ], [ 10, 614 ], [ 20, 626 ], - [ 30, 632 ], + [ 30, 634 ], [ 40, 638 ], [ 50, 640 ], [ 60, 640 ], @@ -26,5 +26,5 @@ [ 90, 650 ], [ 100, 658 ] ] - } + } } \ No newline at end of file diff --git a/VectoCore/VectoCoreTest/TestData/Hybrids/GenericVehicle_Group2_P2/GenericEMotor240kW.vem b/VectoCore/VectoCoreTest/TestData/Hybrids/GenericVehicle_Group2_P2/GenericEMotor240kW.vem index c135ad47cb758f0d46a2d9544f51d6bcf558b188..74a934daae91119a5da613b6787fc05b2ea33d24 100644 --- a/VectoCore/VectoCoreTest/TestData/Hybrids/GenericVehicle_Group2_P2/GenericEMotor240kW.vem +++ b/VectoCore/VectoCoreTest/TestData/Hybrids/GenericVehicle_Group2_P2/GenericEMotor240kW.vem @@ -1,16 +1,16 @@ { - "Header": { - "CreatedBy": " ()", - "Date": "2016-10-13T08:54:28.7387223Z", - "AppVersion": "3", - "FileVersion": 1 - }, - "Body": { - "SavedInDeclMode": false, + "Header": { + "CreatedBy": " ()", + "Date": "2016-10-13T08:54:28.7387223Z", + "AppVersion": "3", + "FileVersion": 1 + }, + "Body": { + "SavedInDeclMode": false, "Model": "Generic Electric Motor", - "FullLoadCurve": "GenericEMotor240kW.vemp", - "EfficiencyMap": "GenericMap240kW.vemo", + "FullLoadCurve": "GenericEMotor240kW.vemp", "DragCurve": "GenericDrag.vemd", - "Inertia" : 0.15 + "EfficiencyMap": "GenericMap240kW.vemo", + "Inertia" : 0.2 } } \ No newline at end of file diff --git a/VectoCore/VectoCoreTest/TestData/Hybrids/GenericVehicle_Group2_P2/GenericEMotor240kW.vemp b/VectoCore/VectoCoreTest/TestData/Hybrids/GenericVehicle_Group2_P2/GenericEMotor240kW.vemp index d5f1106f86d9de4590e718cbddfe5848057a1398..694f1894340578c273e6dddf9d5612aab11d218b 100644 --- a/VectoCore/VectoCoreTest/TestData/Hybrids/GenericVehicle_Group2_P2/GenericEMotor240kW.vemp +++ b/VectoCore/VectoCoreTest/TestData/Hybrids/GenericVehicle_Group2_P2/GenericEMotor240kW.vemp @@ -1,4 +1,4 @@ -n [rpm] , T_drive [Nm] , T_drag [Nm] +n [rpm] , T_drive [Nm] , T_recuperation [Nm] 0 , 802.14 , -802.14 1600 , 802.14 , -802.14 1665 , 802.14 , -802.14 diff --git a/VectoCore/VectoCoreTest/TestData/Hybrids/GenericVehicle_Group2_P2/HybridStrategyParams.vctl b/VectoCore/VectoCoreTest/TestData/Hybrids/GenericVehicle_Group2_P2/HybridStrategyParams.vctl index 5a94a8a4c5bc12b6d13e24df38344e2bc1969192..3df557399efecbfb8c1aa5a5bb3b2781ecff9c70 100644 --- a/VectoCore/VectoCoreTest/TestData/Hybrids/GenericVehicle_Group2_P2/HybridStrategyParams.vctl +++ b/VectoCore/VectoCoreTest/TestData/Hybrids/GenericVehicle_Group2_P2/HybridStrategyParams.vctl @@ -6,10 +6,9 @@ "FileVersion": 1 }, "Body": { - "ICE IgnitionOn Speed": "600" , - "ICE RampUp Torque": "-800" , - "Electric Motor Ramp Down Time On Engine Start": "0.1", - "Generator Speed": "1400" , - "Generator Torque": "600" + "EquivalenceFactor": 2.5, + "MinSoC": 20 , + "MaxSoC": 80, + "TargetSoC": 50 } } \ No newline at end of file diff --git a/VectoCore/VectoCoreTest/VectoCoreTest.csproj b/VectoCore/VectoCoreTest/VectoCoreTest.csproj index 2d6840cf78cd0f25ea42431958707d51900bc01a..1f21390cf7590f5965fc3f3e2ad4bbedca583be9 100644 --- a/VectoCore/VectoCoreTest/VectoCoreTest.csproj +++ b/VectoCore/VectoCoreTest/VectoCoreTest.csproj @@ -432,6 +432,9 @@ <None Include="TestData\Hybrids\GenericVehicle_Group2_P2\GenericMap240kW.vemo"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> + <None Include="TestData\Hybrids\GenericVehicle_Group2_P2\HybridStrategyParams.vctl"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> <None Include="TestData\Hybrids\GenericVehicle_Group2_P2\Truck.vacc"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None>