Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 48 additions & 9 deletions data/IO/default_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@ performance_model_input = "PerformanceModel"
# "PerformanceModel" : JSON file with state variables - fuel_flow = f(h, V, gamma, m_fuel) (TABULAR INPUT)

performance_model_input_file = "IO/sample_performance_model.toml"
climb_descent_usage = true # If true, then full trajectory is used for emissions calculate (including takeoff, landing)
# If false, then only cruise used, LTO data used for takeoff, climb, approach

["LTO data"]
LTO_input_mode = "EDB" # "PerformanceModel" : LTO data provided in PerformanceModel file
# "EDB" : Use EDB data to get LTO performance
edb_engine_file = "engines/EDB_data_06_2025.toml"

["Missions"]
missions_folder = "missions"
Expand All @@ -34,8 +27,54 @@ sample_schedule = false # Sample schedule distribution to get smaller co
sample_number = 1000 # If sample_schedule: how many flights for the sample

["Emissions"]
fuel_file = "fuels/conventional_jetA.toml"
nvpm_method = "SCOPE11" # PMnvol estimation method for LTO (SCOPE11, fox, foa3, dop, sst, newsnci)
Fuel = "conventional_jetA" # Fuel files stored in data/fuels/
# Current options include:
# conventional_jetA

CO2_calculation = true # Compute CO2 emissions with EI in fuels file

H2O_calculation = true # Compute H2O emissions with EI in fuels file

SOx_calculation = true # Compute SOx emissions with EI in fuels file

EI_NOx_method = "BFFM2" # Options include
# P3T3: Pt3, Tt3 method
# BFFM2: Boeing Fuel flow method 2
# None: Do not compute NOx emissions

EI_HC_method = "BFFM2" # Options include
# BFFM2: Boeing Fuel flow method 2
# None: Do not compute HC emissions

EI_CO_method = "BFFM2" # Options include
# BFFM2: Boeing Fuel flow method 2
# None: Do not compute CO emissions

EI_PMvol_method = "fuel_flow"
# Options include
# fuel_flow: Calculate EI(PMvolo) and OCicEI based on fuel flow
# FOA3: Using the FOA3.0 method (Wayson et al., 2009)
# None: Do not compute PMvol emissions

EI_PMnvol_method = "MEEM" # Options include
# MEEM: Mission Emissions Estimation Methodology (MEEM)
# based on Ahrens et al. (2022),
# SCOPE11, and the methodology of Peck et al. (2013).
# SCOPE11: SCOPE11 methodology
# None: Do not compute PMnvol emissions

LTO_input_mode = "EDB" # "performance_model" : LTO data provided in PerformanceModel file
# "EDB" : Use EDB data to get LTO performance
EDB_input_file = "engines/EDB_data_06_2025.toml"

climb_descent_usage = true # true: emissions calculated for entire trajectory (takeoff, climb, cruise, descent)
# false: emissions only calculated for cruise, LTO data used for takeoff, climb, approach

APU_calculation = true # Compute emissions from APU

GSE_calculation = true # Compute emissions from GSE

LC_calculation = true # Compute lifecycle emissions

["OUTPUT"]
output_folder = "Emission_Files"
146 changes: 104 additions & 42 deletions docs/src/AEIC/performance_model.rst
Original file line number Diff line number Diff line change
@@ -1,49 +1,111 @@
Performance Model
=======================
=================

The ``PerformanceModel`` class encapsulates aircraft performance data. It builds a structured matrix of fuel flows as a function of altitude, TAS, ROCD, mass.
``AEIC.performance_model.PerformanceModel`` takes aircraft performance,
missions, and emissions configuration data as input and produces the
data structure needed by trajectory solvers and the emissions pipeline.
It builds a fuel-flow performance table as a function of aircraft mass,
altitude, rate of climb/descent, and true airspeed.

Class Definition
----------------

.. autoclass:: AEIC.performance_model.PerformanceModel
:members:

Attributes
Overview
----------

.. attribute:: config

Dictionary of all parsed key-value pairs from the configuration TOML file.

.. attribute:: missions

List of missions (flights) parsed from the input TOML file.

.. attribute:: ac_params

Instance of ``Bada3AircraftParameters`` representing aircraft configuration parameters.

.. attribute:: engine_model

Instance of ``Bada3JetEngineModel`` initialized with aircraft parameters.

.. attribute:: LTO_data

Dictionary of emissions or fuel flow data during the landing-takeoff cycle.

.. attribute:: model_info

Parsed metadata from TOML describing the aircraft performance model (e.g., cruise speeds).

