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

Skip to content
Snippets Groups Projects
Commit c70aef11 authored by Markus QUARITSCH's avatar Markus QUARITSCH
Browse files

refactoring getwhrpower in combustion engine

parent f266ba7b
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,11 @@ namespace TUGraz.VectoCore.InputData.Reader.ComponentData
WHRMap = whrMap;
}
public string Name
{
get { return WHRMap.Name; }
}
public class Entry
{
[Required, SIRange(0, 5000 * Constants.RPMToRad)] public readonly PerSecond EngineSpeed;
......
......@@ -455,18 +455,20 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
protected virtual void GetWHRPower(WHRData whr, PerSecond engineSpeed, NewtonMeter engineTorque, ref Watt pWHRMap, ref Watt pWHRCorr)
{
if (whr != null) {
var whrPwrEl = whr.WHRMap.GetWHRPower(
engineTorque, engineSpeed, DataBus.ExecutionMode != ExecutionMode.Declaration);
if (DataBus.ExecutionMode != ExecutionMode.Declaration && whrPwrEl.Extrapolated) {
Log.Warn(
"Electric WHR power was extrapolated: range for WHR-Map is not sufficient: n: {0}, torque: {1}",
engineSpeed.Value(), engineTorque.Value());
}
if (whrPwrEl.GeneratedPower != null) {
pWHRMap = whrPwrEl.GeneratedPower;
pWHRCorr = pWHRMap * whr.WHRCorrectionFactor;
}
if (whr == null) {
return;
}
var whrPwr = whr.WHRMap.GetWHRPower(
engineTorque, engineSpeed, DataBus.ExecutionMode != ExecutionMode.Declaration);
if (DataBus.ExecutionMode != ExecutionMode.Declaration && whrPwr.Extrapolated) {
Log.Warn(
"WHR power was extrapolated in {2}: range for WHR-Map is not sufficient: n: {0}, torque: {1}",
engineSpeed.Value(), engineTorque.Value(), whr.WHRMap.Name);
}
if (whrPwr.GeneratedPower != null) {
pWHRMap = whrPwr.GeneratedPower;
pWHRCorr = pWHRMap * whr.WHRCorrectionFactor;
}
}
......
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