rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
WallFuel Class Reference

#include <wall_fuel.h>

Inheritance diagram for WallFuel:
Inheritance graph
[legend]
Collaboration diagram for WallFuel:
Collaboration graph
[legend]

Public Member Functions

float adjust (float desiredMassGrams)
 
float getWallFuel () const
 
void resetWF ()
 

Data Fields

int invocationCounter = 0
 
- Data Fields inherited from wall_fuel_state_s
float wallFuelCorrection = (float)0
 
floatms_t wallFuel = (floatms_t)0
 

Detailed Description

Wall wetting, also known as fuel film See https://github.com/rusefi/rusefi/issues/151 for the theory

Definition at line 15 of file wall_fuel.h.

Member Function Documentation

◆ adjust()

float WallFuel::adjust ( float  desiredMassGrams)
Parameters
desiredMassGramsdesired fuel quantity, in grams
Returns
total adjusted fuel squirt mass in grams once wall wetting is taken into effect

Definition at line 14 of file wall_fuel.cpp.

14 {
16 if (std::isnan(desiredMassGrams)) {
17 return desiredMassGrams;
18 }
19
21
22 /*
23 this math is based on
24 SAE 810494 by C. F. Aquino
25 SAE 1999-01-0553 by Peter J Maloney
26
27 M_cmd = commanded fuel mass (output of this function)
28 desiredMassGrams = desired fuel mass (input to this function)
29 fuelFilmMass = fuel film mass (how much is currently on the wall)
30
31 First we compute how much fuel to command, by accounting for
32 a) how much fuel will evaporate from the walls, entering the air
33 b) how much fuel from the injector will hit the walls, being deposited
34
35 Next, we compute how much fuel will be deposited on the walls. The net
36 effect of these two steps is computed (some leaves walls, some is deposited)
37 and stored back in fuelFilmMass.
38
39 alpha describes the amount of fuel that REMAINS on the wall per cycle.
40 It is computed as a function of the evaporation time constant (tau) and
41 the time the fuel spent on the wall this cycle, (recriprocal RPM).
42
43 beta describes the amount of fuel that hits the wall.
44 */
45
46 // If disabled, pass value through
48 return desiredMassGrams;
49 }
50
51 float alpha = engine->module<WallFuelController>()->getAlpha();
52 float beta = engine->module<WallFuelController>()->getBeta();
53
54 float fuelFilmMass = wallFuel;
55 float M_cmd = (desiredMassGrams - (1 - alpha) * fuelFilmMass) / (1 - beta);
56
57 // We can't inject a negative amount of fuel
58 // If this goes below zero we will be over-fueling slightly,
59 // but that's ok.
60 if (M_cmd <= 0) {
61 M_cmd = 0;
62 }
63
64 // remainder on walls from last time + new from this time
65 float fuelFilmMassNext = alpha * fuelFilmMass + beta * M_cmd;
66
67 wallFuel = fuelFilmMassNext;
68 wallFuelCorrection = M_cmd - desiredMassGrams;
69 return M_cmd;
70}
constexpr auto & module()
Definition engine.h:200
bool getEnable() const override
Definition wall_fuel.h:39
int invocationCounter
Definition wall_fuel.h:24
static EngineAccessor engine
Definition engine.h:413
@ WallFuelAdjust

Referenced by InjectionEvent::onTriggerTooth().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getWallFuel()

float WallFuel::getWallFuel ( ) const

Definition at line 72 of file wall_fuel.cpp.

72 {
73 return wallFuel;
74}

◆ resetWF()

void WallFuel::resetWF ( )

Definition at line 10 of file wall_fuel.cpp.

10 {
11 wallFuel = 0;
12}

Referenced by resetAccel().

Here is the caller graph for this function:

Field Documentation

◆ invocationCounter

int WallFuel::invocationCounter = 0

Definition at line 24 of file wall_fuel.h.

Referenced by adjust().


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