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

#include <aeroelem.h>

Inheritance diagram for AerodynamicBeam2:
Collaboration diagram for AerodynamicBeam2:

Public Member Functions

 AerodynamicBeam2 (unsigned int uLabel, const DofOwner *pDO, const Beam2 *pB, InducedVelocity *pR, bool bPassive, const Vec3 &fTmp1, const Vec3 &fTmp2, const Mat3x3 &Ra1Tmp, const Mat3x3 &Ra2Tmp, const Shape *pC, const Shape *pF, const Shape *pV, const Shape *pT, const Shape *pTL, integer iN, AeroData *a, const DriveCaller *pDC, bool bUseJacobian, OrientationDescription ood, flag fOut)
 
virtual ~AerodynamicBeam2 (void)
 
virtual std::ostream & Restart (std::ostream &out) const
 
virtual VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, doublereal, const VectorHandler &, const VectorHandler &)
 
virtual SubVectorHandlerAssRes (SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual SubVectorHandlerInitialAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr)
 
virtual void Output (OutputHandler &OH) const
 
virtual AerodynamicElem::Type GetAerodynamicElemType (void) const
 
virtual void GetConnectedNodes (std::vector< const Node * > &connectedNodes) const
 
- Public Member Functions inherited from Elem
 Elem (unsigned int uL, flag fOut)
 
virtual ~Elem (void)
 
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 unsigned int iGetNumPrivData (void) const
 
virtual unsigned int iGetPrivDataIdx (const char *s) const
 
virtual doublereal dGetPrivData (unsigned int i) const
 
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 Output (OutputHandler &OH, const VectorHandler &X, const VectorHandler &XP) const
 
virtual flag fToBeOutput (void) const
 
virtual bool bToBeOutput (void) const
 
- Public Member Functions inherited from Aerodynamic2DElem< 2 >
 Aerodynamic2DElem (unsigned int uLabel, const DofOwner *pDO, InducedVelocity *pR, bool bPassive, const Shape *pC, const Shape *pF, const Shape *pV, const Shape *pT, const Shape *pTL, integer iN, AeroData *a, const DriveCaller *pDC, bool bUseJacobian, OrientationDescription ood, flag fOut)
 
virtual ~Aerodynamic2DElem (void)
 
virtual Elem::Type GetElemType (void) const
 
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 OutputPrepare (OutputHandler &OH)
 
virtual void SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *h=0)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP)
 
virtual void WorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
virtual unsigned int iGetInitialNumDof (void) const
 
virtual void InitialWorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
virtual VariableSubMatrixHandlerInitialAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &)
 
virtual const InducedVelocitypGetInducedVelocity (void) const
 
- Public Member Functions inherited from AerodynamicElem
 AerodynamicElem (unsigned int uL, const DofOwner *pDO, flag fOut)
 
virtual ~AerodynamicElem (void)
 
