MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
AeroData Class Referenceabstract

#include <aerodata.h>

Inheritance diagram for AeroData:
Collaboration diagram for AeroData:

Public Types

enum  UnsteadyModel { STEADY = 0, HARRIS = 1, BIELAWA = 2, LAST }
 
enum  {
  VX = 0, VY = 1, VZ = 2, WX = 3,
  WY = 4, WZ = 5, FX = 0, FY = 1,
  FZ = 2, MX = 3, MY = 4, MZ = 5
}
 

Public Member Functions

 AeroData (int i_p, int i_dim, UnsteadyModel u=STEADY, DriveCaller *pt=0)
 
virtual ~AeroData (void)
 
virtual std::ostream & Restart (std::ostream &out) const =0
 
std::ostream & RestartUnsteady (std::ostream &out) const
 
virtual void SetAirData (const doublereal &rho, const doublereal &c)
 
virtual void SetSectionData (const doublereal &abscissa, const doublereal &chord, const doublereal &forcepoint, const doublereal &velocitypoint, const doublereal &twist, const doublereal &omega=0.)
 
virtual int GetForces (int i, const doublereal *W, doublereal *TNG, outa_t &OUTA)
 
virtual int GetForcesJac (int i, const doublereal *W, doublereal *TNG, Mat6x6 &J, outa_t &OUTA)
 
virtual unsigned int iGetNumDof (void) const
 
virtual DofOrder::Order GetDofType (unsigned int i) const
 
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)
 
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)
 
virtual void AfterConvergence (int i, const VectorHandler &X, const VectorHandler &XP)
 
AeroData::UnsteadyModel Unsteady (void) const
 
- Public Member Functions inherited from AeroMemory
 AeroMemory (DriveCaller *pt)
 
virtual ~AeroMemory (void)
 
void Predict (int i, doublereal alpha, doublereal &alf1, doublereal &alf2)
 
void Update (int i)
 
void SetNumPoints (int i)
 
int GetNumPoints (void) const
 

Protected Member Functions

int StorageSize (void) const
 
int GetForcesJacForwardDiff_int (int i, const doublereal *W, doublereal *TNG, Mat6x6 &J, outa_t &OUTA)
 
int GetForcesJacCenteredDiff_int (int i, const doublereal *W, doublereal *TNG, Mat6x6 &J, outa_t &OUTA)
 

Protected Attributes

UnsteadyModel unsteadyflag
 
vam_t VAM
 
doublereal Omega
 
- Protected Attributes inherited from AeroMemory
DriveCallerpTime
 

Detailed Description

Definition at line 87 of file aerodata.h.

Member Enumeration Documentation

anonymous enum
Enumerator
VX 
VY 
VZ 
WX 
WY 
WZ 
FX 
FY 
FZ 
MX 
MY 
MZ 

Definition at line 97 of file aerodata.h.

97  {
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  };
Enumerator
STEADY 
HARRIS 
BIELAWA 
LAST 

Definition at line 89 of file aerodata.h.

89  {
90  STEADY = 0,
91  HARRIS = 1,
92  BIELAWA = 2,
93 
94  LAST
95  };

Constructor & Destructor Documentation

AeroData::AeroData ( int  i_p,
int  i_dim,
AeroData::UnsteadyModel  u = STEADY,
DriveCaller pt = 0 
)

Definition at line 181 of file aerodata.cc.

References vam_t::bc_position, vam_t::chord, vam_t::density, vam_t::force_position, MBDYN_EXCEPT_ARGS, AeroMemory::SetNumPoints(), vam_t::sound_celerity, STEADY, vam_t::twist, and VAM.

183 : AeroMemory(ptime), unsteadyflag(u), Omega(0.)
184 {
185  // silence static analyzers
186  VAM.density = -1.;
187  VAM.sound_celerity = -1.;
188  VAM.chord = -1.;
189  VAM.force_position = 0.;
190  VAM.bc_position = 0.;
191  VAM.twist = 0.;
192 
193  if (u != AeroData::STEADY) {
194  if (ptime == 0) {
196  }
197  }
198 
199  SetNumPoints(i_p*i_dim);
200 }
doublereal density
Definition: aerodc81.h:108
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
AeroMemory(DriveCaller *pt)
Definition: aerodata.cc:44
vam_t VAM
Definition: aerodata.h:117
doublereal sound_celerity
Definition: aerodc81.h:109
doublereal twist
Definition: aerodc81.h:113
doublereal bc_position
Definition: aerodc81.h:112
doublereal Omega
Definition: aerodata.h:118
doublereal force_position
Definition: aerodc81.h:111
doublereal chord
Definition: aerodc81.h:110
UnsteadyModel unsteadyflag
Definition: aerodata.h:116
void SetNumPoints(int i)
Definition: aerodata.cc:141

Here is the call graph for this function:

AeroData::~AeroData ( void  )
virtual

Definition at line 202 of file aerodata.cc.

References NO_OP.

