pytornado.fileio.cpacs package¶
Submodules¶
pytornado.fileio.cpacs.aircraft module¶
Functions for conversion of CPACS aircraft definition to native model
Developed at Airinnova AB, Stockholm, Sweden.
-
pytornado.fileio.cpacs.aircraft.get_aircraft_airfoils(aircraft, settings, tigl, wing_uid, segment_uid, idx_wing, idx_segment)¶ Extract the aircraft airfoils
- Args:
aircraft: Aircraft model settings: Settings object tigl: Tigl handle segment_uid: Name of the segment idx_wing: Index of the wing idx_segment: Index of the segment
-
pytornado.fileio.cpacs.aircraft.get_aircraft_controls(aircraft, wing_uid, idx_wing, tixi, tigl)¶ Extract the controls surfaces
- Args:
aircraft: Aircraft model wing_uid: Name of the wing idx_wing: Index of the wing tixi: Tixi handle tigl: Tigl handle
Warning
- CPACS3 changed the control surface defintions!
- In Tigl 3.0.0 some fuctions for controlSurfaces are missing (currently we use a workaround, see PATCH_* functions)
- In CPACS3 relative coordinates can be defined based on a ‘section’ or ‘componentSegment’, currently we assume the old definition (based on ‘componentSegment’)
-
pytornado.fileio.cpacs.aircraft.get_aircraft_name(aircraft, tixi)¶ Extract the aircraft name from CPACS and add it to the aircraft model
- Args:
aircraft: Aircraft model tixi: Tixi handle
-
pytornado.fileio.cpacs.aircraft.get_aircraft_refs(aircraft, tixi)¶ Extract the aircraft reference values
- Args:
aircraft: Aircraft model tixi: Tixi handle
Warning
- ‘rcenter’ is same as ‘gcenter’
- Currently there is only one reference length in CPACS
-
pytornado.fileio.cpacs.aircraft.get_aircraft_wing_segments(aircraft, settings, xpath_wing, wing_uid, idx_wing, tixi, tigl)¶ Extract a wing segment for a given wing
- Args:
aircraft: Aircraft model settings: Settings object xpath_wing: CPACS wing path idx_wing: Wing index tixi: Tixi handle tigl: Tigl handle
-
pytornado.fileio.cpacs.aircraft.get_aircraft_wings(aircraft, settings, tixi, tigl)¶ Extract aircraft wings including airfoils and controls
- Args:
aircraft: Aircraft model tixi: Tixi handle tigl: Tigl handle
-
pytornado.fileio.cpacs.aircraft.load(settings)¶ Get aircraft model from CPACS
- Args:
aircraft: Aircraft model settings: Settings object
-
pytornado.fileio.cpacs.aircraft.write_airfoil_files(settings, tixi)¶ Extract airfoil data from CPACS and write airfoil files
- Args:
settings: Settings object tixi: Tixi handle
pytornado.fileio.cpacs.results module¶
Write VLM results back to CPACS
Developed at Airinnova AB, Stockholm, Sweden.
-
pytornado.fileio.cpacs.results.save_aeroperformance_map(state, settings)¶ Write aeroperformance map results back to CPACS
- Args:
state: (object) data structure for operating conditions settings: (object) data structure for execution settings
pytornado.fileio.cpacs.state module¶
Import of CPACS aeroperformance maps (flight states) and export of results
Developed at Airinnova AB, Stockholm, Sweden.
-
pytornado.fileio.cpacs.state.load(settings)¶ Load the flight state from the CPACS aeroperformance map
pytornado.fileio.cpacs.utils module¶
General CPACS functions
-
pytornado.fileio.cpacs.utils.XPATHS¶ alias of
pytornado.fileio.cpacs.utils._XPaths
-
pytornado.fileio.cpacs.utils.add_vector(tixi, xpath, vector)¶ Add a vector at given CPACS path
- Note:
- Values will be overwritten if paths exists
- Args:
tixi: Tixi handle xpath: CPACS path vector: List or tuple (vector) to add
-
pytornado.fileio.cpacs.utils.close_tixi(tixi, cpacs_file)¶ Close Tixi and save to file
- Args:
tixi: Tixi handle cpacs_file: CPACS file path
-
pytornado.fileio.cpacs.utils.get_segment_mid_point(tigl, idx_wing, idx_segment, eta, xsi)¶ Return a mid point for a segment
- Args:
tigl: Tigl handle idx_wing: Wing index idx_segment: Segment index eta: Relative segment coordinate xsi: Relative segment coordinate - Returns:
mid_point: List with mid coordinate
-
pytornado.fileio.cpacs.utils.modify_cpacs(cpacs_file)¶ Context manganger for handling CPACS files
- Args:
cpacs_file: CPACS file path
-
pytornado.fileio.cpacs.utils.open_tigl(tixi)¶ Return a Tigl handle
- Args:
tixi: Tixi handle - Returns:
tigl: Tigl handle
-
pytornado.fileio.cpacs.utils.open_tixi(cpacs_file)¶ Return a Tixi handle
- Args:
cpacs_file: CPACS file path - Returns:
tixi: Tixi handle