AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
CombustionEngine.h
Go to the documentation of this file.
1/*
2Copyright 2007-2024. 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
75
81 bool setThrottle(agx::Real throttle);
82
87
93 bool setThrottleAngle(agx::Real throttleAngle);
94
99
106 bool setIdleThrottleAngle(agx::Real throttleAngle);
107
112
118 bool setMaxThrottleAngle(agx::Real throttleAngle);
119
124
133
140 bool setThrottlePinBoreRatio(agx::Real throttlePinBoreRatio);
141
146
147
154
159
165 bool setMaxVolumetricEfficiency(agx::Real maxVolumetricEfficiency);
166
171
178
185
190
198
203
211 bool setHeatValue(agx::Real heatValue);
212
217
224
230
236
241
246
251
256
262 bool setInletVolume(agx::Real inletVolume);
263
268
273 void setEnable(bool enable);
274
278 bool getEnable() const;
279
285 void setInletTemperature(agx::Real inletTemperature);
286
291
296
301
306
307
314 static bool readLibraryProperties(const agx::String& name, CombustionEngineParameters& parameters);
315
321
327
328
330
331 public:
333 virtual bool preUpdate(agx::Real timeStep) override;
334
336 virtual bool store(agxStream::StorageStream& str) const override;
337
339 virtual bool restore(agxStream::StorageStream& str) override;
340
342
344
345 protected:
347
348 void initParameters();
349
354 void computeMaxThrottleArea();
355
359 void computeVolumetricEfficiencyCoefficients();
360
366 agx::Real computeFlowGain(agx::Real r);
367
372 agx::Real computeFlowGainDerivative(agx::Real r);
373
379 agx::Real computeThrottleAreaGain(agx::Real alpha);
380
382
383 private:
384
390 void stepPressure(agx::Real timeStep);
391
396 void startEngine();
397
398 private:
399
400 agx::Real m_inletVolume;
401 agx::Real m_inletPressure;
402
403 agx::Real m_idleThrottleAngle;
404
405 agx::Real m_maxThrottleAngle;
406 agx::Real m_throttleAngle;
407
408 agx::Real m_maxThrottleArea;
409
410 agx::Real m_inletTemperature;
411 agx::Real m_ambientPressure;
412
413 agx::Real m_airGasConstant;
414
415 bool m_enable;
416 bool m_started;
417
418 agx::Real m_idleInletPressure;
419
420 agx::Real m_c0;
421 agx::Real m_c1;
422 agx::Real m_c2;
423 agx::Real m_c3;
424
425 agx::Real m_thermalEfficiency;
426
427 agx::Real m_indicatedTorque;
428 agx::Real m_frictionTorque;
429 agx::Real m_pumpTorque;
430
431 agx::Real m_outputTorque;
432
433 CombustionEngineParameters m_combustionEngineParameters;
434 };
435
437}
#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...
#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 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.
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:97
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition macros.h:96
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:42
Parameters that specifies the performance of a combustion engine.