Octopus Documentation

Octopus is a software package designed primarily to model the flow of nitrous oxide (N2O) through a rocket engine injector. It has a built-in EOS based on a Helmholz energy method outlined in `[3]<main ref 3>`_, and includes the required coefficients to use it with nitrous oxide. 19 other chemicals are also available, but CO2 is not. octopus.utils.Nist contains methods that may be used, along with scipy.optimize and octopus.utils.derivative() to produce the required coefficients for the modelling of CO2, if required.

octopus.main

Implementation of injector fluid dynamics classes.

octopus.utils

Implementation of data and mathematical utilities used in the octopus.main module

Octopus.main module

Implementation of injector fluid dynamics classes.

Classes

Fluid(name)

Represents a fluid.

PropertySource(p, T)

An object to provide a constant pressure and temperature as a parent object for a Manifold.

Manifold(fluid, parent)

Represent a propellant manifold, at least one Fluid input and one Orifice output.

Orifice(manifold, L, D, orifice_type, Cd)

Represent a propellant orifice on the injector plate, at least one Manifold input.

Element(o_orifices, f_orifices)

Represent an injector element, at least one Orifice input

class octopus.main.Fluid(name: str)[source]

Bases: object

Represents a fluid.

Initiate a Fluid instance.

Parameters

ID – id of fluid

rhol(T: Iterable)[source]
rhog(T: Iterable)[source]
psat(T: Iterable)[source]
hl(T: Iterable)[source]
hg(T: Iterable)[source]
sl(T: Iterable)[source]
sg(T: Iterable)[source]
class octopus.main.PropertySource(p: float = 101325, T: float = 298)[source]

Bases: object

An object to provide a constant pressure and temperature as a parent object for a Manifold.

The user may create their own property source class, by extending :class`PropertySource`, and modifying the current p() and T() methods.

Initialise :class`PropertySource` object with constant pressure and temperature to supply to manifold fluid. :param p: pressure (Pa) :param T: temperature (K)

property p
property T
class octopus.main.Manifold(fluid: str, parent: octopus.main.PropertySource)[source]

Bases: object

Represent a propellant manifold, at least one Fluid input and one Orifice output. If a user wishes to model losses within the manifold, they may extend this class and add the required computing into the Manifold.p() and Manifold.T() functions.

Initialise Manifold object with a working fluid and property parent.

Parameters
  • fluidFluid object to use EOS functions from

  • parentPropertySource object to get p and T from

property p
property T
class octopus.main.Orifice(manifold: octopus.main.Manifold, L: float, D: float, orifice_type: int = 0, Cd: float = 0.7)[source]

Bases: object

Represent a propellant orifice on the injector plate, at least one Manifold input.

Initialise Orifice object.

Parameters
  • manifoldManifold to get fluid EOS and properties from

  • L – orifice length (m)

  • D – orifice diameter (m)

  • orifice_typeSTRAIGHT (default) or CAVITATING

  • Cd – discharge coefficient = 0.7

STRAIGHT = 0
CAVITATING = 1
m_dot_SPI(p1: float)[source]

Return single-phase-incompressible mass flow rate.

Parameters

p1 – combustion chamber pressure (Pa)

Returns

mass flow rate (kg/s)

m_dot_HEM(p1: float)[source]

Return homogeneous-equilibrium-model mass flow rate.

Parameters

p1 – combustion chamber pressure (Pa)

Returns

mass flow rate (kg/s)

m_dot_dyer(P_cc: float)[source]

Return Dyer model mass flow rate.

Parameters

P_cc – combustion chamber pressure (Pa)

Returns

mass flow rate (kg/s)

class octopus.main.Element(o_orifices: Sequence[octopus.main.Orifice], f_orifices: Sequence[octopus.main.Orifice])[source]

Bases: object

Represent an injector element, at least one Orifice input

of_ratio(p: float)[source]

Octopus.utils module

Implementation of data and mathematical utilities used in the octopus.main module

Functions

derivative(f, axis, *args[, dx])

Calculate the numerical derivative of a scalar funtion f(args) with respect to args[axis].

Classes

Nist(filename)

Collection of tools for retrieving data from a NIST csv file.

octopus.utils.derivative(f: callable, axis: int, *args: Any, dx: float = 0.01)float[source]

Calculate the numerical derivative of a scalar funtion f(args) with respect to args[axis].

Parameters
  • f – vector function to find derivative of with the signature f(args) -> iterable

  • axis – index of the parameter against which the derivative of f is to be taken

  • args – parameters to pass to f, including the one against which the derivative is to be taken

  • dx – differentiation step

Returns

array of floats representing vector derivative f with respect to args[axis]

class octopus.utils.Nist(filename: str)[source]

Bases: object

Collection of tools for retrieving data from a NIST csv file.

Retrieve thermodynamic data from a tab-delimited csv file.

Parameters

filename – filename, not including file extension, of a tab-delimited NIST datafile

list_fields()List[str][source]

List fields in NIST datafile

Returns

list of column headers in the NIST datafile

get_fields(*fields: Union[str, float])List[numpy.ndarray][source]

Retrieve data under specified fields

Parameters

fields – titles or indices of column headers in the datafile for which data is to beretrieved, in the order in which the fields are to be returned

Returns

2D array of data to be returned which can be accessed by data[field_index][datapoint]

Indices and tables