Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
HelpersEnergy Class Reference

Helper methods for energy-based electricity consumption computation based on the battery device. More...

#include <HelpersEnergy.h>

Inheritance diagram for HelpersEnergy:
[legend]
Collaboration diagram for HelpersEnergy:
[legend]

Public Member Functions

double acceleration (const SUMOEmissionClass c, const PollutantsInterface::EmissionType e, const double v, const double P, const double slope, const EnergyParams *param) const
 Computes the achievable acceleration using the given speed and amount of consumed electric power.
double compute (const SUMOEmissionClass c, const PollutantsInterface::EmissionType e, const double v, const double a, const double slope, const EnergyParams *param) const
 Computes the emitted pollutant amount using the given speed and acceleration.
std::string getFuel (const SUMOEmissionClass) const
 Returns the fuel type described by this emission class as described in the Amitran interface (Gasoline, Diesel, ...).
double getWeight (const SUMOEmissionClass) const
 Returns a reference weight in kg described by this emission class This implementation returns the default mass for this model.
 HelpersEnergy ()
 Constructor (initializes myEmissionClassStrings).

Static Private Attributes

static const int ENERGY_BASE = 4 << 16
static constexpr double myDefaultAirDragCoefficient = 0.35
static constexpr double myDefaultConstantPowerIntake = 100.
static constexpr double myDefaultFrontSurfaceArea = 2.6
static constexpr double myDefaultMass = 1830.
static constexpr double myDefaultPropulsionEfficiency = 0.98
static constexpr double myDefaultRadialDragCoefficient = 0.1
static constexpr double myDefaultRecuperationEfficiency = 0.96
static constexpr double myDefaultRecuperationEfficiencyByDeceleration = 0.0
static constexpr double myDefaultRollDragCoefficient = 0.01
static constexpr double myDefaultRotatingMass = 40.

Detailed Description

Helper methods for energy-based electricity consumption computation based on the battery device.

Definition at line 41 of file HelpersEnergy.h.

Constructor & Destructor Documentation

◆ HelpersEnergy()

HelpersEnergy::HelpersEnergy ( )

Constructor (initializes myEmissionClassStrings).

Definition at line 36 of file HelpersEnergy.cpp.

References ENERGY_BASE.

Member Function Documentation

◆ acceleration()

double HelpersEnergy::acceleration ( const SUMOEmissionClass c,
const PollutantsInterface::EmissionType e,
const double v,
const double P,
const double slope,
const EnergyParams * param ) const

Computes the achievable acceleration using the given speed and amount of consumed electric power.

Parameters
[in]cemission class for the function parameters to use
[in]ethe type of emission (CO, CO2, ...), only electricity gives valid results
[in]vThe vehicle's current velocity
[in]PThe vehicle's current power consumption
[in]slopeThe road's slope at vehicle's position [deg]
Returns
The amount emitted by the given emission class when moving with the given velocity and acceleration [mg/s or ml/s]

Definition at line 133 of file HelpersEnergy.cpp.

References PolySolver::cubicSolve(), DEG2RAD, EnergyParams::getDefault(), EnergyParams::getDoubleOptional(), EnergyParams::getTotalMass(), GRAVITY, MAX2(), MAX3(), myDefaultAirDragCoefficient, myDefaultFrontSurfaceArea, myDefaultMass, myDefaultPropulsionEfficiency, myDefaultRecuperationEfficiency, myDefaultRollDragCoefficient, myDefaultRotatingMass, SUMO_ATTR_AIRDRAGCOEFFICIENT, SUMO_ATTR_FRONTSURFACEAREA, SUMO_ATTR_PROPULSIONEFFICIENCY, SUMO_ATTR_RECUPERATIONEFFICIENCY, SUMO_ATTR_ROLLDRAGCOEFFICIENT, SUMO_ATTR_ROTATINGMASS, TL, TS, and WRITE_ERROR.

◆ compute()

double HelpersEnergy::compute ( const SUMOEmissionClass c,
const PollutantsInterface::EmissionType e,
const double v,
const double a,
const double slope,
const EnergyParams * param ) const

Computes the emitted pollutant amount using the given speed and acceleration.

Returns only valid values for electricity all other types give 0.

Parameters
[in]cemission class for the function parameters to use
[in]ethe type of emission (CO, CO2, ...), only electricity gives valid results
[in]vThe vehicle's current velocity
[in]aThe vehicle's current acceleration
[in]slopeThe road's slope at vehicle's position [deg]
Returns
The amount emitted by the given emission class when moving with the given velocity and acceleration [mg/s or ml/s]

Definition at line 42 of file HelpersEnergy.cpp.

