60 lines
1.1 KiB
C++
60 lines
1.1 KiB
C++
/*
|
|
* @file wall_fuel.h
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "wall_fuel_state_generated.h"
|
|
#include "engine_module.h"
|
|
|
|
/**
|
|
* 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 {
|
|
public:
|
|
/**
|
|
* @param desiredMassGrams desired fuel quantity, in grams
|
|
* @return total adjusted fuel squirt mass in grams once wall wetting is taken into effect
|
|
*/
|
|
float adjust(float desiredMassGrams);
|
|
float getWallFuel() const;
|
|
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;
|
|
};
|