rusefi-1/firmware/controllers/algo/wall_fuel.h

57 lines
1.1 KiB
C
Raw Normal View History

2021-10-16 17:16:40 -07:00
/*
* @file wall_fuel.h
*
*/
#pragma once
/**
* Wall wetting, also known as fuel film
* See https://github.com/rusefi/rusefi/issues/151 for the theory
*/
class WallFuel : public wall_fuel_state_s {
2021-10-16 17:16:40 -07:00
public:
/**
2021-11-25 15:45:44 -08:00
* @param desiredMassGrams desired fuel quantity, in grams
* @return total adjusted fuel squirt mass in grams once wall wetting is taken into effect
2021-10-16 17:16:40 -07:00
*/
2021-11-25 15:45:44 -08:00
float adjust(float desiredMassGrams);
float getWallFuel() const;
2021-10-16 17:16:40 -07:00
void resetWF();
int invocationCounter = 0;
};
struct IWallFuelController {
virtual bool getEnable() const = 0;
virtual float getAlpha() const = 0;
virtual float getBeta() const = 0;
};
class WallFuelController : public IWallFuelController, public EngineModule {
public:
using interface_t = IWallFuelController;
void onFastCallback() override;
bool getEnable() const override {
return m_enable;
}
float getAlpha() const override {
return m_alpha;
}
float getBeta() const override {
return m_beta;
}
protected:
float computeTau() const;
float computeBeta() const;
private:
bool m_enable = false;
float m_alpha = 0;
float m_beta = 0;
};