avl_rungen

avl_rungen#

Caution

Internal module — not part of the public API. Users should call avl_sweep() instead. This page is for contributors who need to understand or modify the command generation logic.

Generate AVL run-case and command files for alpha/beta/deflection sweeps.

avl_aero_tables.avl_rungen.make_run_command(avl_name, alpha, beta, ctrl_names, ctrl_sweeps, out_dir)[source]#

Return the AVL interactive command script for a sweep.

Parameters:
  • avl_name (str) – Geometry file stem without extension (e.g. “bd”).

  • alpha (list[float]) – List of angle-of-attack values in degrees.

  • beta (list[float]) – List of sideslip angle values in degrees.

  • ctrl_names (list[str]) – Ordered list of control-surface names matching AVL’s D1, D2, … indices.

  • ctrl_sweeps (dict[str, list[float]]) – Mapping from control-surface name to its deflection sweep values. Only surfaces present in this dict are swept; others stay at zero. An empty dict produces one run per (alpha, beta) point.

  • out_dir (Path) – Directory where .st output files will be written. May be an absolute or relative path — keep it short; AVL has an ~80-char filename limit.

Return type:

str

Example

>>> from pathlib import Path
>>> from avl_aero_tables.avl_rungen import make_run_command
>>> cmd = make_run_command(
...     "bd",
...     alpha=[0.0, 5.0],
...     beta=[0.0],
...     ctrl_names=["flap", "aileron", "elevator", "rudder"],
...     ctrl_sweeps={},
...     out_dir=Path("/tmp/avl_out"),
... )
>>> cmd.splitlines()[0]
'LOAD bd'
>>> cmd.count("A A")  # one alpha line per case
2
avl_aero_tables.avl_rungen.make_run_reset(avl_name, ctrl_names, *, Mach=0.0, CDoref=0.0, Xref=0.0, Yref=0.0, Zref=0.0, Lunit='Lunit', Munit='Munit', Tunit='Tunit')[source]#

Return the content of a reset run-case file (all states zeroed).

The reset run case is loaded into AVL before each sweep point to ensure a clean starting state. ctrl_names is the ordered list of control surface names (e.g. [“flap”, “aileron”, “elevator”, “rudder”]).

Example

>>> from avl_aero_tables.avl_rungen import make_run_reset
>>> text = make_run_reset(
...     "bd",
...     ["flap", "aileron", "elevator", "rudder"],
...     CDoref=0.017,
...     Xref=3.4,
...     Zref=0.5,
... )
>>> "Run case  1:  Reset bd" in text
True
>>> " CDo       =   0.01700" in text
True
Parameters:
  • avl_name (str)

  • ctrl_names (list[str])

  • Mach (float)

  • CDoref (float)

  • Xref (float)

  • Yref (float)

  • Zref (float)

  • Lunit (str)

  • Munit (str)

  • Tunit (str)

Return type:

str