MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
aerodata.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/aero/aerodata.h,v 1.44 2017/01/12 14:45:58 masarati Exp $ */
2 /*
3  * MBDyn (C) is a multibody analysis code.
4  * http://www.mbdyn.org
5  *
6  * Copyright (C) 1996-2017
7  *
8  * Pierangelo Masarati <masarati@aero.polimi.it>
9  * Paolo Mantegazza <mantegazza@aero.polimi.it>
10  *
11  * Dipartimento di Ingegneria Aerospaziale - Politecnico di Milano
12  * via La Masa, 34 - 20156 Milano, Italy
13  * http://www.aero.polimi.it
14  *
15  * Changing this copyright notice is forbidden.
16  *
17  * This program is free software; you can redistribute it and/or modify
18  * it under the terms of the GNU General Public License as published by
19  * the Free Software Foundation (version 2 of the License).
20  *
21  *
22  * This program is distributed in the hope that it will be useful,
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25  * GNU General Public License for more details.
26  *
27  * You should have received a copy of the GNU General Public License
28  * along with this program; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  */
31 
32 #ifndef AERODATA_H
33 #define AERODATA_H
34 
35 #include "ac/f2c.h"
36 
37 #include "myassert.h"
38 #include "withlab.h"
39 #include "drive.h"
40 #include "dofown.h"
41 #include "matvec6.h"
42 #include "matvec3n.h"
43 #include "shape.h"
44 
45 #include "aerodc81.h"
46 
47 /* C81Data - begin */
48 
49 class C81Data : public WithLabel, public c81_data {
50 public:
51  C81Data(unsigned int uLabel);
52 };
53 
54 /* C81Data - end */
55 
56 
57 /* AeroMemory - begin */
58 
59 class AeroMemory {
60 private:
65 
66 protected:
68 
69  virtual int StorageSize(void) const = 0;
70 
71 public:
73  virtual ~AeroMemory(void);
74 
75  void Predict(int i, doublereal alpha,
76  doublereal &alf1, doublereal &alf2);
77  void Update(int i);
78  void SetNumPoints(int i);
79  int GetNumPoints(void) const;
80 };
81 
82 /* Memory - end */
83 
84 
85 /* AeroData - begin */
86 
87 class AeroData : public AeroMemory {
88 public:
90  STEADY = 0,
91  HARRIS = 1,
92  BIELAWA = 2,
93 
95  };
96 
97  enum {
98  VX = 0,
99  VY = 1,
100  VZ = 2,
101 
102  WX = 3,
103  WY = 4,
104  WZ = 5,
105 
106  FX = 0,
107  FY = 1,
108  FZ = 2,
109 
110  MX = 3,
111  MY = 4,
112  MZ = 5
113  };
114 
115 protected:
119 
120  int StorageSize(void) const;
121 
122  int GetForcesJacForwardDiff_int(int i, const doublereal* W, doublereal* TNG, Mat6x6& J, outa_t& OUTA);
123  int GetForcesJacCenteredDiff_int(int i, const doublereal* W, doublereal* TNG, Mat6x6& J, outa_t& OUTA);
124 
125 public:
126  AeroData(int i_p, int i_dim,
127  UnsteadyModel u = STEADY, DriveCaller *pt = 0);
128  virtual ~AeroData(void);
129 
130  virtual std::ostream& Restart(std::ostream& out) const = 0;
131  std::ostream& RestartUnsteady(std::ostream& out) const;
132  virtual void SetAirData(const doublereal& rho, const doublereal& c);
133 
134  virtual void SetSectionData(const doublereal& abscissa,
135  const doublereal& chord,
136  const doublereal& forcepoint,
137  const doublereal& velocitypoint,
138  const doublereal& twist,
139  const doublereal& omega = 0.);
140 
141  virtual int
142  GetForces(int i, const doublereal* W, doublereal* TNG, outa_t& OUTA);
143  virtual int
144  GetForcesJac(int i, const doublereal* W, doublereal* TNG, Mat6x6& J, outa_t& OUTA);
145 
146  // aerodynamic models with internal states
147  virtual unsigned int iGetNumDof(void) const;
148  virtual DofOrder::Order GetDofType(unsigned int i) const;
149  virtual void
150  AssRes(SubVectorHandler& WorkVec,
151  doublereal dCoef,
152  const VectorHandler& XCurr,
153  const VectorHandler& XPrimeCurr,
154  integer iFirstIndex, integer iFirstSubIndex,
155  int i, const doublereal* W, doublereal* TNG, outa_t& OUTA);
156  virtual void
157  AssJac(FullSubMatrixHandler& WorkMat,
158  doublereal dCoef,
159  const VectorHandler& XCurr,
160  const VectorHandler& XPrimeCurr,
161  integer iFirstIndex, integer iFirstSubIndex,
162  const Mat3xN& vx, const Mat3xN& wx, Mat3xN& fq, Mat3xN& cq,
163  int i, const doublereal* W, doublereal* TNG, Mat6x6& J, outa_t& OUTA);
164  virtual void
165  AfterConvergence(int i,
166  const VectorHandler& X, const VectorHandler& XP);
167 
168  AeroData::UnsteadyModel Unsteady(void) const;
169 };
170 
171 /* AeroData - end */
172 
173 extern void
174 ReadAeroData(DataManager* pDM, MBDynParser& HP, int dim,
175  Shape** ppChord, Shape** ppForce,
176  Shape** ppVelocity, Shape** ppTwist,
177  Shape** ppTipLoss,
178  integer* piNumber, DriveCaller** ppDC,
179  AeroData** aerodata);
180 
181 #endif /* AERODATA_H */
182 
virtual void SetSectionData(const doublereal &abscissa, const doublereal &chord, const doublereal &forcepoint, const doublereal &velocitypoint, const doublereal &twist, const doublereal &omega=0.)
Definition: aerodata.cc:237
int StorageSize(void) const
Definition: aerodata.cc:221
std::ostream & RestartUnsteady(std::ostream &out) const
Definition: aerodata.cc:252
virtual int GetForcesJac(int i, const doublereal *W, doublereal *TNG, Mat6x6 &J, outa_t &OUTA)
Definition: aerodata.cc:384
integer iPoints
Definition: aerodata.h:63
AeroMemory(DriveCaller *pt)
Definition: aerodata.cc:44
vam_t VAM
Definition: aerodata.h:117
virtual unsigned int iGetNumDof(void) const
Definition: aerodata.cc:362
doublereal * a
Definition: aerodata.h:61
virtual int GetForces(int i, const doublereal *W, doublereal *TNG, outa_t &OUTA)
Definition: aerodata.cc:377
virtual void SetAirData(const doublereal &rho, const doublereal &c)
Definition: aerodata.cc:214
virtual int StorageSize(void) const =0
C81Data(unsigned int uLabel)
Definition: aerodata.cc:171
doublereal * t
Definition: aerodata.h:62
doublereal Omega
Definition: aerodata.h:118
virtual std::ostream & Restart(std::ostream &out) const =0
AeroData::UnsteadyModel Unsteady(void) const
Definition: aerodata.cc:208
void Predict(int i, doublereal alpha, doublereal &alf1, doublereal &alf2)
Definition: aerodata.cc:65
int GetNumPoints(void) const
Definition: aerodata.cc:162
DriveCaller * pTime
Definition: aerodata.h:67
int GetForcesJacForwardDiff_int(int i, const doublereal *W, doublereal *TNG, Mat6x6 &J, outa_t &OUTA)
Definition: aerodata.cc:271
UnsteadyModel
Definition: aerodata.h:89
UnsteadyModel unsteadyflag
Definition: aerodata.h:116
unsigned int uLabel
Definition: withlab.h:44
int GetForcesJacCenteredDiff_int(int i, const doublereal *W, doublereal *TNG, Mat6x6 &J, outa_t &OUTA)
Definition: aerodata.cc:313
virtual void AfterConvergence(int i, const VectorHandler &X, const VectorHandler &XP)
Definition: aerodata.cc:416
virtual DofOrder::Order GetDofType(unsigned int i) const
Definition: aerodata.cc:368
static std::stack< cleanup * > c
Definition: cleanup.cc:59
int numUpdates
Definition: aerodata.h:64
virtual ~AeroData(void)
Definition: aerodata.cc:202
void ReadAeroData(DataManager *pDM, MBDynParser &HP, int dim, Shape **ppChord, Shape **ppForce, Shape **ppVelocity, Shape **ppTwist, Shape **ppTipLoss, integer *piNumber, DriveCaller **ppDC, AeroData **aerodata)
Definition: aerodata.cc:593
virtual ~AeroMemory(void)
Definition: aerodata.cc:50
virtual void AssJac(FullSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr, integer iFirstIndex, integer iFirstSubIndex, const Mat3xN &vx, const Mat3xN &wx, Mat3xN &fq, Mat3xN &cq, int i, const doublereal *W, doublereal *TNG, Mat6x6 &J, outa_t &OUTA)
Definition: aerodata.cc:403
double doublereal
Definition: colamd.c:52
AeroData(int i_p, int i_dim, UnsteadyModel u=STEADY, DriveCaller *pt=0)
Definition: aerodata.cc:181
long int integer
Definition: colamd.c:51
void SetNumPoints(int i)
Definition: aerodata.cc:141
void Update(int i)
Definition: aerodata.cc:116
virtual void AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr, integer iFirstIndex, integer iFirstSubIndex, int i, const doublereal *W, doublereal *TNG, outa_t &OUTA)
Definition: aerodata.cc:391
Definition: shape.h:50