AGXDynamics  2.35.0.3
CombustionEngine.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. 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 
22 
23 
24 namespace agxDriveTrain
25 {
27  {
28  public:
36  CombustionEngine(agx::Real displacementVolume);
37 
41  agx::Real getRPM() const;
42 
48  agx::Real getInletPressure() const;
49 
53  void setDisplacementVolume(agx::Real displacementVolume);
54 
58  agx::Real getDisplacementVolume() const;
59 
65  bool setThrottle(agx::Real throttle);
66 
70  agx::Real getThrottle() const;
71 
77  bool setThrottleAngle(agx::Real throttleAngle);
78 
82  agx::Real getThrottleAngle() const;
83 
90  bool setIdleThrottleAngle(agx::Real throttleAngle);
91 
95  agx::Real getIdleThrottleAngle() const;
96 
102  bool setMaxThrottleAngle(agx::Real throttleAngle);
103 
107  agx::Real getMaxThrottleAngle() const;
108 
116  bool setThrottleAngleRange(agx::Real min, agx::Real max);
117 
123  bool setThrottleBore(agx::Real throttleBore);
124 
128  agx::Real getThrottleBore() const;
129 
135  bool setNrRevolutionsPerCycle(agx::Real nrRevolutionsPerCycle);
136 
140  agx::Real getNrRevolutionsPerCycle() const;
141 
145  agx::Real getOutputTorque();
146 
152  bool setVolumetricEfficiency(agx::Real volumetricEfficiency);
153 
157  agx::Real getVolumetricEfficiency() const;
158 
165  bool setDischargeCoefficient(agx::Real dischargeCoefficient);
166 
170  agx::Real getDischargeCoefficient() const;
171 
177  bool setInletVolume(agx::Real inletVolume);
178 
182  agx::Real getInletVolume() const;
183 
188  void setEnable(bool enable);
189 
193  bool getEnable() const;
194 
198  virtual void setInertia(agx::Real inertia) override;
199 
203  virtual agx::Real getInertia() const override;
204 
205  public:
208  virtual bool preUpdate(agx::Real timeStep) override;
209 
211  virtual bool store(agxStream::StorageStream& str) const override;
212 
214  virtual bool restore(agxStream::StorageStream& str) override;
215 
217 
219 
220  protected:
221  CombustionEngine() = default;
222 
223  virtual ~CombustionEngine();
224 
225  private:
230  agx::Real computeThrottleMassFlow();
231 
236  agx::Real computeThrottleMassFlowDer();
237 
244  void stepPressure(agx::Real timeStep, agx::Real angularVel);
245 
251  void startEngine(agx::Real timeStep);
252 
253 
254  private:
255  agx::Real m_inletPressure;
256  agx::Real m_torque;
257 
258  agx::Real m_idleThrottle;
259  agx::Real m_maxThrottleAngle;
260  agx::Real m_throttleAngle;
261  agx::Real m_throttleBore;
262  agx::Real m_displacementVolume;
263  agx::Real m_loadConstant;
264  agx::Real m_nrRevolutionsPerCycle;
265 
266  agx::Real m_inletVolume;
267  agx::Real m_inletTemp;
268  agx::Real m_ambientPressure;
269  agx::Real m_volumetricEfficiency;
270  agx::Real m_airGasConstant;
271  agx::Real m_dischargeCoefficient;
272 
273  bool m_enable;
274  bool m_started;
275 
276  agx::Real m_c1;
277  agx::Real m_c2;
278  agx::Real m_startingTime;
279  agx::Real m_restInertia;
280  };
281 
283 }
RotationalUnit.h
agx::Real
double Real
Definition: Real.h:42
export.h
DOXYGEN_END_INTERNAL_BLOCK
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:97
agxDriveTrain
A library of agxPowerLine components designed to model the various parts of a vehicle drive train.
DOXYGEN_START_INTERNAL_BLOCK
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:96
agxStream::StorageStream
Abstract base class for storing/restoring a line/drums with version control.
Definition: StorageStream.h:48
AGXSTREAM_DECLARE_SERIALIZABLE
#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
agxDriveTrain::CombustionEngine
Definition: CombustionEngine.h:26
agx::min
Vec3T< T > min(const Vec3T< T > &lhs, const Vec3T< T > &rhs)
Definition: Vec3Template.h:880
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
AGXMODEL_EXPORT
#define AGXMODEL_EXPORT
Definition: agxModel/export.h:42
agxPowerLine::RotationalUnit
A rotational unit has one degree of freedom.
Definition: RotationalUnit.h:29
agx::max
Vec3T< T > max(const Vec3T< T > &lhs, const Vec3T< T > &rhs)
Definition: Vec3Template.h:874