WSF
WsfFuelFlowTables.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 2003-2015 The Boeing 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// Updated by Infoscitex, a DCS Company.
13// ****************************************************************************
14
15#ifndef WSFFUELFLOWTABLES_HPP
16#define WSFFUELFLOWTABLES_HPP
17
18#include "wsf_export.h"
19
20#include "TblLookup.hpp"
21#include "WsfPlatform.hpp"
23
26{
27public:
28 WsfFuelFlow(UtAtmosphere& aAtmosphere, double aRate);
30 virtual ~WsfFuelFlow() = default;
31 virtual WsfFuelFlow* Clone() const;
32
34
35 virtual bool Initialize(WsfPlatform* aPlatformPtr);
37
40 virtual double CalcConsumptionRate(); // calling this uses the platform's current altitude and speed
41 virtual double CalcConsumptionRateAltitudeSpeed(const double aAltitude, const double aSpeed);
42
43 void SetTableSpeedIsInMach(bool aSpeedInMach) { mSpeedInMach = aSpeedInMach; }
44
45protected:
46 double GetSpeed() const;
47 double GetMass() const;
48 double GetAlt() const;
49
50 // derived classes should use the lookup table on the given altitude and speed
51 virtual double CalcConsumptionRateAltitudeSpeedP(const double aAltitude, const double aSpeed) { return mFlowRate; }
52
54 WsfFuelFlow(const WsfFuelFlow& aSrc);
55
57 double mFlowRate;
58 WsfPlatform* mPlatPtr; // The platform the fuel flow is computed for.
59 UtAtmosphere mAtmosphere;
60};
61
67{
68public:
70 std::shared_ptr<TblIndVarU<double>> aIVsPtr,
71 std::shared_ptr<TblDepVar1<double>> aRatesPtr,
72 UtAtmosphere& aAtmosphere);
74 ~WsfFuelFlow1D() override = default;
75
76 WsfFuelFlow* Clone() const override;
77
78protected:
80 WsfFuelFlow1D(const WsfFuelFlow1D& aSrc);
81
82 double CalcConsumptionRateAltitudeSpeedP(const double aAltitude, const double aSpeed) override;
83
85 std::shared_ptr<TblIndVarU<double>> mIVsPtr; //<! Independent values
86 std::shared_ptr<TblDepVar1<double>> mRatesPtr; //<! Dependent Values (fuel flow rates) = f(IV);
87 TblLookupLU<double> mLookup;
88};
89
92{
93public:
96 std::shared_ptr<TblIndVarU<double>> aIVs1Ptr,
97 std::shared_ptr<TblIndVarU<double>> aIVs2Ptr,
98 std::shared_ptr<TblDepVar2<double>> aRatesPtr,
99 UtAtmosphere& aAtmosphere);
101 ~WsfFuelFlow2D() override = default;
102 WsfFuelFlow* Clone() const override;
103
104protected:
106 WsfFuelFlow2D(const WsfFuelFlow2D& aSrc);
107
108 double CalcConsumptionRateAltitudeSpeedP(const double aAltitude, const double aSpeed) override;
109
112 std::shared_ptr<TblIndVarU<double>> mIVs1Ptr; //<! Independent values
113 std::shared_ptr<TblIndVarU<double>> mIVs2Ptr; //<! Independent values
114 std::shared_ptr<TblDepVar2<double>> mRatesPtr; //<! Dependent Values (fuel flow rates) = f(IV);
115 TblLookupLU<double> mLookup1;
116 TblLookupLU<double> mLookup2;
117};
118
121{
122public:
126 std::shared_ptr<TblIndVarU<double>> aIVs1Ptr,
127 std::shared_ptr<TblIndVarU<double>> aIVs2Ptr,
128 std::shared_ptr<TblIndVarU<double>> aIVs3Ptr,
129 std::shared_ptr<TblDepVar3<double>> aRatesPtr,
130 UtAtmosphere& aAtmosphere);
131 ~WsfFuelFlow3D() override = default;
133 WsfFuelFlow* Clone() const override;
134
137
141 const std::shared_ptr<TblIndVarU<double>> GetIVs1Ptr() const { return mIVs1Ptr; }
142 const std::shared_ptr<TblIndVarU<double>> GetIVs2Ptr() const { return mIVs2Ptr; }
143 const std::shared_ptr<TblIndVarU<double>> GetIVs3Ptr() const { return mIVs3Ptr; }
144 const std::shared_ptr<TblDepVar3<double>> GetRatesPtr() const { return mRatesPtr; }
146
147protected:
149 WsfFuelFlow3D(const WsfFuelFlow3D& aSrc);
150
151 double CalcConsumptionRateAltitudeSpeedP(const double aAltitude, const double aSpeed) override;
152
156
157 std::shared_ptr<TblIndVarU<double>> mIVs1Ptr; //<! Independent values
158 std::shared_ptr<TblIndVarU<double>> mIVs2Ptr; //<! Independent values
159 std::shared_ptr<TblIndVarU<double>> mIVs3Ptr; //<! Independent values
160
161 std::shared_ptr<TblDepVar3<double>> mRatesPtr; //<! Dependent Values (fuel flow rates) = f(IV);
162
163 TblLookupLU<double> mLookup1;
164 TblLookupLU<double> mLookup2;
165 TblLookupLU<double> mLookup3;
166};
167
168#endif
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
~WsfFuelFlow1D() override=default
std::shared_ptr< TblDepVar1< double > > mRatesPtr
Definition WsfFuelFlowTables.hpp:86
double CalcConsumptionRateAltitudeSpeedP(const double aAltitude, const double aSpeed) override
Definition WsfFuelFlowTables.cpp:136
WsfFuelFlow1D & operator=(const WsfFuelFlow1D &)=delete
std::shared_ptr< TblIndVarU< double > > mIVsPtr
Definition WsfFuelFlowTables.hpp:85
TblLookupLU< double > mLookup
Definition WsfFuelFlowTables.hpp:87
WsfTabularRateFuel::VarType mType
Definition WsfFuelFlowTables.hpp:84
WsfFuelFlow * Clone() const override
Definition WsfFuelFlowTables.cpp:130
WsfFuelFlow1D(WsfTabularRateFuel::VarType aType, std::shared_ptr< TblIndVarU< double > > aIVsPtr, std::shared_ptr< TblDepVar1< double > > aRatesPtr, UtAtmosphere &aAtmosphere)
Definition WsfFuelFlowTables.cpp:104
std::shared_ptr< TblIndVarU< double > > mIVs2Ptr
Definition WsfFuelFlowTables.hpp:113
WsfFuelFlow2D(WsfTabularRateFuel::VarType aIV1Type, WsfTabularRateFuel::VarType aIV2Type, std::shared_ptr< TblIndVarU< double > > aIVs1Ptr, std::shared_ptr< TblIndVarU< double > > aIVs2Ptr, std::shared_ptr< TblDepVar2< double > > aRatesPtr, UtAtmosphere &aAtmosphere)
Definition WsfFuelFlowTables.cpp:158
WsfTabularRateFuel::VarType mIV1Type
Definition WsfFuelFlowTables.hpp:110
TblLookupLU< double > mLookup2
Definition WsfFuelFlowTables.hpp:116
TblLookupLU< double > mLookup1
Definition WsfFuelFlowTables.hpp:115
double CalcConsumptionRateAltitudeSpeedP(const double aAltitude, const double aSpeed) override
Definition WsfFuelFlowTables.cpp:198
std::shared_ptr< TblIndVarU< double > > mIVs1Ptr
Definition WsfFuelFlowTables.hpp:112
std::shared_ptr< TblDepVar2< double > > mRatesPtr
Definition WsfFuelFlowTables.hpp:114
WsfTabularRateFuel::VarType mIV2Type
Definition WsfFuelFlowTables.hpp:111
WsfFuelFlow * Clone() const override
Definition WsfFuelFlowTables.cpp:192
WsfFuelFlow2D & operator=(const WsfFuelFlow2D &)=delete
~WsfFuelFlow2D() override=default
Three-Dimensional flow rate fuel consumption table object.
Definition WsfFuelFlowTables.hpp:121
const std::shared_ptr< TblIndVarU< double > > GetIVs2Ptr() const
Definition WsfFuelFlowTables.hpp:142
std::shared_ptr< TblIndVarU< double > > mIVs3Ptr
Definition WsfFuelFlowTables.hpp:159
WsfFuelFlow3D(WsfTabularRateFuel::VarType aIV1Type, WsfTabularRateFuel::VarType aIV2Type, WsfTabularRateFuel::VarType aIV3Type, std::shared_ptr< TblIndVarU< double > > aIVs1Ptr, std::shared_ptr< TblIndVarU< double > > aIVs2Ptr, std::shared_ptr< TblIndVarU< double > > aIVs3Ptr, std::shared_ptr< TblDepVar3< double > > aRatesPtr, UtAtmosphere &aAtmosphere)
Definition WsfFuelFlowTables.cpp:236
WsfFuelFlow * Clone() const override
Definition WsfFuelFlowTables.cpp:278
TblLookupLU< double > mLookup3
Definition WsfFuelFlowTables.hpp:165
const WsfTabularRateFuel::VarType & GetIV2Type() const
Definition WsfFuelFlowTables.hpp:139
WsfTabularRateFuel::VarType mIV1Type
Definition WsfFuelFlowTables.hpp:153
TblLookupLU< double > mLookup1
Definition WsfFuelFlowTables.hpp:163
WsfTabularRateFuel::VarType mIV2Type
Definition WsfFuelFlowTables.hpp:154
const std::shared_ptr< TblIndVarU< double > > GetIVs1Ptr() const
Definition WsfFuelFlowTables.hpp:141
WsfTabularRateFuel::VarType mIV3Type
Definition WsfFuelFlowTables.hpp:155
std::shared_ptr< TblDepVar3< double > > mRatesPtr
Definition WsfFuelFlowTables.hpp:161
WsfFuelFlow3D & operator=(const WsfFuelFlow3D &)=delete
std::shared_ptr< TblIndVarU< double > > mIVs1Ptr
Definition WsfFuelFlowTables.hpp:157
TblLookupLU< double > mLookup2
Definition WsfFuelFlowTables.hpp:164
std::shared_ptr< TblIndVarU< double > > mIVs2Ptr
Definition WsfFuelFlowTables.hpp:158
~WsfFuelFlow3D() override=default
const std::shared_ptr< TblDepVar3< double > > GetRatesPtr() const
Definition WsfFuelFlowTables.hpp:144
const WsfTabularRateFuel::VarType & GetIV3Type() const
Definition WsfFuelFlowTables.hpp:140
const std::shared_ptr< TblIndVarU< double > > GetIVs3Ptr() const
Definition WsfFuelFlowTables.hpp:143
const WsfTabularRateFuel::VarType & GetIV1Type() const
Definition WsfFuelFlowTables.hpp:138
Constant flow rate fuel consumption table object.
Definition WsfFuelFlowTables.hpp:26
void SetTableSpeedIsInMach(bool aSpeedInMach)
Definition WsfFuelFlowTables.hpp:43
virtual double CalcConsumptionRateAltitudeSpeedP(const double aAltitude, const double aSpeed)
Definition WsfFuelFlowTables.hpp:51
bool mSpeedInMach
Definition WsfFuelFlowTables.hpp:56
virtual double CalcConsumptionRate()
Definition WsfFuelFlowTables.cpp:65
WsfFuelFlow(UtAtmosphere &aAtmosphere, double aRate)
Definition WsfFuelFlowTables.cpp:23
virtual double CalcConsumptionRateAltitudeSpeed(const double aAltitude, const double aSpeed)
Definition WsfFuelFlowTables.cpp:70
virtual bool Initialize(WsfPlatform *aPlatformPtr)
Definition WsfFuelFlowTables.cpp:55
WsfPlatform * mPlatPtr
Definition WsfFuelFlowTables.hpp:58
double mFlowRate
Definition WsfFuelFlowTables.hpp:57
virtual ~WsfFuelFlow()=default
UtAtmosphere mAtmosphere
Definition WsfFuelFlowTables.hpp:59
WsfFuelFlow & operator=(const WsfFuelFlow &)=delete
virtual WsfFuelFlow * Clone() const
Definition WsfFuelFlowTables.cpp:44
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
VarType
Enumeration to identify the variable for a fuel flow table.
Definition WsfTabularRateFuel.hpp:44
Copyrights Multiple, All Rights Reserved