AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
deprecated/CombustionEngine.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or
9having been advised so by Algoryx Simulation AB for a time limited evaluation,
10or having purchased a valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#pragma once
18
19#include <agxModel/export.h>
20
22
23
24namespace agxDriveTrain
25{
26 namespace deprecated {
27
29 {
30 public:
38 CombustionEngine(agx::Real displacementVolume);
39
44
51
55 void setDisplacementVolume(agx::Real displacementVolume);
56
61
67 bool setThrottle(agx::Real throttle);
68
73
79 bool setThrottleAngle(agx::Real throttleAngle);
80
85
92 bool setIdleThrottleAngle(agx::Real throttleAngle);
93
98
104 bool setMaxThrottleAngle(agx::Real throttleAngle);
105
110
119
125 bool setThrottleBore(agx::Real throttleBore);
126
131
137 bool setNrRevolutionsPerCycle(agx::Real nrRevolutionsPerCycle);
138
143
148
154 bool setVolumetricEfficiency(agx::Real volumetricEfficiency);
155
160
167 bool setDischargeCoefficient(agx::Real dischargeCoefficient);
168
173
179 bool setInletVolume(agx::Real inletVolume);
180
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
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 }
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
#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
void setDisplacementVolume(agx::Real displacementVolume)
Set the total Displacement volume of engine cylinders in m^3.
bool setNrRevolutionsPerCycle(agx::Real nrRevolutionsPerCycle)
Set how many revolutions per cycle the engine cylinders have.
void setEnable(bool enable)
Must be called to start the engine.
virtual void setInertia(agx::Real inertia) override
Set the inertia for the engine.
bool setMaxThrottleAngle(agx::Real throttleAngle)
Set the largest angle the throttle plate is allowed to have, i.e.
bool setThrottleAngle(agx::Real throttleAngle)
Set the throttle plate angle directly, instead of percentage of throttle opening.
CombustionEngine(agx::Real displacementVolume)
Create an combustion engine.
bool setDischargeCoefficient(agx::Real dischargeCoefficient)
Set the discharge coefficient of the flow past the throttle.
bool setThrottle(agx::Real throttle)
Set the percentage that the throttle is open.
bool setInletVolume(agx::Real inletVolume)
Set the inlet manifold volume of the engine.
virtual agx::Real getInertia() const override
Get the engine inertia.
bool setThrottleBore(agx::Real throttleBore)
Set the diameter of the throttle plate, which is assumed to be circular.
agx::Real getRPM() const
Get revolutions per minute.
bool setThrottleAngleRange(agx::Real min, agx::Real max)
Set the smallest and largest angle the throttle plate is allowed to have, i.e.
bool setIdleThrottleAngle(agx::Real throttleAngle)
Set the idle throttle angle for the engine, i.e.
agx::Real getInletPressure() const
Get the current pressure in the inlet manifold, i.e.the pressure right before the cylinders.
bool setVolumetricEfficiency(agx::Real volumetricEfficiency)
Set the volumetric efficiency.
A rotational unit has one degree of freedom.
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:89
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:88
A library of agxPowerLine components designed to model the various parts of a vehicle drive train.
This namespace contain classes for streaming classes into archives, ASCII, binary for storage (serial...
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
double Real
Definition: Real.h:41