NASA9Coefficients#

class NASA9Coefficients[source]#

Bases: Flow360BaseModel

NASA 9-coefficient polynomial coefficients for computing temperature-dependent thermodynamic properties.

Supports 1-5 temperature ranges with continuous boundaries. Defaults to a single temperature range.

Example

Single temperature range (default):

>>> fl.NASA9Coefficients(
...     temperature_ranges=[
...         fl.NASA9CoefficientSet(
...             temperature_range_min=200.0 * fl.u.K,
...             temperature_range_max=6000.0 * fl.u.K,
...             coefficients=[0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
...         )
...     ]
... )

Multiple temperature ranges:

>>> fl.NASA9Coefficients(
...     temperature_ranges=[
...         fl.NASA9CoefficientSet(
...             temperature_range_min=200.0 * fl.u.K,
...             temperature_range_max=1000.0 * fl.u.K,
...             coefficients=[0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
...         ),
...         fl.NASA9CoefficientSet(
...             temperature_range_min=1000.0 * fl.u.K,
...             temperature_range_max=6000.0 * fl.u.K,
...             coefficients=[0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
...         )
...     ]
... )

Attributes

temperature_ranges: list[NASA9CoefficientSet]#

List of NASA 9-coefficient sets for different temperature ranges. Must be ordered by increasing temperature and be continuous. Maximum 5 ranges supported.

Additional Constructors

classmethod from_file(filename)#

Loads a Flow360BaseModel from .json, or .yaml file.

Parameters:

filename (str) – Full path to the .yaml or .json file to load the Flow360BaseModel from.

Returns:

An instance of the component class calling load.

Return type:

Flow360BaseModel

Example

>>> params = Flow360BaseModel.from_file(filename='folder/sim.json') 

Methods

get_coefficients_at_temperature(temp_k)[source]#

Get the NASA 9 coefficients for a given temperature.

Finds the temperature range that contains the specified temperature and returns the corresponding coefficients.

Parameters:

temp_k (float) – Temperature in Kelvin

Returns:

NASA 9 coefficients [a0, a1, a2, a3, a4, a5, a6, a7, a8]

Return type:

list

help(methods=False)#

Prints message describing the fields and methods of a Flow360BaseModel.

Parameters:

methods (bool = False) – Whether to also print out information about object’s methods.

Return type:

None

Example

>>> params.help(methods=True) 
to_file(filename, **kwargs)#

Exports Flow360BaseModel instance to .json or .yaml file

Parameters:

filename (str) – Full path to the .json or .yaml or file to save the Flow360BaseModel to.

Return type:

None

Example

>>> params.to_file(filename='folder/flow360.json')