AGX Dynamics  2.37.2.0
CombustionEngine.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or
9 having been advised so by Algoryx Simulation AB for a time limited evaluation,
10 or having purchased a valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #pragma once
18 
19 #include <agxModel/export.h>
20 #include <agxDriveTrain/Shaft.h>
22 
23 
24 namespace agxDriveTrain
25 {
31  {
36  };
37 
38 
40  {
41  public:
57 
62  FrictionTorqueParameters& getFrictionTorqueParameters();
63 
71  CombustionEngineParameters& getCombustionEngineParameters();
72 
77  agx::Real getInletPressure() const;
78 
84  bool setThrottle(agx::Real throttle);
85 
89  agx::Real getThrottle() const;
90 
96  bool setThrottleAngle(agx::Real throttleAngle);
97 
101  agx::Real getThrottleAngle() const;
102 
109  bool setIdleThrottleAngle(agx::Real throttleAngle);
110 
114  agx::Real getIdleThrottleAngle() const;
115 
121  bool setMaxThrottleAngle(agx::Real throttleAngle);
122 
126  agx::Real getMaxThrottleAngle() const;
127 
135  bool setThrottleAngleRange(agx::Real min, agx::Real max);
136 
143  bool setThrottlePinBoreRatio(agx::Real throttlePinBoreRatio);
144 
148  agx::Real getThrottlePinBoreRatio() const;
149 
155  bool setNrRevolutionsPerCycle(agx::Real nrRevolutionsPerCycle);
156 
160  agx::Real getNrRevolutionsPerCycle() const;
161 
167  bool setMaxVolumetricEfficiency(agx::Real maxVolumetricEfficiency);
168 
172  agx::Real getMaxVolumetricEfficiency() const;
173 
179  agx::Real getVolumetricEfficiency(agx::Real N, agx::Real p) const;
180 
186  agx::Real computeCylinderAirMassFlowRate(agx::Real N, agx::Real p);
187 
191  agx::Real getThermalEfficiency() const;
192 
197  bool setAirFuelRatio(agx::Real ratio);
198 
202  agx::Real getAirFuelRatio() const;
203 
208  bool setHeatValue(agx::Real heatValue);
209 
213  agx::Real getHeatValue() const;
214 
220  agx::Real computeIndicatedTorque(agx::Real N, agx::Real p);
221 
226  agx::Real computeFrictionTorque(agx::Real N);
227 
232  agx::Real computePumpTorque(agx::Real p);
233 
237  agx::Real getIndicatedTorque() const;
238 
242  agx::Real getFrictionTorque() const;
243 
247  agx::Real getPumpTorque() const;
248 
252  agx::Real getOutputTorque() const;
253 
259  bool setInletVolume(agx::Real inletVolume);
260 
264  agx::Real getInletVolume() const;
265 
270  void setEnable(bool enable);
271 
275  bool getEnable() const;
276 
282  void setInletTemperature(agx::Real inletTemperature);
283 
287  agx::Real getInletTemperature() const;
288 
292  agx::Real getCylinderAirMassFlow();
293 
297  agx::Real getThrottleAirMassFlow();
298 
303  void computeMaxThrottleArea();
304 
308  void computeVolumetricEfficiencyCoefficients();
309 
315  agx::Real computeFlowGain(agx::Real r);
316 
321  agx::Real computeFlowGainDerivative(agx::Real r);
322 
328  agx::Real computeThrottleAreaGain(agx::Real alpha);
329 
330  public:
332  virtual bool preUpdate(agx::Real timeStep) override;
333 
335  virtual bool store(agxStream::StorageStream& str) const override;
336 
338  virtual bool restore(agxStream::StorageStream& str) override;
339 
341 
343 
344  CombustionEngine() = default;
345 
346  protected:
347  virtual ~CombustionEngine();
348 
349  private:
350 
356  void stepPressure(agx::Real timeStep);
357 
362  void startEngine();
363 
364  private:
365 
366  agx::Real m_inletVolume;
367  agx::Real m_inletPressure;
368 
369  agx::Real m_maxVolumetricEfficiency;
370  agx::Real m_idleThrottleAngle;
371 
372  agx::Real m_maxThrottleAngle;
373  agx::Real m_throttleAngle;
374 
375  agx::Real m_throttlePinBoreRatio;
376  agx::Real m_maxThrottleArea;
377 
378  agx::Real m_nrRevolutionsPerCycle;
379 
380  agx::Real m_inletTemperature;
381  agx::Real m_ambientPressure;
382 
383  agx::Real m_airGasConstant;
384 
385  bool m_enable;
386  bool m_started;
387 
388  agx::Real m_idleInletPressure;
389 
390  agx::Real m_c0;
391  agx::Real m_c1;
392  agx::Real m_c2;
393  agx::Real m_c3;
394 
395  agx::Real m_airFuelRatio;
396  agx::Real m_heatValue;
397  agx::Real m_thermalEfficiency;
398 
399  agx::Real m_indicatedTorque;
400  agx::Real m_frictionTorque;
401  agx::Real m_pumpTorque;
402 
403  agx::Real m_outputTorque;
404 
405  CombustionEngineParameters m_combustionEngineParameters;
406  FrictionTorqueParameters m_frictionTorqueParameters;
407  };
408 
410 }
Vec3T< T > min(const Vec3T< T > &lhs, const Vec3T< T > &rhs)
Definition: Vec3Template.h:861
Vec3T< T > max(const Vec3T< T > &lhs, const Vec3T< T > &rhs)
Definition: Vec3Template.h:855
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
A Shaft is the most basic PowerLine Unit.
Definition: Shaft.h:34
A library of agxPowerLine components designed to model the various parts of a vehicle drive train...
Parameters that affect the engine performance.
Parameters controlling the mean effective friction torque.
Abstract base class for storing/restoring a line/drums with version control.
Definition: StorageStream.h:48
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Definition: Serializable.h:207
#define AGXMODEL_EXPORT
double Real
Definition: Real.h:42
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:98
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:97