.. attribute:: performance_table

Multidimensional NumPy array of fuel flow rates indexed by input variables.

.. attribute:: performance_table_cols

List of sorted values for each input dimension of the performance table.
- Loads project-wide TOML configuration and as :class:`PerformanceConfig`.
- Supports two input modes via :class:`PerformanceInputMode`: reading BADA style OPF
files or ingesting the custom performance-model TOML tables.
- Automatically loads mission definitions, LTO data (either from the performance
file or EDB databank), APU characteristics, and BADA3-based engine parameters.
- Provides convenience accessors such as :attr:`PerformanceModel.missions`,
:attr:`PerformanceModel.performance_table`, and :attr:`PerformanceModel.model_info`
that later modules can consume without re-parsing TOML files.

Usage Example
-------------

.. code-block:: python

from AEIC.performance_model import PerformanceModel

perf = PerformanceModel("IO/default_config.toml")
print("Loaded missions:", len(perf.missions))

table = perf.performance_table
fl_grid, tas_grid, roc_grid, mass_grid = perf.performance_table_cols
print("Fuel-flow grid shape:", table.shape)

# Pass to trajectory or emissions builders
from emissions.emission import Emission
emitter = Emission(perf)

Configuration Schema
--------------------

``PerformanceConfig`` converts the nested TOML mapping into a frozen dataclass
with well-defined fields. Key sections include:

.. list-table::
:header-rows: 1
:widths: 30 15 55

* - Section.Key
- Required
- Description
* - ``[Missions].missions_folder``
- ✓
- Directory containing the mission TOML files (relative to the repo root).
* - ``[Missions].missions_in_file``
- ✓
- File within ``missions_folder`` that lists available missions under ``[flight]``.
* - ``[General Information].performance_model_input``
- ✓
- Determines :class:`PerformanceInputMode`; accepts ``"opf"`` or ``"performancemodel"``.
* - ``[General Information].performance_model_input_file``
- ✓
- Path to the OPF file or the performance-model TOML containing
``[flight_performance]`` and ``[LTO_performance]`` sections.
* - ``[Emissions]``
- ✓
- Stored as :attr:`PerformanceConfig.emissions` and forwarded to
:class:`emissions.emission.EmissionsConfig` for validation of LTO/fuel
choices (see :ref:`Emissions Module <emissions-module>`).

Data Products
-------------

After :meth:`PerformanceModel.initialize_performance` runs, the instance
contains:

- :attr:`PerformanceModel.missions`: list of mission dictionaries read from the
``missions_in_file``.
- :attr:`PerformanceModel.ac_params`: populated :class:`BADA.aircraft_parameters.Bada3AircraftParameters`
reflecting either OPF inputs or the performance table metadata.
- :attr:`PerformanceModel.engine_model`: a :class:`BADA.model.Bada3JetEngineModel`
initialised with ``ac_params`` for thrust and fuel-flow calculations.
- :attr:`PerformanceModel.performance_table`: the multidimensional NumPy array
mapping (flight level, TAS, ROCD, mass, …) onto fuel flow (kg/s).
- :attr:`PerformanceModel.performance_table_cols` and
:attr:`PerformanceModel.performance_table_colnames`: the coordinate arrays and
names that describe each dimension of ``performance_table``.
- :attr:`PerformanceModel.LTO_data`: modal thrust settings, fuel flows, and
emission indices pulled from the performance file (when ``LTO_input_mode =
"performance_model"``) or parsed via :func:`parsers.LTO_reader.parseLTO`.
- :attr:`PerformanceModel.EDB_data`: ICAO engine databank entry loaded by
:meth:`PerformanceModel.get_engine_by_uid` when ``LTO_input_mode = "edb"``.
- :attr:`PerformanceModel.APU_data`: auxiliary-power-unit properties resolved
from ``engines/APU_data.toml`` using the ``APU_name`` specified in the
performance file.
- :attr:`PerformanceModel.model_info`: the remaining metadata (e.g., cruise
speeds, aerodynamic coefficients) trimmed away from ``flight_performance`` after
the table is created.

API Reference
-------------

.. autoclass:: AEIC.performance_model.PerformanceInputMode
:members:

.. attribute:: performance_table_colnames
.. autoclass:: AEIC.performance_model.PerformanceConfig
:members:

Names of each input dimension (excluding fuel flow) used to construct the table.
.. autoclass:: AEIC.performance_model.PerformanceModel
:members: __init__, initialize_performance, read_performance_data, create_performance_table, get_engine_by_uid
Loading