Fluid Class#

class rocketpy.Fluid[source]#

Class that represents a fluid object and its attributes, such as density.

Variables:
  • name (str) – Name of the fluid.

  • density (int, float, callable, string, array, Function) – Input density of the fluid in kg/m³. Used internally to compute the density_function.

  • density_function (Function) – Density of the fluid as a function of temperature and pressure.

__init__(name, density)[source]#

Initializes a Fluid object.

Parameters:
  • name (str) – Name of the fluid.

  • density (int, float, callable, string, array, Function) –

    Density of the fluid in kg/m³ as a function of temperature and pressure. If a int or float is given, it is considered a constant function. A callable, csv file or an list of points can be given to express the density values. The parameter is used as a Function source.

    See more on rocketpy.Function source types.

property density#

Density of the fluid from the class parameter input.

property density_function#

Density of the fluid as a function of temperature and pressure.

get_time_variable_density(temperature, pressure)[source]#

Get the density of the fluid as a function of time.

Parameters:
  • temperature (Function) – Temperature of the fluid in Kelvin.

  • pressure (Function) – Pressure of the fluid in Pascals.

Returns:

Density of the fluid in kg/m³ as function of time.

Return type:

Function

__repr__()[source]#

Representation method.

Returns:

String representation of the class.

Return type:

str

__str__()[source]#

String method.

Returns:

String representation of the class.

Return type:

str