203 {
204  NO_OP;
205 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

void AeroData::AfterConvergence ( int  i,
const VectorHandler X,
const VectorHandler XP 
)
virtual

Reimplemented in TheodorsenAeroData.

Definition at line 416 of file aerodata.cc.

References NO_OP.

420 {
421  NO_OP;
422 }
#define NO_OP
Definition: myassert.h:74
void AeroData::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 
)
virtual

Reimplemented in TheodorsenAeroData.

Definition at line 403 of file aerodata.cc.

References MBDYN_EXCEPT_ARGS.

Referenced by AerodynamicBody::AssJac(), AerodynamicBeam::AssJac(), and AerodynamicBeam2::AssJac().

410 {
411  silent_cerr("AeroData: AssJac() is undefined" << std::endl);
413 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
void AeroData::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 
)
virtual

Reimplemented in TheodorsenAeroData.

Definition at line 391 of file aerodata.cc.

References MBDYN_EXCEPT_ARGS.

Referenced by AerodynamicBody::AssVec(), AerodynamicBeam::AssVec(), and AerodynamicBeam2::AssVec().

397 {
398  silent_cerr("AeroData: AssRes() is undefined" << std::endl);
400 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
DofOrder::Order AeroData::GetDofType ( unsigned int  i) const
virtual

Reimplemented in TheodorsenAeroData.

Definition at line 368 of file aerodata.cc.

References MBDYN_EXCEPT_ARGS.

369 {
370  silent_cerr("AeroData: "
371  "GetDofType() is undefined because aerodynamic data "
372  "has no degrees of freedom" << std::endl);
374 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
int AeroData::GetForces ( int  i,
const doublereal W,
doublereal TNG,
outa_t OUTA 
)
virtual

Reimplemented in C81InterpolatedAeroData, C81MultipleAeroData, C81AeroData, and STAHRAeroData.

Definition at line 377 of file aerodata.cc.

References MBDYN_EXCEPT_ARGS.

Referenced by TheodorsenAeroData::AssRes(), AerodynamicBody::AssVec(), AerodynamicBeam::AssVec(), AerodynamicBeam2::AssVec(), GetForcesJacCenteredDiff_int(), and GetForcesJacForwardDiff_int().

378 {
379  silent_cerr("AeroData: GetForces() is undefined" << std::endl);
381 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
int AeroData::GetForcesJac ( int  i,
const doublereal W,
doublereal TNG,
Mat6x6 J,
outa_t OUTA 
)
virtual

Reimplemented in C81InterpolatedAeroData, C81MultipleAeroData, C81AeroData, and STAHRAeroData.

Definition at line 384 of file aerodata.cc.

References MBDYN_EXCEPT_ARGS.

Referenced by TheodorsenAeroData::AssJac(), AerodynamicBody::AssJac(), AerodynamicBeam::AssJac(), and AerodynamicBeam2::AssJac().

385 {
386  silent_cerr("AeroData: GetForcesJac() is undefined" << std::endl);
388 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
int AeroData::GetForcesJacCenteredDiff_int ( int  i,
const doublereal W,
doublereal TNG,
Mat6x6 J,
outa_t OUTA 
)
protected

Definition at line 313 of file aerodata.cc.

References GetForces(), Vec3::Norm(), Omega, and Mat6x6::Put().

314 {
315  const doublereal epsilon = 1.e-3;
316  const doublereal nu = 1.e-9;
317 
318  Vec3 V(&W[0]);
319  Vec3 Omega(&W[3]);
320 
321  doublereal dv = V.Norm();
322  doublereal dw = Omega.Norm();
323 
324  doublereal TNGp[6];
325  doublereal TNGm[6];
326 
327  GetForces(i, W, TNG0, OUTA);
328 
329  doublereal *WW = const_cast<doublereal *>(W);
330  for (unsigned int iColm1 = 0; iColm1 < 6; iColm1++) {
331  doublereal dorig;
332  doublereal delta;
333 
334  dorig = WW[iColm1];
335  if (iColm1 < 3) {
336  delta = dv*epsilon + nu;
337 
338  } else {
339  delta = dw*epsilon + nu;
340  }
341 
342  WW[iColm1] = dorig + delta;
343 
344  GetForces(i, WW, TNGp, OUTA);
345 
346  WW[iColm1] = dorig - delta;
347 
348  GetForces(i, WW, TNGm, OUTA);
349 
350  doublereal delta2 = 2.*delta;
351  for (unsigned int iRowm1 = 0; iRowm1 < 6; iRowm1++) {
352  J.Put(iRowm1 + 1, iColm1 + 1, (TNGp[iRowm1] - TNGm[iRowm1])/delta2);
353  }
354 
355  WW[iColm1] = dorig;
356  }
357 
358  return 0;
359 }
void Put(unsigned short int ir, unsigned short int ic, const doublereal &d)
Definition: matvec6.h:565
Definition: matvec3.h:98
virtual int GetForces(int i, const doublereal *W, doublereal *TNG, outa_t &OUTA)
Definition: aerodata.cc:377
doublereal Omega
Definition: aerodata.h:118
double doublereal
Definition: colamd.c:52

Here is the call graph for this function:

int AeroData::GetForcesJacForwardDiff_int ( int  i,
const doublereal W,
doublereal TNG,
Mat6x6 J,
outa_t OUTA 
)
protected

Definition at line 271 of file aerodata.cc.

References GetForces(), Vec3::Norm(), Omega, and Mat6x6::Put().

Referenced by STAHRAeroData::GetForcesJac(), C81AeroData::GetForcesJac(), C81MultipleAeroData::GetForcesJac(), and C81InterpolatedAeroData::GetForcesJac().

272 {
273  const doublereal epsilon = 1.e-3;
274  const doublereal nu = 1.e-9;
275 
276  Vec3 V(&W[0]);
277  Vec3 Omega(&W[3]);
278 
279  doublereal dv = V.Norm();
280  doublereal dw = Omega.Norm();
281 
282  doublereal TNG[6];
283 
284  GetForces(i, W, TNG0, OUTA);
285 
286  doublereal *WW = const_cast<doublereal *>(W);
287  for (unsigned int iColm1 = 0; iColm1 < 6; iColm1++) {
288  doublereal dorig;
289  doublereal delta;
290 
291  dorig = WW[iColm1];
292  if (iColm1 < 3) {
293  delta = dv*epsilon + nu;
294 
295  } else {
296  delta = dw*epsilon + nu;
297  }
298  WW[iColm1] = dorig + delta;
299 
300  GetForces(i, WW, TNG, OUTA);
301 
302  for (unsigned int iRowm1 = 0; iRowm1 < 6; iRowm1++) {
303  J.Put(iRowm1 + 1, iColm1 + 1, (TNG[iRowm1] - TNG0[iRowm1])/delta);
304  }
305 
306  WW[iColm1] = dorig;
307  }
308 
309  return 0;
310 }
void Put(unsigned short int ir, unsigned short int ic, const doublereal &d)
Definition: matvec6.h:565
Definition: matvec3.h:98
virtual int GetForces(int i, const doublereal *W, doublereal *TNG, outa_t &OUTA)
Definition: aerodata.cc:377
doublereal Omega
Definition: aerodata.h:118
double doublereal
Definition: colamd.c:52

Here is the call graph for this function:

virtual std::ostream& AeroData::Restart ( std::ostream &  out) const
pure virtual
std::ostream & AeroData::RestartUnsteady ( std::ostream &  out) const

Definition at line 252 of file aerodata.cc.

References BIELAWA, HARRIS, and unsteadyflag.

Referenced by STAHRAeroData::Restart(), C81AeroData::Restart(), C81MultipleAeroData::Restart(), and C81InterpolatedAeroData::Restart().

253 {
254  switch (unsteadyflag) {
255  case AeroData::HARRIS:
256  out << ", unsteady, harris";
257  break;
258 
259  case AeroData::BIELAWA:
260  out << ", unsteady, bielawa";
261  break;
262 
263  default:
264  break;
265  }
266 
267  return out;
268 }
UnsteadyModel unsteadyflag
Definition: aerodata.h:116
void AeroData::SetAirData ( const doublereal rho,
const doublereal c 
)
virtual

Reimplemented in TheodorsenAeroData.

Definition at line 214 of file aerodata.cc.

References c, vam_t::density, vam_t::sound_celerity, and VAM.

Referenced by AerodynamicBody::AssJac(), AerodynamicBeam::AssJac(), AerodynamicBeam2::AssJac(), AerodynamicBody::AssVec(), AerodynamicBeam::AssVec(), AerodynamicBeam2::AssVec(), and TheodorsenAeroData::SetAirData().

215 {
216  VAM.density = rho;
217  VAM.sound_celerity = c;
218 }
doublereal density
Definition: aerodc81.h:108
vam_t VAM
Definition: aerodata.h:117
doublereal sound_celerity
Definition: aerodc81.h:109
static std::stack< cleanup * > c
Definition: cleanup.cc:59
void AeroData::SetSectionData ( const doublereal abscissa,
const doublereal chord,
const doublereal forcepoint,
const doublereal velocitypoint,
const doublereal twist,
const doublereal omega = 0. 
)
virtual
int AeroData::StorageSize ( void  ) const
protectedvirtual

Implements AeroMemory.

Definition at line 221 of file aerodata.cc.

References BIELAWA, HARRIS, MBDYN_EXCEPT_ARGS, STEADY, and unsteadyflag.

222 {
223  switch (unsteadyflag) {
224  case AeroData::HARRIS:
225  case AeroData::BIELAWA:
226  return 3;
227 
228  case AeroData::STEADY:
229  return 0;
230 
231  default:
233  }
234 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
UnsteadyModel unsteadyflag
Definition: aerodata.h:116
AeroData::UnsteadyModel AeroData::Unsteady ( void  ) const

Definition at line 208 of file aerodata.cc.

References unsteadyflag.

Referenced by TheodorsenAeroData::TheodorsenAeroData().

209 {
210  return unsteadyflag;
211 }
UnsteadyModel unsteadyflag
Definition: aerodata.h:116

Member Data Documentation

doublereal AeroData::Omega
protected

The documentation for this class was generated from the following files: