Aviary icon indicating copy to clipboard operation
Aviary copied to clipboard

propeller map implementation

Open mizu0fire0 opened this issue 8 months ago • 1 comments

Description

when definining a turboprop engine with an external propeller map provided by the user like this : shaft_model=EngineDeck(name='shaft',options=options,required_variables=required_vars) propeller=PropellerMap(name='Centauri_propeller',options=options) turboprop=TurbopropModel('turboprop',options=options,shaft_power_model=shaft_model,propeller_model=propeller)

prob.load_inputs(r'aircraft_definition.csv',phase_info,engine_builders=[turboprop],verbosity=3)

this leads to an error in the turboprop_model.py on line 191

if self.propeller_model is not None: params.update(self.propeller_model.get_parameters()) return params

Example

since the PropellerMap function does not currently have attributes of get_parameters,build_pre_mission,build_mission,get_mass ... all of which are variables of propeller_builder . when adding all the attributes to propellermap class function , the leads to circular imports error due to propeller_map importing propeller_performance for the attribute build_mission and propeller_performance imports propeller_map

Aviary Version

0.9.8

Relevant environment information

No response

mizu0fire0 avatar Apr 09 '25 00:04 mizu0fire0

Apologies I missed your post - It looks like we're missing the ability to use propeller maps with the PropellerBuilder! That can probably get put together pretty quickly by the team. In the meantime, you can take a look at aviary/subsystems/test/test_turboprop_model.py for the ExamplePropModel, that was intended just to use for testing but may be workable for your model.

jkirk5 avatar Apr 21 '25 15:04 jkirk5

Ok I made some overhauls to the propeller map code, but the answer to your problem was actually unrelated - all you need to do is add the path to your propeller data file to Aircraft.Engine.Propeller.DATA_FILE. If you are not using a propeller data file then you don't need to do anything when building the TurbopropModel object, propeller performance will be automatically computed using the Hamilton Standard method. It turns out PropellerMaps weren't actually designed to be user-facing, but what you tried made total sense and I didn't even notice the real issue for a good minute.

jkirk5 avatar Jun 09 '25 14:06 jkirk5