libICEpost.src.engineModel.functions

@author: F. Ramognino <federico.ramognino@polimi.it> Last update: 25/06/2024

Generic functions useful for internal combustion engines.

Functions

upMean(→ float)

Compute the mean piston speed of a piston engine [m/s].

MFB(→ float)

Compute the CA instant at which the engine

loadModel(...)

Convenient function for loading the engineModel from a control dictionary.

Module Contents

libICEpost.src.engineModel.functions.upMean(*, n: float, S: float) float[source]

Compute the mean piston speed of a piston engine [m/s].

Parameters:
  • n (float) – Engine speed [rpm]

  • S (float) – Engine stroke [m]

Returns:

mean piston speed [m/s]

Return type:

float

libICEpost.src.engineModel.functions.MFB(engine: libICEpost.src.engineModel.EngineModel.EngineModel.EngineModel, xb: float) float[source]

Compute the CA instant at which the engine model reaches a given fuel mass fraction (xb). Assuming that the xb array was already computed and stored in the engine model.

Parameters:
  • engine (EngineModel) – The engine model

  • xb (float) – The value of xb to reach [0,1]

Returns:

CA(xb)

Return type:

float

libICEpost.src.engineModel.functions.loadModel(controlDict: libICEpost.src.base.dataStructures.Dictionary.Dictionary, *, fatal: bool = True) libICEpost.src.engineModel.EngineModel.EngineModel.EngineModel | None[source]

Convenient function for loading the engineModel from a control dictionary.

Parameters:
  • controlDict (Dictionary) – The control dictionary to load the model from.

  • fatal (bool) – If True, the function will raise an exception if the model cannot be loaded. Default is True.

Returns:

The engine model.

Return type:

EngineModel