JSBSim Flight Dynamics Model  1.0 (02 March 2017)
An Open Source Flight Dynamics and Control Software Library in C++
FGBuoyantForces.h
1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 
3  Header: FGBuoyantForces.h
4  Author: Anders Gidenstam, Jon S. Berndt
5  Date started: 01/21/08
6 
7  ------------- Copyright (C) 2008 - 2011 Anders Gidenstam -------------
8  ------------- Copyright (C) 2008 Jon S. Berndt (jon@jsbsim.org) -------------
9 
10  This program is free software; you can redistribute it and/or modify it under
11  the terms of the GNU Lesser General Public License as published by the Free Software
12  Foundation; either version 2 of the License, or (at your option) any later
13  version.
14 
15  This program is distributed in the hope that it will be useful, but WITHOUT
16  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17  FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
18  details.
19 
20  You should have received a copy of the GNU Lesser General Public License along with
21  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
22  Place - Suite 330, Boston, MA 02111-1307, USA.
23 
24  Further information about the GNU Lesser General Public License can also be found on
25  the world wide web at http://www.gnu.org.
26 
27 HISTORY
28 --------------------------------------------------------------------------------
29 01/21/08 JSB Created
30 
31 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
32 SENTRY
33 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
34 
35 #ifndef FGBUOYANTFORCES_H
36 #define FGBUOYANTFORCES_H
37 
38 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
39 INCLUDES
40 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
41 
42 #include <vector>
43 #include <map>
44 
45 #include "FGModel.h"
46 #include "FGGasCell.h"
47 #include "math/FGColumnVector3.h"
48 
49 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
50 DEFINITIONS
51 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
52 
53 #define ID_BUOYANTFORCES "$Id: FGBuoyantForces.h,v 1.18 2013/11/24 11:40:55 bcoconni Exp $"
54 
55 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
56 FORWARD DECLARATIONS
57 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
58 
59 namespace JSBSim {
60 
61 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
62 CLASS DOCUMENTATION
63 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
64 
101 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
102 CLASS DECLARATION
103 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
104 
105 class FGBuoyantForces : public FGModel
106 {
107 
108 public:
111  FGBuoyantForces(FGFDMExec* Executive);
114 
115  bool InitModel(void);
116 
124  bool Run(bool Holding);
125 
131  bool Load(Element* element);
132 
135  const FGColumnVector3& GetForces(void) const {return vTotalForces;}
136 
139  double GetForces(int idx) const {return vTotalForces(idx);}
140 
143  const FGColumnVector3& GetMoments(void) const {return vTotalMoments;}
144 
147  double GetMoments(int idx) const {return vTotalMoments(idx);}
148 
152  double GetGasMass(void) const;
153 
156  const FGColumnVector3& GetGasMassMoment(void);
157 
161  const FGMatrix33& GetGasMassInertia(void);
162 
166  std::string GetBuoyancyStrings(const std::string& delimeter);
167 
172  std::string GetBuoyancyValues(const std::string& delimeter);
173 
175 
176 private:
177  std::vector <FGGasCell*> Cells;
178  // Buoyant forces and moments. Excluding the gas weight.
179  FGColumnVector3 vTotalForces; // [lbs]
180  FGColumnVector3 vTotalMoments; // [lbs ft]
181 
182  // Gas mass related masses, inertias and moments.
183  FGMatrix33 gasCellJ; // [slug ft^2]
184  FGColumnVector3 vGasCellXYZ;
185  FGColumnVector3 vXYZgasCell_arm; // [lbs in]
186 
187  bool NoneDefined;
188 
189  void bind(void);
190 
191  void Debug(int from);
192 };
193 
194 } // namespace JSBSim
195 
196 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
197 #endif
198 
const FGColumnVector3 & GetGasMassMoment(void)
Gets the total moment from the gas mass.
Encapsulates the Buoyant forces calculations.
~FGBuoyantForces()
Destructor.
std::string GetBuoyancyValues(const std::string &delimeter)
Gets the coefficient values.
FGBuoyantForces(FGFDMExec *Executive)
Constructor.
double GetForces(int idx) const
Gets a component of the total Buoyant force vector.
const FGMatrix33 & GetGasMassInertia(void)
Gets the total moments of inertia for the gas mass in the body frame.
bool Run(bool Holding)
Runs the Buoyant forces model; called by the Executive Can pass in a value indicating if the executiv...
const FGColumnVector3 & GetMoments(void) const
Gets the total Buoyancy moment vector.
double GetGasMass(void) const
Gets the total gas mass.
Base class for all scheduled JSBSim models.
Definition: FGModel.h:74
std::string GetBuoyancyStrings(const std::string &delimeter)
Gets the strings for the current set of gas cells.
const FGColumnVector3 & GetForces(void) const
Gets the total Buoyant force vector.
This class implements a 3 element column vector.
double GetMoments(int idx) const
Gets a component of the total Buoyancy moment vector.
bool Load(Element *element)
Loads the Buoyant forces model.
Handles matrix math operations.
Definition: FGMatrix33.h:92
Encapsulates the JSBSim simulation executive.
Definition: FGFDMExec.h:189