MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
CyclocopterPolimi Class Reference
Inheritance diagram for CyclocopterPolimi:
Collaboration diagram for CyclocopterPolimi:

Public Member Functions

 CyclocopterPolimi (unsigned int uL, const DofOwner *pDO, DataManager *pDM, MBDynParser &HP)
 
virtual ~CyclocopterPolimi (void)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP)
 
virtual void Output (OutputHandler &OH) const
 
virtual SubVectorHandlerAssRes (SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void AddForce (const Elem *pEl, const StructNode *pNode, const Vec3 &F, const Vec3 &M, const Vec3 &X)
 
virtual Vec3 GetInducedVelocity (Elem::Type type, unsigned uLabel, unsigned uPnt, const Vec3 &X) const
 
virtual doublereal GetW (const Vec3 &X) const
 
virtual doublereal GetPsi (const Vec3 &X) const
 
virtual Mat3x3 GetRRotor (const Vec3 &X) const
 
- Public Member Functions inherited from Elem
 Elem (unsigned int uL, flag fOut)
 
virtual ~Elem (void)
 
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 int GetNumConnectedNodes (void) 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 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, 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 CyclocopterInflow
 CyclocopterInflow (unsigned int uL, const DofOwner *pDO)
 
virtual ~CyclocopterInflow (void)
 
virtual Elem::Type GetElemType (void) const
 
virtual InducedVelocity::Type GetInducedVelocityType (void) const
 
virtual std::ostream & Restart (std::ostream &out) const
 
virtual void SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph)
 
virtual void SetInitialValue (VectorHandler &X)
 
virtual void GetConnectedNodes (std::vector< const Node * > &connectedNodes) const
 
virtual unsigned int iGetInitialNumDof (void) const
 
virtual void InitialWorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
VariableSubMatrixHandlerInitialAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
 
SubVectorHandlerInitialAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr)
 
- Public Member Functions inherited from UserDefinedElem
 UserDefinedElem (unsigned uLabel, const DofOwner *pDO)
 
virtual ~UserDefinedElem (void)
 
bool NeedsAirProperties (void) const
 
void NeedsAirProperties (bool yesno)
 
virtual AerodynamicElem::Type GetAerodynamicElemType (void) 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 AerodynamicElem
 AerodynamicElem (unsigned int uL, const DofOwner *pDO, flag fOut)
 
virtual ~AerodynamicElem (void)
 
virtual const InducedVelocitypGetInducedVelocity (void) const
 
- Public Member Functions inherited from ElemWithDofs
 ElemWithDofs (unsigned int uL, const DofOwner *pDO, flag fOut)
 
virtual ~ElemWithDofs (void)
 
- Public Member Functions inherited from DofOwnerOwner
 DofOwnerOwner (const DofOwner *pDO)
 
virtual ~DofOwnerOwner ()
 
virtual const DofOwnerpGetDofOwner (void) const
 
virtual integer iGetFirstIndex (void) const
 
- Public Member Functions inherited from AirPropOwner
 AirPropOwner (void)
 
virtual ~AirPropOwner (void)
 
virtual void PutAirProperties (const AirProperties *pAP)
 
virtual flag fGetAirVelocity (Vec3 &Velocity, const Vec3 &X) const
 
virtual doublereal dGetAirDensity (const Vec3 &X) const
 
virtual doublereal dGetAirPressure (const Vec3 &X) const
 
virtual doublereal dGetAirTemperature (const Vec3 &X) const
 
virtual doublereal dGetSoundSpeed (const Vec3 &X) const
 
virtual bool GetAirProps (const Vec3 &X, doublereal &rho, doublereal &c, doublereal &p, doublereal &T) const
 
- Public Member Functions inherited from ElemGravityOwner
 ElemGravityOwner (unsigned int uL, flag fOut)
 
virtual ~ElemGravityOwner (void)
 
virtual doublereal dGetM (void) const
 
Vec3 GetS (void) const
 
Mat3x3 GetJ (void) const
 
Vec3 GetB (void) const
 
Vec3 GetG (void) const
 
- Public Member Functions inherited from GravityOwner
 GravityOwner (void)
 
virtual ~GravityOwner (void)
 
void PutGravity (const Gravity *pG)
 
