fastga.models.propulsion.fuel_propulsion.basicIC_engine.basicIC_engine module
Parametric propeller IC engine.
- class fastga.models.propulsion.fuel_propulsion.basicIC_engine.basicIC_engine.BasicICEngine(max_power: float, cruise_altitude_propeller: float, fuel_type: float, strokes_nb: float, prop_layout: float, k_factor_sfc: float, speed_SL, thrust_SL, thrust_limit_SL, efficiency_SL, speed_CL, thrust_CL, thrust_limit_CL, efficiency_CL, effective_J, effective_efficiency_ls, effective_efficiency_cruise)[source]
Bases:
fastga.models.propulsion.fuel_propulsion.base.AbstractFuelPropulsionParametric Internal Combustion engine.
It computes engine characteristics using fuel type, motor architecture and constant propeller efficiency using analytical model from following sources:
- Parameters
max_power – maximum delivered mechanical power of engine (units=W)
cruise_altitude_propeller – design altitude for cruise (units=m)
fuel_type – 1.0 for gasoline and 2.0 for diesel engine and 3.0 for Jet Fuel
strokes_nb – can be either 2-strokes (=2.0) or 4-strokes (=4.0)
prop_layout – propulsion position in nose (=3.0) or wing (=1.0)
speed_SL – array with the speed at which the sea level performance of the propeller
were computed :param thrust_SL: array with the required thrust at which the sea level performance of the propeller were computed :param thrust_limit_SL: array with the limit thrust available at the speed in speed_SL :param efficiency_SL: array containing the sea level efficiency computed at speed_SL and thrust_SL :param speed_CL: array with the speed at which the cruise level performance of the propeller were computed :param thrust_CL: array with the required thrust at which the cruise level performance of the propeller were computed :param thrust_limit_CL: array with the limit thrust available at the speed in speed_CL :param efficiency_CL: array containing the cruise level efficiency computed at speed_CL and thrust_CL
- property propeller_efficiency_interpolator_sl
- property propeller_efficiency_interpolator_cl
- property sfc_interpolator
- compute_flight_points(flight_points: fastoad.model_base.flight_point.FlightPoint)[source]
Computes Specific Fuel Consumption according to provided conditions.
See
FlightPointfor available fields that may be used for computation. If a DataFrame instance is provided, it is expected that its columns match field names of FlightPoint (actually, the DataFrame instance should be generated from a list of FlightPoint instances).Note
About thrust_is_regulated, thrust_rate and thrust
thrust_is_regulatedtells if a flight point should be computed usingthrust_rate(when False) orthrust(when True) as input. This way, the method can be used in a vectorized mode, where each point can be set to respect a thrust order or a thrust rate order.if
thrust_is_regulatedis not defined, the considered input will be the defined one betweenthrust_rateandthrust(if both are provided,thrust_ratewill be used)if
thrust_is_regulatedisTrueorFalse(i.e., not a sequence), the considered input will be taken accordingly, and should of course be defined.if there are several flight points,
thrust_is_regulatedis a sequence or array,thrust_rateandthrustshould be provided and have the same shape asthrust_is_regulated:code:. The method will consider for each element which input will be used according tothrust_is_regulated.
- Parameters
flight_points – FlightPoint or DataFram instance
- Returns
None (inputs are updated in-place)
- propeller_efficiency(thrust: Union[float, Sequence[float]], atmosphere: stdatm.atmosphere.Atmosphere) Union[float, Sequence][source]
Compute the propeller efficiency.
- Parameters
thrust – Thrust (in N)
atmosphere – Atmosphere instance at intended altitude
- Returns
efficiency
- compute_max_power(flight_points: fastoad.model_base.flight_point.FlightPoint) Union[float, Sequence][source]
Compute the ICE maximum power @ given flight-point.
- Parameters
flight_points – current flight point(s)
- Returns
maximum power in kW
- sfc(thrust: Union[float, Sequence[float]], engine_setting: Union[float, Sequence[float]], atmosphere: stdatm.atmosphere.Atmosphere) Tuple[numpy.ndarray, numpy.ndarray][source]
Computation of the SFC.
- Parameters
thrust – Thrust (in N)
engine_setting – Engine settings (climb, cruise,… )
atmosphere – Atmosphere instance at intended altitude
- Returns
SFC (in g/kw) and Power (in W)
- max_thrust(engine_setting: Union[float, Sequence[float]], atmosphere: stdatm.atmosphere.Atmosphere) numpy.ndarray[source]
Computation of maximum thrust either due to propeller thrust limit or ICE max power.
- Parameters
engine_setting – Engine settings (climb, cruise,… )
atmosphere – Atmosphere instance at intended altitude (should be <=20km)
- Returns
maximum thrust (in N)
- compute_weight() float[source]
Computes weight of installed propulsion (engine, nacelle and propeller) depending on maximum power. Uses model described in : Gudmundsson, Snorri. General aviation aircraft design: Applied Methods and Procedures. Butterworth-Heinemann, 2013. Equation (6-44)
- class fastga.models.propulsion.fuel_propulsion.basicIC_engine.basicIC_engine.Engine(*args, **kwargs)[source]
Bases:
fastga.models.propulsion.dict.DynamicAttributeDictClass for storing data for engine.
An instance is a simple dict, but for convenience, each item can be accessed as an attribute (inspired by pandas DataFrames). Hence, one can write:
>>> engine = Engine(power_SL=10000.) >>> engine["power_SL"] 10000.0 >>> engine["mass"] = 70000. >>> engine.mass 70000.0 >>> engine.mass = 50000. >>> engine["mass"] 50000.0
Note: constructor will forbid usage of unknown keys as keyword argument, but other methods will allow them, while not making the matching between dict keys and attributes, hence:
>>> engine["foo"] = 42 # Ok >>> bar = engine.foo # raises exception !!!! >>> engine.foo = 50 # allowed by Python >>> # But inner dict is not affected: >>> engine.foo 50 >>> engine["foo"] 42
This class is especially useful for generating pandas DataFrame: a pandas DataFrame can be generated from a list of dict… or a list of oad.FlightPoint instances.
The set of dictionary keys that are mapped to instance attributes is given by the
get_attribute_keys().A dictionary class where keys can also be used as attributes.
The keys that can be used as attributes are defined using decorators
AddKeyAttributeorSetKeyAttributes.They can also be used as keyword arguments when instantiating this class.
Note
Using this class as a dict is useful when instantiating another dict or a pandas DataFrame, or instantiating from them. Direct interaction with DynamicAttributeDict instance should be done through attributes.
Example:
>>> @AddKeyAttributes({"foo": 0.0, "bar": None, "baz": 42.0}) ... class MyDict(DynamicAttributeDict): ... pass ... >>> d = MyDict(foo=5, bar="aa") >>> d.foo 5 >>> d.bar 'aa' >>> d.baz # returns the default value 42.0 >>> d["foo"] = 10.0 # can still be used as a dict >>> d.foo # but change are propagated to/from the matching attribute 10.0 >>> d.foo = np.nan # setting None or numpy.nan returns to default value >>> d["foo"] 0.0 >>> d.foo # But the attribute will now return the default value 0.0 >>> d.bar = None # If default value is None, setting None or numpy.nan deletes the key. >>> # d["bar"] #would trigger a key error >>> d.bar # But the attribute will return None
- Parameters
args – a dict-like object where all keys are contained in
attribute_keyskwargs – argument keywords must be names contained in
attribute_keys
- classmethod get_attribute_keys()
- Returns
list of attributes paired to dict key.
- property height
Height in meters.
- property length
Length in meters.
- property mass
Mass in kilograms.
- property power_SL
Power at sea level in watts.
- property width
Width in meters.
- class fastga.models.propulsion.fuel_propulsion.basicIC_engine.basicIC_engine.Nacelle(*args, **kwargs)[source]
Bases:
fastga.models.propulsion.dict.DynamicAttributeDictClass for storing data for nacelle.
Similar to
Engine.A dictionary class where keys can also be used as attributes.
The keys that can be used as attributes are defined using decorators
AddKeyAttributeorSetKeyAttributes.They can also be used as keyword arguments when instantiating this class.
Note
Using this class as a dict is useful when instantiating another dict or a pandas DataFrame, or instantiating from them. Direct interaction with DynamicAttributeDict instance should be done through attributes.
Example:
>>> @AddKeyAttributes({"foo": 0.0, "bar": None, "baz": 42.0}) ... class MyDict(DynamicAttributeDict): ... pass ... >>> d = MyDict(foo=5, bar="aa") >>> d.foo 5 >>> d.bar 'aa' >>> d.baz # returns the default value 42.0 >>> d["foo"] = 10.0 # can still be used as a dict >>> d.foo # but change are propagated to/from the matching attribute 10.0 >>> d.foo = np.nan # setting None or numpy.nan returns to default value >>> d["foo"] 0.0 >>> d.foo # But the attribute will now return the default value 0.0 >>> d.bar = None # If default value is None, setting None or numpy.nan deletes the key. >>> # d["bar"] #would trigger a key error >>> d.bar # But the attribute will return None
- Parameters
args – a dict-like object where all keys are contained in
attribute_keyskwargs – argument keywords must be names contained in
attribute_keys
- classmethod get_attribute_keys()
- Returns
list of attributes paired to dict key.
- property height
Height in meters.
- property length
Length in meters.
- property wet_area
Wet area in meters².
- property width
Width in meters.