PySAGAS CFD Utilities

class pysagas.cfd.deck.AbstractDeck[source]
abstract __init__()[source]
Return type:

None

abstract from_csv(**kwargs)[source]

Load the deck from csv.

abstract insert()[source]

Insert data into the deck.

abstract to_csv()[source]

Write the deck to csv.

class pysagas.cfd.deck.AeroDeck[source]

Aerodynamic coefficient deck.

__init__(inputs, columns=['CL', 'CD', 'Cm'], a_ref=1, c_ref=1)[source]

Instantiate a new aerodeck.

Parameters:
  • inputs (list[str]) – A list of the inputs to this aerodeck. For example, [“aoa”, “mach”].

  • columns (list[str], optional) – A list of column names to use for this deck. The default is [“CL”, “CD”, “Cm”].

  • a_ref (float, optional) – The reference area. The default is 1.

  • c_ref (float, optional) – The reference length. The default is 1.

Return type:

None

classmethod from_csv(filepath, inputs, a_ref=1, c_ref=1)[source]

Create an Aerodeck from a CSV file.

Parameters:
  • filepath (str) – The filepath to the csv file containing aerodeck data.

  • inputs (list[str]) – A list of the inputs to this aerodeck. For example, [“aoa”, “mach”].

  • a_ref (float, optional) – The reference area. The default is 1.

  • c_ref (float, optional) – The reference length. The default is 1.

insert(result, **kwargs)[source]

Insert aerodynamic coefficients into the aerodeck.

Parameters:

result (FlowResults | dict) – The aerodynamic coefficients to be inserted, either as a PySAGAS native FlowResults object, or a dictionary with keys matching the data columns specified on instantiation of the deck.

See also

FlowResults

class pysagas.cfd.deck.Deck[source]
__init__(inputs, columns, **kwargs)[source]

Instantiate a new deck.

Parameters:
  • inputs (list[str]) – A list of the inputs to this aerodeck. For example, [“aoa”, “mach”].

  • columns (list[str]) – A list of column names to use for this deck. For example, [“CL”, “CD”, “Cm”].

Return type:

None

to_csv(file_prefix=None)[source]

Save the deck to CSV file.

Parameters:

file_prefix (str, optional) – The CSV file name prefix. If None is provided, the deck __repr__ will be used. The default is None.

class pysagas.cfd.deck.MultiDeck[source]

Collection of multiple Deck objects.

__init__(inputs, parameters, base_deck, **kwargs)[source]

Instantiate a new deck collection.

Parameters:
  • inputs (list[str]) – A list of the inputs to this deck. For example, [“aoa”, “mach”].

  • parameters (list[str]) – A list of the parameters to this deck. For example, [“wingspan”, “length”].

  • base_deck (Deck) – The base deck to initalise self._decks with.

Return type:

None

class pysagas.cfd.deck.SensDeck[source]
__init__(inputs, parameters, a_ref=1, c_ref=1, **kwargs)[source]

Instantiate a new sensitivity deck.

This object is a collection of `AeroDeck`s, containing aerodynamic sensitivity information.

Parameters:
  • inputs (list[str]) – A list of the inputs to this deck. For example, [“aoa”, “mach”].

  • parameters (list[str]) – A list of the parameters to this deck. For example, [“wingspan”, “length”].

  • a_ref (float, optional) – The reference area. The default is 1.

  • c_ref (float, optional) – The reference length. The default is 1.

Return type:

None

See also

AeroDeck

classmethod from_csv(param_filepaths, inputs, a_ref=1, c_ref=1)[source]

Create a SensDeck from a collection of CSV files.

Parameters:
  • param_filepaths (dict[str, str]) – A dictionary of filepaths, keyed by the associated parameter.

  • inputs (list[str]) – A list of the inputs to this aerodeck. For example, [“aoa”, “mach”].

  • a_ref (float, optional) – The reference area. The default is 1.

  • c_ref (float, optional) – The reference length. The default is 1.

insert(result, **kwargs)[source]

Insert data into the deck.

Parameters:

result (SensitivityResults)

to_csv(file_prefix=None)[source]

Save the decks to CSV file.

Parameters:

file_prefix (str, optional) – The CSV file name prefix. If None is provided, the deck __repr__ will be used. The default is None.