MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
aerodata.h File Reference
#include "ac/f2c.h"
#include "myassert.h"
#include "withlab.h"
#include "drive.h"
#include "dofown.h"
#include "matvec6.h"
#include "matvec3n.h"
#include "shape.h"
#include "aerodc81.h"
Include dependency graph for aerodata.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  C81Data
 
class  AeroMemory
 
class  AeroData
 

Functions

void ReadAeroData (DataManager *pDM, MBDynParser &HP, int dim, Shape **ppChord, Shape **ppForce, Shape **ppVelocity, Shape **ppTwist, Shape **ppTipLoss, integer *piNumber, DriveCaller **ppDC, AeroData **aerodata)
 

Function Documentation

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 at line 593 of file aerodata.cc.

References DEBUGCOUTFNAME, DEBUGLCOUT, MBDynParser::GetC81Data(), MBDynParser::GetDriveCaller(), HighParser::GetInt(), IncludeParser::GetLineData(), HighParser::GetString(), HighParser::IsArg(), HighParser::IsKeyWord(), LASTKEYWORD, MBDYN_EXCEPT_ARGS, MYDEBUG_INPUT, DataManager::pGetDrvHdl(), ReadC81MultipleAeroData(), ReadShape(), ReadUnsteadyFlag(), SAFENEW, SAFENEWWITHCONSTRUCTOR, and AeroData::STEADY.

Referenced by ReadAerodynamicBeam(), ReadAerodynamicBeam2(), and ReadAerodynamicBody().

