WSF
WsfRocketOrbitalManeuvering.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2017 Infoscitex, a DCS Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef WSFROCKETORBITALMANEUVERING_HPP
13#define WSFROCKETORBITALMANEUVERING_HPP
14
15#include "wsf_space_export.h"
16
18
21{
22public:
27
28 WsfOrbitalManeuvering* Clone() const override;
29
30 bool ProcessInput(UtInput& aInput) override;
31
32 bool Initialize(const UtCalendar& aEpoch) override;
33
34 void SetPlatformAttributes(WsfPlatform* aPlatform) const override;
35
37
38 double GetRequiredDuration(double aDeltaV) const override;
39 double GetRequiredDeltaV(double aDuration) const override;
40 double GetAvailableDeltaV() const override;
41 double GetAvailableDuration() const override;
42 bool ReduceAvailableDeltaV_By(double aDeltaV) override;
43 bool PerformStagingOperation() override;
45
46 const double GetTotalMass() const { return mRocket.GetTotalMass(); }
47
48protected:
49 // The stage class is meant to be a simplified version of the WsfGuidedMover::Stage class.
50 // Todo constuct or initialize a stage from a WsfGuidedMover::Stage.
51 class Stage
52 {
53 public:
54 Stage();
55 ~Stage() = default;
56
57 bool Initialize();
58 bool ProcessInput(UtInput& aInput);
59
60 double GetDuration(double aTotalMass, double aDeltaV) const;
61 double GetDeltaV(double aTotalMass, double aDuration) const;
62 double GetAvailableDeltaV(double aTotalMass) const;
63 double GetAvailableDuration() const { return mFuelMass / mBurnRate; }
64 double GetEmptyMass() const { return mEmptyMass; }
65 double GetFuelMass() const { return mFuelMass; }
66 double GetTotalMass() const { return mTotalMass; }
67 double GetBurnRate() const { return mBurnRate; }
68 double GetThrust() const { return mThrust; }
69 double GetSpecificImpulse() const;
70 double GetExhaustVelocity() const { return mExhaustVelocity; }
71 double Thrust(double aTotalMass, double aDuration, double& aDeltaV);
72
73 protected:
76 double mEmptyMass;
77
80 double mFuelMass;
81
84 double mTotalMass;
85
87 double mBurnRate;
88
90 double mThrust;
91
94 };
95
96 // A Rocket is a sequence of stages
97 class Rocket
98 {
99 public:
100 Rocket();
101 Rocket(const Rocket& aSrc);
102 Rocket& operator=(const Rocket&) = delete;
103 ~Rocket() = default;
104
105 bool Initialize();
106 bool ProcessInput(UtInput& aInput);
107
108 double Thrust(double aDuration, double& aDeltaV);
109 double GetDuration(double aDeltaV) const;
110 double GetDeltaV(double aDuration) const;
111 double GetAvailableDeltaV() const;
112 double GetAvailableDuration() const;
113 double GetTotalMass() const;
114 double GetFuelMass() const;
115 double GetEmptyMass() const;
116 double GetPayloadMass() const;
118
119 private:
120 typedef std::vector<Stage> Stages;
121 double GetTotalMass(const Stages::iterator aFromStage) const;
122
123 // bool mPerformAutomaticStaging;
124 Stages mStages;
125 Stages::iterator mCurrentStageIter;
126 };
127
128private:
129 Rocket mRocket;
130};
131
132#endif
virtual bool ReduceAvailableDeltaV_By(double aDeltaV)
Definition WsfOrbitalManeuvering.cpp:91
virtual double GetRequiredDuration(double aDeltaV) const =0
Given a delta-v, return the required time to complete the maneuver.
virtual double GetAvailableDuration() const
Return the available duration corresponding with the available delta-v.
Definition WsfOrbitalManeuvering.cpp:84
bool ProcessInput(UtInput &aInput) override
Definition WsfOrbitalManeuvering.cpp:28
WsfOrbitalManeuvering * Clone() const override=0
virtual double GetAvailableDeltaV() const
Definition WsfOrbitalManeuvering.cpp:78
virtual bool Initialize(const UtCalendar &aEpoch)
Definition WsfOrbitalManeuvering.cpp:43
virtual double GetRequiredDeltaV(double aDuration) const =0
Given a maneuver duration, return the necessary delta-v.
virtual void SetPlatformAttributes(WsfPlatform *aPlatform) const
Definition WsfOrbitalManeuvering.hpp:43
virtual bool PerformStagingOperation()
Default method returns false (see WsfRocketOrbitalManeuvering).
Definition WsfOrbitalManeuvering.cpp:166
WsfOrbitalManeuvering()=default
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
Definition WsfRocketOrbitalManeuvering.hpp:98
double GetAvailableDuration() const
Definition WsfRocketOrbitalManeuvering.cpp:392
double GetDuration(double aDeltaV) const
Definition WsfRocketOrbitalManeuvering.cpp:372
double GetPayloadMass() const
Return the payload mass, which is the total mass of all subsequent stages, if any.
Definition WsfRocketOrbitalManeuvering.cpp:440
double Thrust(double aDuration, double &aDeltaV)
Definition WsfRocketOrbitalManeuvering.cpp:361
double GetEmptyMass() const
Definition WsfRocketOrbitalManeuvering.cpp:434
double GetTotalMass() const
Return the total mass of the rocket, including all stages.
Definition WsfRocketOrbitalManeuvering.cpp:415
double GetAvailableDeltaV() const
Return the total delta-v available for the entire multi-stage rocket.
Definition WsfRocketOrbitalManeuvering.cpp:385
Rocket & operator=(const Rocket &)=delete
bool Initialize()
Definition WsfRocketOrbitalManeuvering.cpp:313
double GetDeltaV(double aDuration) const
Definition WsfRocketOrbitalManeuvering.cpp:402
bool ProcessInput(UtInput &aInput)
Definition WsfRocketOrbitalManeuvering.cpp:49
Rocket()
Definition WsfRocketOrbitalManeuvering.cpp:305
bool PerformStagingOperation()
Perform a staging event for the rocket. If no other stages are present, false is returned.
Definition WsfRocketOrbitalManeuvering.cpp:457
double GetFuelMass() const
Return the fuel mass, considered to be the fuel for this stage only.
Definition WsfRocketOrbitalManeuvering.cpp:426
double GetBurnRate() const
Definition WsfRocketOrbitalManeuvering.hpp:67
double mBurnRate
The rate of fuel expenditure (Kg/Sec); this can be provided or derived from the exhaust velocity.
Definition WsfRocketOrbitalManeuvering.hpp:87
double mFuelMass
Definition WsfRocketOrbitalManeuvering.hpp:80
double GetDuration(double aTotalMass, double aDeltaV) const
Definition WsfRocketOrbitalManeuvering.cpp:288
double GetEmptyMass() const
Definition WsfRocketOrbitalManeuvering.hpp:64
double GetFuelMass() const
Definition WsfRocketOrbitalManeuvering.hpp:65
bool Initialize()
Definition WsfRocketOrbitalManeuvering.cpp:144
double GetExhaustVelocity() const
Definition WsfRocketOrbitalManeuvering.hpp:70
double mThrust
The thrust (N); this must be provided.
Definition WsfRocketOrbitalManeuvering.hpp:90
double GetThrust() const
Definition WsfRocketOrbitalManeuvering.hpp:68
double mEmptyMass
Definition WsfRocketOrbitalManeuvering.hpp:76
double GetDeltaV(double aTotalMass, double aDuration) const
Definition WsfRocketOrbitalManeuvering.cpp:299
double mTotalMass
Definition WsfRocketOrbitalManeuvering.hpp:84
double GetTotalMass() const
Definition WsfRocketOrbitalManeuvering.hpp:66
Stage()
Definition WsfRocketOrbitalManeuvering.cpp:134
double mExhaustVelocity
The exhaust velocity (m/s); this can be provided or derived from the burn rate.
Definition WsfRocketOrbitalManeuvering.hpp:93
double GetAvailableDeltaV(double aTotalMass) const
Definition WsfRocketOrbitalManeuvering.cpp:294
double GetAvailableDuration() const
Definition WsfRocketOrbitalManeuvering.hpp:63
bool ProcessInput(UtInput &aInput)
Definition WsfRocketOrbitalManeuvering.cpp:241
WsfRocketOrbitalManeuvering & operator=(const WsfRocketOrbitalManeuvering &)=delete
const double GetTotalMass() const
Definition WsfRocketOrbitalManeuvering.hpp:46
Copyrights Multiple, All Rights Reserved