Module: fuelTank

Executive Summary

This class is an instantiation of the stateEffector abstract class and implements an effector representing a fuel tank. This fuel tank has one state associated with it and is the mass of the fuel inside the tank

The module PDF Description contains further information on this module’s function, how to run it, as well as testing.

Message Connection Descriptions

The following table lists all the module input and output messages. The module msg variable name is set by the user from python. The msg type contains a link to the message structure definition, while the description provides information on what this message is used for.

Module I/O Messages

Msg Variable Name

Msg Type

Description

fuelTankOutMsg

FuelTankMsgPayload

fuel tank output message name


Defines

FUEL_TANK_H

Enums

enum FuelTankModelTypes

Values:

enumerator TANK_MODEL_FIRST_MODEL
enumerator TANK_MODEL_CONSTANT_VOLUME
enumerator TANK_MODEL_CONSTANT_DENSITY
enumerator TANK_MODEL_EMPTYING
enumerator TANK_MODEL_UNIFORM_BURN
enumerator TANK_MODEL_CENTRIFUGAL_BURN
enumerator TANK_MODEL_LAST_MODEL

Variables

FuelTankModelConstantVolume_t FuelTankModelConstantVolume

fuel tank variable

FuelTankModelConstantDensity_t FuelTankModelConstantDensity

fuel tank variable

FuelTankModelEmptying_t FuelTankModelEmptying

fuel tank variable

FuelTankModelUniformBurn_t FuelTankModelUniformBurn

fuel tank variable

FuelTankModelCentrifugalBurn_t FuelTankModelCentrifugalBurn

fuel tank variable

FuelTankModel *FuelTankModels[TANK_MODEL_LAST_MODEL - TANK_MODEL_FIRST_MODEL]

fuel tank variable

struct FuelTankModel
#include <fuelTank.h>

fuel tank model structure

Subclassed by FuelTankModelCentrifugalBurn_t, FuelTankModelConstantDensity_t, FuelTankModelConstantVolume_t, FuelTankModelEmptying_t, FuelTankModelUniformBurn_t

Public Functions

virtual void computeTankProps(double mFuel) = 0

class method

virtual void computeTankPropDerivs(double mFuel, double mDotFuel) = 0

class method

inline FuelTankModel()
inline virtual ~FuelTankModel()

Public Members

double propMassInit

[kg] Initial propellant mass in tank

double maxFuelMass = 1.0

[kg] maximum tank mass

Eigen::Vector3d r_TcT_TInit

[m] Initial position vector from B to tank point in B frame comp.

Eigen::Matrix3d ITankPntT_T

[kg m^2] Inertia of tank about pnt T in B frame comp.

Eigen::Matrix3d IPrimeTankPntT_T

[kg m^2/s] Derivative of inertia of tank about pnt T in B frame comp.

Eigen::Vector3d r_TcT_T

[m] position vector from B to tank point in B frame comp.

Eigen::Vector3d rPrime_TcT_T

[m/s] Derivative of position vector from B to tank point in B frame comp.

Eigen::Vector3d rPPrime_TcT_T

[m/s^2] Second derivative of position vector from B to tank point in B frame comp.

struct FuelTankModelConstantVolume_t : public FuelTankModel
#include <fuelTank.h>

fuel tank constant volume structure

Public Functions

inline virtual void computeTankProps(double mFuel)

class method

inline virtual void computeTankPropDerivs(double mFuel, double mDotFuel)

class method

Public Members

double radiusTankInit

[m] Initial radius of the spherical tank

struct FuelTankModelConstantDensity_t : public FuelTankModel
#include <fuelTank.h>

fuel tank constant density structure

Public Functions

inline virtual void computeTankProps(double mFuel)

class method

inline virtual void computeTankPropDerivs(double mFuel, double mDotFuel)

class method

Public Members

double radiusTankInit

[m] Initial radius of the spherical tank

double radiusTank

[m] Current radius of the spherical tank

struct FuelTankModelEmptying_t : public FuelTankModel
#include <fuelTank.h>

fuel tank model emptying structure

Public Functions

inline virtual void computeTankProps(double mFuel)

class method

inline virtual void computeTankPropDerivs(double mFuel, double mDotFuel)

class method

Public Members

double radiusTankInit

[m] Initial radius of the spherical tank

double rhoFuel

[kg/m^3] density of the fuel

double thetaStar

[rad] angle from vertical to top of fuel

double thetaDotStar

[rad/s] derivative of angle from vertical to top of fuel

double thetaDDotStar

[rad/s^2] second derivative of angle from vertical to top of fuel

Eigen::Vector3d k3

&#8212; Direction of fuel depletion

struct FuelTankModelUniformBurn_t : public FuelTankModel
#include <fuelTank.h>

fuel tank model structure for a uniform burn

