Class FuelSource
- Namespace
- NominalSystems.Classes
- Assembly
- NominalSystems.Classes.dll
[Nominal] Base class for 'FuelSource' types. This component is a container for fuel and applies energy momentum contributions to the spacecraft. It also calculates the mass flow between components.
public class FuelSource : StateEffector
- Inheritance
-
FuelSource
- Inherited Members
Constructors
FuelSource()
Construct a empty fuel container
public FuelSource()
Fields
ActualFuelConsumption
[kg/s] Rate of fuel being consumed from tank.
[EditableVariable("kg/s", true, "", "")]
public double ActualFuelConsumption
Field Value
DryMass
[kg] The mass of the tank without fuel.
[EditableVariable("kg", 0, false, "", "")]
public double DryMass
Field Value
In_FuelNodes
[-] A list of the connected mass nodes for flow control.
public readonly List<FuelNodeModel> In_FuelNodes
Field Value
Out_FuelSourceStatusMsg
[-] A output 'FuelContainer' payload
public readonly FuelSourceStatusMessage Out_FuelSourceStatusMsg
Field Value
RequestedFuelConsumption
[kg/s] Rate of fuel being consumed. TODO: Sam - To be used when fuel is consumed depending on a burn model
public double RequestedFuelConsumption
Field Value
Properties
Amount
[kg] The current stored fuel.
[EditableVariable("kg", 0, false, "", "")]
public virtual double Amount { get; set; }
Property Value
Capacity
[kg] The maximum storage capacity.
[EditableVariable("kg", 0, false, "", "")]
public virtual double Capacity { get; set; }
Property Value
FlowRate
[kg/s] The current rate of change of mass.
[EditableVariable("kg/s", true, "", "")]
public virtual double FlowRate { get; }
Property Value
IPrimeTankPntT_T
[kg m^2/s] Derivative of inertia of tank about pnt T in B frame comp.
[EditableVariable("kg m^2/s", 0, false, "", "")]
public Matrix3 IPrimeTankPntT_T { get; set; }
Property Value
ITankPntT_T
[kg m^2] Inertia of tank about pnt T in B frame comp.
[EditableVariable("kg m^2", 0, false, "", "")]
public Matrix3 ITankPntT_T { get; set; }
Property Value
MaximumFlowRate
[kg/s] The maximum flow rate of the fuel source.
[EditableVariable("kg/s", false, "", "")]
public virtual double MaximumFlowRate { get; set; }
Property Value
ModelType
[-] The enum of the FuelSourceModel.
[EditableVariable("-", false, "", "")]
public FuelSourceModelType ModelType { get; set; }
Property Value
RPPrime_TcT_T
[m/s^2] Second derivative of position vector from B to tank point in B frame comp.
[EditableVariable("m/s^2", 0, false, "", "")]
public Vector3 RPPrime_TcT_T { get; set; }
Property Value
RPrime_TcT_T
[m/s] Derivative of position vector from B to tank point in B frame comp.
[EditableVariable("m/s", 0, false, "", "")]
public Vector3 RPrime_TcT_T { get; set; }
Property Value
R_TcT_TInit
[m] Initial position vector from B to tank point in B frame comp.
[EditableVariable("m", 0, false, "", "")]
public Vector3 R_TcT_TInit { get; set; }
Property Value
TankLength
[m] Length of the tank.
[EditableVariable("m", 0, false, "", "")]
public double TankLength { get; set; }
Property Value
TankRadius
[m] Initial radius of the cylindrical tank.
[EditableVariable("m", 0, false, "", "")]
public double TankRadius { get; set; }
Property Value
UpdateOnly
[-] Sets whether to use update only mass depletion.
[EditableVariable("-", false, "", "")]
public bool UpdateOnly { get; set; }
Property Value
Methods
AttachFuelNode(FuelNodeModel)
Attach a FuelNode to the fuel source
public void AttachFuelNode(FuelNodeModel node)
Parameters
node
FuelNodeModel[-] A Fuel Node
ComputeDerivatives(double, Vector3, Vector3, Vector3)
Computers the Derivatives of the Body along with the Kinematic Derivatives
public override void ComputeDerivatives(double time, Vector3 rDDot_BN_N, Vector3 omegaDot_BN_B, Vector3 sigma_BN)
Parameters
time
doubleThe current computation time
rDDot_BN_N
Vector3The acceleration in the body frame
omegaDot_BN_B
Vector3The derivative of the attitude rate in the body frame
sigma_BN
Vector3The current attitude in the body frame
IsModelTypeSupported(Type)
Returns true if 'ComponentModel' type is supported model
protected override bool IsModelTypeSupported(Type type)
Parameters
type
Typea 'ComponentModel' type
Returns
LinkInStates(StateProperties)
Links any state variables
public override void LinkInStates(StateProperties states)
Parameters
states
StateProperties
OnBegin(double)
Called when the 'Component' is beginning
protected override void OnBegin(double time)
Parameters
time
doublecurrent time (seconds)
OnDecodeMetadata(JObject)
Called after the "Component" was loaded to handle additional metadata.
protected override void OnDecodeMetadata(JObject metadata)
Parameters
metadata
JObject
OnEncodeMetadata(JObject)
Called while the "Component" is being saved to save additional metadata.
protected override JObject OnEncodeMetadata(JObject metadata)
Parameters
metadata
JObject
Returns
- JObject
OnUpdate(double, double)
Called when the 'Component' should update
protected override void OnUpdate(double time, double step)
Parameters
RegisterStates(StateProperties)
Registers any of the states to the state parameters
public override void RegisterStates(StateProperties states)
Parameters
states
StateProperties
RemoveFuelNode(FuelNodeModel)
Remove a FuelNode from the fuel source
public void RemoveFuelNode(FuelNodeModel node)
Parameters
node
FuelNodeModel[-] A Fuel Node
SetFuelSourceModel(FuelSourceModelType)
Sets the current FuelSourceModelType to the input type and keeping old values.
public void SetFuelSourceModel(FuelSourceModelType fuelSourceModelType)
Parameters
fuelSourceModelType
FuelSourceModelType[-] The FuelSourceModelType to be set to
SetFuelSourceModel(FuelSourceModelType, double, double, Vector3, Matrix3, Matrix3, Vector3, Vector3)
Sets the FuelSourceModelType to the input and sets the values.
public void SetFuelSourceModel(FuelSourceModelType fuelSourceModelType, double radiusTankInit, double lengthTank, Vector3 _r_TcT_TInit, Matrix3 _IPrimeTankPntT_T, Matrix3 _ITankPntT_T, Vector3 _rPrime_TcT_T, Vector3 _rPPrime_TcT_T)
Parameters
fuelSourceModelType
FuelSourceModelType[-] The FuelSourceModelType to change to
radiusTankInit
double[m] Initial radius of the cylindrical tank
lengthTank
double[m] Length of the tank
_r_TcT_TInit
Vector3[m] Initial position vector from B to tank point in B frame comp
_IPrimeTankPntT_T
Matrix3[kg m^2/s] Derivative of inertia of tank about pnt T in B frame comp
_ITankPntT_T
Matrix3[kg m^2] Inertia of tank about pnt T in B frame comp
_rPrime_TcT_T
Vector3[m/s] Derivative of position vector from B to tank point in B frame comp
_rPPrime_TcT_T
Vector3[m/s^2] Second derivative of position vector from B to tank point in B frame comp
UpdateContributions(double, ref BackSubstitutionMatrices, Vector3, Vector3, Vector3)
Subsitutes in the BackSubstitutionMatrices and performs some calculations.
public override void UpdateContributions(double time, ref BackSubstitutionMatrices backSubContribution, Vector3 sigma_BN, Vector3 omega_BN_B, Vector3 g_N)
Parameters
time
doubleThe current time [s]
backSubContribution
BackSubstitutionMatricesA reference to the Matrices
sigma_BN
Vector3The current Attitude
omega_BN_B
Vector3The current Attitude rate
g_N
Vector3The spacecraft local gravity vector
UpdateEnergyMomentumContributions(double, ref Vector3, ref double, Vector3)
Computes the Energy and Momentum Contributions from the Body
public override void UpdateEnergyMomentumContributions(double time, ref Vector3 rotAngMomPntCContr_B, ref double rotEnergyContr, Vector3 omega_BN_B)
Parameters
time
doubleThe current time [s]
rotAngMomPntCContr_B
Vector3A reference to the Angular Momentum Vector
rotEnergyContr
doubleA reference to the Energy Contribution value
omega_BN_B
Vector3The current Attitude Rate of the body
UpdateMassProperties(double, double)
Updates the mass properties of the current physical object at a particular time.
public override void UpdateMassProperties(double time, double step)
Parameters
time
double[s] The current time of the simulation
step
double[s] The delta time between the updates
WriteOutputStateMessages(double)
Writes state messages after integration
public override void WriteOutputStateMessages(double time)
Parameters
time
doubleThe current time [s]