virtual bool bGetGravity (const Vec3 &X, Vec3 &Acc) const
 
- Public Member Functions inherited from InducedVelocity
 InducedVelocity (unsigned int uL, const StructNode *pCraft, ResForceSet **ppres, flag fOut)
 
virtual ~InducedVelocity (void)
 
virtual unsigned int iGetNumPrivData (void) const
 
virtual unsigned int iGetPrivDataIdx (const char *s) const
 
virtual doublereal dGetPrivData (unsigned int i) const
 
virtual bool bSectionalForces (void) const
 
virtual unsigned int iGetNumDof (void) const
 
virtual const Vec3GetXCurr (void) const
 
virtual const Vec3GetForces (void) const
 
virtual const Vec3GetMoments (void) const
 
virtual void AddSectionalForce (Elem::Type type, const Elem *pEl, unsigned uPnt, const Vec3 &F, const Vec3 &M, doublereal dW, const Vec3 &X, const Mat3x3 &R, const Vec3 &V, const Vec3 &W)
 
virtual void ResetForce (void)
 
virtual void WorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
virtual VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 

Protected Attributes

Mat3x3 RRotor
 
Vec3 dUind
 
Vec3 dUindPrev
 
doublereal dXi
 
bool bFlagIsFirstBlade
 
doublereal dAzimuth
 
doublereal dAzimuthPrev
 
Vec3 F
 
Vec3 FMean
 
Vec3 FMeanOut
 
unsigned int iStepCounter
 
Vec3 Uk
 
Vec3 Uk_1
 
Vec3 Uk_2
 
Vec3 Yk
 
Vec3 Yk_1
 
Vec3 Yk_2
 
unsigned int iCounter
 
unsigned int iRotationCounter
 
doublereal dpPrev
 
doublereal dp
 
bool flag_print
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 
- Protected Attributes inherited from CyclocopterInflow
const StructNodepRotor
 
bool bFlagAverage
 
doublereal dRadius
 
doublereal dSpan
 
doublereal dArea
 
doublereal dKappa
 
DriveOwner Weight
 
doublereal dWeight
 
Mat3x3 RRot
 
Mat3x3 RRotorTranspose
 
doublereal dUindMean
 
doublereal a1
 
doublereal a2
 
doublereal b0
 
doublereal b1
 
doublereal b2
 
- Protected Attributes inherited from UserDefinedElem
bool needsAirProperties
 
- Protected Attributes inherited from AirPropOwner
const AirPropertiespAirProperties
 
- Protected Attributes inherited from GravityOwner
GravitypGravity
 
- Protected Attributes inherited from InducedVelocity
const StructNodepCraft
 
ExternResForces Res
 
ResForceSet ** ppRes
 

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 }
 
- Public Types inherited from AerodynamicElem
enum  Type {
  UNKNOWN = -1, INDUCEDVELOCITY = 0, AEROMODAL, AERODYNAMICBODY,
  AERODYNAMICBEAM, AERODYNAMICEXTERNAL, AERODYNAMICEXTERNALMODAL, AERODYNAMICLOADABLE,
  AIRCRAFTINSTRUMENTS, GENERICFORCE, LASTAEROTYPE
}
 
- Public Types inherited from InducedVelocity
enum  Type {
  UNKNOWN = -1, USER_DEFINED = 0x01000000U, ROTOR = 0x10000000U, NO = (0U | ROTOR),
  UNIFORM = (1U | ROTOR), GLAUERT = (2U | ROTOR), MANGLER = (3U | ROTOR), DYNAMICINFLOW = (4U | ROTOR),
  PETERS_HE = (5U | ROTOR), CYCLOCOPTER = (11U | ROTOR), LASTROTORTYPE
}
 
- Protected Member Functions inherited from CyclocopterInflow
void SetFilterCoefficients (doublereal dOmegaFilter, doublereal dDeltaT)
 
- Protected Member Functions inherited from ElemGravityOwner
virtual Vec3 GetS_int (void) const
 
virtual Mat3x3 GetJ_int (void) const
 
virtual Vec3 GetB_int (void) const
 
virtual Vec3 GetG_int (void) const
 

Detailed Description

Definition at line 1221 of file module-cyclocopter.cc.