Public Functions

inline virtual void computeTankProps(double mFuel)

class method

inline virtual void computeTankPropDerivs(double mFuel, double mDotFuel)

class method

Public Members

double radiusTankInit

[m] Initial radius of the cylindrical tank

double lengthTank

[m] Length of the tank

struct FuelTankModelCentrifugalBurn_t : public FuelTankModel
#include <fuelTank.h>

fuel tank model structure for a centrifugal burn

Public Functions

inline virtual void computeTankProps(double mFuel)

class method

inline virtual void computeTankPropDerivs(double mFuel, double mDotFuel)

class method

Public Members

double radiusTankInit

[m] Initial radius of the cylindrical tank

double lengthTank

[m] Length of the tank

double radiusInner

[m] Inner radius of the cylindrical tank

class FuelTank : public StateEffector, public SysModel
#include <fuelTank.h>

fuel tank model class

Public Functions

FuelTank()

&#8212; Contructor

This is the constructor, setting variables to default values

~FuelTank()

&#8212; Destructor

This is the destructor, nothing to report here

void WriteOutputMessages(uint64_t CurrentClock)

This method takes the computed fuel tank mass properties and outputs them to the messaging system.

Parameters

CurrentClock – The current simulation time (used for time stamping)

Returns

void

void UpdateState(uint64_t CurrentSimNanos)

This method allows the fuel tank to write out its messages to the messaging system

Parameters

CurrentSimNanos – The current simulation time in nanoseconds

Returns

void

void setTankModel(FuelTankModelTypes model)

set fuel tank model

Parameters

model – fuel tank model type

Returns

void

void pushFuelSloshParticle(FuelSlosh *particle)

&#8212; Method to attach fuel slosh particle

This is a method to attach a fuel slosh particle to the tank

void registerStates(DynParamManager &states)

&#8212; Method to register mass state with state manager

Method for fuel tank to register states. The fuel tank has one state associated with it: mass, and it also has the responsibility to call register states for the fuel slosh particles

void linkInStates(DynParamManager &states)

&#8212; Method to give the tank access to other states

Method for fuel tank to access the states that it needs, needs omega

void updateEffectorMassProps(double integTime)

&#8212; Method to add contribtution mass props from the tank

This method gives the fuel tank the ability to add its contributions the mass of the vehicle.

inline void addThrusterSet(DynamicEffector *NewdynEff)

&#8212; Method to add dynamic thruster

inline void addThrusterSet(StateEffector *NewstateEff)

&#8212; Method to add state thruster

virtual void updateContributions(double integTime, BackSubMatrices &backSubContr, Eigen::Vector3d sigma_BN, Eigen::Vector3d omega_BN_B, Eigen::Vector3d g_N)

&#8212; Back-sub contributions

This method allows the fuel tank to add its contributions to the matrices for the back-sub method.

virtual void updateEnergyMomContributions(double integTime, Eigen::Vector3d &rotAngMomPntCContr_B, double &rotEnergyContr, Eigen::Vector3d omega_BN_B)

&#8212; Energy and momentum calculations

This method allows the fuel tank to contribute to the energy and momentum calculations

virtual void computeDerivatives(double integTime, Eigen::Vector3d rDDot_BN_N, Eigen::Vector3d omegaDot_BN_B, Eigen::Vector3d sigma_BN)

&#8212; Method for each stateEffector to calculate derivatives

This method allows the fuel tank to compute its derivative

Public Members

std::string nameOfMassState

&#8212; name of mass state

std::vector<FuelSlosh*> fuelSloshParticles

&#8212; vector of fuel slosh particles

std::vector<DynamicEffector*> dynEffectors

&#8212; Vector of dynamic effectors for thrusters

std::vector<StateEffector*> stateEffectors

&#8212; Vector of state effectors for thrusters

Eigen::Matrix3d dcm_TB

&#8212; DCM from body frame to tank frame

Eigen::Vector3d r_TB_B

[m] position of tank in B frame

bool updateOnly

&#8212; Sets whether to use update only mass depletion

Message<FuelTankMsgPayload> fuelTankOutMsg

&#8212; fuel tank output message name

FuelTankMsgPayload fuelTankMassPropMsg

instance of messaging system message struct

BSKLogger bskLogger

&#8212; BSK Logging

Private Members

StateData *omegaState

&#8212; state data for omega_BN of the hub

StateData *massState

&#8212; state data for mass state

double fuelConsumption

[kg/s] rate of fuel being consumed

double tankFuelConsumption

[kg/s] rate of fuel being consumed from tank

FuelTankModel *fuelTankModel

&#8212; style of tank to simulate

Eigen::Matrix3d ITankPntT_B
Eigen::Vector3d r_TcB_B

Private Static Attributes

static uint64_t effectorID = 1

[] ID number of this panel