AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
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#include <agxDriveTrain/Shaft.h>
22
23
24namespace agxDriveTrain
25{
26
37 {
38 public:
39
46
54
60
69
74
80
86 bool setThrottle(agx::Real throttle);
87
92
98 bool setThrottleAngle(agx::Real throttleAngle);
99
104
110 bool setIdleThrottleAngle(agx::Real throttleAngle);
111
116
122 bool setMaxThrottleAngle(agx::Real throttleAngle);
123
128
136
142 bool setThrottlePinBoreRatio(agx::Real throttlePinBoreRatio);
143
148
155
160
165 bool setMaxVolumetricEfficiency(agx::Real maxVolumetricEfficiency);
166
171
178
183
190
195
203
208
216 bool setHeatValue(agx::Real heatValue);
217
222
229
235
241
246
251
256
261
267 bool setInletVolume(agx::Real inletVolume);
268
273
278 void setEnable(bool enable);
279
283 bool getEnable() const;
284
290 void setInletTemperature(agx::Real inletTemperature);
291
296
301
306
311
318 static bool readLibraryProperties(const agx::String& name, CombustionEngineParameters& parameters);
319
325
331
332
334
335 public:
337 virtual bool preUpdate(agx::Real timeStep) override;
338
340 virtual bool store(agxStream::StorageStream& str) const override;
341
343 virtual bool restore(agxStream::StorageStream& str) override;
344
346
348
349 protected:
351
352 void initParameters();
353
358 void computeMaxThrottleArea();
359
363 void computeVolumetricEfficiencyCoefficients();
364
370 agx::Real computeFlowGain(agx::Real r);
371
376 agx::Real computeFlowGainDerivative(agx::Real r);
377
383 agx::Real computeThrottleAreaGain(agx::Real alpha);
384
386
387 private:
388
394 void stepPressure(agx::Real timeStep);
395
400 void startEngine();
401
402 private:
403
404 agx::Real m_inletVolume;
405 agx::Real m_inletPressure;
406
407 agx::Real m_throttleAngle;
408
409 agx::Real m_maxThrottleArea;
410
411 agx::Real m_inletTemperature;
412 agx::Real m_ambientPressure;
413
414 agx::Real m_airGasConstant;
415
416 bool m_enable;
417 bool m_started;
418
419 agx::Real m_idleInletPressure;
420
421 agx::Real m_c0;
422 agx::Real m_c1;
423 agx::Real m_c2;
424 agx::Real m_c3;
425
426 agx::Real m_thermalEfficiency;
427
428 agx::Real m_indicatedTorque;
429 agx::Real m_frictionTorque;
430 agx::Real m_pumpTorque;
431
432 agx::Real m_outputTorque;
433
434 CombustionEngineParameters m_combustionEngineParameters;
435 };
436
438}
#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
The model of the combustion engine consists of two subsystems: namely, the intake manifold dynamics a...
agx::Real computeIndicatedTorque(agx::Real N, agx::Real p)
Compute the engine indicated torque.
agx::Real getMaxThrottleAngle() const
CombustionEngine(const CombustionEngineParameters &params)
Create a combustion engine from specific parameters.
bool setThrottleAngleRange(agx::Real min, agx::Real max)
Set the minimum and maximum angle that the throttle plate is allowed to have, i.e.
void setNrRevolutionsPerCycle(CombustionEngineParameters::RevolutionsPerCycle nrRevolutionsPerCycle)
Set the number of crankshaft revolutions during one engine operating cycle.
agx::Real getMaxVolumetricEfficiency() const
CombustionEngine()
Create a combustion engine.
bool setAirFuelRatio(agx::Real ratio)
Set the stoichiometric air-fuel ratio.
agx::Real getPumpTorque() const
bool loadLibraryProperties(const agx::String &name)
Load named CombustionEngineParameters from the Material Library for the current CombustionEngine.
agx::Real getHeatValue() const
bool setThrottle(agx::Real throttle)
Set the fraction or the percentage of the throttle openning.
agx::Real getThermalEfficiency() const
agx::Real getInletVolume() const
void setEnable(bool enable)
Must be called to start the engine.
agx::Real getFrictionTorque() const
bool setMaxThrottleAngle(agx::Real throttleAngle)
Set the maximum angle that the throttle plate is allowed to have, i.e.
agx::Real getVolumetricEfficiency(agx::Real N, agx::Real p) const
agx::Real getInletPressure() const
Get the current pressure in the inlet manifold.
bool setInletVolume(agx::Real inletVolume)
Set the inlet manifold volume of the engine.
bool setThrottleAngle(agx::Real throttleAngle)
Set the opening angle of the throttle plate directly, as opposed to the fraction/percentage of the th...
bool setThrottlePinBoreRatio(agx::Real throttlePinBoreRatio)
Set the ratio between throttle pin diameter and throttle bore diameter.
static agx::StringVector getAvailableLibraryProperties()
Returns a vector with all the named CombustionEngineProperties that were found in the Material Librar...
CombustionEngineParameters & getCombustionEngineParameters()
Return directly a reference to allow the constructs like engine.getCombustionEngineParameters()....
agx::Real getInletTemperature() const
agx::Real computeFrictionTorque(agx::Real N)
Compute the engine friction torque losses.
agx::Real getAirFuelRatio() const
agx::Real getRPM() const
returns the number of revolutions per minute
agx::Real getOutputTorque() const
agx::Real getIndicatedTorque() const
agx::Real computePumpTorque(agx::Real p)
Compute the pumping torque losses.
agx::Real getThrottleAngle() const
static bool readLibraryProperties(const agx::String &name, CombustionEngineParameters &parameters)
Load the named parameters and copy data into parameters.
bool setHeatValue(agx::Real heatValue)
Set the heat value of the fuel, Unit: J/kg.
agx::Real getCurrentVolumetricEfficiency() const
CombustionEngineParameters::RevolutionsPerCycle getNrRevolutionsPerCycle() const
bool setMaxVolumetricEfficiency(agx::Real maxVolumetricEfficiency)
Set the maximum volumetric efficiency of the engine.
void setInletTemperature(agx::Real inletTemperature)
The inlet manifold is where the fuel and air to be mixed.
agx::Real getIdleThrottleAngle() const
bool setIdleThrottleAngle(agx::Real throttleAngle)
Set the idle throttle angle, i.e.
void setCombustionEngineParameters(const CombustionEngineParameters &parameters)
Set the parameters for this combustion engine.
agx::Real getThrottlePinBoreRatio() const
agx::Real computeCylinderAirMassFlowRate(agx::Real N, agx::Real p)
Compute the engine air mass flow rate at current engine speed N and inlet pressure p.
A Shaft is the most basic PowerLine Unit.
Definition: Shaft.h:35
#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
Parameters that specifies the performance of a combustion engine.