AGX Dynamics  2.37.2.0
deprecated/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 
22 
23 
24 namespace agxDriveTrain
25 {
26  namespace deprecated {
27 
29  {
30  public:
38  CombustionEngine(agx::Real displacementVolume);
39 
43  agx::Real getRPM() const;
44 
50  agx::Real getInletPressure() const;
51 
55  void setDisplacementVolume(agx::Real displacementVolume);
56 
60  agx::Real getDisplacementVolume() const;
61 
67  bool setThrottle(agx::Real throttle);
68 
72  agx::Real getThrottle() const;
73 
79  bool setThrottleAngle(agx::Real throttleAngle);
80 
84  agx::Real getThrottleAngle() const;
85 
92  bool setIdleThrottleAngle(agx::Real throttleAngle);
93 
97  agx::Real getIdleThrottleAngle() const;
98 
104  bool setMaxThrottleAngle(agx::Real throttleAngle);
105 
109  agx::Real getMaxThrottleAngle() const;
110 
118  bool setThrottleAngleRange(agx::Real min, agx::Real max);
119 
125  bool setThrottleBore(agx::Real throttleBore);
126 
130  agx::Real getThrottleBore() const;
131 
137  bool setNrRevolutionsPerCycle(agx::Real nrRevolutionsPerCycle);
138 
142  agx::Real getNrRevolutionsPerCycle() const;
143 
147  agx::Real getOutputTorque();
148 
154  bool setVolumetricEfficiency(agx::Real volumetricEfficiency);
155 
159  agx::Real getVolumetricEfficiency() const;
160 
167  bool setDischargeCoefficient(agx::Real dischargeCoefficient);
168 
172  agx::Real getDischargeCoefficient() const;
173 
179  bool setInletVolume(agx::Real inletVolume);
180 
184  agx::Real getInletVolume() const;
185 
190  void setEnable(bool enable);
191 
195  bool getEnable() const;
196 
200  virtual void setInertia(agx::Real inertia) override;
201 
205  virtual agx::Real getInertia() const override;
206 
207  public:
210  virtual bool preUpdate(agx::Real timeStep) override;
211 
213  virtual bool store(agxStream::StorageStream& str) const override;
214 
216  virtual bool restore(agxStream::StorageStream& str) override;
217 
219 
221 
222  protected:
223  CombustionEngine() = default;
224 
225  virtual ~CombustionEngine();
226 
227  private:
232  agx::Real computeThrottleMassFlow();
233 
238  agx::Real computeThrottleMassFlowDer();
239 
246  void stepPressure(agx::Real timeStep, agx::Real angularVel);
247 
253  void startEngine(agx::Real timeStep);
254 
255 
256  private:
257  agx::Real m_inletPressure;
258  agx::Real m_torque;
259 
260  agx::Real m_idleThrottle;
261  agx::Real m_maxThrottleAngle;
262  agx::Real m_throttleAngle;
263  agx::Real m_throttleBore;
264  agx::Real m_displacementVolume;
265  agx::Real m_loadConstant;
266  agx::Real m_nrRevolutionsPerCycle;
267 
268  agx::Real m_inletVolume;
269  agx::Real m_inletTemp;
270  agx::Real m_ambientPressure;
271  agx::Real m_volumetricEfficiency;
272  agx::Real m_airGasConstant;
273  agx::Real m_dischargeCoefficient;
274 
275  bool m_enable;
276  bool m_started;
277 
278  agx::Real m_c1;
279  agx::Real m_c2;
280  agx::Real m_startingTime;
281  agx::Real m_restInertia;
282  };
283 
285 }
286  }
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
A rotational unit has one degree of freedom.
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
A library of agxPowerLine components designed to model the various parts of a vehicle drive train...
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