MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
genfm.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/aero/genfm.h,v 1.20 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 GENFM_H
33 #define GENFM_H
34 
35 /* Generic force/moment element based on table lookup */
36 /* originated from GARTEUR HC AG-16 activity to model generic aerodynamic
37  * forces related to rigid body motion as a function of dynamic pressure
38  * angle of attack and sideslip angle, with data provided by DLR for Bo105
39  * fuselage and tail empennages */
40 
41 #include "aerodyn.h"
42 
44  std::string name;
45 
47 
48  /* angle of attack and sideslip angle datapoints number */
49  int nAlpha;
50  int nBeta;
51 
52  std::vector<doublereal> Alpha;
53  std::vector<doublereal> Beta;
54 
57 
64  };
65 
66  std::vector<std::vector<GenericAerodynamicCoef> > Data;
67 };
68 
70  virtual public Elem,
71  public AerodynamicElem,
72  public InitialAssemblyElem
73 {
74 protected:
75  /* Node the forces are applied to */
76  const StructNode* pNode;
77  /* Reference surface and length used to dimensionalize
78  * non-dimensional coefficients */
81  const bool bAlphaFirst;
82  /* Offset of aerodynamic center with respect to node position */
83  const Vec3 tilde_f;
84  /* orientation of aerodynamic reference frame with respect to node */
85  const Mat3x3 tilde_Ra; /* Rotaz. del sistema aerodinamico al nodo */
86 
87  /* force and moment */
92 
93  // persistent
95 
96  /* aerodynamic data */
98 
99  /* Assemblaggio residuo */
100  void AssVec(SubVectorHandler& WorkVec);
101 
102 public:
103  GenericAerodynamicForce(unsigned int uLabel,
104  const DofOwner *pDO,
105  const StructNode* pN,
106  const Vec3& fTmp, const Mat3x3& RaTmp,
109  flag fOut);
110  virtual ~GenericAerodynamicForce(void);
111 
112  /* Scrive il contributo dell'elemento al file di restart */
113  virtual std::ostream& Restart(std::ostream& out) const;
114 
115  /* Tipo dell'elemento (usato per debug ecc.) */
116  virtual Elem::Type GetElemType(void) const;
117 
118  /* funzioni proprie */
119 
120  /* Dimensioni del workspace */
121  virtual void
122  WorkSpaceDim(integer* piNumRows, integer* piNumCols) const;
123 
124  /* assemblaggio jacobiano */
125  virtual VariableSubMatrixHandler&
127  doublereal dCoef,
128  const VectorHandler& XCurr,
129  const VectorHandler& XPrimeCurr);
130 
131  /* assemblaggio residuo */
132  virtual SubVectorHandler&
133  AssRes(SubVectorHandler& WorkVec,
134  doublereal dCoef,
135  const VectorHandler& XCurr,
136  const VectorHandler& XPrimeCurr);
137 
138  /*
139  * output; si assume che ogni tipo di elemento sappia, attraverso
140  * l'OutputHandler, dove scrivere il proprio output
141  */
142  virtual void Output(OutputHandler& OH) const;
143 
144  /* Dati privati */
145  virtual unsigned int iGetNumPrivData(void) const;
146  virtual unsigned int iGetPrivDataIdx(const char *s) const;
147  virtual doublereal dGetPrivData(unsigned int i) const;
148 
149  /* Numero di GDL iniziali */
150  virtual unsigned int iGetInitialNumDof(void) const;
151 
152  /* Dimensioni del workspace */
153  virtual void
154  InitialWorkSpaceDim(integer* piNumRows, integer* piNumCols) const;
155 
156  /* assemblaggio jacobiano */
157  virtual VariableSubMatrixHandler&
159  const VectorHandler& XCurr);
160 
161  /* assemblaggio residuo */
162  virtual SubVectorHandler&
164  const VectorHandler& XCurr);
165 
166  /* Tipo di elemento aerodinamico */
167  virtual AerodynamicElem::Type GetAerodynamicElemType(void) const;
168 
169  /*
170  * Fornisce il tipo e la label dei nodi che sono connessi all'elemento
171  * utile per l'assemblaggio della matrice di connessione fra i dofs
172  */
173  virtual void
174  GetConnectedNodes(std::vector<const Node *>& connectedNodes) const;
175 };
176 
177 extern Elem *
179  const DofOwner *pDO, unsigned int uLabel);
180 
181 /* GenericAerodynamicForce - end */
182 
183 #endif /* GENFM_H */
184 
GenericAerodynamicCoef operator-(const GenericAerodynamicCoef &c) const
Definition: genfm.cc:533
virtual VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
Definition: genfm.cc:314
virtual Elem::Type GetElemType(void) const
Definition: genfm.cc:272
const Vec3 tilde_f
Definition: genfm.h:83
long int flag
Definition: mbdyn.h:43
void AssVec(SubVectorHandler &WorkVec)
Definition: genfm.cc:49
Definition: matvec3.h:98
GenericAerodynamicData * pData
Definition: genfm.h:97
std::vector< doublereal > Alpha
Definition: genfm.h:52
virtual SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: genfm.cc:345
GenericAerodynamicCoef operator*(const doublereal &d) const
Definition: genfm.cc:549
const bool bAlphaFirst
Definition: genfm.h:81
virtual SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
Definition: genfm.cc:483
virtual AerodynamicElem::Type GetAerodynamicElemType(void) const
Definition: genfm.cc:324
std::string name
Definition: genfm.h:44
virtual ~GenericAerodynamicForce(void)
Definition: genfm.cc:263
const Mat3x3 tilde_Ra
Definition: genfm.h:85
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: genfm.cc:306
std::vector< std::vector< GenericAerodynamicCoef > > Data
Definition: genfm.h:66
doublereal dBeta
Definition: genfm.h:94
virtual void Output(OutputHandler &OH) const
Definition: genfm.cc:367
GenericAerodynamicCoef operator/(const doublereal &d) const
Definition: genfm.cc:564
std::vector< doublereal > Beta
Definition: genfm.h:53
Elem * ReadGenericAerodynamicForce(DataManager *pDM, MBDynParser &HP, const DofOwner *pDO, unsigned int uLabel)
Definition: genfm.cc:802
const doublereal dRefSurface
Definition: genfm.h:79
unsigned int uLabel
Definition: withlab.h:44
const StructNode * pNode
Definition: genfm.h:76
const doublereal dRefLength
Definition: genfm.h:80
virtual void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
Definition: genfm.cc:330
GenericAerodynamicForce(unsigned int uLabel, const DofOwner *pDO, const StructNode *pN, const Vec3 &fTmp, const Mat3x3 &RaTmp, doublereal dS, doublereal dL, bool bAlphaFirst, GenericAerodynamicData *pData, flag fOut)
Definition: genfm.cc:236
virtual unsigned int iGetPrivDataIdx(const char *s) const
Definition: genfm.cc:387
static std::stack< cleanup * > c
Definition: cleanup.cc:59
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: genfm.cc:279
const doublereal dS
Definition: beamslider.cc:71
Definition: elem.h:75
Type
Definition: elem.h:91
doublereal dAlpha
Definition: genfm.h:94
virtual VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: genfm.cc:287
virtual unsigned int iGetInitialNumDof(void) const
Definition: genfm.cc:299
virtual doublereal dGetPrivData(unsigned int i) const
Definition: genfm.cc:442
double doublereal
Definition: colamd.c:52
GenericAerodynamicCoef operator+(const GenericAerodynamicCoef &c) const
Definition: genfm.cc:517
long int integer
Definition: colamd.c:51
virtual std::ostream & Restart(std::ostream &out) const
Definition: genfm.cc:338
virtual unsigned int iGetNumPrivData(void) const
Definition: genfm.cc:381