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 builtin 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.
Implementation of injector fluid dynamics classes. 

Implementation of data and mathematical utilities used in the octopus.main module 
Octopus.main module¶
Implementation of injector fluid dynamics classes.
Classes

Represents a fluid. 

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

Represent a propellant manifold, at least one 

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

Represent an injector element, at least one 

class
octopus.main.
Fluid
(name: str)[source]¶ Bases:
object
Represents a fluid.
Initiate a Fluid instance.
 Parameters
ID – id of fluid

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()
andT()
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
¶

property

class
octopus.main.
Manifold
(fluid: str, parent: octopus.main.PropertySource)[source]¶ Bases:
object
Represent a propellant manifold, at least one
Fluid
input and oneOrifice
output. If a user wishes to model losses within the manifold, they may extend this class and add the required computing into theManifold.p()
andManifold.T()
functions.Initialise
Manifold
object with a working fluid and property parent. Parameters
fluid –
Fluid
object to use EOS functions fromparent –
PropertySource
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
manifold –
Manifold
to get fluid EOS and properties fromL – orifice length (m)
D – orifice diameter (m)
orifice_type –
STRAIGHT
(default) orCAVITATING
Cd – discharge coefficient = 0.7

STRAIGHT
= 0¶

CAVITATING
= 1¶

m_dot_SPI
(p1: float)[source]¶ Return singlephaseincompressible mass flow rate.
 Parameters
p1 – 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
Octopus.utils module¶
Implementation of data and mathematical utilities used in the octopus.main module
Functions

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

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 tabdelimited csv file.
 Parameters
filename – filename, not including file extension, of a tabdelimited 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]