virtual bool NeedsAirProperties (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
 
virtual void SetInitialValue (VectorHandler &X)
 
- 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 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 DriveOwner
 DriveOwner (const DriveCaller *pDC=0)
 
 DriveOwner (const DriveOwner &drive)
 
virtual ~DriveOwner (void)
 
void Set (const DriveCaller *pDC)
 
DriveCallerpGetDriveCaller (void) const
 
doublereal dGet (const doublereal &dVar) const
 
doublereal dGet (void) const
 
bool bIsDifferentiable (void) const
 
doublereal dGetP (const doublereal &dVar) const
 
doublereal dGetP (void) const
 
- Public Member Functions inherited from AerodynamicOutput
 AerodynamicOutput (flag f, int iNP, OrientationDescription ood)
 
 ~AerodynamicOutput (void)
 
void SetOutputFlag (flag f, int iNP)
 
void ResetIterator (void)
 
void SetData (const Vec3 &v, const doublereal *pd, const Vec3 &X, const Mat3x3 &R, const Vec3 &V, const Vec3 &W, const Vec3 &F, const Vec3 &M)
 
AerodynamicOutput::eOutput GetOutput (void) const
 
bool IsOutput (void) const
 
bool IsSTD (void) const
 
bool IsPGAUSS (void) const
 
bool IsNODE (void) const
 

Protected Types

enum  { NODE1 = 0, NODE2, LASTNODE }
 
enum  { DELTAx1 = 0, DELTAg1, DELTAx2, DELTAg2 }
 

Protected Member Functions

void AssVec (SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
- Protected Member Functions inherited from Aerodynamic2DElem< 2 >
virtual void SetOutputFlag (flag f=flag(1))
 
void Output_int (OutputHandler &OH) const
 
void AddForce_int (const StructNode *pN, const Vec3 &F, const Vec3 &M, const Vec3 &X) const
 
void AddSectionalForce_int (unsigned uPnt, const Vec3 &F, const Vec3 &M, doublereal dW, const Vec3 &X, const Mat3x3 &R, const Vec3 &V, const Vec3 &W) const
 

Protected Attributes

const Beam2pBeam
 
const StructNodepNode [2]
 
const Vec3 f1
 
const Vec3 f2
 
const Mat3x3 Ra1
 
const Mat3x3 Ra2
 
const Vec3 Ra1_3
 
const Vec3 Ra2_3
 
Vec3 F [LASTNODE]
 
Vec3 M [LASTNODE]
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 
- Protected Attributes inherited from Aerodynamic2DElem< 2 >
AeroDataaerodata
 
InducedVelocitypIndVel
 
bool bPassiveInducedVelocity
 
const ShapeOwner Chord
 
const ShapeOwner ForcePoint
 
const ShapeOwner VelocityPoint
 
const ShapeOwner Twist
 
const ShapeOwner TipLoss
 
GaussDataIterator GDI
 
std::vector< outa_tOUTA
 
Mat3xN vx
 
Mat3xN wx
 
Mat3xN fq
 
Mat3xN cq
 
bool bJacobian
 
- Protected Attributes inherited from AirPropOwner
const AirPropertiespAirProperties
 
- Protected Attributes inherited from DriveOwner
DriveCallerpDriveCaller
 
- Protected Attributes inherited from AerodynamicOutput
flag m_eOutput
 
OrientationDescription od
 
std::vector< Aero_outputOutputData
 
std::vector< Aero_output >
::iterator 
OutputIter
 

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 AerodynamicOutput
enum  eOutput {
  AEROD_OUT_NONE = 0x0U, AEROD_OUT_STD = (ToBeOutput::OUTPUT_PRIVATE << 0), AEROD_OUT_PGAUSS = (ToBeOutput::OUTPUT_PRIVATE << 1), AEROD_OUT_NODE = (ToBeOutput::OUTPUT_PRIVATE << 2),
  AEROD_OUT_MASK = (AEROD_OUT_STD | AEROD_OUT_PGAUSS | AEROD_OUT_NODE)
}
 
enum  {
  OUTPUT_NONE = 0x0U, OUTPUT_GP_X = (ToBeOutput::OUTPUT_PRIVATE << 4), OUTPUT_GP_R = (ToBeOutput::OUTPUT_PRIVATE << 5), OUTPUT_GP_V = (ToBeOutput::OUTPUT_PRIVATE << 6),
  OUTPUT_GP_W = (ToBeOutput::OUTPUT_PRIVATE << 7), OUTPUT_GP_CONFIGURATION = (OUTPUT_GP_X | OUTPUT_GP_R | OUTPUT_GP_V | OUTPUT_GP_W), OUTPUT_GP_F = (ToBeOutput::OUTPUT_PRIVATE << 8), OUTPUT_GP_M = (ToBeOutput::OUTPUT_PRIVATE << 9),
  OUTPUT_GP_FORCES = (OUTPUT_GP_F | OUTPUT_GP_M), OUTPUT_DEFAULT = (OUTPUT_GP_F | OUTPUT_GP_M), OUTPUT_GP_ALL = (ToBeOutput::OUTPUT_PRIVATE_MASK & (~AEROD_OUT_MASK))
}
 

Detailed Description

Definition at line 447 of file aeroelem.h.

Member Enumeration Documentation

anonymous enum
protected
Enumerator
NODE1 
NODE2 
LASTNODE 

Definition at line 452 of file aeroelem.h.

anonymous enum
protected
Enumerator
DELTAx1 
DELTAg1 
DELTAx2 
DELTAg2 

Definition at line 453 of file aeroelem.h.

Constructor & Destructor Documentation

AerodynamicBeam2::AerodynamicBeam2 ( unsigned int  uLabel,
const DofOwner pDO,
const Beam2 pB,
InducedVelocity pR,
bool  bPassive,
const Vec3 fTmp1,
const Vec3 fTmp2,
const Mat3x3 Ra1Tmp,
const Mat3x3 Ra2Tmp,
const Shape pC,
const Shape pF,
const Shape pV,
const Shape pT,
const Shape pTL,
integer  iN,
AeroData a,
const DriveCaller pDC,
bool  bUseJacobian,
OrientationDescription  ood,
flag  fOut 
)

Definition at line 2445 of file aeroelem.cc.

References ASSERT, Elem::BEAM, DEBUGCOUTFNAME, Beam2::GetElemType(), NODE1, NODE2, pBeam, Beam2::pGetNode(), pNode, and Node::STRUCTURAL.

2466 : Elem(uLabel, fOut),
2467 Aerodynamic2DElem<2>(uLabel, pDO, pR, bPassive,
2468  pC, pF, pV, pT, pTL, iN, a, pDC, bUseJacobian, ood, fOut),
2469 pBeam(pB),
2470 f1(fTmp1),
2471 f2(fTmp2),
2472 Ra1(Ra1Tmp),
2473 Ra2(Ra2Tmp),
2474 Ra1_3(Ra1Tmp.GetVec(3)),
2475 Ra2_3(Ra2Tmp.GetVec(3))
2476 {
2477  DEBUGCOUTFNAME("AerodynamicBeam2::AerodynamicBeam2");
2478 
2479  ASSERT(pBeam != 0);
2481 
2482  pNode[NODE1] = pBeam->pGetNode(1);
2483  pNode[NODE2] = pBeam->pGetNode(2);
2484 
2485  ASSERT(pNode[NODE1] != 0);
2486  ASSERT(pNode[NODE1]->GetNodeType() == Node::STRUCTURAL);
2487  ASSERT(pNode[NODE2] != 0);
2488  ASSERT(pNode[NODE2]->GetNodeType() == Node::STRUCTURAL);
2489 }
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256
const StructNode * pNode[2]
Definition: aeroelem.h:456
Vec3 GetVec(unsigned short int i) const
Definition: matvec3.h:893
const Mat3x3 Ra1
Definition: aeroelem.h:460
virtual Elem::Type GetElemType(void) const
Definition: beam2.h:212
unsigned int uLabel
Definition: withlab.h:44
virtual const StructNode * pGetNode(unsigned int i) const
Definition: beam2.cc:852
#define ASSERT(expression)
Definition: colamd.c:977
const Vec3 Ra2_3
Definition: aeroelem.h:463
const Vec3 f2
Definition: aeroelem.h:459
static const doublereal a
Definition: hfluid_.h:289
const Vec3 f1
Definition: aeroelem.h:458
const Mat3x3 Ra2
Definition: aeroelem.h:461
const Beam2 * pBeam
Definition: aeroelem.h:455
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
const Vec3 Ra1_3
Definition: aeroelem.h:462

Here is the call graph for this function:

AerodynamicBeam2::~AerodynamicBeam2 ( void  )
virtual

Definition at line 2491 of file aeroelem.cc.

References DEBUGCOUTFNAME.

2492 {
2493  DEBUGCOUTFNAME("AerodynamicBeam2::~AerodynamicBeam2");
2494 }
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256

Member Function Documentation

VariableSubMatrixHandler & AerodynamicBeam2::AssJac ( VariableSubMatrixHandler WorkMat,
doublereal  dCoef,
const VectorHandler XCurr,
const VectorHandler XPrimeCurr 
)
virtual

Implements Elem.

Definition at line 2528 of file aeroelem.cc.

References Aerodynamic2DElem< 2 >::aerodata, AeroData::AssJac(), Aerodynamic2DElem< 2 >::bJacobian, c, Aerodynamic2DElem< 2 >::Chord, grad::cos(), Aerodynamic2DElem< 2 >::cq, Vec3::Cross(), DEBUGCOUT, DELTAg1, DELTAg2, DELTAx1, DELTAx2, ShapeOwner::dGet(), DriveOwner::dGet(), Rotor::dGetOmega(), PntWght::dGetPnt(), PntWght::dGetWght(), dN2, DxDcsi2N(), f1, f2, AirPropOwner::fGetAirVelocity(), GaussDataIterator::fGetNext(), Aerodynamic2DElem< 2 >::ForcePoint, Aerodynamic2DElem< 2 >::fq, Aerodynamic2DElem< 2 >::GDI, AirPropOwner::GetAirProps(), Elem::GetElemType(), GaussDataIterator::GetFirst(), AeroData::GetForcesJac(), InducedVelocity::GetInducedVelocity(), WithLabel::GetLabel(), Mat6x6::GetMat11(), Mat6x6::GetMat12(), Mat6x6::GetMat21(), Mat6x6::GetMat22(), Mat3xN::GetVec(), StructDispNode::GetXCurr(), DofOwnerOwner::iGetFirstIndex(), StructDispNode::iGetFirstMomentumIndex(), StructDispNode::iGetFirstPositionIndex(), AeroData::iGetNumDof(), LASTNODE, MatCross, MatCrossCross, ER_Rot::MatR, Mat3x3::MulTM(), MultRMRt(), Mat3x3::MulTV(), NODE1, NODE2, Aerodynamic2DElem< 2 >::OUTA, ER_Rot::Param, pdsf2, pdsi2, Aerodynamic2DElem< 2 >::pIndVel, pNode, FullSubMatrixHandler::PutColIndex(), Mat3xN::PutMat3x3(), FullSubMatrixHandler::PutRowIndex(), Vec3::PutTo(), Ra1, Ra2, Mat3x3::Reset(), AerodynamicOutput::ResetIterator(), FullSubMatrixHandler::ResizeReset(), AeroData::SetAirData(), VariableSubMatrixHandler::SetFull(), VariableSubMatrixHandler::SetNullMatrix(), AeroData::SetSectionData(), ShapeFunc2N(), grad::sin(), FullSubMatrixHandler::Sub(), Mat3x3::Transpose(), Aerodynamic2DElem< 2 >::Twist, Aerodynamic2DElem< 2 >::VelocityPoint, Aerodynamic2DElem< 2 >::vx, Elem::WorkSpaceDim(), Aerodynamic2DElem< 2 >::wx, and Zero3.

2532 {
2533  DEBUGCOUT("Entering AerodynamicBeam2::AssJac()" << std::endl);
2534 
2535  if (!bJacobian) {
2536  WorkMat.SetNullMatrix();
2537  return WorkMat;
2538  }
2539 
2540  FullSubMatrixHandler& WM = WorkMat.SetFull();
2541 
2542  /* Ridimensiona la sottomatrice in base alle esigenze */
2543  integer iNumRows = 0;
2544  integer iNumCols = 0;
2545  WorkSpaceDim(&iNumRows, &iNumCols);
2546  WM.ResizeReset(iNumRows, iNumCols);
2547 
2548  integer iNode1FirstIndex = pNode[NODE1]->iGetFirstMomentumIndex();
2549  integer iNode1FirstPosIndex = pNode[NODE1]->iGetFirstPositionIndex();
2550  integer iNode2FirstIndex = pNode[NODE2]->iGetFirstMomentumIndex();
2551  integer iNode2FirstPosIndex = pNode[NODE2]->iGetFirstPositionIndex();
2552 
2553  for (int iCnt = 1; iCnt <= 6; iCnt++) {
2554  WM.PutRowIndex(iCnt, iNode1FirstIndex + iCnt);
2555  WM.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
2556  WM.PutRowIndex(6 + iCnt, iNode2FirstIndex + iCnt);
2557  WM.PutColIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
2558  }
2559 
2560  doublereal dW[6];
2561 
2562  /* array di vettori per via del ciclo sui nodi ... */
2563  Vec3 Xn[2];
2564 
2565  /* Dati dei nodi */
2566  Xn[NODE1] = pNode[NODE1]->GetXCurr();
2567  const Mat3x3& Rn1(pNode[NODE1]->GetRCurr());
2568  const Vec3& Vn1(pNode[NODE1]->GetVCurr());
2569  const Vec3& Wn1(pNode[NODE1]->GetWCurr());
2570 
2571  Xn[NODE2] = pNode[NODE2]->GetXCurr();
2572  const Mat3x3& Rn2(pNode[NODE2]->GetRCurr());
2573  const Vec3& Vn2(pNode[NODE2]->GetVCurr());
2574  const Vec3& Wn2(pNode[NODE2]->GetWCurr());
2575 
2576  Vec3 f1Tmp(Rn1*f1);
2577  Vec3 f2Tmp(Rn2*f2);
2578 
2579  Vec3 X1Tmp(Xn[NODE1] + f1Tmp);
2580  Vec3 X2Tmp(Xn[NODE2] + f2Tmp);
2581 
2582  Vec3 V1Tmp(Vn1 + Wn1.Cross(f1Tmp));
2583  Vec3 V2Tmp(Vn2 + Wn2.Cross(f2Tmp));
2584 
2585  Vec3 Omega1Crossf1(Wn1.Cross(f1Tmp));
2586  Vec3 Omega2Crossf2(Wn2.Cross(f2Tmp));
2587 
2588  /*
2589  * Matrice di trasformazione dal sistema globale a quello aerodinamico
2590  */
2591  Mat3x3 RR1(Rn1*Ra1);
2592  Mat3x3 RR2(Rn2*Ra2);
2593 
2594  /*
2595  * half of relative rotation vector from node 1 to node 2
2596  */
2597  Vec3 overline_theta(Vec3(ER_Rot::Param, RR1.MulTM(RR2))/2.);
2598 
2599  /*
2600  * Se l'elemento e' collegato ad un rotore,
2601  * si fa dare la velocita' di rotazione
2602  */
2603  doublereal dOmega = 0.;
2604  if (pIndVel != 0) {
2605  Rotor *pRotor = dynamic_cast<Rotor *>(pIndVel);
2606  if (pRotor != 0) {
2607  dOmega = pRotor->dGetOmega();
2608  }
2609  }
2610 
2611  /*
2612  * Dati "permanenti" (uso solo la posizione del nodo 2 perche'
2613  * non dovrebbero cambiare "molto")
2614  */
2615  Vec3 Xmid = (Xn[NODE2] + Xn[NODE1])/2.;
2616  doublereal rho, c, p, T;
2617  GetAirProps(Xmid, rho, c, p, T); /* p, T no used yet */
2618  aerodata->SetAirData(rho, c);
2619 
2620  int iPnt = 0;
2621 
2622  ResetIterator();
2623 
2624  integer iNumDof = aerodata->iGetNumDof();
2625  integer iFirstEq = -1;
2626  integer iFirstSubEq = -1;
2627  if (iNumDof > 0) {
2628  iFirstEq = iGetFirstIndex();
2629  iFirstSubEq = 12;
2630 
2631  integer iOffset = iFirstEq - 12;
2632 
2633  for (int iCnt = 12 + 1; iCnt <= iNumRows; iCnt++) {
2634  WM.PutRowIndex(iCnt, iOffset + iCnt);
2635  WM.PutColIndex(iCnt, iOffset + iCnt);
2636  }
2637  }
2638 
2639  for (int iNode = 0; iNode < LASTNODE; iNode++) {
2640  doublereal dsi = pdsi2[iNode];
2641  doublereal dsf = pdsf2[iNode];
2642 
2643  doublereal dsm = (dsf + dsi)/2.;
2644  doublereal dsdCsi = (dsf - dsi)/2.;
2645 
2646  Mat3x3 WM_F[4], WM_M[4];
2647  WM_F[DELTAx1].Reset();
2648  WM_F[DELTAg1].Reset();
2649  WM_F[DELTAx2].Reset();
2650  WM_F[DELTAg2].Reset();
2651  WM_M[DELTAx1].Reset();
2652  WM_M[DELTAg1].Reset();
2653  WM_M[DELTAx2].Reset();
2654  WM_M[DELTAg2].Reset();
2655 
2656  /* Ciclo sui punti di Gauss */
2657  PntWght PW = GDI.GetFirst();
2658  do {
2659  doublereal dCsi = PW.dGetPnt();
2660  doublereal ds = dsm + dsdCsi*dCsi;
2661  doublereal dXds = DxDcsi2N(ds,
2662  Xn[NODE1], Xn[NODE2]);
2663 
2664  doublereal dN1 = ShapeFunc2N(ds, 1);
2665  doublereal dN2 = ShapeFunc2N(ds, 2);
2666 
2667  // note: identical to dN1 and dN2; see tecman.pdf
2668 #if 0
2669  doublereal dNN1 = (1. + dN1 - dN2)/2.;
2670  doublereal dNN2 = (1. + dN2 - dN1)/2.;
2671 #endif
2672 
2673  Vec3 Xr(X1Tmp*dN1 + X2Tmp*dN2);
2674  Vec3 Vr(V1Tmp*dN1 + V2Tmp*dN2);
2675  Vec3 Wr(Wn1*dN1 + Wn2*dN2);
2676  Vec3 thetar(overline_theta*dN2);
2677 
2678  /* Contributo di velocita' del vento */
2679  Vec3 VTmp(Zero3);
2680  if (fGetAirVelocity(VTmp, Xr)) {
2681  Vr -= VTmp;
2682  }
2683 
2684  /*
2685  * Se l'elemento e' collegato ad un rotore,
2686  * aggiunge alla velocita' la velocita' indotta
2687  */
2688  if (pIndVel != 0) {
2690  GetLabel(), iPnt, Xr);
2691  }
2692 
2693  /* Copia i dati nel vettore di lavoro dVAM */
2694  doublereal dTw = Twist.dGet(ds);
2695  /* Contributo dell'eventuale sup. mobile */
2696  dTw += dGet();
2697 
2698  aerodata->SetSectionData(dCsi,
2699  Chord.dGet(ds),
2700  ForcePoint.dGet(ds),
2701  VelocityPoint.dGet(ds),
2702  dTw,
2703  dOmega);
2704 
2705  /*
2706  * Lo svergolamento non viene piu' trattato in aerod2_;
2707  * quindi lo uso per correggere la matrice di rotazione
2708  * dal sistema aerodinamico a quello globale
2709  */
2710  Mat3x3 RRloc(RR1*Mat3x3(ER_Rot::MatR, thetar));
2711  if (dTw != 0.) {
2712  doublereal dCosT = cos(dTw);
2713  doublereal dSinT = sin(dTw);
2714  /* Assumo lo svergolamento positivo a cabrare */
2715  Mat3x3 RTw(dCosT, dSinT, 0.,
2716  -dSinT, dCosT, 0.,
2717  0., 0., 1.);
2718  /*
2719  * Allo stesso tempo interpola le g
2720  * e aggiunge lo svergolamento
2721  */
2722  RRloc = RRloc*RTw;
2723  }
2724 
2725  /*
2726  * Ruota velocita' e velocita' angolare nel sistema
2727  * aerodinamico e li copia nel vettore di lavoro dW
2728  */
2729  VTmp = RRloc.MulTV(Vr);
2730  VTmp.PutTo(&dW[0]);
2731 
2732  Vec3 WTmp = RRloc.MulTV(Wr);
2733  WTmp.PutTo(&dW[3]);
2734  /* Funzione di calcolo delle forze aerodinamiche */
2735  doublereal Fa0[6];
2736  Mat6x6 JFa;
2737 
2738  doublereal cc = dXds*dsdCsi*PW.dGetWght();
2739 
2740  Vec3 d(Xr - Xn[iNode]);
2741 
2742  Mat3x3 Bv1(MatCross, (Vr - Omega1Crossf1)*(dN1*dCoef));
2743  Mat3x3 Bv2(MatCross, (Vr - Omega2Crossf2)*(dN2*dCoef));
2744 
2745  Mat3x3 Bw1(MatCross, (Wr - Wn1)*(dN1*dCoef));
2746  Mat3x3 Bw2(MatCross, (Wr - Wn2)*(dN2*dCoef));
2747 
2748  if (iNumDof) {
2749  // prepare (v/dot{x} + dCoef*v/x) and so
2750  Mat3x3 RRlocT(RRloc.Transpose());
2751 
2752  vx.PutMat3x3(1, RRlocT*dN1);
2753  vx.PutMat3x3(4, RRloc.MulTM(Bv1 - Mat3x3(MatCross, f1Tmp*dN1)));
2754 
2755  vx.PutMat3x3(6 + 1, RRlocT*dN2);
2756  vx.PutMat3x3(6 + 4, RRloc.MulTM(Bv2 - Mat3x3(MatCross, f2Tmp*dN2)));
2757 
2758  wx.PutMat3x3(4, RRlocT + Bw1);
2759  wx.PutMat3x3(6 + 4, RRlocT + Bw2);
2760 
2761  // equations from iFirstEq on are dealt with by aerodata
2762  aerodata->AssJac(WM, dCoef, XCurr, XPrimeCurr,
2763  iFirstEq, iFirstSubEq,
2764  vx, wx, fq, cq, iPnt, dW, Fa0, JFa, OUTA[iPnt]);
2765 
2766  // deal with (f/dot{q} + dCoef*f/q) and so
2767  integer iOffset = 12 + iPnt*iNumDof;
2768  for (integer iCol = 1; iCol <= iNumDof; iCol++) {
2769  Vec3 fqTmp((RRloc*fq.GetVec(iCol))*cc);
2770  Vec3 cqTmp(d.Cross(fqTmp) + (RRloc*cq.GetVec(iCol))*cc);
2771 
2772  WM.Sub(6*iNode + 1, iOffset + iCol, fqTmp);
2773  WM.Sub(6*iNode + 4, iOffset + iCol, cqTmp);
2774  }
2775 
2776  // first equation
2777  iFirstEq += iNumDof;
2778  iFirstSubEq += iNumDof;
2779 
2780  } else {
2781  aerodata->GetForcesJac(iPnt, dW, Fa0, JFa, OUTA[iPnt]);
2782  }
2783 
2784  // rotate force, couple and Jacobian matrix in absolute frame
2785  Mat6x6 JFaR = MultRMRt(JFa, RRloc, cc);
2786 
2787  // force and moment about the node
2788  Vec3 fTmp(RRloc*(Vec3(&Fa0[0])*dCoef));
2789  Vec3 cTmp(RRloc*(Vec3(&Fa0[3])*dCoef) + d.Cross(fTmp));
2790 
2791  Mat3x3 WM_F2[4];
2792 
2793  // f <-> x
2794  WM_F2[DELTAx1] = JFaR.GetMat11()*dN1;
2795 
2796  WM_F2[DELTAx2] = JFaR.GetMat11()*dN2;
2797 
2798  doublereal delta;
2799 
2800  // c <-> x
2801  delta = (iNode == NODE1) ? 1. : 0.;
2802  WM_M[DELTAx1] += JFaR.GetMat21()*dN1 - Mat3x3(MatCross, fTmp*(dN1 - delta));
2803 
2804  delta = (iNode == NODE2) ? 1. : 0.;
2805  WM_M[DELTAx2] += JFaR.GetMat21()*dN2 - Mat3x3(MatCross, fTmp*(dN2 - delta));
2806 
2807  // f <-> g
2808  WM_F2[DELTAg1] = (JFaR.GetMat12() - JFaR.GetMat11()*Mat3x3(MatCross, f1Tmp))*dN1;
2809  WM_F2[DELTAg1] += JFaR.GetMat11()*Bv1 + JFaR.GetMat12()*Bw1;
2810  WM_F2[DELTAg1] -= Mat3x3(MatCross, fTmp*dN1);
2811 
2812  WM_F2[DELTAg2] = (JFaR.GetMat12() - JFaR.GetMat11()*Mat3x3(MatCross, f2Tmp))*dN2;
2813  WM_F2[DELTAg2] += JFaR.GetMat11()*Bv2 + JFaR.GetMat12()*Bw2;
2814  WM_F2[DELTAg2] -= Mat3x3(MatCross, fTmp*dN2);
2815 
2816  // c <-> g
2817  WM_M[DELTAg1] += (JFaR.GetMat22() - JFaR.GetMat21()*Mat3x3(MatCross, f1Tmp))*dN1;
2818  WM_M[DELTAg1] += JFaR.GetMat21()*Bv1 + JFaR.GetMat22()*Bw1;
2819  WM_M[DELTAg1] -= Mat3x3(MatCross, cTmp*dN1);
2820  WM_M[DELTAg1] += Mat3x3(MatCrossCross, fTmp, f1Tmp*dN1);
2821 
2822  WM_M[DELTAg2] += (JFaR.GetMat22() - JFaR.GetMat21()*Mat3x3(MatCross, f2Tmp))*dN2;
2823  WM_M[DELTAg2] += JFaR.GetMat21()*Bv2 + JFaR.GetMat22()*Bw2;
2824  WM_M[DELTAg2] -= Mat3x3(MatCross, cTmp*dN2);
2825  WM_M[DELTAg2] += Mat3x3(MatCrossCross, fTmp, f2Tmp*dN2);
2826 
2827  for (int iCnt = 0; iCnt < 2*LASTNODE; iCnt++) {
2828  WM_F[iCnt] += WM_F2[iCnt];
2829  WM_M[iCnt] += d.Cross(WM_F2[iCnt]);
2830  }
2831 
2832  iPnt++;
2833 
2834  } while (GDI.fGetNext(PW));
2835 
2836  for (int iCnt = 0; iCnt < 2*LASTNODE; iCnt++) {
2837  WM.Sub(6*iNode + 1, 3*iCnt + 1, WM_F[iCnt]);
2838  WM.Sub(6*iNode + 4, 3*iCnt + 1, WM_M[iCnt]);
2839  }
2840  }
2841 
2842  return WorkMat;
2843 }
void ResetIterator(void)
Definition: aeroelem.cc:77
Mat3x3 MultRMRt(const Mat3x3 &m, const Mat3x3 &R)
Definition: matvec3.cc:1162
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
static const doublereal pdsi2[]
Definition: aeroelem.cc:2523
virtual void SetSectionData(const doublereal &abscissa, const doublereal &chord, const doublereal &forcepoint, const doublereal &velocitypoint, const doublereal &twist, const doublereal &omega=0.)
Definition: aerodata.cc:237
const Vec3 Zero3(0., 0., 0.)
virtual bool GetAirProps(const Vec3 &X, doublereal &rho, doublereal &c, doublereal &p, doublereal &T) const
Definition: aerodyn.cc:760
Mat3x3 GetMat12(void)
Definition: matvec6.h:328
virtual int GetForcesJac(int i, const doublereal *W, doublereal *TNG, Mat6x6 &J, outa_t &OUTA)
Definition: aerodata.cc:384
Definition: matvec3.h:98
GradientExpression< UnaryExpr< FuncSin, Expr > > sin(const GradientExpression< Expr > &u)
Definition: gradient.h:2977
MatR_Manip MatR
Definition: Rot.cc:292
const MatCross_Manip MatCross
Definition: matvec3.cc:639
FullSubMatrixHandler & SetFull(void)
Definition: submat.h:1168
doublereal DxDcsi2N(doublereal d, const Vec3 &X1, const Vec3 &X2)
Definition: shapefnc.cc:113
const StructNode * pNode[2]
Definition: aeroelem.h:456
flag fGetNext(doublereal &d, integer i=0) const
Definition: gauss.cc:205
Mat3x3 GetMat21(void)
Definition: matvec6.h:324
virtual unsigned int iGetNumDof(void) const
Definition: aerodata.cc:362
PntWght GetFirst(void) const
Definition: gauss.cc:198
doublereal dGet(void) const
Definition: drive.cc:671
std::vector< outa_t > OUTA
Definition: aeroelem.h:164
const ShapeOwner Chord
Definition: aeroelem.h:157
InducedVelocity * pIndVel
Definition: aeroelem.h:154
void PutMat3x3(integer iCol, const Mat3x3 &m)
Definition: matvec3n.cc:628
Param_Manip Param
Definition: Rot.cc:291
Mat3x3 GetMat22(void)
Definition: matvec6.h:332
virtual Elem::Type GetElemType(void) const =0
const ShapeOwner Twist
Definition: aeroelem.h:160
AeroData * aerodata
Definition: aeroelem.h:153
virtual void SetAirData(const doublereal &rho, const doublereal &c)
Definition: aerodata.cc:214
Mat3x3 GetMat11(void)
Definition: matvec6.h:320
Vec3 GetVec(integer iCol) const
Definition: matvec3n.cc:553
doublereal ShapeFunc2N(doublereal d, integer iNode, enum Order Ord)
Definition: shapefnc.cc:66
const Mat3x3 Ra1
Definition: aeroelem.h:460
void Reset(void)
Definition: matvec3.cc:613
doublereal dGetWght(void) const
Definition: gauss.h:56
const doublereal dN2[2]
Definition: shapefnc.cc:52
const ShapeOwner ForcePoint
Definition: aeroelem.h:158
void SetNullMatrix(void)
Definition: submat.h:1159
void PutTo(doublereal *pd) const
Definition: matvec3.h:339
virtual Vec3 GetInducedVelocity(Elem::Type type, unsigned uLabel, unsigned uPnt, const Vec3 &X) const =0
static const doublereal pdsf2[]
Definition: aeroelem.cc:2524
#define DEBUGCOUT(msg)
Definition: myassert.h:232
GaussDataIterator GDI
Definition: aeroelem.h:163
virtual integer iGetFirstMomentumIndex(void) const =0
virtual doublereal dGet(doublereal d) const
Definition: shape.cc:60
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
virtual doublereal dGetOmega(void) const
Definition: rotor.h:151
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual void ResizeReset(integer, integer)
Definition: submat.cc:182
const ShapeOwner VelocityPoint
Definition: aeroelem.h:159
static std::stack< cleanup * > c
Definition: cleanup.cc:59
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640
doublereal dGetPnt(void) const
Definition: gauss.h:55
void PutRowIndex(integer iSubRow, integer iRow)
Definition: submat.h:311
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const =0
const Vec3 f2
Definition: aeroelem.h:459
void Sub(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:215
virtual flag fGetAirVelocity(Vec3 &Velocity, const Vec3 &X) const
Definition: aerodyn.cc:725
GradientExpression< UnaryExpr< FuncCos, Expr > > cos(const GradientExpression< Expr > &u)
Definition: gradient.h:2978
const Vec3 f1
Definition: aeroelem.h:458
const Mat3x3 Ra2
Definition: aeroelem.h:461
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
virtual void AssJac(FullSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr, integer iFirstIndex, integer iFirstSubIndex, const Mat3xN &vx, const Mat3xN &wx, Mat3xN &fq, Mat3xN &cq, int i, const doublereal *W, doublereal *TNG, Mat6x6 &J, outa_t &OUTA)
Definition: aerodata.cc:403
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
unsigned int GetLabel(void) const
Definition: withlab.cc:62
Definition: rotor.h:43
Definition: gauss.h:50

Here is the call graph for this function:

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

Implements Elem.

Definition at line 2847 of file aeroelem.cc.

References AssVec(), DEBUGCOUTFNAME, StructDispNode::iGetFirstMomentumIndex(), NODE1, NODE2, pNode, SubVectorHandler::PutRowIndex(), VectorHandler::ResizeReset(), and Elem::WorkSpaceDim().

2852 {
2853  DEBUGCOUTFNAME("AerodynamicBeam2::AssRes");
2854 
2855  integer iNumRows;
2856  integer iNumCols;
2857  WorkSpaceDim(&iNumRows, &iNumCols);
2858  WorkVec.ResizeReset(iNumRows);
2859 
2860  integer iNode1FirstIndex = pNode[NODE1]->iGetFirstMomentumIndex();
2861  integer iNode2FirstIndex = pNode[NODE2]->iGetFirstMomentumIndex();
2862  for (int iCnt = 1; iCnt <= 6; iCnt++) {
2863  WorkVec.PutRowIndex(iCnt, iNode1FirstIndex + iCnt);
2864  WorkVec.PutRowIndex(6 + iCnt, iNode2FirstIndex + iCnt);
2865  }
2866 
2867  AssVec(WorkVec, dCoef, XCurr, XPrimeCurr);
2868 
2869  return WorkVec;
2870 }
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256
virtual void ResizeReset(integer)
Definition: vh.cc:55
const StructNode * pNode[2]
Definition: aeroelem.h:456
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
virtual integer iGetFirstMomentumIndex(void) const =0
void AssVec(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: aeroelem.cc:2894
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const =0
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

void AerodynamicBeam2::AssVec ( SubVectorHandler WorkVec,
doublereal  dCoef,
const VectorHandler XCurr,
const VectorHandler XPrimeCurr 
)
protected

Definition at line 2894 of file aeroelem.cc.

References VectorHandler::Add(), Aerodynamic2DElem< 2 >::AddForce_int(), Aerodynamic2DElem< 2 >::AddSectionalForce_int(), Aerodynamic2DElem< 2 >::aerodata, AeroData::AssRes(), ToBeOutput::bToBeOutput(), c, Aerodynamic2DElem< 2 >::Chord, grad::cos(), Vec3::Cross(), grad::Cross(), DEBUGCOUTFNAME, ShapeOwner::dGet(), DriveOwner::dGet(), Rotor::dGetOmega(), PntWght::dGetPnt(), PntWght::dGetWght(), dN2, DxDcsi2N(), F, f1, f2, AirPropOwner::fGetAirVelocity(), GaussDataIterator::fGetNext(), Aerodynamic2DElem< 2 >::ForcePoint, Aerodynamic2DElem< 2 >::GDI, AirPropOwner::GetAirProps(), Elem::GetElemType(), GaussDataIterator::GetFirst(), AeroData::GetForces(), InducedVelocity::GetInducedVelocity(), WithLabel::GetLabel(), StructDispNode::GetXCurr(), DofOwnerOwner::iGetFirstIndex(), AeroData::iGetNumDof(), VectorHandler::iGetSize(), LASTNODE, M, ER_Rot::MatR, Mat3x3::MulTV(), NODE1, NODE2, Aerodynamic2DElem< 2 >::OUTA, ER_Rot::Param, pdsf2, pdsi2, Aerodynamic2DElem< 2 >::pIndVel, pNode, SubVectorHandler::PutRowIndex(), Vec3::PutTo(), Ra1, Ra2, Vec3::Reset(), AerodynamicOutput::ResetIterator(), AeroData::SetAirData(), AerodynamicOutput::SetData(), AeroData::SetSectionData(), ShapeFunc2N(), grad::sin(), Aerodynamic2DElem< 2 >::TipLoss, Aerodynamic2DElem< 2 >::Twist, Aerodynamic2DElem< 2 >::VelocityPoint, and Zero3.

Referenced by AssRes(), and InitialAssRes().

2898 {
2899  DEBUGCOUTFNAME("AerodynamicBeam2::AssVec");
2900 
2901  doublereal dTng[6];
2902  doublereal dW[6];
2903 
2904  Vec3 Xn[LASTNODE];
2905 
2906  /* Dati dei nodi */
2907  Xn[NODE1] = pNode[NODE1]->GetXCurr();
2908  const Mat3x3& Rn1(pNode[NODE1]->GetRCurr());
2909  const Vec3& Vn1(pNode[NODE1]->GetVCurr());
2910  const Vec3& Wn1(pNode[NODE1]->GetWCurr());
2911 
2912  Xn[NODE2] = pNode[NODE2]->GetXCurr();
2913  const Mat3x3& Rn2(pNode[NODE2]->GetRCurr());
2914  const Vec3& Vn2(pNode[NODE2]->GetVCurr());
2915  const Vec3& Wn2(pNode[NODE2]->GetWCurr());
2916 
2917  Vec3 f1Tmp(Rn1*f1);
2918  Vec3 f2Tmp(Rn2*f2);
2919 
2920  Vec3 X1Tmp(Xn[NODE1] + f1Tmp);
2921  Vec3 X2Tmp(Xn[NODE2] + f2Tmp);
2922 
2923  Vec3 V1Tmp(Vn1 + Wn1.Cross(f1Tmp));
2924  Vec3 V2Tmp(Vn2 + Wn2.Cross(f2Tmp));
2925 
2926  /*
2927  * Matrice di trasformazione dal sistema globale a quello aerodinamico
2928  */
2929  Mat3x3 RR1(Rn1*Ra1);
2930  Mat3x3 RR2(Rn2*Ra2);
2931 
2932  /*
2933  * half of relative rotation vector from node 1 to node 2
2934  */
2935  Vec3 overline_theta(Vec3(ER_Rot::Param, RR1.MulTM(RR2))/2.);
2936 
2937  /*
2938  * Se l'elemento e' collegato ad un rotore,
2939  * si fa dare la velocita' di rotazione
2940  */
2941  doublereal dOmega = 0.;
2942  if (pIndVel != 0) {
2943  Rotor *pRotor = dynamic_cast<Rotor *>(pIndVel);
2944  if (pRotor != 0) {
2945  dOmega = pRotor->dGetOmega();
2946  }
2947  }
2948 
2949  /*
2950  * Dati "permanenti" (uso solo la posizione di mezzo perche'
2951  * non dovrebbero cambiare "molto")
2952  */
2953  Vec3 Xmid = (Xn[NODE2] + Xn[NODE1])/2.;
2954  doublereal rho, c, p, T;
2955  GetAirProps(Xmid, rho, c, p, T); /* p, T no used yet */
2956  aerodata->SetAirData(rho, c);
2957 
2958  int iPnt = 0;
2959 
2960  ResetIterator();
2961 
2962  integer iNumDof = aerodata->iGetNumDof();
2963  integer iFirstEq = -1;
2964  integer iFirstSubEq = -1;
2965  if (iNumDof > 0) {
2966  iFirstEq = iGetFirstIndex();
2967  iFirstSubEq = 12;
2968 
2969  integer iOffset = iFirstEq - 12;
2970  integer iNumRows = WorkVec.iGetSize();
2971  for (int iCnt = 12 + 1; iCnt <= iNumRows; iCnt++) {
2972  WorkVec.PutRowIndex(iCnt, iOffset + iCnt);
2973  }
2974  }
2975 
2976  for (int iNode = 0; iNode < LASTNODE; iNode++) {
2977 
2978  /* Resetta i dati */
2979  F[iNode].Reset();
2980  M[iNode].Reset();
2981 
2982  doublereal dsi = pdsi2[iNode];
2983  doublereal dsf = pdsf2[iNode];
2984 
2985  doublereal dsm = (dsf + dsi)/2.;
2986  doublereal dsdCsi = (dsf - dsi)/2.;
2987 
2988  /* Ciclo sui punti di Gauss */
2989  PntWght PW = GDI.GetFirst();
2990  do {
2991  doublereal dCsi = PW.dGetPnt();
2992  doublereal ds = dsm + dsdCsi*dCsi;
2993  doublereal dXds = DxDcsi2N(ds, Xn[NODE1], Xn[NODE2]);
2994 
2995  doublereal dN1 = ShapeFunc2N(ds, 1);
2996  doublereal dN2 = ShapeFunc2N(ds, 2);
2997 
2998  Vec3 Xr(X1Tmp*dN1 + X2Tmp*dN2);
2999  Vec3 Vr(V1Tmp*dN1 + V2Tmp*dN2);
3000  Vec3 Wr(Wn1*dN1 + Wn2*dN2);
3001  Vec3 thetar(overline_theta*((1. + dN2 - dN1)/2.));
3002 
3003  /* Contributo di velocita' del vento */
3004  Vec3 VTmp(Zero3);
3005  if (fGetAirVelocity(VTmp, Xr)) {
3006  Vr -= VTmp;
3007  }
3008 
3009  /*
3010  * Se l'elemento e' collegato ad un rotore,
3011  * aggiunge alla velocita' la velocita' indotta
3012  */
3013  if (pIndVel != 0) {
3015  GetLabel(), iPnt, Xr);
3016  }
3017 
3018  /* Copia i dati nel vettore di lavoro dVAM */
3019  doublereal dTw = Twist.dGet(ds);
3020  dTw += dGet(); /* Contributo dell'eventuale sup. mobile */
3021  aerodata->SetSectionData(dCsi,
3022  Chord.dGet(ds),
3023  ForcePoint.dGet(ds),
3024  VelocityPoint.dGet(ds),
3025  dTw,
3026  dOmega);
3027 
3028  /*
3029  * Lo svergolamento non viene piu' trattato in aerod2_; quindi
3030  * lo uso per correggere la matrice di rotazione
3031  * dal sistema aerodinamico a quello globale
3032  */
3033  Mat3x3 RRloc(RR1*Mat3x3(ER_Rot::MatR, thetar));
3034  if (dTw != 0.) {
3035  doublereal dCosT = cos(dTw);
3036  doublereal dSinT = sin(dTw);
3037  /* Assumo lo svergolamento positivo a cabrare */
3038  Mat3x3 RTw( dCosT, dSinT, 0.,
3039  -dSinT, dCosT, 0.,
3040  0., 0., 1.);
3041  /*
3042  * Allo stesso tempo interpola le g e aggiunge lo svergolamento
3043  */
3044  RRloc = RRloc*RTw;
3045  }
3046 
3047  /*
3048  * Ruota velocita' e velocita' angolare nel sistema
3049  * aerodinamico e li copia nel vettore di lavoro dW
3050  */
3051  VTmp = RRloc.MulTV(Vr);
3052  VTmp.PutTo(dW);
3053 
3054  Vec3 WTmp = RRloc.MulTV(Wr);
3055  WTmp.PutTo(&dW[3]);
3056 
3057  /* Funzione di calcolo delle forze aerodinamiche */
3058  if (iNumDof) {
3059  aerodata->AssRes(WorkVec, dCoef, XCurr, XPrimeCurr,
3060  iFirstEq, iFirstSubEq, iPnt, dW, dTng, OUTA[iPnt]);
3061 
3062  // first equation
3063  iFirstEq += iNumDof;
3064  iFirstSubEq += iNumDof;
3065 
3066  } else {
3067  aerodata->GetForces(iPnt, dW, dTng, OUTA[iPnt]);
3068  }
3069 
3070  /* Dimensionalizza le forze */
3071  doublereal dWght = dXds*dsdCsi*PW.dGetWght();
3072  dTng[1] *= TipLoss.dGet(dCsi);
3073  Vec3 FTmp(RRloc*(Vec3(&dTng[0])));
3074  Vec3 MTmp(RRloc*(Vec3(&dTng[3])));
3075 
3076  // Se e' definito il rotore, aggiungere il contributo alla trazione
3077  AddSectionalForce_int(iPnt, FTmp, MTmp, dWght, Xr, RRloc, Vr, Wr);
3078 
3079  FTmp *= dWght;
3080  MTmp *= dWght;
3081  F[iNode] += FTmp;
3082  M[iNode] += MTmp;
3083  M[iNode] += (Xr - Xn[iNode]).Cross(FTmp);
3084 
3085  // specific for Gauss points force output
3086  if (bToBeOutput()) {
3087  SetData(VTmp, dTng, Xr, RRloc, Vr, Wr, FTmp, MTmp);
3088  }
3089 
3090  iPnt++;
3091 
3092  } while (GDI.fGetNext(PW));
3093 
3094  // Se e' definito il rotore, aggiungere il contributo alla trazione
3095  AddForce_int(pNode[iNode], F[iNode], M[iNode], Xn[iNode]);
3096 
3097  /* Somma il termine al residuo */
3098  WorkVec.Add(6*iNode + 1, F[iNode]);
3099  WorkVec.Add(6*iNode + 4, M[iNode]);
3100  }
3101 }
void ResetIterator(void)
Definition: aeroelem.cc:77
static const doublereal pdsi2[]
Definition: aeroelem.cc:2523
virtual void SetSectionData(const doublereal &abscissa, const doublereal &chord, const doublereal &forcepoint, const doublereal &velocitypoint, const doublereal &twist, const doublereal &omega=0.)
Definition: aerodata.cc:237
const Vec3 Zero3(0., 0., 0.)
virtual bool GetAirProps(const Vec3 &X, doublereal &rho, doublereal &c, doublereal &p, doublereal &T) const
Definition: aerodyn.cc:760
virtual bool bToBeOutput(void) const
Definition: output.cc:890
Definition: matvec3.h:98
GradientExpression< UnaryExpr< FuncSin, Expr > > sin(const GradientExpression< Expr > &u)
Definition: gradient.h:2977
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256
MatR_Manip MatR
Definition: Rot.cc:292
doublereal DxDcsi2N(doublereal d, const Vec3 &X1, const Vec3 &X2)
Definition: shapefnc.cc:113
const StructNode * pNode[2]
Definition: aeroelem.h:456
flag fGetNext(doublereal &d, integer i=0) const
Definition: gauss.cc:205
virtual unsigned int iGetNumDof(void) const
Definition: aerodata.cc:362
PntWght GetFirst(void) const
Definition: gauss.cc:198
doublereal dGet(void) const
Definition: drive.cc:671
Vec3 F[LASTNODE]
Definition: aeroelem.h:469
std::vector< outa_t > OUTA
Definition: aeroelem.h:164
virtual int GetForces(int i, const doublereal *W, doublereal *TNG, outa_t &OUTA)
Definition: aerodata.cc:377
const ShapeOwner Chord
Definition: aeroelem.h:157
InducedVelocity * pIndVel
Definition: aeroelem.h:154
Param_Manip Param
Definition: Rot.cc:291
virtual Elem::Type GetElemType(void) const =0
virtual integer iGetSize(void) const =0
const ShapeOwner Twist
Definition: aeroelem.h:160
AeroData * aerodata
Definition: aeroelem.h:153
const ShapeOwner TipLoss
Definition: aeroelem.h:161
virtual void SetAirData(const doublereal &rho, const doublereal &c)
Definition: aerodata.cc:214
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
doublereal ShapeFunc2N(doublereal d, integer iNode, enum Order Ord)
Definition: shapefnc.cc:66
const Mat3x3 Ra1
Definition: aeroelem.h:460
doublereal dGetWght(void) const
Definition: gauss.h:56
const doublereal dN2[2]
Definition: shapefnc.cc:52
const ShapeOwner ForcePoint
Definition: aeroelem.h:158
void Reset(void)
Definition: matvec3.cc:109
void PutTo(doublereal *pd) const
Definition: matvec3.h:339
virtual Vec3 GetInducedVelocity(Elem::Type type, unsigned uLabel, unsigned uPnt, const Vec3 &X) const =0
static const doublereal pdsf2[]
Definition: aeroelem.cc:2524
GaussDataIterator GDI
Definition: aeroelem.h:163
virtual doublereal dGet(doublereal d) const
Definition: shape.cc:60
virtual doublereal dGetOmega(void) const
Definition: rotor.h:151
Vec3 M[LASTNODE]
Definition: aeroelem.h:470
VectorExpression< VectorCrossExpr< VectorLhsExpr, VectorRhsExpr >, 3 > Cross(const VectorExpression< VectorLhsExpr, 3 > &u, const VectorExpression< VectorRhsExpr, 3 > &v)
Definition: matvec.h:3248
void AddSectionalForce_int(unsigned uPnt, const Vec3 &F, const Vec3 &M, doublereal dW, const Vec3 &X, const Mat3x3 &R, const Vec3 &V, const Vec3 &W) const
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
const ShapeOwner VelocityPoint
Definition: aeroelem.h:159
static std::stack< cleanup * > c
Definition: cleanup.cc:59
void SetData(const Vec3 &v, const doublereal *pd, const Vec3 &X, const Mat3x3 &R, const Vec3 &V, const Vec3 &W, const Vec3 &F, const Vec3 &M)
Definition: aeroelem.cc:92
doublereal dGetPnt(void) const
Definition: gauss.h:55
const Vec3 f2
Definition: aeroelem.h:459
virtual flag fGetAirVelocity(Vec3 &Velocity, const Vec3 &X) const
Definition: aerodyn.cc:725
GradientExpression< UnaryExpr< FuncCos, Expr > > cos(const GradientExpression< Expr > &u)
Definition: gradient.h:2978
const Vec3 f1
Definition: aeroelem.h:458
const Mat3x3 Ra2
Definition: aeroelem.h:461
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
double doublereal
Definition: colamd.c:52
void AddForce_int(const StructNode *pN, const Vec3 &F, const Vec3 &M, const Vec3 &X) const
long int integer
Definition: colamd.c:51
unsigned int GetLabel(void) const
Definition: withlab.cc:62
virtual void AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr, integer iFirstIndex, integer iFirstSubIndex, int i, const doublereal *W, doublereal *TNG, outa_t &OUTA)
Definition: aerodata.cc:391
Definition: rotor.h:43
Definition: gauss.h:50

Here is the call graph for this function:

virtual AerodynamicElem::Type AerodynamicBeam2::GetAerodynamicElemType ( void  ) const
inlinevirtual

Implements AerodynamicElem.

Definition at line 525 of file aeroelem.h.

References AerodynamicElem::AERODYNAMICBEAM.

virtual void AerodynamicBeam2::GetConnectedNodes ( std::vector< const Node * > &  connectedNodes) const
inlinevirtual

Reimplemented from Elem.

Definition at line 535 of file aeroelem.h.

References NODE1, and NODE2.

535  {
536  connectedNodes.resize(2);
537  connectedNodes[0] = pNode[NODE1];
538  connectedNodes[1] = pNode[NODE2];
539  };
const StructNode * pNode[2]
Definition: aeroelem.h:456
SubVectorHandler & AerodynamicBeam2::InitialAssRes ( SubVectorHandler WorkVec,
const VectorHandler XCurr 
)
virtual

Implements SubjectToInitialAssembly.

Definition at line 2874 of file aeroelem.cc.

References AssVec(), DEBUGCOUTFNAME, StructDispNode::iGetFirstPositionIndex(), NODE1, NODE2, pNode, SubVectorHandler::PutRowIndex(), and VectorHandler::ResizeReset().

2876 {
2877  DEBUGCOUTFNAME("AerodynamicBeam2::InitialAssRes");
2878  WorkVec.ResizeReset(12);
2879 
2880  integer iNode1FirstIndex = pNode[NODE1]->iGetFirstPositionIndex();
2881  integer iNode2FirstIndex = pNode[NODE2]->iGetFirstPositionIndex();
2882  for (int iCnt = 1; iCnt <= 6; iCnt++) {
2883  WorkVec.PutRowIndex(iCnt, iNode1FirstIndex + iCnt);
2884  WorkVec.PutRowIndex(6 + iCnt, iNode2FirstIndex + iCnt);
2885  }
2886 
2887  AssVec(WorkVec, 1., XCurr, XCurr);
2888 
2889  return WorkVec;
2890 }
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256
virtual void ResizeReset(integer)
Definition: vh.cc:55
const StructNode * pNode[2]
Definition: aeroelem.h:456
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
void AssVec(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: aeroelem.cc:2894
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

void AerodynamicBeam2::Output ( OutputHandler OH) const
virtual

Reimplemented from ToBeOutput.

Definition at line 3108 of file aeroelem.cc.

References AerodynamicOutput::AEROD_OUT_NODE, AerodynamicOutput::AEROD_OUT_PGAUSS, AerodynamicOutput::AEROD_OUT_STD, OutputHandler::AERODYNAMIC, OutputHandler::Aerodynamic(), ASSERT, ToBeOutput::bToBeOutput(), DEBUGCOUTFNAME, F, Aerodynamic2DElem< 2 >::GDI, WithLabel::GetLabel(), AerodynamicOutput::GetOutput(), NumIntData::iGetNum(), M, NODE1, NODE2, Aerodynamic2DElem< 2 >::OUTA, Aerodynamic2DElem< iNN >::Output_int(), AerodynamicOutput::OutputData, pBeam, OutputHandler::UseText(), and Vec3::Write().

3109 {
3110  DEBUGCOUTFNAME("AerodynamicBeam2::Output");
3111 
3112  if (bToBeOutput()) {
3114 
3116  std::ostream& out = OH.Aerodynamic() << std::setw(8) << GetLabel();
3117 
3118  switch (GetOutput()) {
3119 
3120  case AEROD_OUT_NODE:
3121  out << " " << std::setw(8) << pBeam->GetLabel()
3122  << " ", F[NODE1].Write(out, " ") << " ", M[NODE1].Write(out, " ")
3123  << " ", F[NODE2].Write(out, " ") << " ", M[NODE2].Write(out, " ");
3124  break;
3125 
3126  case AEROD_OUT_PGAUSS:
3127  ASSERT(!OutputData.empty());
3128 
3129  for (std::vector<Aero_output>::const_iterator i = OutputData.begin();
3130  i != OutputData.end(); ++i)
3131  {
3132  out << " " << i->alpha
3133  << " " << i->f;
3134  }
3135  break;
3136 
3137  case AEROD_OUT_STD:
3138  for (int i = 0; i < 2*GDI.iGetNum(); i++) {
3139  out
3140  << " " << OUTA[i].alpha
3141  << " " << OUTA[i].gamma
3142  << " " << OUTA[i].mach
3143  << " " << OUTA[i].cl
3144  << " " << OUTA[i].cd
3145  << " " << OUTA[i].cm
3146  << " " << OUTA[i].alf1
3147  << " " << OUTA[i].alf2;
3148  }
3149  break;
3150 
3151  default:
3152  ASSERT(0);
3153  break;
3154  }
3155 
3156  out << std::endl;
3157  }
3158  }
3159 }
std::ostream & Write(std::ostream &out, const char *sFill=" ") const
Definition: matvec3.cc:738
virtual bool bToBeOutput(void) const
Definition: output.cc:890
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256
AerodynamicOutput::eOutput GetOutput(void) const
Definition: aeroelem.cc:125
Vec3 F[LASTNODE]
Definition: aeroelem.h:469
std::vector< outa_t > OUTA
Definition: aeroelem.h:164
GaussDataIterator GDI
Definition: aeroelem.h:163
#define ASSERT(expression)
Definition: colamd.c:977
Vec3 M[LASTNODE]
Definition: aeroelem.h:470
void Output_int(OutputHandler &OH) const
Definition: aeroelem.cc:544
std::vector< Aero_output > OutputData
Definition: aeroelem.h:107
virtual integer iGetNum(void) const
Definition: gauss.h:96
const Beam2 * pBeam
Definition: aeroelem.h:455
unsigned int GetLabel(void) const
Definition: withlab.cc:62
bool UseText(int out) const
Definition: output.cc:446
std::ostream & Aerodynamic(void) const
Definition: output.h:485

Here is the call graph for this function:

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

Implements Elem.

Definition at line 2498 of file aeroelem.cc.

References Aerodynamic2DElem< 2 >::aerodata, Aerodynamic2DElem< 2 >::Chord, DEBUGCOUTFNAME, f1, f2, Aerodynamic2DElem< 2 >::ForcePoint, Aerodynamic2DElem< 2 >::GDI, WithLabel::GetLabel(), Mat3x3::GetVec(), NumIntData::iGetNum(), pBeam, DriveOwner::pGetDriveCaller(), ShapeOwner::pGetShape(), Aerodynamic2DElem< 2 >::pIndVel, Ra1, Ra2, Shape::Restart(), AeroData::Restart(), DriveCaller::Restart(), Aerodynamic2DElem< 2 >::Twist, Aerodynamic2DElem< 2 >::VelocityPoint, Write(), and Vec3::Write().

2499 {
2500  DEBUGCOUTFNAME("AerodynamicBeam2::Restart");
2501  out << " aerodynamic beam2: " << GetLabel()
2502  << ", " << pBeam->GetLabel();
2503  if (pIndVel != 0) {
2504  out << ", rotor, " << pIndVel->GetLabel();
2505  }
2506  out << ", reference, node, ", f1.Write(out, ", ")
2507  << ", reference, node, 1, ", (Ra1.GetVec(1)).Write(out, ", ")
2508  << ", 2, ", (Ra1.GetVec(2)).Write(out, ", ")
2509  << ", reference, node, ", f2.Write(out, ", ")
2510  << ", reference, node, 1, ", (Ra2.GetVec(1)).Write(out, ", ")
2511  << ", 2, ", (Ra2.GetVec(2)).Write(out, ", ")
2512  << ", ";
2513  Chord.pGetShape()->Restart(out) << ", ";
2514  ForcePoint.pGetShape()->Restart(out) << ", ";
2515  VelocityPoint.pGetShape()->Restart(out) << ", ";
2516  Twist.pGetShape()->Restart(out) << ", "
2517  << GDI.iGetNum() << ", control, ";
2518  pGetDriveCaller()->Restart(out) << ", ";
2519  aerodata->Restart(out);
2520  return out << ";" << std::endl;
2521 }
std::ostream & Write(std::ostream &out, const char *sFill=" ") const
Definition: matvec3.cc:738
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256
virtual std::ostream & Restart(std::ostream &out) const =0
std::ostream & Write(std::ostream &out, const FullMatrixHandler &m, const char *s, const char *s2)
Definition: fullmh.cc:376
const ShapeOwner Chord
Definition: aeroelem.h:157
InducedVelocity * pIndVel
Definition: aeroelem.h:154
virtual const Shape * pGetShape(void) const
Definition: shape.cc:72
Vec3 GetVec(unsigned short int i) const
Definition: matvec3.h:893
const ShapeOwner Twist
Definition: aeroelem.h:160
AeroData * aerodata
Definition: aeroelem.h:153
virtual std::ostream & Restart(std::ostream &out) const =0
virtual std::ostream & Restart(std::ostream &out) const =0
const Mat3x3 Ra1
Definition: aeroelem.h:460
const ShapeOwner ForcePoint
Definition: aeroelem.h:158
GaussDataIterator GDI
Definition: aeroelem.h:163
DriveCaller * pGetDriveCaller(void) const
Definition: drive.cc:658
const ShapeOwner VelocityPoint
Definition: aeroelem.h:159
virtual integer iGetNum(void) const
Definition: gauss.h:96
const Vec3 f2
Definition: aeroelem.h:459
const Vec3 f1
Definition: aeroelem.h:458
const Mat3x3 Ra2
Definition: aeroelem.h:461
const Beam2 * pBeam
Definition: aeroelem.h:455
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

Member Data Documentation

Vec3 AerodynamicBeam2::F[LASTNODE]
protected

Definition at line 469 of file aeroelem.h.

Referenced by AssVec(), and Output().

const Vec3 AerodynamicBeam2::f1
protected

Definition at line 458 of file aeroelem.h.

Referenced by AssJac(), AssVec(), and Restart().

const Vec3 AerodynamicBeam2::f2
protected

Definition at line 459 of file aeroelem.h.

Referenced by AssJac(), AssVec(), and Restart().

Vec3 AerodynamicBeam2::M[LASTNODE]
protected

Definition at line 470 of file aeroelem.h.

Referenced by AssVec(), and Output().

const Beam2* AerodynamicBeam2::pBeam
protected

Definition at line 455 of file aeroelem.h.

Referenced by AerodynamicBeam2(), Output(), and Restart().

const StructNode* AerodynamicBeam2::pNode[2]
protected

Definition at line 456 of file aeroelem.h.

Referenced by AerodynamicBeam2(), AssJac(), AssRes(), AssVec(), and InitialAssRes().

const Mat3x3 AerodynamicBeam2::Ra1
protected

Definition at line 460 of file aeroelem.h.

Referenced by AssJac(), AssVec(), and Restart().

const Vec3 AerodynamicBeam2::Ra1_3
protected

Definition at line 462 of file aeroelem.h.

const Mat3x3 AerodynamicBeam2::Ra2
protected

Definition at line 461 of file aeroelem.h.

Referenced by AssJac(), AssVec(), and Restart().

const Vec3 AerodynamicBeam2::Ra2_3
protected

Definition at line 463 of file aeroelem.h.


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