avl_fileread#
Parses an AVL geometry file (.avl) into a nested Python dataclass tree rooted at AvlGeometry.
Parse an AVL geometry file (.avl) into a nested Python structure.
- class avl_aero_tables.avl_fileread.AvlBody(name: 'str' = '', nbody: 'float' = 0.0, bspace: 'float' = 0.0, ydupl: 'float | str' = '', scale: 'list[float] | None' = None, trans: 'list[float] | None' = None, bfile: 'str' = '', bfile_x: 'list[float]' = <factory>, bfile_y: 'list[float]' = <factory>)[source]#
Bases:
object- Parameters:
name (str)
nbody (float)
bspace (float)
ydupl (float | str)
scale (list[float] | None)
trans (list[float] | None)
bfile (str)
bfile_x (list[float])
bfile_y (list[float])
- bfile: str = ''#
- bfile_x: list[float]#
- bfile_y: list[float]#
- bspace: float = 0.0#
- name: str = ''#
- nbody: float = 0.0#
- scale: list[float] | None = None#
- trans: list[float] | None = None#
- ydupl: float | str = ''#
- class avl_aero_tables.avl_fileread.AvlControlEntry(name, gain, xhinge, xyzhvec, sgn_dup=1.0)[source]#
Bases:
objectOne control-surface definition attached to a section.
- Parameters:
name (str)
gain (float)
xhinge (float)
xyzhvec (tuple[float, float, float])
sgn_dup (float)
- gain: float#
- name: str#
- sgn_dup: float = 1.0#
- xhinge: float#
- xyzhvec: tuple[float, float, float]#
- class avl_aero_tables.avl_fileread.AvlGeometry(header: 'AvlHeader' = <factory>, body: 'AvlBody | None' = None, surface: 'dict[str, AvlSurface]'=<factory>)[source]#
Bases:
object- Parameters:
header (AvlHeader)
body (AvlBody | None)
surface (dict[str, AvlSurface])
- property ctrl_names: list[str]#
Return ordered unique control-surface names across all surfaces.
Example
>>> from avl_aero_tables.avl_fileread import avl_fileread >>> geom = avl_fileread("examples/bd.avl") >>> geom.ctrl_names ['flap', 'aileron', 'elevator', 'rudder']
- surface: dict[str, AvlSurface]#
- class avl_aero_tables.avl_fileread.AvlHeader(name: 'str' = '', Mach: 'float' = 0.0, iYsym: 'int' = 0, iZsym: 'int' = 0, Zsym: 'float' = 0.0, Sref: 'float' = 0.0, Cref: 'float' = 0.0, Bref: 'float' = 0.0, Xref: 'float' = 0.0, Yref: 'float' = 0.0, Zref: 'float' = 0.0, CDoref: 'float' = 0.0)[source]#
Bases:
object- Parameters:
name (str)
Mach (float)
iYsym (int)
iZsym (int)
Zsym (float)
Sref (float)
Cref (float)
Bref (float)
Xref (float)
Yref (float)
Zref (float)
CDoref (float)
- Bref: float = 0.0#
- CDoref: float = 0.0#
- Cref: float = 0.0#
- Mach: float = 0.0#
- Sref: float = 0.0#
- Xref: float = 0.0#
- Yref: float = 0.0#
- Zref: float = 0.0#
- Zsym: float = 0.0#
- iYsym: int = 0#
- iZsym: int = 0#
- name: str = ''#
- class avl_aero_tables.avl_fileread.AvlSectionEntry(xle, yle, zle, chord, ainc=0.0, nspan=0.0, sspan=0.0, naca=None, afile=None, claf=None, controls=<factory>)[source]#
Bases:
objectOne chordwise section of a lifting surface.
- Parameters:
xle (float)
yle (float)
zle (float)
chord (float)
ainc (float)
nspan (float)
sspan (float)
naca (str | None)
afile (str | None)
claf (float | None)
controls (list[AvlControlEntry])
- afile: str | None = None#
- ainc: float = 0.0#
- chord: float#
- claf: float | None = None#
- controls: list[AvlControlEntry]#
- naca: str | None = None#
- nspan: float = 0.0#
- sspan: float = 0.0#
- xle: float#
- yle: float#
- zle: float#
- class avl_aero_tables.avl_fileread.AvlSurface(nchord: 'float' = 0.0, cspace: 'float' = 0.0, nspan: 'float | str' = '', sspace: 'float | str' = '', ydupl: 'float | str' = '', lcomp: 'float | None' = None, scale: 'list[float] | None' = None, trans: 'list[float] | None' = None, dainc: 'float | None' = None, nowake: 'bool' = False, noalbe: 'bool' = False, noload: 'bool' = False, sections: 'list[AvlSectionEntry]' = <factory>)[source]#
Bases:
object- Parameters:
nchord (float)
cspace (float)
nspan (float | str)
sspace (float | str)
ydupl (float | str)
lcomp (float | None)
scale (list[float] | None)
trans (list[float] | None)
dainc (float | None)
nowake (bool)
noalbe (bool)
noload (bool)
sections (list[AvlSectionEntry])
- cspace: float = 0.0#
- dainc: float | None = None#
- lcomp: float | None = None#
- nchord: float = 0.0#
- noalbe: bool = False#
- noload: bool = False#
- nowake: bool = False#
- nspan: float | str = ''#
- scale: list[float] | None = None#
- sections: list[AvlSectionEntry]#
- sspace: float | str = ''#
- trans: list[float] | None = None#
- ydupl: float | str = ''#
- avl_aero_tables.avl_fileread.avl_fileread(avl_file)[source]#
Parse an AVL geometry file and return an AvlGeometry dataclass tree.
Example
>>> from avl_aero_tables.avl_fileread import avl_fileread >>> geom = avl_fileread("examples/bd.avl") >>> geom.header.name 'Bubble Dancer RES' >>> list(geom.surface.keys()) ['Wing', 'Horizontal_tail', 'Vertical_tail'] >>> geom.ctrl_names ['flap', 'aileron', 'elevator', 'rudder']
- Parameters:
avl_file (str | Path)
- Return type: