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

#include <aerodyn_.h>

Inheritance diagram for StdAirProperties:
Collaboration diagram for StdAirProperties:

Public Member Functions

 StdAirProperties (const TplDriveCaller< Vec3 > *pDC, doublereal PRef, const DriveCaller *RhoRef, doublereal TRef, doublereal a, doublereal R, doublereal g0, doublereal z0, doublereal z1, doublereal z2, std::vector< const Gust * > &g, const RigidBodyKinematics *pRBK, flag fOut)
 
virtual ~StdAirProperties (void)
 
virtual std::ostream & Restart (std::ostream &out) const
 
virtual doublereal dGetAirDensity (const Vec3 &) const
 
virtual doublereal dGetAirPressure (const Vec3 &) const
 
virtual doublereal dGetAirTemperature (const Vec3 &) const
 
virtual doublereal dGetSoundSpeed (const Vec3 &) const
 
virtual bool GetAirProps (const Vec3 &X, doublereal &rho, doublereal &c, doublereal &p, doublereal &T) const
 
- Public Member Functions inherited from Elem
 Elem (unsigned int uL, flag fOut)
 
virtual ~Elem (void)
 
virtual unsigned int iGetNumDof (void) const
 
virtual std::ostream & DescribeDof (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeDof (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
virtual std::ostream & DescribeEq (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeEq (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
virtual DofOrder::Order GetDofType (unsigned int) const
 
virtual void AssMats (VariableSubMatrixHandler &WorkMatA, VariableSubMatrixHandler &WorkMatB, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual bool bInverseDynamics (void) const
 
void SetInverseDynamicsFlags (unsigned uIDF)
 
unsigned GetInverseDynamicsFlags (void) const
 
bool bIsErgonomy (void) const
 
bool bIsRightHandSide (void) const
 
virtual VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
 
virtual SubVectorHandlerAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr, const VectorHandler &XPrimePrimeCurr, InverseDynamics::Order iOrder=InverseDynamics::INVERSE_DYNAMICS)
 
virtual void GetConnectedNodes (std::vector< const Node * > &connectedNodes) const
 
- Public Member Functions inherited from WithLabel
 WithLabel (unsigned int uL=0, const std::string &sN="")
 
virtual ~WithLabel (void)
 
void PutLabel (unsigned int uL)
 
void PutName (const std::string &sN)
 
unsigned int GetLabel (void) const
 
const std::string & GetName (void) const
 
- Public Member Functions inherited from SimulationEntity
 SimulationEntity (void)
 
virtual ~SimulationEntity (void)
 
virtual bool bIsValidIndex (unsigned int i) const
 
virtual DofOrder::Order GetEqType (unsigned int i) const
 
virtual void SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *h=0)
 
virtual HintParseHint (DataManager *pDM, const char *s) const
 
virtual void BeforePredict (VectorHandler &, VectorHandler &, VectorHandler &, VectorHandler &) const
 
virtual void AfterPredict (VectorHandler &X, VectorHandler &XP)
 
virtual void Update (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void DerivativesUpdate (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void Update (const VectorHandler &XCurr, InverseDynamics::Order iOrder)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP, const VectorHandler &XPP)
 
virtual std::ostream & OutputAppend (std::ostream &out) const
 
virtual void ReadInitialState (MBDynParser &HP)
 
- Public Member Functions inherited from ToBeOutput
 ToBeOutput (flag fOut=fDefaultOut)
 
virtual ~ToBeOutput (void)
 
virtual void OutputPrepare (OutputHandler &OH)
 
virtual void Output (OutputHandler &OH, const VectorHandler &X, const VectorHandler &XP) const
 
virtual flag fToBeOutput (void) const
 
virtual bool bToBeOutput (void) const
 
virtual void SetOutputFlag (flag f=flag(1))
 
- Public Member Functions inherited from AirProperties
 AirProperties (const TplDriveCaller< Vec3 > *pDC, std::vector< const Gust * > &pg, const RigidBodyKinematics *pRBK, flag fOut)
 
virtual ~AirProperties (void)
 
virtual void AddGust (const Gust *pG)
 
virtual Elem::Type GetElemType (void) const
 
virtual void WorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
virtual VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, doublereal, const VectorHandler &, const VectorHandler &)
 
virtual SubVectorHandlerAssRes (SubVectorHandler &WorkVec, doublereal, const VectorHandler &, const VectorHandler &)
 
virtual unsigned int iGetInitialNumDof (void) const
 
virtual void InitialWorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
virtual VariableSubMatrixHandlerInitialAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &)
 
virtual SubVectorHandlerInitialAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr)
 
virtual void Output (OutputHandler &) const
 
virtual Vec3 GetVelocity (const Vec3 &) const
 
virtual bool GetVelocity (const Vec3 &, Vec3 &V) const
 
virtual int GetNumConnectedNodes (void) const
 
virtual unsigned int iGetNumPrivData (void) const
 
virtual unsigned int iGetPrivDataIdx (const char *s) const
 
virtual doublereal dGetPrivData (unsigned int i) const
 
- Public Member Functions inherited from InitialAssemblyElem
 InitialAssemblyElem (unsigned int uL, flag fOut)
 
virtual ~InitialAssemblyElem (void)
 
- Public Member Functions inherited from SubjectToInitialAssembly
 SubjectToInitialAssembly (void)
 
virtual ~SubjectToInitialAssembly (void)
 
- Public Member Functions inherited from TplDriveOwner< Vec3 >
 TplDriveOwner (const TplDriveCaller< Vec3 > *pDC=0)
 
virtual ~TplDriveOwner (void)
 
void Set (const TplDriveCaller< Vec3 > *pDC)
 
TplDriveCaller< Vec3 > * pGetDriveCaller (void) const
 
Vec3 Get (const doublereal &dVar) const
 
Vec3 Get (void) const
 
virtual bool bIsDifferentiable (void) const
 
virtual Vec3 GetP (void) const
 

Protected Attributes

doublereal PRef
 
const DriveCallerRhoRef
 
doublereal TRef
 
doublereal a
 
doublereal R
 
doublereal g0
 
doublereal z0
 
doublereal z1
 
doublereal z2
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 
- Protected Attributes inherited from AirProperties
Vec3 Velocity
 
std::vector< const Gust * > gust
 
const RigidBodyKinematicspRBK
 
- Protected Attributes inherited from TplDriveOwner< Vec3 >
TplDriveCaller< Vec3 > * pTplDriveCaller
 

Additional Inherited Members

- Public Types inherited from Elem
enum  Type {
  UNKNOWN = -1, AIRPROPERTIES = 0, INDUCEDVELOCITY, AUTOMATICSTRUCTURAL,
  GRAVITY, BODY, JOINT, JOINT_REGULARIZATION,
  BEAM, PLATE, FORCE, INERTIA,
  ELECTRICBULK, ELECTRIC, THERMAL, HYDRAULIC,
  BULK, LOADABLE, DRIVEN, EXTERNAL,
  AEROMODAL, AERODYNAMIC, GENEL, SOCKETSTREAM_OUTPUT,
  RTAI_OUTPUT = SOCKETSTREAM_OUTPUT, LASTELEMTYPE
}
 
- Public Types inherited from SimulationEntity
typedef std::vector< Hint * > Hints
 
- Public Types inherited from ToBeOutput
enum  { OUTPUT = 0x1U, OUTPUT_MASK = 0xFU, OUTPUT_PRIVATE = 0x10U, OUTPUT_PRIVATE_MASK = ~OUTPUT_MASK }
 

Detailed Description

Definition at line 124 of file aerodyn_.h.

Constructor & Destructor Documentation

StdAirProperties::StdAirProperties ( const TplDriveCaller< Vec3 > *  pDC,
doublereal  PRef,
const DriveCaller RhoRef,
doublereal  TRef,
doublereal  a,
doublereal  R,
doublereal  g0,
doublereal  z0,
doublereal  z1,
doublereal  z2,
std::vector< const Gust * > &  g,
const RigidBodyKinematics pRBK,
flag  fOut 
)

Definition at line 379 of file aerodyn.cc.

References ASSERT.

384 : Elem(1, fOut),
385 AirProperties(pDC, g, pRBK, fOut),
386 PRef(PRef),
387 RhoRef(RhoRef),
388 TRef(TRef),
389 a(a),
390 R(R),
391 g0(g0),
392 z0(z0),
393 z1(z1),
394 z2(z2)
395 {
396  ASSERT(PRef > 0.);
397  ASSERT(RhoRef != NULL);
398  ASSERT(TRef > 0.);
399  ASSERT(R > 0.);
400  ASSERT(g0 > 0.);
401  ASSERT(z1 > 0.);
402  ASSERT(z2 > z1);
403 }
AirProperties(const TplDriveCaller< Vec3 > *pDC, std::vector< const Gust * > &pg, const RigidBodyKinematics *pRBK, flag fOut)
Definition: aerodyn.cc:73
doublereal TRef
Definition: aerodyn_.h:129
doublereal a
Definition: aerodyn_.h:130
doublereal PRef
Definition: aerodyn_.h:127
const DriveCaller * RhoRef
Definition: aerodyn_.h:128
doublereal g0
Definition: aerodyn_.h:132
#define ASSERT(expression)
Definition: colamd.c:977
doublereal z2
Definition: aerodyn_.h:136
doublereal z1
Definition: aerodyn_.h:134
doublereal z0
Definition: aerodyn_.h:133
doublereal R
Definition: aerodyn_.h:131
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
StdAirProperties::~StdAirProperties ( void  )
virtual

Definition at line 405 of file aerodyn.cc.

References RhoRef.

406 {
407  delete RhoRef;
408 }
const DriveCaller * RhoRef
Definition: aerodyn_.h:128

Member Function Documentation

doublereal StdAirProperties::dGetAirDensity ( const Vec3 X) const
virtual

Implements AirProperties.

Definition at line 430 of file aerodyn.cc.

References c, and GetAirProps().

431 {
432  doublereal rho, c, p, T;
433 
434  GetAirProps(X, rho, c, p, T);
435 
436  return rho;
437 }
virtual bool GetAirProps(const Vec3 &X, doublereal &rho, doublereal &c, doublereal &p, doublereal &T) const
Definition: aerodyn.cc:470
static std::stack< cleanup * > c
Definition: cleanup.cc:59
double doublereal
Definition: colamd.c:52

Here is the call graph for this function:

doublereal StdAirProperties::dGetAirPressure ( const Vec3 X) const
virtual

Implements AirProperties.

Definition at line 440 of file aerodyn.cc.

References c, and GetAirProps().

441 {
442  doublereal rho, c, p, T;
443 
444  GetAirProps(X, rho, c, p, T);
445 
446  return p;
447 }
virtual bool GetAirProps(const Vec3 &X, doublereal &rho, doublereal &c, doublereal &p, doublereal &T) const
Definition: aerodyn.cc:470
static std::stack< cleanup * > c
Definition: cleanup.cc:59
double doublereal
Definition: colamd.c:52

Here is the call graph for this function:

doublereal StdAirProperties::dGetAirTemperature ( const Vec3 X) const
virtual

Implements AirProperties.

Definition at line 450 of file aerodyn.cc.

References c, and GetAirProps().

451 {
452  doublereal rho, c, p, T;
453 
454  GetAirProps(X, rho, c, p, T);
455 
456  return T;
457 }
virtual bool GetAirProps(const Vec3 &X, doublereal &rho, doublereal &c, doublereal &p, doublereal &T) const
Definition: aerodyn.cc:470
static std::stack< cleanup * > c
Definition: cleanup.cc:59
double doublereal
Definition: colamd.c:52

Here is the call graph for this function:

doublereal StdAirProperties::dGetSoundSpeed ( const Vec3 X) const
virtual

Implements AirProperties.

Definition at line 460 of file aerodyn.cc.

References c, and GetAirProps().

461 {
462  doublereal rho, c, p, T;
463 
464  GetAirProps(X, rho, c, p, T);
465 
466  return c;
467 }
virtual bool GetAirProps(const Vec3 &X, doublereal &rho, doublereal &c, doublereal &p, doublereal &T) const
Definition: aerodyn.cc:470
static std::stack< cleanup * > c
Definition: cleanup.cc:59
double doublereal
Definition: colamd.c:52

Here is the call graph for this function:

bool StdAirProperties::GetAirProps ( const Vec3 X,
doublereal rho,
doublereal c,
doublereal p,
doublereal T 
) const
virtual

Implements AirProperties.

Definition at line 470 of file aerodyn.cc.

References a, Vec3::dGet(), DriveCaller::dGet(), grad::exp(), g0, MBDYN_EXCEPT_ARGS, grad::pow(), PRef, R, RhoRef, grad::sqrt(), TRef, z0, and z1.

Referenced by dGetAirDensity(), dGetAirPressure(), dGetAirTemperature(), and dGetSoundSpeed().

472 {
473  /* FIXME */
474  doublereal z = X.dGet(3) + z0;
475 
476  doublereal rhoRef = RhoRef->dGet();
477  if (rhoRef < 0.) {
478  silent_cerr("StdAirProperties: illegal reference density "
479  << rhoRef << std::endl);
481  }
482 
483  if (z < z1) {
484  /* regione del gradiente (troposfera) */
485  T = TRef + a * z;
486  p = PRef * pow(T / TRef, -g0 / (a * R));
487  rho = rhoRef * pow(T / TRef, -(g0 / (a * R) + 1));
488 
489  } else {
490  /* regione a T = const. (stratosfera) */
491  T = TRef + a * z1;
492  doublereal p1 = PRef * pow(T / TRef, -g0 / (a * R));
493  doublereal e = exp(-g0 / (R * T) * (z - z1));
494  p = p1*e;
495  doublereal rho1 = rhoRef * pow(T / TRef, -(g0 / (a * R) + 1));
496  rho = rho1*e;
497  }
498 
499  c = sqrt(1.4 * R * T);
500 
501  return true;
502 }
GradientExpression< UnaryExpr< FuncExp, Expr > > exp(const GradientExpression< Expr > &u)
Definition: gradient.h:2975
GradientExpression< BinaryExpr< FuncPow, LhsExpr, RhsExpr > > pow(const GradientExpression< LhsExpr > &u, const GradientExpression< RhsExpr > &v)
Definition: gradient.h:2961
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
doublereal TRef
Definition: aerodyn_.h:129
doublereal a
Definition: aerodyn_.h:130
doublereal PRef
Definition: aerodyn_.h:127
const DriveCaller * RhoRef
Definition: aerodyn_.h:128
doublereal g0
Definition: aerodyn_.h:132
const doublereal & dGet(unsigned short int iRow) const
Definition: matvec3.h:285
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
Definition: gradient.h:2974
virtual doublereal dGet(const doublereal &dVar) const =0
static std::stack< cleanup * > c
Definition: cleanup.cc:59
doublereal z1
Definition: aerodyn_.h:134
doublereal z0
Definition: aerodyn_.h:133
doublereal R
Definition: aerodyn_.h:131
double doublereal
Definition: colamd.c:52

Here is the call graph for this function:

std::ostream & StdAirProperties::Restart ( std::ostream &  out) const
virtual

Reimplemented from AirProperties.

Definition at line 412 of file aerodyn.cc.

References a, g0, PRef, R, AirProperties::Restart(), DriveCaller::Restart(), RhoRef, TRef, z0, z1, and z2.

413 {
414  out << " air properties: std, "
415  << PRef << ", ",
416  RhoRef->Restart(out) << ", "
417  << TRef << ", "
418  << a << ", "
419  << R << ", "
420  << g0 << ", "
421  << z1 << ", "
422  << z2 << ", ";
423  if (z0 != 0.) {
424  out << "reference altitude, " << z0 << ", ";
425  }
426  return AirProperties::Restart(out);
427 }
doublereal TRef
Definition: aerodyn_.h:129
doublereal a
Definition: aerodyn_.h:130
doublereal PRef
Definition: aerodyn_.h:127
virtual std::ostream & Restart(std::ostream &out) const =0
const DriveCaller * RhoRef
Definition: aerodyn_.h:128
doublereal g0
Definition: aerodyn_.h:132
doublereal z2
Definition: aerodyn_.h:136
doublereal z1
Definition: aerodyn_.h:134
doublereal z0
Definition: aerodyn_.h:133
virtual std::ostream & Restart(std::ostream &out) const
Definition: aerodyn.cc:109
doublereal R
Definition: aerodyn_.h:131

Here is the call graph for this function:

Member Data Documentation

doublereal StdAirProperties::a
protected

Definition at line 130 of file aerodyn_.h.

Referenced by GetAirProps(), and Restart().

doublereal StdAirProperties::g0
protected

Definition at line 132 of file aerodyn_.h.

Referenced by GetAirProps(), and Restart().

doublereal StdAirProperties::PRef
protected

Definition at line 127 of file aerodyn_.h.

Referenced by GetAirProps(), and Restart().

doublereal StdAirProperties::R
protected

Definition at line 131 of file aerodyn_.h.

Referenced by GetAirProps(), and Restart().

const DriveCaller* StdAirProperties::RhoRef
protected

Definition at line 128 of file aerodyn_.h.

Referenced by GetAirProps(), Restart(), and ~StdAirProperties().

doublereal StdAirProperties::TRef
protected

Definition at line 129 of file aerodyn_.h.

Referenced by GetAirProps(), and Restart().

doublereal StdAirProperties::z0
protected

Definition at line 133 of file aerodyn_.h.

Referenced by GetAirProps(), and Restart().

doublereal StdAirProperties::z1
protected

Definition at line 134 of file aerodyn_.h.

Referenced by GetAirProps(), and Restart().

doublereal StdAirProperties::z2
protected

Definition at line 136 of file aerodyn_.h.

Referenced by Restart().


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