Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 681b0d9f authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

connect WHR also in simple powertrain (testpowertrain)

make sure the whr previous state is correctly set if used in the testpowertrain
parent b6550b65
No related branches found
No related tags found
No related merge requests found
......@@ -1731,6 +1731,13 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
default: throw new VectoException("Wrong CycleType for SimplePowertrain");
}
if ((data.SuperCapData != null || data.BatteryData != null) && data.EngineData.WHRType.IsElectrical()) {
var dcDcConverterEfficiency = DeclarationData.WHRChargerEfficiency;
var whrCharger = new WHRCharger(container, dcDcConverterEfficiency);
es.Connect(whrCharger);
engine.WHRCharger = whrCharger;
}
vehicle.AddComponent(new Wheels(container, data.VehicleData.DynamicTyreRadius, data.VehicleData.WheelsInertia))
.AddComponent(ctl)
.AddComponent(new Brakes(container))
......
......@@ -23,6 +23,11 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
protected override void DoCommitSimulationStep(Second time, Second simulationInterval)
{
AdvanceState();
if (PreviousState.GeneratedEnergy == null && DataBus.IsTestPowertrain) {
// the method GeneratedEnergy is not called because there is no moddata to write and we are in a testpowertrain
// make sure the value is not null...
PreviousState.GeneratedEnergy = 0.SI<WattSecond>();
}
}
#endregion
......
......@@ -494,7 +494,12 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
var (pWHRelMap, pWHRelCorr) = GetWHRPower(ModelData.ElectricalWHR, engineSpeed, engineTorque);
var (pWHRmechMap, pWHRmechCorr) = GetWHRPower(ModelData.MechanicalWHR, engineSpeed, engineTorque);
if (Math.Abs(DataBus.BatteryInfo.StateOfCharge - DataBus.BatteryInfo.MaxSoC) < 0.01) {
// we are close to the max charge - 'bypass' electric WHR...
pWHRelCorr = 0.SI<Watt>();
}
container[ModalResultField.P_WHR_el_map] = pWHRelMap;
container[ModalResultField.P_WHR_el_corr] = pWHRelCorr;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment