1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/aero/rotor.h,v 1.69 2017/01/12 14:45:58 masarati Exp $ */ 2 /* 3 * MBDyn (C) is a multibody analysis code. 4 * http://www.mbdyn.org 5 * 6 * Copyright (C) 1996-2017 7 * 8 * Pierangelo Masarati <masarati@aero.polimi.it> 9 * Paolo Mantegazza <mantegazza@aero.polimi.it> 10 * 11 * Dipartimento di Ingegneria Aerospaziale - Politecnico di Milano 12 * via La Masa, 34 - 20156 Milano, Italy 13 * http://www.aero.polimi.it 14 * 15 * Changing this copyright notice is forbidden. 16 * 17 * This program is free software; you can redistribute it and/or modify 18 * it under the terms of the GNU General Public License as published by 19 * the Free Software Foundation (version 2 of the License). 20 * 21 * 22 * This program is distributed in the hope that it will be useful, 23 * but WITHOUT ANY WARRANTY; without even the implied warranty of 24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 * GNU General Public License for more details. 26 * 27 * You should have received a copy of the GNU General Public License 28 * along with this program; if not, write to the Free Software 29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 30 */ 31 32 /* Elementi di rotore */ 33 34 #ifndef ROTOR_H 35 #define ROTOR_H 36 37 #include "indvel.h" 38 39 extern const char* psRotorNames[]; 40 41 /* Rotor - begin */ 42 43 class Rotor 44 : virtual public Elem, public InducedVelocityElem { 45 protected: 46 const StructNode* pRotor; 47 const StructNode* pGround; 48 49 doublereal dOmegaRef; // Velocita' di rotazione di riferimento 50 51 doublereal dRadius; // Raggio del rotore 52 doublereal dVTipRef; // Raggio del rotore 53 doublereal dArea; // Area del disco 54 doublereal dUMean; // Velocita' indotta media 55 doublereal dUMeanRef; // Velocita' indotta media (nominale) 56 mutable doublereal dUMeanPrev; // Vel. indotta media al passo prec. 57 58 // iterations for dUMeanRef 59 unsigned int iMaxIter; 60 unsigned int iCurrIter; 61 doublereal dTolerance; 62 doublereal dEta; 63 bool bUMeanRefConverged; 64 65 DriveOwner Weight; 66 // Peso della velocita' indotta media 67 // (peso della V al passo precedente, def = 0.) 68 doublereal dWeight; 69 // Correzione H (scala la velocita' indotta) 70 doublereal dHoverCorrection; 71 // FF 72 doublereal dForwardFlightCorrection; 73 74 // Trasposta della matrice di rotazione rotore 75 Mat3x3 RRotTranspose; 76 Mat3x3 RRot; 77 Vec3 RRot3; // Direzione dell'asse del rotore 78 Vec3 VCraft; // Velocita' di traslazione del velivolo 79 doublereal dPsi0; // Angolo di azimuth del rotore 80 doublereal dSinAlphad; // Angolo di incidenza del disco? 81 doublereal dCosAlphad; // ??? 82 doublereal dMu; // Parametro di'avanzamento 83 doublereal dLambda; // Parametro di influsso 84 doublereal dChi; // ??? 85 86 doublereal dVelocity; // Velocita' di riferimento 87 doublereal dOmega; // Velocita' di rotazione di riferimento 88 89 90 91 // temporaneo 92 mutable int iNumSteps; 93 94 // Questa funzione non viene usata, da Rotor, ma da altre classi derivate 95 // con modellazioni piu' sofisticate della velocita' indotta 96 virtual doublereal dGetPsi(const Vec3& X) const; 97 98 // Calcola la distanza di un punto dall'asse di rotazione 99 // in coordinate adimensionali 100 virtual doublereal dGetPos(const Vec3& X) const; 101 102 // Combina i due ... 103 virtual void GetPos(const Vec3& X, doublereal& dr, doublereal& dp) const; 104 105 // Calcola la velocita' di traslazione del rotore 106 virtual void InitParam(bool bComputeMeanInducedVelocity = true); 107 108 virtual void Init(const StructNode* pC, const Mat3x3& rrot, 109 const StructNode* pR, const StructNode* pG, 110 ResForceSet **ppres, 111 const doublereal& dR, 112 unsigned int iMaxIt, 113 const doublereal& dTol, 114 const doublereal& dE, 115 flag fOut); 116 117 public: 118 Rotor(unsigned int uL, const DofOwner* pDO); 119 Rotor(unsigned int uL, const DofOwner* pDO, 120 const StructNode* pC, const Mat3x3& rrot, 121 const StructNode* pR, const StructNode* pG, 122 ResForceSet **ppres, 123 const doublereal& dR, 124 unsigned int iMaxIt, 125 const doublereal& dTol, 126 const doublereal& dE, 127 flag fOut); 128 virtual ~Rotor(void); 129 130 // Elaborazione stato interno dopo la convergenza 131 virtual void 132 AfterConvergence(const VectorHandler& X, const VectorHandler& XP); 133 134 // output; si assume che ogni tipo di elemento sappia, 135 // attraverso l'OutputHandler, dove scrivere il proprio output 136 virtual void Output(OutputHandler& OH) const; 137 138 // Contributo al file di Restart 139 virtual std::ostream& Restart(std::ostream& out) const; 140 141 // Relativo ai ...WithDofs SetInitialValue(VectorHandler &)142 virtual void SetInitialValue(VectorHandler& /* X */ ) { 143 NO_OP; 144 }; 145 GetXCurr(void)146 virtual inline const Vec3& GetXCurr(void) const { 147 return pRotor->GetXCurr(); 148 }; 149 150 // accesso a dati dGetOmega(void)151 virtual inline doublereal dGetOmega(void) const { 152 #if defined(USE_MULTITHREAD) && defined(MBDYN_X_MT_ASSRES) 153 Wait(); 154 #endif // USE_MULTITHREAD && MBDYN_X_MT_ASSRES 155 return dOmega; 156 }; 157 dGetRadius(void)158 virtual inline doublereal dGetRadius(void) const { 159 #if defined(USE_MULTITHREAD) && defined(MBDYN_X_MT_ASSRES) 160 Wait(); 161 #endif // USE_MULTITHREAD && MBDYN_X_MT_ASSRES 162 return dRadius; 163 }; 164 dGetMu(void)165 virtual inline doublereal dGetMu(void) const { 166 #if defined(USE_MULTITHREAD) && defined(MBDYN_X_MT_ASSRES) 167 Wait(); 168 #endif // USE_MULTITHREAD && MBDYN_X_MT_ASSRES 169 return dMu; 170 }; 171 GetForces(void)172 virtual inline const Vec3& GetForces(void) const { 173 #if defined(USE_MULTITHREAD) && defined(MBDYN_X_MT_ASSRES) 174 Wait(); 175 #endif // USE_MULTITHREAD && MBDYN_X_MT_ASSRES 176 return Res.Force(); 177 }; 178 GetMoments(void)179 virtual inline const Vec3& GetMoments(void) const { 180 #if defined(USE_MULTITHREAD) && defined(MBDYN_X_MT_ASSRES) 181 Wait(); 182 #endif // USE_MULTITHREAD && MBDYN_X_MT_ASSRES 183 return Res.Moment(); 184 }; 185 186 // *******PER IL SOLUTORE PARALLELO******** 187 // Fornisce il tipo e la label dei nodi che sono connessi all'elemento 188 // utile per l'assemblaggio della matrice di connessione fra i dofs 189 virtual void GetConnectedNodes(std::vector<const Node * > & connectedNodes)190 GetConnectedNodes(std::vector<const Node *>& connectedNodes) const { 191 if (pGround != 0) { 192 connectedNodes.resize(3); 193 connectedNodes[2] = pGround; 194 } else { 195 connectedNodes.resize(2); 196 } 197 198 connectedNodes[0] = pCraft; 199 connectedNodes[1] = pRotor; 200 }; 201 // ************************************************ 202 }; 203 204 /* Rotor - end */ 205 206 207 /* NoRotor - begin */ 208 209 class NoRotor : virtual public Elem, public Rotor { 210 protected: 211 virtual void Init(const StructNode* pCraft, 212 const Mat3x3& rrot, 213 const StructNode* pRotor, 214 ResForceSet **ppres, 215 const doublereal& dR, 216 flag fOut); 217 218 public: 219 NoRotor(unsigned int uLabel, const DofOwner* pDO); 220 NoRotor(unsigned int uLabel, 221 const DofOwner* pDO, 222 const StructNode* pCraft, 223 const Mat3x3& rrot, 224 const StructNode* pRotor, 225 ResForceSet **ppres, 226 const doublereal& dR, 227 flag fOut); 228 virtual ~NoRotor(void); 229 230 // assemblaggio residuo 231 virtual SubVectorHandler& 232 AssRes(SubVectorHandler& WorkVec, 233 doublereal dCoef, 234 const VectorHandler& XCurr, 235 const VectorHandler& XPrimeCurr); 236 237 // Contributo al file di Restart 238 virtual std::ostream& Restart(std::ostream& out) const; 239 GetInducedVelocityType(void)240 virtual InducedVelocity::Type GetInducedVelocityType(void) const { 241 return InducedVelocity::NO; 242 }; 243 244 // Somma alla trazione il contributo di un elemento 245 virtual void 246 AddForce(const Elem *pEl, const StructNode *pNode, const Vec3& F, const Vec3& M, const Vec3& X); 247 248 // Restituisce ad un elemento la velocita' indotta 249 // in base alla posizione azimuthale 250 virtual Vec3 GetInducedVelocity(Elem::Type type, 251 unsigned uLabel, unsigned uPnt, const Vec3& X) const; 252 }; 253 254 /* NoRotor - end */ 255 256 257 /* UniformRotor - begin */ 258 259 class UniformRotor : virtual public Elem, public Rotor { 260 protected: 261 virtual void Init(const StructNode* pCraft, 262 const Mat3x3& rrot, 263 const StructNode* pRotor, 264 const StructNode* pGround, 265 ResForceSet **ppres, 266 const doublereal& dOR, 267 const doublereal& dR, 268 DriveCaller *pdW, 269 unsigned int iMaxIt, 270 const doublereal& dTol, 271 const doublereal& dE, 272 const doublereal& dCH, 273 const doublereal& dCFF, 274 flag fOut); 275 276 public: 277 UniformRotor(unsigned int uLabel, const DofOwner* pDO); 278 UniformRotor(unsigned int uLabel, 279 const DofOwner* pDO, 280 const StructNode* pCraft, 281 const Mat3x3& rrot, 282 const StructNode* pRotor, 283 const StructNode* pGround, 284 ResForceSet **ppres, 285 const doublereal& dOR, 286 const doublereal& dR, 287 DriveCaller *pdW, 288 unsigned int iMaxIt, 289 const doublereal& dTol, 290 const doublereal& dE, 291 const doublereal& dCH, 292 const doublereal& dCFF, 293 flag fOut); 294 virtual ~UniformRotor(void); 295 296 // assemblaggio residuo 297 virtual SubVectorHandler& 298 AssRes(SubVectorHandler& WorkVec, 299 doublereal dCoef, 300 const VectorHandler& XCurr, 301 const VectorHandler& XPrimeCurr); 302 303 // Contributo al file di Restart 304 virtual std::ostream& Restart(std::ostream& out) const; 305 GetInducedVelocityType(void)306 InducedVelocity::Type GetInducedVelocityType(void) const { 307 return InducedVelocity::UNIFORM; 308 }; 309 310 // Somma alla trazione il contributo di un elemento 311 virtual void 312 AddForce(const Elem *pEl, const StructNode *pNode, const Vec3& F, const Vec3& M, const Vec3& X); 313 314 // Restituisce ad un elemento la velocita' indotta 315 // in base alla posizione azimuthale 316 virtual Vec3 GetInducedVelocity(Elem::Type type, 317 unsigned uLabel, unsigned uPnt, const Vec3& X) const; 318 }; 319 320 class UniformRotor2 : virtual public Elem, public UniformRotor { 321 protected: 322 #if 0 // not needed because identical to UniformRotor::Init() 323 virtual void Init(const StructNode* pCraft, 324 const Mat3x3& rrot, 325 const StructNode* pRotor, 326 const StructNode* pGround, 327 ResForceSet **ppres, 328 const doublereal& dOR, 329 const doublereal& dR, 330 DriveCaller *pdW, 331 unsigned int iMaxIt, 332 const doublereal& dTol, 333 const doublereal& dE, 334 const doublereal& dCH, 335 const doublereal& dCFF, 336 flag fOut); 337 #endif 338 339 public: 340 UniformRotor2(unsigned int uLabel, const DofOwner* pDO); 341 UniformRotor2(unsigned int uLabel, 342 const DofOwner* pDO, 343 const StructNode* pCraft, 344 const Mat3x3& rrot, 345 const StructNode* pRotor, 346 const StructNode* pGround, 347 ResForceSet **ppres, 348 const doublereal& dOR, 349 const doublereal& dR, 350 DriveCaller *pdW, 351 unsigned int iMaxIt, 352 const doublereal& dTol, 353 const doublereal& dE, 354 const doublereal& dCH, 355 const doublereal& dCFF, 356 flag fOut); 357 virtual ~UniformRotor2(void); 358 359 virtual bool bSectionalForces(void) const; 360 virtual void AddSectionalForce(Elem::Type type, 361 const Elem *pEl, unsigned uPnt, 362 const Vec3& F, const Vec3& M, doublereal dW, 363 const Vec3& X, const Mat3x3& R, 364 const Vec3& V, const Vec3& W); 365 }; 366 367 /* UniformRotor - end */ 368 369 370 /* GlauertRotor - begin */ 371 372 class GlauertRotor : virtual public Elem, public Rotor { 373 public: 374 enum Type { 375 UNKNOWN = -1, 376 377 // from (?) 378 GLAUERT, 379 380 // from J. Gordon Leishman, Principles of Helicopter Aerodynamics, 2000 381 COLEMAN_ET_AL, 382 DREES_1, 383 PAYNE, 384 WHITE_AND_BLAKE, 385 PITT_AND_PETERS, 386 HOWLETT, 387 388 // from Massimo Gennaretti, Roma Tre 389 DREES_2, 390 391 LAST 392 }; 393 394 protected: 395 Type gtype; 396 397 virtual void Init(const StructNode* pCraft, 398 const Mat3x3& rrot, 399 const StructNode* pRotor, 400 const StructNode* pGround, 401 ResForceSet **ppres, 402 const doublereal& dOR, 403 const doublereal& dR, 404 DriveCaller *pdW, 405 unsigned int iMaxIt, 406 const doublereal& dTol, 407 const doublereal& dE, 408 const doublereal& dCH, 409 const doublereal& dCFF, 410 flag fOut); 411 412 public: 413 GlauertRotor(unsigned int uLabel, const DofOwner* pDO); 414 GlauertRotor(unsigned int uLabel, 415 const DofOwner* pDO, 416 const StructNode* pCraft, 417 const Mat3x3& rrot, 418 const StructNode* pRotor, 419 const StructNode* pGround, 420 ResForceSet **ppres, 421 const doublereal& dOR, 422 const doublereal& dR, 423 DriveCaller *pdW, 424 unsigned int iMaxIt, 425 const doublereal& dTol, 426 const doublereal& dE, 427 const doublereal& dCH, 428 const doublereal& dCFF, 429 GlauertRotor::Type gtype, 430 flag fOut); 431 virtual ~GlauertRotor(void); 432 433 // assemblaggio residuo 434 virtual SubVectorHandler& 435 AssRes(SubVectorHandler& WorkVec, 436 doublereal dCoef, 437 const VectorHandler& XCurr, 438 const VectorHandler& XPrimeCurr); 439 440 // Contributo al file di Restart 441 virtual std::ostream& Restart(std::ostream& out) const; 442 GetInducedVelocityType(void)443 InducedVelocity::Type GetInducedVelocityType(void) const { 444 return InducedVelocity::GLAUERT; 445 }; 446 447 // Somma alla trazione il contributo di un elemento 448 virtual void 449 AddForce(const Elem *pEl, const StructNode *pNode, const Vec3& F, const Vec3& M, const Vec3& X); 450 451 // Restituisce ad un elemento la velocita' indotta 452 // in base alla posizione azimuthale 453 virtual Vec3 GetInducedVelocity(Elem::Type type, 454 unsigned uLabel, unsigned uPnt, const Vec3& X) const; 455 }; 456 457 /* GlauertRotor - end */ 458 459 460 /* ManglerRotor - begin */ 461 462 class ManglerRotor : virtual public Elem, public Rotor { 463 protected: 464 virtual void Init(const StructNode* pCraft, 465 const Mat3x3& rrot, 466 const StructNode* pRotor, 467 const StructNode* pGround, 468 ResForceSet **ppres, 469 const doublereal& dOR, 470 const doublereal& dR, 471 DriveCaller *pdW, 472 unsigned int iMaxIt, 473 const doublereal& dTol, 474 const doublereal& dE, 475 const doublereal& dCH, 476 const doublereal& dCFF, 477 flag fOut); 478 479 public: 480 ManglerRotor(unsigned int uLabel, const DofOwner* pDO); 481 ManglerRotor(unsigned int uLabel, 482 const DofOwner* pDO, 483 const StructNode* pCraft, 484 const Mat3x3& rrot, 485 const StructNode* pRotor, 486 const StructNode* pGround, 487 ResForceSet **ppres, 488 const doublereal& dOR, 489 const doublereal& dR, 490 DriveCaller *pdW, 491 unsigned int iMaxIt, 492 const doublereal& dTol, 493 const doublereal& dE, 494 const doublereal& dCH, 495 const doublereal& dCFF, 496 flag fOut); 497 virtual ~ManglerRotor(void); 498 499 // assemblaggio residuo 500 virtual SubVectorHandler& 501 AssRes(SubVectorHandler& WorkVec, 502 doublereal dCoef, 503 const VectorHandler& XCurr, 504 const VectorHandler& XPrimeCurr); 505 506 // Contributo al file di Restart 507 virtual std::ostream& Restart(std::ostream& out) const; 508 GetInducedVelocityType(void)509 InducedVelocity::Type GetInducedVelocityType(void) const { 510 return InducedVelocity::MANGLER; 511 }; 512 513 // Somma alla trazione il contributo di un elemento 514 virtual void 515 AddForce(const Elem *pEl, const StructNode *pNode, const Vec3& F, const Vec3& M, const Vec3& X); 516 517 // Restituisce ad un elemento la velocita' indotta 518 // in base alla posizione azimuthale 519 virtual Vec3 GetInducedVelocity(Elem::Type type, 520 unsigned uLabel, unsigned uPnt, const Vec3& X) const; 521 }; 522 523 /* ManglerRotor - end */ 524 525 526 /* DynamicInflowRotor - begin */ 527 528 /* 529 * Based on the 3 state dynamic inflow by Pitt-Peters: 530 * 531 * D. M. Pitt, D. A. Peters, 532 * "Theoretical Prediction of Dynamic Inflow Derivatives", 533 * Vertica, Vol. 5, pp.21-34, 1981 534 * 535 * as discussed by Chen in: 536 * 537 * R. T. N. Chen, 538 * "A Survey of Nonuniform Inflow Models for Rotorcraft 539 * Flight Dynamics and Control Applications" 540 * Vertica, Vol 14, No. 2, pp.147-184, 1990 541 */ 542 543 class DynamicInflowRotor : virtual public Elem, public Rotor { 544 protected: 545 doublereal dVConst; 546 doublereal dVSine; 547 doublereal dVCosine; 548 549 doublereal dL11; 550 doublereal dL13; 551 doublereal dL22; 552 doublereal dL31; 553 doublereal dL33; 554 555 virtual void Init(const StructNode* pCraft, 556 const Mat3x3& rrot, 557 const StructNode* pRotor, 558 const StructNode* pGround, 559 ResForceSet **ppres, 560 const doublereal& dOR, 561 const doublereal& dR, 562 unsigned int iMaxIt, 563 const doublereal& dTol, 564 const doublereal& dE, 565 const doublereal& dCH, 566 const doublereal& dCFF, 567 const doublereal& dVConstTmp, 568 const doublereal& dVSineTmp, 569 const doublereal& dVCosineTmp, 570 flag fOut); 571 572 public: 573 DynamicInflowRotor(unsigned int uLabel, const DofOwner* pDO); 574 DynamicInflowRotor(unsigned int uLabel, 575 const DofOwner* pDO, 576 const StructNode* pCraft, 577 const Mat3x3& rrot, 578 const StructNode* pRotor, 579 const StructNode* pGround, 580 ResForceSet **ppres, 581 const doublereal& dOR, 582 const doublereal& dR, 583 unsigned int iMaxIt, 584 const doublereal& dTol, 585 const doublereal& dE, 586 const doublereal& dCH, 587 const doublereal& dCFF, 588 const doublereal& dVConstTmp, 589 const doublereal& dVSineTmp, 590 const doublereal& dVCosineTmp, 591 flag fOut); 592 virtual ~DynamicInflowRotor(void); 593 594 // ritorna il numero di Dofs per gli elementi che sono anche DofOwner iGetNumDof(void)595 virtual unsigned int iGetNumDof(void) const { 596 return 3; 597 }; 598 599 // output; si assume che ogni tipo di elemento sappia, 600 // attraverso l'OutputHandler, dove scrivere il proprio output 601 virtual void Output(OutputHandler& OH) const; 602 603 // Dimensioni del workspace WorkSpaceDim(integer * piNumRows,integer * piNumCols)604 virtual void WorkSpaceDim(integer* piNumRows, integer* piNumCols) const { 605 *piNumRows = 3; 606 *piNumCols = 3; 607 }; 608 609 // assemblaggio jacobiano 610 virtual VariableSubMatrixHandler& 611 AssJac(VariableSubMatrixHandler& WorkMat, 612 doublereal dCoef, 613 const VectorHandler& XCurr, 614 const VectorHandler& XPrimeCurr); 615 616 // assemblaggio residuo 617 virtual SubVectorHandler& 618 AssRes(SubVectorHandler& WorkVec, 619 doublereal dCoef, 620 const VectorHandler& XCurr, 621 const VectorHandler& XPrimeCurr); 622 623 // Contributo al file di Restart 624 virtual std::ostream& Restart(std::ostream& out) const; 625 626 // Relativo ai ...WithDofs 627 virtual void SetInitialValue(VectorHandler& X); 628 629 // Relativo ai ...WithDofs 630 virtual void 631 SetValue(DataManager *pDM, 632 VectorHandler& X, VectorHandler& XP, 633 SimulationEntity::Hints *ph = 0); 634 GetInducedVelocityType(void)635 InducedVelocity::Type GetInducedVelocityType(void) const { 636 return InducedVelocity::DYNAMICINFLOW; 637 }; 638 639 // Somma alla trazione il contributo di un elemento */ 640 virtual void 641 AddForce(const Elem *pEl, const StructNode *pNode, const Vec3& F, const Vec3& M, const Vec3& X); 642 643 // Restituisce ad un elemento la velocita' indotta 644 // in base alla posizione azimuthale 645 virtual Vec3 GetInducedVelocity(Elem::Type type, 646 unsigned uLabel, unsigned uPnt, const Vec3& X) const; 647 }; 648 649 /* DynamicInflowRotor - end */ 650 651 /* PetersHeRotor - begin */ 652 653 /* 654 * Based on the 3 state dynamic inflow by Pitt-Peters: 655 * 656 * D. M. Pitt, D. A. Peters, 657 * "Theoretical Prediction of Dynamic Inflow Derivatives", 658 * Vertica, Vol. 5, pp.21-34, 1981 659 * 660 * as discussed by Chen in: 661 * 662 * R. T. N. Chen, 663 * "A Survey of Nonuniform Inflow Models for Rotorcraft 664 * Flight Dynamics and Control Applications" 665 * Vertica, Vol 14, No. 2, pp.147-184, 1990 666 */ 667 668 class PetersHeRotor : virtual public Elem, public Rotor { 669 protected: 670 doublereal dVConst; 671 doublereal dVSine; 672 doublereal dVCosine; 673 674 doublereal dL11; 675 doublereal dL13; 676 doublereal dL22; 677 doublereal dL31; 678 doublereal dL33; 679 680 virtual void Init(const StructNode* pCraft, 681 const Mat3x3& rrot, 682 const StructNode* pRotor, 683 const StructNode* pGround, 684 ResForceSet **ppres, 685 const doublereal& dOR, 686 const doublereal& dR, 687 unsigned int iMaxIt, 688 const doublereal& dTol, 689 const doublereal& dE, 690 const doublereal& dCH, 691 const doublereal& dCFF, 692 const doublereal& dVConstTmp, 693 const doublereal& dVSineTmp, 694 const doublereal& dVCosineTmp, 695 flag fOut); 696 697 public: 698 PetersHeRotor(unsigned int uLabel, const DofOwner* pDO); 699 PetersHeRotor(unsigned int uLabel, 700 const DofOwner* pDO, 701 const StructNode* pCraft, 702 const Mat3x3& rrot, 703 const StructNode* pRotor, 704 const StructNode* pGround, 705 ResForceSet **ppres, 706 const doublereal& dOR, 707 const doublereal& dR, 708 unsigned int iMaxIt, 709 const doublereal& dTol, 710 const doublereal& dE, 711 const doublereal& dCH, 712 const doublereal& dCFF, 713 const doublereal& dVConstTmp, 714 const doublereal& dVSineTmp, 715 const doublereal& dVCosineTmp, 716 flag fOut); 717 virtual ~PetersHeRotor(void); 718 719 // ritorna il numero di Dofs per gli elementi che sono anche DofOwner iGetNumDof(void)720 virtual unsigned int iGetNumDof(void) const { 721 return 3; 722 }; 723 724 // output; si assume che ogni tipo di elemento sappia, 725 // attraverso l'OutputHandler, dove scrivere il proprio output 726 virtual void Output(OutputHandler& OH) const; 727 728 // Dimensioni del workspace WorkSpaceDim(integer * piNumRows,integer * piNumCols)729 virtual void WorkSpaceDim(integer* piNumRows, integer* piNumCols) const { 730 *piNumRows = 3; 731 *piNumCols = 3; 732 }; 733 734 // assemblaggio jacobiano 735 virtual VariableSubMatrixHandler& 736 AssJac(VariableSubMatrixHandler& WorkMat, 737 doublereal dCoef, 738 const VectorHandler& XCurr, 739 const VectorHandler& XPrimeCurr); 740 741 // assemblaggio residuo 742 virtual SubVectorHandler& 743 AssRes(SubVectorHandler& WorkVec, 744 doublereal dCoef, 745 const VectorHandler& XCurr, 746 const VectorHandler& XPrimeCurr); 747 748 // Contributo al file di Restart 749 virtual std::ostream& Restart(std::ostream& out) const; 750 751 // Relativo ai ...WithDofs 752 virtual void SetInitialValue(VectorHandler& X); 753 754 // Relativo ai ...WithDofs 755 virtual void 756 SetValue(DataManager *pDM, 757 VectorHandler& X, VectorHandler& XP, 758 SimulationEntity::Hints *ph = 0); 759 GetInducedVelocityType(void)760 InducedVelocity::Type GetInducedVelocityType(void) const { 761 return InducedVelocity::DYNAMICINFLOW; 762 }; 763 764 // Somma alla trazione il contributo di un elemento */ 765 virtual void 766 AddForce(const Elem *pEl, const StructNode *pNode, const Vec3& F, const Vec3& M, const Vec3& X); 767 768 // Restituisce ad un elemento la velocita' indotta 769 // in base alla posizione azimuthale 770 virtual Vec3 GetInducedVelocity(Elem::Type type, 771 unsigned uLabel, unsigned uPnt, const Vec3& X) const; 772 }; 773 774 /* PetersHeRotor - end */ 775 776 class DataManager; 777 class MBDynParser; 778 779 extern Elem* 780 ReadRotor(DataManager* pDM, 781 MBDynParser& HP, 782 const DofOwner* pDO, 783 unsigned int uLabel); 784 785 #endif /* ROTOR_H */ 786 787