598 {
599  DEBUGCOUTFNAME("ReadAeroData");
600 
601  /* Keywords */
602  const char* sKeyWords[] = {
603  "naca0012",
604  "rae9671",
605  "c81",
606 
607  "theodorsen",
608 
609  0
610  };
611 
612  /* enum delle parole chiave */
613  enum KeyWords {
614  UNKNOWN = -1,
615  NACA0012 = 0,
616  RAE9671,
617  C81,
618 
619  THEODORSEN,
620 
622  };
623 
624  /* tabella delle parole chiave */
625  KeyTable K(HP, sKeyWords);
626 
627  *ppChord = ReadShape(HP);
628  *ppForce = ReadShape(HP);
629  *ppVelocity = ReadShape(HP);
630  *ppTwist = ReadShape(HP);
631 
632  *ppTipLoss = 0;
633  if (HP.IsKeyWord("tip" "loss")) {
634  *ppTipLoss = ReadShape(HP);
635 
636  } else {
638  ConstShape1D(1.));
639  }
640 
641  *piNumber = HP.GetInt();
642  if (*piNumber <= 0) {
643  silent_cerr("need at least 1 Gauss integration point at line "
644  << HP.GetLineData() << std::endl);
646  }
647  DEBUGLCOUT(MYDEBUG_INPUT, "Gauss points number: "
648  << *piNumber << std::endl);
649 
650  if (HP.IsKeyWord("control")) {
651  /* Driver di un'eventuale controllo */
652  *ppDC = HP.GetDriveCaller();
653 
654  } else {
655  SAFENEW(*ppDC, NullDriveCaller);
656  }
657 
658  if (HP.IsArg()) {
659  switch (HP.IsKeyWord()) {
660  default:
661  silent_cerr("unknown airfoil type \"" << HP.GetString()
662  << "\" at line " << HP.GetLineData()
663  << "; using default (NACA0012)"
664  << std::endl);
665 
666  case NACA0012: {
668  "airfoil is NACA0012" << std::endl);
669 
671  DriveCaller *ptime = 0;
672  if (eInst != AeroData::STEADY) {
674  TimeDriveCaller(pDM->pGetDrvHdl()));
675  }
676  SAFENEWWITHCONSTRUCTOR(*aerodata,
678  STAHRAeroData(*piNumber, iDim, eInst, 1, ptime));
679  break;
680  }
681 
682  case RAE9671: {
684  "airfoil is RAE9671" << std::endl);
685 
687  DriveCaller *ptime = 0;
688  if (eInst != AeroData::STEADY) {
690  TimeDriveCaller(pDM->pGetDrvHdl()));
691  }
692  SAFENEWWITHCONSTRUCTOR(*aerodata,
694  STAHRAeroData(*piNumber, iDim, eInst, 2, ptime));
695  break;
696  }
697 
698  /*
699  * uso tabelle standard, che vengono cercate in base all'indice
700  * (sistemare)
701  */
702  case C81:
703  if (HP.IsKeyWord("multiple")) {
704  ReadC81MultipleAeroData(pDM, HP, aerodata, *piNumber, iDim);
705 
706  } else if (HP.IsKeyWord("interpolated")) {
707  ReadC81MultipleAeroData(pDM, HP, aerodata, *piNumber, iDim, true);
708 
709  } else {
710  unsigned iProfile = (unsigned)HP.GetInt();
711  const c81_data* data = HP.GetC81Data(iProfile);
712 
714  "airfoil data is from file c81 "
715  << iProfile << std::endl);
717  eInst = ReadUnsteadyFlag(HP);
718  DriveCaller *ptime = 0;
719  if (eInst != AeroData::STEADY) {
722  TimeDriveCaller(pDM->pGetDrvHdl()));
723  }
724  SAFENEWWITHCONSTRUCTOR(*aerodata,
725  C81AeroData,
726  C81AeroData(*piNumber, iDim,
727  eInst, iProfile,
728  data, ptime));
729  }
730  break;
731 
732  case THEODORSEN: {
733  if (!HP.IsKeyWord("c81")) {
734  silent_cerr("Theodorsen aerodata: warning, assuming \"c81\" at line "
735  << HP.GetLineData() << std::endl);
736  }
737 
738  AeroData *pa = 0;
739  if (HP.IsKeyWord("multiple")) {
740  ReadC81MultipleAeroData(pDM, HP, &pa, *piNumber, iDim);
741 
742  } else if (HP.IsKeyWord("interpolated")) {
743  ReadC81MultipleAeroData(pDM, HP, &pa, *piNumber, iDim, true);
744 
745  } else {
746  unsigned iProfile = (unsigned)HP.GetInt();
747  const c81_data* data = HP.GetC81Data(iProfile);
748 
750  "airfoil data is from file c81 "
751  << iProfile << std::endl);
753  eInst = ReadUnsteadyFlag(HP);
754  DriveCaller *ptime = 0;
755  if (eInst != AeroData::STEADY) {
758  TimeDriveCaller(pDM->pGetDrvHdl()));
759  }
761  C81AeroData,
762  C81AeroData(*piNumber, iDim,
763  eInst, iProfile,
764  data, ptime));
765  }
766 
767  DriveCaller *ptime = 0;
770  TimeDriveCaller(pDM->pGetDrvHdl()));
771 
772  SAFENEWWITHCONSTRUCTOR(*aerodata,
774  TheodorsenAeroData(*piNumber, iDim,
775  pa, ptime));
776  } break;
777  }
778 
779  } else {
780  /* FIXME: better abort! */
781  silent_cerr("missing airfoil type at line "
782  << HP.GetLineData()
783  << "; using default (NACA0012)"
784  << std::endl);
785 
787  SAFENEWWITHCONSTRUCTOR(*aerodata,
788  STAHRAeroData, STAHRAeroData(*piNumber, iDim, eInst, 1));
789  }
790 }
static void ReadC81MultipleAeroData(DataManager *pDM, MBDynParser &HP, AeroData **aerodata, int iGP, int iDim, bool bInterp=false)
Definition: aerodata.cc:496
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256
virtual integer GetInt(integer iDefval=0)
Definition: parser.cc:1050
static AeroData::UnsteadyModel ReadUnsteadyFlag(MBDynParser &HP)
Definition: aerodata.cc:427
const DriveHandler * pGetDrvHdl(void) const
Definition: dataman.h:340
Shape * ReadShape(MBDynParser &HP)
Definition: shape.cc:298
const c81_data * GetC81Data(unsigned profile) const
Definition: mbpar.cc:1921
#define SAFENEW(pnt, item)
Definition: mynewmem.h:695
virtual bool IsKeyWord(const char *sKeyWord)
Definition: parser.cc:910
UnsteadyModel
Definition: aerodata.h:89
KeyWords
Definition: dataman4.cc:94
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
virtual std::string GetString(const std::string &sDefVal)
Definition: parser.cc:1074
virtual bool IsArg(void)
Definition: parser.cc:807
DriveCaller * GetDriveCaller(bool bDeferred=false)
Definition: mbpar.cc:2033
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697
#define DEBUGLCOUT(level, msg)
Definition: myassert.h:244

Here is the call graph for this function: