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

Public Member Functions

 CyclocopterUniform2D (unsigned int uL, const DofOwner *pDO, DataManager *pDM, MBDynParser &HP)
 
virtual ~CyclocopterUniform2D (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
 
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
 
- 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 863 of file module-cyclocopter.cc.

Constructor & Destructor Documentation

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

Definition at line 936 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.

938 : Elem(uL, flag(0)),
939 CyclocopterInflow(uL, pDO),
940 RRotor(::Eye3),
941 dUind(::Zero3), dUindPrev(::Zero3),
942 bFlagIsFirstBlade(true),
943 dAzimuth(0.), dAzimuthPrev(0.),
944 F(::Zero3), FMean(::Zero3), FMeanOut(::Zero3),
945 iStepCounter(0),
946 Uk(::Zero3), Uk_1(::Zero3), Uk_2(::Zero3), Yk(::Zero3), Yk_1(::Zero3), Yk_2(::Zero3)
947 {
948  if (HP.IsKeyWord("help")) {
949  silent_cout(
950 " \n"
951 "Module: Cyclocopter \n"
952 "Author: Pierangelo Masarati <pierangelo.masarati@polimi.it> \n"
953 "based on work by \n"
954 " Mattia Mattaboni <mattia.mattaboni@mail.polimi.it> \n"
955 "Organization: Dipartimento di Scienze e Tecnologie Aerospaziali \n"
956 " Politecnico di Milano \n"
957 " http://www.aero.polimi.it/ \n"
958 " Description: This module implements induced velocity models \n"
959 " for cycloidal rotors. \n"
960 " \n"
961 " All rights reserved. \n"
962 "\n"
963 " Usage:\n"
964 " user element: <label> , cycloidal uniform 2D ,\n"
965 " <aircraft_node_label> ,\n"
966 " [ orientation , (OrientationMatrix) <orientation> , ]\n"
967 " <rotor_node_label>\n"
968 " (bool) <average> ,\n"
969 " <rotor_radius> ,\n"
970 " <blade_span>\n"
971 " [ , delay , (DriveCaller) <delay> ]\n"
972 " [ , omegacut , <cut_frequency> ]\n"
973 " [ , kappa , <hover_correction_coefficient> ]\n"
974 " [ , timestep , <time_step> ]\n"
975 " [ , <output_data> ]\n"
976 " ;\n"
977  << std::endl);
978 
979  if (!HP.IsArg()) {
980  /*
981  * Exit quietly if nothing else is provided
982  */
983  throw NoErr(MBDYN_EXCEPT_ARGS);
984  }
985  }
986 
987  if (!ReadRotorData(pDM, HP, uLabel, pCraft, RRot, pRotor)) {
989  }
990 
991  DriveCaller *pdW = 0;
992  doublereal dOmegaFilter;
993  doublereal dDeltaT;
994  if (!ReadUniform(pDM, HP, uLabel, bFlagAverage, dRadius, dSpan, pdW, dOmegaFilter, dKappa, dDeltaT)) {
996  }
997 
998  ppRes = ReadResSets(pDM, HP);
999 
1001 
1002  dArea = 2*dRadius*dSpan;
1003  Weight.Set(pdW);
1004 
1005  SetFilterCoefficients(dOmegaFilter, dDeltaT);
1006 }
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
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:

CyclocopterUniform2D::~CyclocopterUniform2D ( void  )
virtual

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

References NO_OP.

1009 {
1010  NO_OP;
1011 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

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

Reimplemented from InducedVelocity.

Definition at line 1171 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.

1172 {
1173  /* colcolo la posizione azimutale della prima pala */
1174  // if (bFlagIsFirstBlade && bFlagAverage) {
1175  if (bFlagIsFirstBlade) {
1176  Vec3 XRel(RRotorTranspose*(X - pRotor->GetXCurr()));
1177  doublereal d1 = XRel(2);
1178  doublereal d2 = XRel(3);
1179  dAzimuth = atan2(d2, d1);
1180  bFlagIsFirstBlade = false;
1181  }
1182 
1183  /* Sole se deve fare l'output calcola anche il momento */
1184  if (bToBeOutput()) {
1185  Res.AddForces(F, M, X);
1186  InducedVelocity::AddForce(pEl, pNode, F, M, X);
1187 
1188  } else {
1189  Res.AddForce(F);
1190  }
1191 }
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 CyclocopterUniform2D::AfterConvergence ( const VectorHandler X,
const VectorHandler XP 
)
virtual

Reimplemented from CyclocopterInflow.

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

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

1043 {
1044  bFlagIsFirstBlade = true;
1045 #if 0
1046  if (bFlagAverage) {
1047  /* calcolo la forza media sul giro generata dal rotore */
1048  FMean = FMean + F;
1049  iStepCounter++;
1050  // if ((dAzimuth > 0. && dAzimuthPrev < 0.) || (dAzimuth < 0. && dAzimuthPrev > 0.)) {
1051  if ((dAzimuth > 0. && dAzimuthPrev < 0.)) {
1053  /* Forza nel piano normale all'asse di rotazione */
1054  doublereal dT = sqrt(FMean(2)*FMean(2) + FMean(3)*FMean(3));
1055  /* Velocità indotta: calcolata in base alla dT */
1057  dUindMean = sqrt(dT/(2*dRho*dArea));
1058  /* Componenti della velocità indotta nel sistema
1059  * rotore */
1060  dUind = 0.;
1061  if (dT > std::numeric_limits<doublereal>::epsilon()) {
1062  dUind(2) = dUindMean*FMean(2)/dT;
1063  dUind(3) = dUindMean*FMean(3)/dT;
1064  }
1065  dUind(1) = (1 - dWeight)*dUind(1) + dWeight*dUindPrev(1);
1066  dUind(2) = (1 - dWeight)*dUind(2) + dWeight*dUindPrev(2);
1067  dUind(3) = (1 - dWeight)*dUind(3) + dWeight*dUindPrev(3);
1068 
1069  FMean = 0.;
1070  iStepCounter = 0;
1071  }
1072  }
1073 #endif
1074 
1075  /* calcolo la forza media sul giro generata dal rotore */
1076  FMean = FMean + F;
1077  iStepCounter++;
1078  if ((dAzimuth > 0. && dAzimuthPrev < 0.)) {
1080  FMeanOut = FMean;
1081  if (bFlagAverage) {
1082  /* Forza nel piano normale all'asse di rotazione */
1083  doublereal dT = sqrt(FMean(2)*FMean(2) + FMean(3)*FMean(3));
1084  /* Velocità indotta: calcolata in base alla dT */
1086  dUindMean = dKappa*sqrt(dT/(2*dRho*dArea));
1087  /* Componenti della velocità indotta nel sistema
1088  * rotore */
1089  dUind = ::Zero3;
1090  if (dT > std::numeric_limits<doublereal>::epsilon()) {
1091  dUind(2) = dUindMean*FMean(2)/dT;
1092  dUind(3) = dUindMean*FMean(3)/dT;
1093  }
1094  dUind(1) = (1 - dWeight)*dUind(1) + dWeight*dUindPrev(1);
1095  dUind(2) = (1 - dWeight)*dUind(2) + dWeight*dUindPrev(2);
1096  dUind(3) = (1 - dWeight)*dUind(3) + dWeight*dUindPrev(3);
1097  }
1098 
1099  FMean = ::Zero3;
1100  iStepCounter = 0;
1101  }
1102 
1104 
1105  dUindPrev = dUind;
1106 
1107  /* aggiorno ingressi e uscite del filtro */
1108  Yk_2 = Yk_1;
1109  Yk_1 = Yk;
1110  Uk_2 = Uk_1;
1111  Uk_1 = Uk;
1112 
1113  dWeight = Weight.dGet();
1114  if (dWeight < 0.) {
1115  silent_cout("Rotor(" << GetLabel() << "): "
1116  "delay < 0.0; using 0.0" << std::endl);
1117  dWeight = 0.;
1118 
1119  } else if (dWeight > 1.) {
1120  silent_cout("Rotor(" << GetLabel() << "): "
1121  "delay > 1.0; using 1.0" << std::endl);
1122  dWeight = 1.;
1123  }
1124 
1126 }
virtual doublereal dGetAirDensity(const Vec3 &X) const
Definition: aerodyn.cc:736
virtual void AfterConvergence(const VectorHandler &X, const VectorHandler &XP)
Definition: indvel.cc:170
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
double doublereal
Definition: colamd.c:52
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

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

Implements Elem.

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

References CyclocopterInflow::a1, CyclocopterInflow::a2, CyclocopterInflow::b0, CyclocopterInflow::b1, CyclocopterInflow::b2, CyclocopterInflow::bFlagAverage, CyclocopterInflow::dArea, AirPropOwner::dGetAirDensity(), CyclocopterInflow::dKappa, dUind, CyclocopterInflow::dUindMean, dUindPrev, CyclocopterInflow::dWeight, F, ResForces::Force(), StructNode::GetRCurr(), InducedVelocity::GetXCurr(), 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.

1133 {
1134  /* UNIFORM induced velocity */
1135  /* Trasporta della matrice di rotazione del rotore */
1136  RRotor = pCraft->GetRCurr()*RRot;
1138  /* Forze nel sistema rotore */
1139  F = RRotorTranspose*Res.Force();
1140  if (!bFlagAverage) {
1141  /* filtro le forze */
1142  Uk = F;
1143  Yk = -Yk_1*a1 - Yk_2*a2 + Uk*b0 + Uk_1*b1 + Uk_2*b2;
1144  F = Yk;
1145  /* Forza nel piano normale all'asse di rotazione */
1146  doublereal dT = sqrt(F(2)*F(2) + F(3)*F(3));
1147  /* Velocità indotta: calcolata in base alla dT */
1149  dUindMean = dKappa*sqrt(dT/(2*dRho*dArea));
1150  /* Componenti della velocità indotta nel sistema
1151  * rotore */
1152  dUind = ::Zero3;
1153  if (dT > std::numeric_limits<doublereal>::epsilon()) {
1154  dUind(2) = dUindMean*F(2)/dT;
1155  dUind(3) = dUindMean*F(3)/dT;
1156  }
1157  dUind(1) = (1 - dWeight)*dUind(1) + dWeight*dUindPrev(1);
1158  dUind(2) = (1 - dWeight)*dUind(2) + dWeight*dUindPrev(2);
1159  dUind(3) = (1 - dWeight)*dUind(3) + dWeight*dUindPrev(3);
1160 
1161  dUindMean = sqrt(dUind(1)*dUind(1) + dUind(2)*dUind(2) + dUind(3)*dUind(3));
1162  }
1163 
1164  ResetForce();
1165  WorkVec.Resize(0);
1166 
1167  return WorkVec;
1168 }
ExternResForces Res
Definition: indvel.h:114
virtual doublereal dGetAirDensity(const Vec3 &X) const
Definition: aerodyn.cc:736
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
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 CyclocopterUniform2D::GetInducedVelocity ( Elem::Type  type,
unsigned  uLabel,
unsigned  uPnt,
const Vec3 X 
) const
virtual

Implements InducedVelocity.

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

References dUind, and RRotor.

1196 {
1197  //printf("%f %f %f\n",dUind(1),dUind(2),dUind(3));
1198  return RRotor*dUind;
1199 }
virtual doublereal CyclocopterUniform2D::GetPsi ( const Vec3 X) const
inlinevirtual

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

927  {
928  return 0.;
929  };
virtual Mat3x3 CyclocopterUniform2D::GetRRotor ( const Vec3 X) const
inlinevirtual

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

References Zero3x3.

931  {
933  };
const Mat3x3 Zero3x3(0., 0., 0., 0., 0., 0., 0., 0., 0.)
virtual doublereal CyclocopterUniform2D::GetW ( const Vec3 X) const
inlinevirtual

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

923  {
924  return 0.;
925  };
void CyclocopterUniform2D::Output ( OutputHandler OH) const
virtual

Reimplemented from CyclocopterInflow.

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

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

1015 {
1016  if (bToBeOutput()) {
1017  OH.Loadable()
1018  << std::setw(8) << GetLabel() /* 1 */
1019  << " " << RRotorTranspose*Res.Force() /* 2-4 */
1020  << " " << RRotorTranspose*Res.Moment() /* 5-7 */
1021  << " " << dUindMean /* 8 */
1022  << " " << dAzimuth /* 9 */
1023  << " " << iStepCounter /* 10 */
1024  << " " << dUind /* 11-13 */
1025  << " " << FMeanOut /* 14-16 */
1026  << std::endl;
1027 
1028  /* FIXME: check for parallel stuff ... */
1029  for (int i = 0; ppRes && ppRes[i]; i++) {
1030  OH.Loadable()
1031  << std::setw(8) << GetLabel()
1032  << ":" << ppRes[i]->GetLabel()
1033  << " " << ppRes[i]->pRes->Force()
1034  << " " << ppRes[i]->pRes->Moment()
1035  << std::endl;
1036  }
1037  }
1038 
1039 }
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 CyclocopterUniform2D::bFlagIsFirstBlade
protected

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

Referenced by AddForce(), and AfterConvergence().

doublereal CyclocopterUniform2D::dAzimuth
protected

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

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

doublereal CyclocopterUniform2D::dAzimuthPrev
protected

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

Referenced by AfterConvergence().

Vec3 CyclocopterUniform2D::dUind
protected

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

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

Vec3 CyclocopterUniform2D::dUindPrev
mutableprotected

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

Referenced by AfterConvergence(), and AssRes().

Vec3 CyclocopterUniform2D::F
protected

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

Referenced by AfterConvergence(), and AssRes().

Vec3 CyclocopterUniform2D::FMean
protected

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

Referenced by AfterConvergence().

Vec3 CyclocopterUniform2D::FMeanOut
protected

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

Referenced by AfterConvergence(), and Output().

unsigned int CyclocopterUniform2D::iStepCounter
protected

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

Referenced by AfterConvergence(), and Output().

Mat3x3 CyclocopterUniform2D::RRotor
protected

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

Referenced by AssRes(), and GetInducedVelocity().

Vec3 CyclocopterUniform2D::Uk
protected

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

Referenced by AfterConvergence(), and AssRes().

Vec3 CyclocopterUniform2D::Uk_1
protected

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

Referenced by AfterConvergence(), and AssRes().

Vec3 CyclocopterUniform2D::Uk_2
protected

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

Referenced by AfterConvergence(), and AssRes().

Vec3 CyclocopterUniform2D::Yk
protected

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

Referenced by AfterConvergence(), and AssRes().

Vec3 CyclocopterUniform2D::Yk_1
protected

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

Referenced by AfterConvergence(), and AssRes().

Vec3 CyclocopterUniform2D::Yk_2
protected

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

Referenced by AfterConvergence(), and AssRes().


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