Constructor & Destructor Documentation

CyclocopterPolimi::CyclocopterPolimi ( unsigned int  uL,
const DofOwner pDO,
DataManager pDM,
MBDynParser HP 
)

Definition at line 1303 of file module-cyclocopter.cc.

References CyclocopterInflow::bFlagAverage, CyclocopterInflow::dArea, CyclocopterInflow::dKappa, CyclocopterInflow::dRadius, CyclocopterInflow::dSpan, DataManager::fReadOutput(), Elem::INDUCEDVELOCITY, HighParser::IsArg(), HighParser::IsKeyWord(), MBDYN_EXCEPT_ARGS, InducedVelocity::pCraft, InducedVelocity::ppRes, CyclocopterInflow::pRotor, ReadResSets(), ReadRotorData(), ReadUniform(), CyclocopterInflow::RRot, DriveOwner::Set(), CyclocopterInflow::SetFilterCoefficients(), ToBeOutput::SetOutputFlag(), WithLabel::uLabel, and CyclocopterInflow::Weight.

1305 : Elem(uL, flag(0)),
1306 CyclocopterInflow(uL, pDO),
1307 RRotor(::Eye3),
1308 dUind(::Zero3), dUindPrev(::Zero3),
1309 dXi(0.),
1310 bFlagIsFirstBlade(true),
1311 dAzimuth(0.), dAzimuthPrev(0.),
1312 F(::Zero3), FMean(::Zero3), FMeanOut(::Zero3),
1313 iStepCounter(0),
1314 Uk(::Zero3), Uk_1(::Zero3), Uk_2(::Zero3), Yk(::Zero3), Yk_1(::Zero3), Yk_2(::Zero3),
1315 iCounter(0), iRotationCounter(0),
1316 dpPrev(0.), dp(0.),
1317 flag_print(true)
1318 {
1319  if (HP.IsKeyWord("help")) {
1320  silent_cout(
1321 " \n"
1322 "Module: Cyclocopter \n"
1323 "Author: Pierangelo Masarati <pierangelo.masarati@polimi.it> \n"
1324 "based on work by \n"
1325 " Mattia Mattaboni <mattia.mattaboni@mail.polimi.it> \n"
1326 "Organization: Dipartimento di Scienze e Tecnologie Aerospaziali \n"
1327 " Politecnico di Milano \n"
1328 " http://www.aero.polimi.it/ \n"
1329 " Description: This module implements induced velocity models \n"
1330 " for cycloidal rotors. \n"
1331 " \n"
1332 " All rights reserved. \n"
1333 "\n"
1334 " Usage:\n"
1335 " user element: <label> , cycloidal Polimi ,\n"
1336 " <aircraft_node_label> ,\n"
1337 " [ orientation , (OrientationMatrix) <orientation> , ]\n"
1338 " <rotor_node_label>\n"
1339 " (bool) <average> ,\n"
1340 " <rotor_radius> ,\n"
1341 " <blade_span>\n"
1342 " [ , delay , (DriveCaller) <delay> ]\n"
1343 " [ , omegacut , <cut_frequency> ]\n"
1344 " [ , kappa , <hover_correction_coefficient> ]\n"
1345 " [ , timestep , <time_step> ]\n"
1346 " [ , <output_data> ]\n"
1347 " ;\n"
1348  << std::endl);
1349 
1350  if (!HP.IsArg()) {
1351  /*
1352  * Exit quietly if nothing else is provided
1353  */
1354  throw NoErr(MBDYN_EXCEPT_ARGS);
1355  }
1356  }
1357 
1358  if (!ReadRotorData(pDM, HP, uLabel, pCraft, RRot, pRotor)) {
1360  }
1361 
1362  DriveCaller *pdW = 0;
1363  doublereal dOmegaFilter;
1364  doublereal dDeltaT;
1365  if (!ReadUniform(pDM, HP, uLabel, bFlagAverage, dRadius, dSpan, pdW, dOmegaFilter, dKappa, dDeltaT)) {
1367  }
1368 
1369  ppRes = ReadResSets(pDM, HP);
1370 
1372 
1373  dArea = 2*dRadius*dSpan;
1374  Weight.Set(pdW);
1375 
1376  SetFilterCoefficients(dOmegaFilter, dDeltaT);
1377 }
flag fReadOutput(MBDynParser &HP, const T &t) const
Definition: dataman.h:1064
void SetFilterCoefficients(doublereal dOmegaFilter, doublereal dDeltaT)
const Vec3 Zero3(0., 0., 0.)
long int flag
Definition: mbdyn.h:43
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
ResForceSet ** ppRes
Definition: indvel.h:116
unsigned int iRotationCounter
const Mat3x3 Eye3(1., 0., 0., 0., 1., 0., 0., 0., 1.)
static bool ReadRotorData(DataManager *pDM, MBDynParser &HP, unsigned int uLabel, const StructNode *&pCraft, Mat3x3 &rrot, const StructNode *&pRotor)
CyclocopterInflow(unsigned int uL, const DofOwner *pDO)
const StructNode * pRotor
virtual bool IsKeyWord(const char *sKeyWord)
Definition: parser.cc:910
static bool ReadUniform(DataManager *pDM, MBDynParser &HP, unsigned int uLabel, bool &bFlagAve, doublereal &dR, doublereal &dL, DriveCaller *&pdW, doublereal &dOmegaFilter, doublereal &dKappa, doublereal &dDeltaT)
unsigned int uLabel
Definition: withlab.h:44
ResForceSet ** ReadResSets(DataManager *pDM, MBDynParser &HP)
Definition: resforces.cc:263
Definition: except.h:79
virtual bool IsArg(void)
Definition: parser.cc:807
void Set(const DriveCaller *pDC)
Definition: drive.cc:647
virtual void SetOutputFlag(flag f=flag(1))
Definition: output.cc:896
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
double doublereal
Definition: colamd.c:52
const StructNode * pCraft
Definition: indvel.h:111