References ACCEL2SPEED, DEG2RAD, EnergyParams::getAngleDiff(), EnergyParams::getDefault(), EnergyParams::getDoubleOptional(), EnergyParams::getTotalMass(), GRAVITY, EnergyParams::isOff(), myDefaultAirDragCoefficient, myDefaultConstantPowerIntake, myDefaultFrontSurfaceArea, myDefaultMass, myDefaultPropulsionEfficiency, myDefaultRadialDragCoefficient, myDefaultRecuperationEfficiency, myDefaultRecuperationEfficiencyByDeceleration, myDefaultRollDragCoefficient, myDefaultRotatingMass, SPEED2DIST, SUMO_ATTR_AIRDRAGCOEFFICIENT, SUMO_ATTR_CONSTANTPOWERINTAKE, SUMO_ATTR_FRONTSURFACEAREA, SUMO_ATTR_PROPULSIONEFFICIENCY, SUMO_ATTR_RADIALDRAGCOEFFICIENT, SUMO_ATTR_RECUPERATIONEFFICIENCY, SUMO_ATTR_RECUPERATIONEFFICIENCY_BY_DECELERATION, SUMO_ATTR_ROLLDRAGCOEFFICIENT, SUMO_ATTR_ROTATINGMASS, and TS.

◆ getFuel()

std::string HelpersEnergy::getFuel ( const SUMOEmissionClass ) const
inline

Returns the fuel type described by this emission class as described in the Amitran interface (Gasoline, Diesel, ...).

Parameters
[in]cthe emission class
Returns
always "Electricity"

Definition at line 54 of file HelpersEnergy.h.

◆ getWeight()

double HelpersEnergy::getWeight ( const SUMOEmissionClass ) const
inline

Returns a reference weight in kg described by this emission class This implementation returns the default mass for this model.

Parameters
[in]cthe emission class
Returns
a reference weight

Definition at line 63 of file HelpersEnergy.h.

References myDefaultMass.

Field Documentation

◆ ENERGY_BASE

const int HelpersEnergy::ENERGY_BASE = 4 << 16
staticprivate

Definition at line 43 of file HelpersEnergy.h.

Referenced by HelpersEnergy().

◆ myDefaultAirDragCoefficient

double HelpersEnergy::myDefaultAirDragCoefficient = 0.35
staticconstexprprivate

Definition at line 95 of file HelpersEnergy.h.

Referenced by acceleration(), and compute().

◆ myDefaultConstantPowerIntake

double HelpersEnergy::myDefaultConstantPowerIntake = 100.
staticconstexprprivate

Definition at line 99 of file HelpersEnergy.h.

Referenced by compute().

◆ myDefaultFrontSurfaceArea

double HelpersEnergy::myDefaultFrontSurfaceArea = 2.6
staticconstexprprivate

Definition at line 94 of file HelpersEnergy.h.

Referenced by acceleration(), and compute().

◆ myDefaultMass

double HelpersEnergy::myDefaultMass = 1830.
staticconstexprprivate

Definition at line 93 of file HelpersEnergy.h.

Referenced by acceleration(), compute(), and getWeight().

◆ myDefaultPropulsionEfficiency

double HelpersEnergy::myDefaultPropulsionEfficiency = 0.98
staticconstexprprivate

Definition at line 100 of file HelpersEnergy.h.

Referenced by acceleration(), and compute().

◆ myDefaultRadialDragCoefficient

double HelpersEnergy::myDefaultRadialDragCoefficient = 0.1
staticconstexprprivate

Definition at line 97 of file HelpersEnergy.h.

Referenced by compute().

◆ myDefaultRecuperationEfficiency

double HelpersEnergy::myDefaultRecuperationEfficiency = 0.96
staticconstexprprivate

Definition at line 101 of file HelpersEnergy.h.

Referenced by acceleration(), and compute().

◆ myDefaultRecuperationEfficiencyByDeceleration

double HelpersEnergy::myDefaultRecuperationEfficiencyByDeceleration = 0.0
staticconstexprprivate

Definition at line 102 of file HelpersEnergy.h.

Referenced by compute().

◆ myDefaultRollDragCoefficient

double HelpersEnergy::myDefaultRollDragCoefficient = 0.01
staticconstexprprivate

Definition at line 98 of file HelpersEnergy.h.

Referenced by acceleration(), and compute().

◆ myDefaultRotatingMass

double HelpersEnergy::myDefaultRotatingMass = 40.
staticconstexprprivate

Definition at line 96 of file HelpersEnergy.h.

Referenced by acceleration(), and compute().


The documentation for this class was generated from the following files: