diff --git a/VectoCore/VectoCore/Models/Simulation/Data/ModalResultField.cs b/VectoCore/VectoCore/Models/Simulation/Data/ModalResultField.cs index c447ede96784975785bd5b7d2c2dabc35a414c83..3480f889ddd1ccf50f48a916ff4a9d4cf3c11b99 100644 --- a/VectoCore/VectoCore/Models/Simulation/Data/ModalResultField.cs +++ b/VectoCore/VectoCore/Models/Simulation/Data/ModalResultField.cs @@ -395,17 +395,19 @@ namespace TUGraz.VectoCore.Models.Simulation.Data [ModalResultField(typeof(SI), caption: "EM_{0}_off")] EM_Off_, - [ModalResultField(typeof(SI), caption: "n_{0}_avg [1/min]", outputFactor: 60 / (2 * Math.PI))] n_IEPC_, - [ModalResultField(typeof(SI), caption: "T_{0} [Nm]")] T_IEPC_, - [ModalResultField(typeof(SI), caption: "T_{0}_map [Nm]")] T_IEPC_map_, - [ModalResultField(typeof(SI), caption: "T_{0}_drive_max [Nm]")] T_IEPC_drive_max_, - [ModalResultField(typeof(SI), caption: "T_{0}_gen_max [Nm]")] T_IEPC_gen_max_, - [ModalResultField(typeof(SI), caption: "P_{0}_gen_max [kW]", outputFactor: 1e-3)] P_IEPC_gen_max_, - [ModalResultField(typeof(SI), caption: "P_{0}_drive_max [kW]", outputFactor: 1e-3)] P_IEPC_drive_max_, + [ModalResultField(typeof(SI), caption: "n_{0}_int_avg [1/min]", outputFactor: 60 / (2 * Math.PI))] n_IEPC_int_, + [ModalResultField(typeof(SI), caption: "T_{0}_int [Nm]")] T_IEPC_, + [ModalResultField(typeof(SI), caption: "T_{0}_int_map [Nm]")] T_IEPC_map_, + [ModalResultField(typeof(SI), caption: "T_{0}_int_drive_max [Nm]")] T_IEPC_int_drive_max_, + [ModalResultField(typeof(SI), caption: "T_{0}_int_gen_max [Nm]")] T_IEPC_int_gen_max_, + [ModalResultField(typeof(SI), caption: "P_{0}_int_gen_max [kW]", outputFactor: 1e-3)] P_IEPC_int_gen_max_, + [ModalResultField(typeof(SI), caption: "P_{0}_int_drive_max [kW]", outputFactor: 1e-3)] P_IEPC_int_drive_max_, [ModalResultField(typeof(SI), caption: "P_{0}_inertia_loss [kW]", outputFactor: 1e-3)] P_IEPC_electricMotorInertiaLoss_, - [ModalResultField(typeof(SI), caption: "P_{0}_mech_map [kW]", outputFactor: 1e-3)] P_IEPC_mech_map_, + [ModalResultField(typeof(SI), caption: "P_{0}_int_mech_map [kW]", outputFactor: 1e-3)] P_IEPC_int_mech_map_, [ModalResultField(typeof(SI), caption: "P_{0}_el [kW]", outputFactor: 1e-3)] P_IEPC_el_, [ModalResultField(typeof(SI), caption: "P_{0}_out [kW]", outputFactor: 1e-3)] P_IEPC_out_, + [ModalResultField(typeof(SI), caption: "n_IEPC_out_avg [kW]", outputFactor: 1e-3)] n_IEPC_out_avg, + [ModalResultField(typeof(SI), caption: "T_IEPC_out [kW]", outputFactor: 1e-3)] T_IEPC_out, [ModalResultField(typeof(SI), caption: "P_{0}_loss [kW]", outputFactor: 1e-3)] P_IEPC_electricMotorLoss_, [ModalResultField(typeof(SI), caption: "{0}_off")] IEPC_Off_, [ModalResultField(typeof(SI), caption: "{0}_OVL [%]", outputFactor: 100)] IEPC_OvlBuffer_, diff --git a/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs b/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs index 3a9b506cfcf357fd98ff201a0d48ee966ed1ed63..0fae92d6312ad372e901b6a82813e084be0dcfcf 100644 --- a/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs +++ b/VectoCore/VectoCore/Models/Simulation/Impl/PowertrainBuilder.cs @@ -891,7 +891,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl //-->AxleGear-->APTNGearbox or SinglespeedGearbox-->Engine E2 var gearbox = data.GearboxData.Gears.Count > 1 - ? (IGearbox)new APTNGearbox(container, new APTNShiftStrategy(container)) + ? (IGearbox)new IEPCGearbox(container, new APTNShiftStrategy(container)) : new SingleSpeedGearbox(container, data.GearboxData); em = GetElectricMachine(PowertrainPosition.IEPC, data.ElectricMachinesData, container, es, ctl); powertrain @@ -985,7 +985,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl //-->AxleGear-->APTNGearbox or SinglespeedGearbox-->Engine E2 var gearbox = data.GearboxData.Gears.Count > 1 - ? (IGearbox)new APTNGearbox(container, new APTNShiftStrategy(container)) + ? (IGearbox)new IEPCGearbox(container, new APTNShiftStrategy(container)) : new SingleSpeedGearbox(container, data.GearboxData); em = GetElectricMachine(PowertrainPosition.IEPC, data.ElectricMachinesData, container, es, ctl); powertrain diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/IEPC.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/IEPC.cs index 64ab097e1aea9f8ca1aefffd4e3dc227e0964177..867a88f2ba682b0a7c69b6b5ab2f35f7a169963e 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/IEPC.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/IEPC.cs @@ -21,18 +21,18 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl{ var avgDTSpeed = (prevDtSpeed + CurrentState.DrivetrainSpeed) / 2; //container[ModalResultField.EM_ratio_, Position] = ModelData.RatioADC.SI<Scalar>(); - container[ModalResultField.n_IEPC_, Position] = avgEMSpeed; + container[ModalResultField.n_IEPC_int_, Position] = avgEMSpeed; container[ModalResultField.T_IEPC_, Position] = CurrentState.EMTorque; container[ModalResultField.T_IEPC_map_, Position] = CurrentState.EmTorqueMap; - container[ModalResultField.T_IEPC_drive_max_, Position] = CurrentState.DriveMax; - container[ModalResultField.T_IEPC_gen_max_, Position] = CurrentState.DragMax; + container[ModalResultField.T_IEPC_int_drive_max_, Position] = CurrentState.DriveMax; + container[ModalResultField.T_IEPC_int_gen_max_, Position] = CurrentState.DragMax; - container[ModalResultField.P_IEPC_gen_max_, Position] = (CurrentState.DragMax ?? 0.SI<NewtonMeter>()) * avgEMSpeed; - container[ModalResultField.P_IEPC_drive_max_, Position] = (CurrentState.DriveMax ?? 0.SI<NewtonMeter>()) * avgEMSpeed; + container[ModalResultField.P_IEPC_int_gen_max_, Position] = (CurrentState.DragMax ?? 0.SI<NewtonMeter>()) * avgEMSpeed; + container[ModalResultField.P_IEPC_int_drive_max_, Position] = (CurrentState.DriveMax ?? 0.SI<NewtonMeter>()) * avgEMSpeed; //container[ModalResultField.P_EM_electricMotor_em_mech_, Position] = (CurrentState.EMTorque ?? 0.SI<NewtonMeter>()) * avgEMSpeed; - container[ModalResultField.P_IEPC_mech_map_, Position] = (CurrentState.EmTorqueMap ?? 0.SI<NewtonMeter>()) * avgEMSpeed; + container[ModalResultField.P_IEPC_int_mech_map_, Position] = (CurrentState.EmTorqueMap ?? 0.SI<NewtonMeter>()) * avgEMSpeed; //container[ModalResultField.P_EM_in_, Position] = CurrentState.DrivetrainInTorque * avgDTSpeed; diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/IEPCGearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/IEPCGearbox.cs new file mode 100644 index 0000000000000000000000000000000000000000..ccc88dd5136ce06397fe4332e7eea78e13ed786d --- /dev/null +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/IEPCGearbox.cs @@ -0,0 +1,30 @@ +using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.Models.Simulation; +using TUGraz.VectoCore.Models.Simulation.Data; +using TUGraz.VectoCore.OutputData; + +namespace TUGraz.VectoCore.Models.SimulationComponent.Impl +{ + public class IEPCGearbox : APTNGearbox + { + public IEPCGearbox(IVehicleContainer container, IShiftStrategy strategy) : base(container, strategy) { } + + protected override void DoWriteModalResults(Second time, Second simulationInterval, + IModalDataContainer container) + { + //var avgInAngularSpeed = (PreviousState.InAngularVelocity + CurrentState.InAngularVelocity) / 2.0; + //var avgOutAngularSpeed = (PreviousState.OutAngularVelocity + CurrentState.OutAngularVelocity) / 2.0; + //var inPower = CurrentState.InTorque * avgInAngularSpeed; + //var outPower = CurrentState.OutTorque * avgOutAngularSpeed; + container[ModalResultField.Gear] = Disengaged || DataBus.VehicleInfo.VehicleStopped ? 0 : Gear.Gear; + //container[ModalResultField.P_gbx_loss] = inPower - outPower; + //container[ModalResultField.P_gbx_inertia] = CurrentState.InertiaTorqueLossOut * avgOutAngularSpeed; + //container[ModalResultField.P_gbx_in] = inPower; + container[ModalResultField.n_IEPC_out_avg] = (PreviousState.OutAngularVelocity + + CurrentState.OutAngularVelocity) / 2.0; + container[ModalResultField.T_IEPC_out] = CurrentState.OutTorque; + //container[ModalResultField.T_gbx_in] = CurrentState.InTorque; + _strategy.WriteModalResults(container); + } + } +} \ No newline at end of file diff --git a/VectoCore/VectoCore/OutputData/ModalDataContainer.cs b/VectoCore/VectoCore/OutputData/ModalDataContainer.cs index 2a43cc64354cc05baaba5a1e14db4556d5933300..fe7610ff63b029939cfe5177626a32331bd82e9e 100644 --- a/VectoCore/VectoCore/OutputData/ModalDataContainer.cs +++ b/VectoCore/VectoCore/OutputData/ModalDataContainer.cs @@ -95,15 +95,15 @@ namespace TUGraz.VectoCore.OutputData }; private readonly ModalResultField[] _iepcColumns = { - ModalResultField.n_IEPC_, + ModalResultField.n_IEPC_int_, ModalResultField.T_IEPC_, ModalResultField.T_IEPC_map_, - ModalResultField.T_IEPC_drive_max_, - ModalResultField.T_IEPC_gen_max_, - ModalResultField.P_IEPC_gen_max_, - ModalResultField.P_IEPC_drive_max_, + ModalResultField.T_IEPC_int_drive_max_, + ModalResultField.T_IEPC_int_gen_max_, + ModalResultField.P_IEPC_int_gen_max_, + ModalResultField.P_IEPC_int_drive_max_, ModalResultField.P_IEPC_electricMotorInertiaLoss_, - ModalResultField.P_IEPC_mech_map_, + ModalResultField.P_IEPC_int_mech_map_, ModalResultField.P_IEPC_el_, ModalResultField.P_IEPC_out_, ModalResultField.P_IEPC_electricMotorLoss_, @@ -356,7 +356,7 @@ namespace TUGraz.VectoCore.OutputData } var elPwrField = emPos == PowertrainPosition.IEPC ? ModalResultField.P_IEPC_el_ : ModalResultField.P_EM_electricMotor_el_; - var mechPwrField = emPos == PowertrainPosition.IEPC ? ModalResultField.P_IEPC_mech_map_ : ModalResultField.P_EM_mech_; + var mechPwrField = emPos == PowertrainPosition.IEPC ? ModalResultField.P_IEPC_int_mech_map_ : ModalResultField.P_EM_mech_; var selected = Data.AsEnumerable().Select(r => { var dt = r.Field<Second>(ModalResultField.simulationInterval.GetName()); return new { @@ -417,7 +417,7 @@ namespace TUGraz.VectoCore.OutputData } var offField = emPos == PowertrainPosition.IEPC ? ModalResultField.IEPC_Off_ : ModalResultField.EM_Off_; var elPwrField = emPos == PowertrainPosition.IEPC ? ModalResultField.P_IEPC_el_ : ModalResultField.P_EM_electricMotor_el_; - var mechPwrField = emPos == PowertrainPosition.IEPC ? ModalResultField.P_IEPC_mech_map_ : ModalResultField.P_EM_mech_; + var mechPwrField = emPos == PowertrainPosition.IEPC ? ModalResultField.P_IEPC_int_mech_map_ : ModalResultField.P_EM_mech_; var selected = Data.AsEnumerable().Select(r => { var dt = r.Field<Second>(ModalResultField.simulationInterval.GetName()); return new { @@ -531,7 +531,7 @@ namespace TUGraz.VectoCore.OutputData public PerSecond ElectricMotorAverageSpeed(PowertrainPosition emPos) { var field = emPos == PowertrainPosition.IEPC - ? ModalResultField.n_IEPC_ + ? ModalResultField.n_IEPC_int_ : ModalResultField.n_EM_electricMotor_; var integral = GetValues(x => x.Field<PerSecond>(string.Format(field.GetCaption(), emPos.GetName())).Value() * x.Field<Second>(ModalResultField.simulationInterval.GetName()).Value()).Sum(); diff --git a/VectoCore/VectoCoreTest/TestData/Hybrids/GenericIEPC-S/Common/Hybrid_Parameters.vhctl b/VectoCore/VectoCoreTest/TestData/Hybrids/GenericIEPC-S/Common/Hybrid_Parameters.vhctl new file mode 100644 index 0000000000000000000000000000000000000000..2f2ed814fcff9e24e146e56f0d0ff41378f5a386 --- /dev/null +++ b/VectoCore/VectoCoreTest/TestData/Hybrids/GenericIEPC-S/Common/Hybrid_Parameters.vhctl @@ -0,0 +1,18 @@ +{ + "Header": { + "CreatedBy": "", + "Date": "2020-09-07T15:28:08.3781385Z", + "AppVersion": "3", + "FileVersion": 2 + }, + "Body": { + "----EquivalenceFactor": 2.0, + "MinSoC": 24.0, + "----MaxSoC": 80.0, + "TargetSoC": 70.0, + "----AuxBufferTime": 5.0, + "----AuxBufferChgTime": 5.0, + "----MinICEOnTime": 10.0, + "GensetMinOptPowerFactor": 0.2 + } +} \ No newline at end of file diff --git a/VectoCore/VectoCoreTest/XML/XMLDeclarationInputv24.cs b/VectoCore/VectoCoreTest/XML/XMLDeclarationInputv24.cs index 64ecf91f45da8df09019ae117714957b8225533a..e9489aa2ba4b7a7b8a6809e436588f839bee105e 100644 --- a/VectoCore/VectoCoreTest/XML/XMLDeclarationInputv24.cs +++ b/VectoCore/VectoCoreTest/XML/XMLDeclarationInputv24.cs @@ -1414,7 +1414,7 @@ namespace TUGraz.VectoCore.Tests.XML Assert.IsNotNull(vehicle.Components.ElectricStorage); Assert.IsNull(vehicle.Components.PTOTransmissionInputData); Assert.IsNull(vehicle.TorqueLimits); - Assert.IsNull(vehicle.ElectricMotorTorqueLimits); + Assert.IsNotNull(vehicle.ElectricMotorTorqueLimits); Assert.IsNull(vehicle.BoostingLimitations); } @@ -1457,7 +1457,7 @@ namespace TUGraz.VectoCore.Tests.XML Assert.IsNull(vehicle.Components.PTOTransmissionInputData); Assert.IsNull(vehicle.CargoVolume); Assert.IsNull(vehicle.TorqueLimits); - Assert.IsNull(vehicle.ElectricMotorTorqueLimits); + Assert.IsNotNull(vehicle.ElectricMotorTorqueLimits); Assert.IsNull(vehicle.BoostingLimitations); }