Here is the call graph for this function:

CyclocopterPolimi::~CyclocopterPolimi ( void  )
virtual

Definition at line 1379 of file module-cyclocopter.cc.

References NO_OP.

1380 {
1381  NO_OP;
1382 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

void CyclocopterPolimi::AddForce ( const Elem pEl,
const StructNode pNode,
const Vec3 F,
const Vec3 M,
const Vec3 X 
)
virtual

Reimplemented from InducedVelocity.

Definition at line 1516 of file module-cyclocopter.cc.

References ResForces::AddForce(), InducedVelocity::AddForce(), ResForces::AddForces(), grad::atan2(), bFlagIsFirstBlade, ToBeOutput::bToBeOutput(), dAzimuth, StructDispNode::GetXCurr(), CyclocopterInflow::pRotor, InducedVelocity::Res, and CyclocopterInflow::RRotorTranspose.

1517 {
1518  /* colcolo la posizione azimutale della prima pala */
1519  if (bFlagIsFirstBlade) {
1520  Vec3 XRel(RRotorTranspose*(X - pRotor->GetXCurr()));
1521  doublereal d1 = XRel(2);
1522  doublereal d2 = XRel(3);
1523  dAzimuth = atan2(d2, d1);
1524  bFlagIsFirstBlade = false;
1525  }
1526 
1527  /* Sole se deve fare l'output calcola anche il momento */
1528  if (bToBeOutput()) {
1529  Res.AddForces(F,M,X);
1530  InducedVelocity::AddForce(pEl, pNode, F, M, X);
1531 
1532  } else {
1533  Res.AddForce(F);
1534  }
1535 }
ExternResForces Res
Definition: indvel.h:114
virtual bool bToBeOutput(void) const
Definition: output.cc:890
Definition: matvec3.h:98
virtual void AddForce(const Elem *pEl, const StructNode *pNode, const Vec3 &F, const Vec3 &M, const Vec3 &X)
Definition: indvel.cc:252
void AddForces(const Vec3 &f, const Vec3 &c, const Vec3 &x)
Definition: resforces.cc:77
const StructNode * pRotor
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
void AddForce(const Vec3 &f)
Definition: resforces.cc:58
GradientExpression< BinaryExpr< FuncAtan2, LhsExpr, RhsExpr > > atan2(const GradientExpression< LhsExpr > &u, const GradientExpression< RhsExpr > &v)
Definition: gradient.h:2962
double doublereal
Definition: colamd.c:52

Here is the call graph for this function:

void CyclocopterPolimi::AfterConvergence ( const VectorHandler X,
const VectorHandler XP 
)
virtual

Reimplemented from CyclocopterInflow.

Definition at line 1385 of file module-cyclocopter.cc.

References InducedVelocity::AfterConvergence(), grad::atan2(), CyclocopterInflow::bFlagAverage, bFlagIsFirstBlade, CyclocopterInflow::dArea, dAzimuth, dAzimuthPrev, DriveOwner::dGet(), AirPropOwner::dGetAirDensity(), CyclocopterInflow::dKappa, dUind, CyclocopterInflow::dUindMean, dUindPrev, CyclocopterInflow::dWeight, dXi, F, FMean, FMeanOut, WithLabel::GetLabel(), InducedVelocity::GetXCurr(), iStepCounter, M_PI, grad::sqrt(), Uk, Uk_1, Uk_2, CyclocopterInflow::Weight, Yk, Yk_1, Yk_2, and Zero3.

1386 {
1387  bFlagIsFirstBlade = true;
1388  /* calcolo la forza media sul giro generata dal rotore */
1389  FMean = FMean + F;;
1390  iStepCounter++;
1391  // if ((dAzimuth > 0. && dAzimuthPrev < 0.) || (dAzimuth < 0. && dAzimuthPrev > 0.)) {
1392  if ((dAzimuth > 0. && dAzimuthPrev < 0.)) {
1394  FMeanOut = FMean;
1395  if (bFlagAverage) {
1396  /* Forza nel piano normale all'asse di rotazione */
1397  doublereal dT = sqrt(FMean(2)*FMean(2) + FMean(3)*FMean(3));
1398  /* Velocità indotta: calcolata in base alla dT */
1400  dUindMean = dKappa*sqrt(dT/(2*dRho*dArea));
1401  /* Componenti della velocità indotta nel sistema
1402  * rotore */
1403  dUind = Zero3;
1404  if (dT > std::numeric_limits<doublereal>::epsilon()) {
1405  dUind(2) = dUindMean*FMean(2)/dT;
1406  dUind(3) = dUindMean*FMean(3)/dT;
1407  }
1408  dUind(1) = (1 - dWeight)*dUind(1) + dWeight*dUindPrev(1);
1409  dUind(2) = (1 - dWeight)*dUind(2) + dWeight*dUindPrev(2);
1410  dUind(3) = (1 - dWeight)*dUind(3) + dWeight*dUindPrev(3);
1411  /* angolo di cui è ruotata la trazione */
1412  dXi = atan2(FMean(3), FMean(2)) - M_PI/2.;
1413  }
1414 
1415  FMean = Zero3;
1416  iStepCounter = 0;
1417  }
1418 
1420 
1421  dUindPrev = dUind;
1422 
1423  /* aggiorno ingressi e uscite del filtro */
1424  Yk_2 = Yk_1;
1425  Yk_1 = Yk;
1426  Uk_2 = Uk_1;
1427  Uk_1 = Uk;
1428 
1429  dWeight = Weight.dGet();
1430  if (dWeight < 0.) {
1431  silent_cout("Rotor(" << GetLabel() << "): "
1432  "delay < 0.0; using 0.0" << std::endl);
1433  dWeight = 0.;
1434 
1435  } else if (dWeight > 1.) {
1436  silent_cout("Rotor(" << GetLabel() << "): "
1437  "delay > 1.0; using 1.0" << std::endl);
1438  dWeight = 1.;
1439  }
1440 
1442 }
virtual doublereal dGetAirDensity(const Vec3 &X) const
Definition: aerodyn.cc:736
virtual void AfterConvergence(const VectorHandler &X, const VectorHandler &XP)
Definition: indvel.cc:170
#define M_PI
Definition: gradienttest.cc:67
const Vec3 Zero3(0., 0., 0.)
virtual const Vec3 & GetXCurr(void) const
Definition: indvel.h:159
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
Definition: gradient.h:2974
doublereal dGet(const doublereal &dVar) const
Definition: drive.cc:664
GradientExpression< BinaryExpr< FuncAtan2, LhsExpr, RhsExpr > > atan2(const GradientExpression< LhsExpr > &u, const GradientExpression< RhsExpr > &v)
Definition: gradient.h:2962
double doublereal
Definition: colamd.c:52
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

SubVectorHandler & CyclocopterPolimi::AssRes ( SubVectorHandler WorkVec,
doublereal  dCoef,
const VectorHandler XCurr,
const VectorHandler XPrimeCurr 
)
virtual

Implements Elem.

Definition at line 1472 of file module-cyclocopter.cc.

References CyclocopterInflow::a1, CyclocopterInflow::a2, grad::atan2(), CyclocopterInflow::b0, CyclocopterInflow::b1, CyclocopterInflow::b2, CyclocopterInflow::bFlagAverage, CyclocopterInflow::dArea, AirPropOwner::dGetAirDensity(), CyclocopterInflow::dKappa, dUind, CyclocopterInflow::dUindMean, dUindPrev, CyclocopterInflow::dWeight, dXi, F, ResForces::Force(), StructNode::GetRCurr(), InducedVelocity::GetXCurr(), M_PI, InducedVelocity::pCraft, InducedVelocity::Res, InducedVelocity::ResetForce(), VectorHandler::Resize(), CyclocopterInflow::RRot, RRotor, CyclocopterInflow::RRotorTranspose, grad::sqrt(), Mat3x3::Transpose(), Uk, Uk_1, Uk_2, Yk, Yk_1, Yk_2, and Zero3.

1476 {
1477  /* UNIFORM induced velocity */
1478  /* Trasporta della matrice di rotazione del rotore */
1479  RRotor = pCraft->GetRCurr()*RRot;
1481  /* Forze nel sistema rotore */
1482  F = RRotorTranspose*Res.Force();
1483  if (!bFlagAverage) {
1484  /* filtro le forze */
1485  Uk = F;
1486  Yk = -Yk_1*a1 - Yk_2*a2 + Uk*b0 + Uk_1*b1 + Uk_2*b2;
1487  F = Yk;
1488  /* Forza nel piano normale all'asse di rotazione */
1489  doublereal dT = sqrt(F(2)*F(2) + F(3)*F(3));
1490  /* Velocità indotta: calcolata in base alla dT */
1492  dUindMean = dKappa*sqrt(dT/(2*dRho*dArea));
1493  /* Componenti della velocità indotta nel sistema
1494  * rotore */
1495  dUind = Zero3;
1496  if (dT > std::numeric_limits<doublereal>::epsilon()) {
1497  dUind(2) = dUindMean*F(2)/dT;
1498  dUind(3) = dUindMean*F(3)/dT;
1499  }
1500  dUind(1) = (1 - dWeight)*dUind(1) + dWeight*dUindPrev(1);
1501  dUind(2) = (1 - dWeight)*dUind(2) + dWeight*dUindPrev(2);
1502  dUind(3) = (1 - dWeight)*dUind(3) + dWeight*dUindPrev(3);
1503 
1504  dUindMean = sqrt(dUind(1)*dUind(1) + dUind(2)*dUind(2) + dUind(3)*dUind(3));
1505  /* angolo di cui è ruotata la trazione */
1506  dXi = atan2(F(3), F(2)) - M_PI/2.;
1507  }
1508 
1509  ResetForce();
1510  WorkVec.Resize(0);
1511 
1512  return WorkVec;
1513 }
ExternResForces Res
Definition: indvel.h:114
virtual doublereal dGetAirDensity(const Vec3 &X) const
Definition: aerodyn.cc:736
#define M_PI
Definition: gradienttest.cc:67
const Vec3 Zero3(0., 0., 0.)
virtual void ResetForce(void)
Definition: indvel.cc:276
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
virtual const Vec3 & Force(void) const
Definition: resforces.cc:103
virtual const Vec3 & GetXCurr(void) const
Definition: indvel.h:159
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
Definition: gradient.h:2974
Mat3x3 Transpose(void) const
Definition: matvec3.h:816
GradientExpression< BinaryExpr< FuncAtan2, LhsExpr, RhsExpr > > atan2(const GradientExpression< LhsExpr > &u, const GradientExpression< RhsExpr > &v)
Definition: gradient.h:2962
double doublereal
Definition: colamd.c:52
virtual void Resize(integer iNewSize)=0
const StructNode * pCraft
Definition: indvel.h:111

Here is the call graph for this function:

Vec3 CyclocopterPolimi::GetInducedVelocity ( Elem::Type  type,
unsigned  uLabel,
unsigned  uPnt,
const Vec3 X 
) const
virtual

Implements InducedVelocity.

Definition at line 1538 of file module-cyclocopter.cc.

References grad::atan2(), grad::cos(), CyclocopterInflow::dRadius, dUind, dXi, StructDispNode::GetXCurr(), M_PI, CyclocopterInflow::pRotor, RRotor, CyclocopterInflow::RRotorTranspose, and grad::sqrt().

1540 {
1541  Vec3 XRel(RRotorTranspose*(X - pRotor->GetXCurr()));
1542 
1543  doublereal d1 = XRel(2);
1544  doublereal d2 = XRel(3);
1545 
1546  /* dPsi0 non serve a nulla perchè uso l'angolo
1547  * relativo: (dp-dXi)!!! */
1548  doublereal dpp = atan2(d2, d1);
1549 
1550  doublereal r = sqrt(d1*d1 + d2*d2)*cos(dpp - dXi);
1551 
1552  return RRotor*((dUind*(M_PI/2.))*cos((M_PI/2.)*(r/dRadius)));
1553 }
#define M_PI
Definition: gradienttest.cc:67
Definition: matvec3.h:98
const StructNode * pRotor
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
Definition: gradient.h:2974
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
GradientExpression< UnaryExpr< FuncCos, Expr > > cos(const GradientExpression< Expr > &u)
Definition: gradient.h:2978
GradientExpression< BinaryExpr< FuncAtan2, LhsExpr, RhsExpr > > atan2(const GradientExpression< LhsExpr > &u, const GradientExpression< RhsExpr > &v)
Definition: gradient.h:2962
double doublereal
Definition: colamd.c:52

Here is the call graph for this function:

virtual doublereal CyclocopterPolimi::GetPsi ( const Vec3 X) const
inlinevirtual

Definition at line 1294 of file module-cyclocopter.cc.

1294  {
1295  return 0.;
1296  };
virtual Mat3x3 CyclocopterPolimi::GetRRotor ( const Vec3 X) const
inlinevirtual

Definition at line 1298 of file module-cyclocopter.cc.

References Zero3x3.

1298  {
1300  };
const Mat3x3 Zero3x3(0., 0., 0., 0., 0., 0., 0., 0., 0.)
virtual doublereal CyclocopterPolimi::GetW ( const Vec3 X) const
inlinevirtual

Definition at line 1290 of file module-cyclocopter.cc.

1290  {
1291  return 0.;
1292  };
void CyclocopterPolimi::Output ( OutputHandler OH) const
virtual

Reimplemented from CyclocopterInflow.

Definition at line 1445 of file module-cyclocopter.cc.

References ToBeOutput::bToBeOutput(), dAzimuth, dUind, CyclocopterInflow::dUindMean, dXi, FMeanOut, ResForces::Force(), WithLabel::GetLabel(), OutputHandler::Loadable(), ResForces::Moment(), InducedVelocity::ppRes, InducedVelocity::Res, and CyclocopterInflow::RRotorTranspose.

1446 {
1447  if (bToBeOutput()) {
1448  OH.Loadable()
1449  << std::setw(8) << GetLabel() /* 1 */
1450  << " " << RRotorTranspose*Res.Force() /* 2-4 */
1451  << " " << RRotorTranspose*Res.Moment() /* 5-7 */
1452  << " " << dUindMean /* 8 */
1453  << " " << dUind /* 9 -11*/
1454  << " " << dXi /* 12 */
1455  << " " << dAzimuth /* 13 */
1456  << " " << FMeanOut /* 14-16 */
1457  << std::endl;
1458 
1459  /* FIXME: check for parallel stuff ... */
1460  for (int i = 0; ppRes && ppRes[i]; i++) {
1461  OH.Loadable()
1462  << std::setw(8) << GetLabel()
1463  << ":" << ppRes[i]->GetLabel()
1464  << " " << ppRes[i]->pRes->Force()
1465  << " " << ppRes[i]->pRes->Moment()
1466  << std::endl;
1467  }
1468  }
1469 }
ExternResForces Res
Definition: indvel.h:114
virtual bool bToBeOutput(void) const
Definition: output.cc:890
ResForceSet ** ppRes
Definition: indvel.h:116
virtual const Vec3 & Force(void) const
Definition: resforces.cc:103
virtual const Vec3 & Moment(void) const
Definition: resforces.cc:109
std::ostream & Loadable(void) const
Definition: output.h:506
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

Member Data Documentation

bool CyclocopterPolimi::bFlagIsFirstBlade
protected

Definition at line 1230 of file module-cyclocopter.cc.

Referenced by AddForce(), and AfterConvergence().

doublereal CyclocopterPolimi::dAzimuth
protected

Definition at line 1232 of file module-cyclocopter.cc.

Referenced by AddForce(), AfterConvergence(), and Output().

doublereal CyclocopterPolimi::dAzimuthPrev
protected

Definition at line 1232 of file module-cyclocopter.cc.

Referenced by AfterConvergence().

doublereal CyclocopterPolimi::dp
protected

Definition at line 1244 of file module-cyclocopter.cc.

doublereal CyclocopterPolimi::dpPrev
protected

Definition at line 1244 of file module-cyclocopter.cc.

Vec3 CyclocopterPolimi::dUind
protected

Definition at line 1225 of file module-cyclocopter.cc.

Referenced by AfterConvergence(), AssRes(), GetInducedVelocity(), and Output().

Vec3 CyclocopterPolimi::dUindPrev
mutableprotected

Definition at line 1226 of file module-cyclocopter.cc.

Referenced by AfterConvergence(), and AssRes().

doublereal CyclocopterPolimi::dXi
protected

Definition at line 1228 of file module-cyclocopter.cc.

Referenced by AfterConvergence(), AssRes(), GetInducedVelocity(), and Output().

Vec3 CyclocopterPolimi::F
protected

Definition at line 1234 of file module-cyclocopter.cc.

Referenced by AfterConvergence(), and AssRes().

bool CyclocopterPolimi::flag_print
protected

Definition at line 1246 of file module-cyclocopter.cc.

Vec3 CyclocopterPolimi::FMean
protected

Definition at line 1234 of file module-cyclocopter.cc.

Referenced by AfterConvergence().

Vec3 CyclocopterPolimi::FMeanOut
protected

Definition at line 1234 of file module-cyclocopter.cc.

Referenced by AfterConvergence(), and Output().

unsigned int CyclocopterPolimi::iCounter
protected

Definition at line 1241 of file module-cyclocopter.cc.

unsigned int CyclocopterPolimi::iRotationCounter
protected

Definition at line 1242 of file module-cyclocopter.cc.

unsigned int CyclocopterPolimi::iStepCounter
protected

Definition at line 1236 of file module-cyclocopter.cc.

Referenced by AfterConvergence().

Mat3x3 CyclocopterPolimi::RRotor
protected

Definition at line 1224 of file module-cyclocopter.cc.

Referenced by AssRes(), and GetInducedVelocity().

Vec3 CyclocopterPolimi::Uk
protected

Definition at line 1239 of file module-cyclocopter.cc.

Referenced by AfterConvergence(), and AssRes().

Vec3 CyclocopterPolimi::Uk_1
protected

Definition at line 1239 of file module-cyclocopter.cc.

Referenced by AfterConvergence(), and AssRes().

Vec3 CyclocopterPolimi::Uk_2
protected

Definition at line 1239 of file module-cyclocopter.cc.

Referenced by AfterConvergence(), and AssRes().

Vec3 CyclocopterPolimi::Yk
protected

Definition at line 1239 of file module-cyclocopter.cc.

Referenced by AfterConvergence(), and AssRes().

Vec3 CyclocopterPolimi::Yk_1
protected

Definition at line 1239 of file module-cyclocopter.cc.

Referenced by AfterConvergence(), and AssRes().

Vec3 CyclocopterPolimi::Yk_2
protected

Definition at line 1239 of file module-cyclocopter.cc.

Referenced by AfterConvergence(), and AssRes().


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