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

#include <windprof.h>

Inheritance diagram for PowerLawWindProfile:
Collaboration diagram for PowerLawWindProfile:

Public Member Functions

 PowerLawWindProfile (const Vec3 &X0, const Mat3x3 &R0, const doublereal dZRef, const DriveCaller *pVRef, const doublereal dPower)
 
virtual ~PowerLawWindProfile (void)
 
virtual bool GetVelocity (const Vec3 &X, Vec3 &V) const
 
virtual std::ostream & Restart (std::ostream &out) const
 
- Public Member Functions inherited from WindProfile
 WindProfile (const Vec3 &X0, const Mat3x3 &R0)
 
virtual ~WindProfile (void)
 
- Public Member Functions inherited from Gust
virtual ~Gust (void)
 
void SetAirProperties (const AirProperties *pap)
 
virtual Vec3 GetVelocity (const Vec3 &X) const
 

Protected Attributes

const doublereal dZRef
 
DriveOwner VRef
 
const doublereal dPower
 
- Protected Attributes inherited from WindProfile
const Vec3 X0
 
const Mat3x3 R0
 
- Protected Attributes inherited from Gust
const AirPropertiespAP
 

Detailed Description

Definition at line 84 of file windprof.h.

Constructor & Destructor Documentation

PowerLawWindProfile::PowerLawWindProfile ( const Vec3 X0,
const Mat3x3 R0,
const doublereal  dZRef,
const DriveCaller pVRef,
const doublereal  dPower 
)

Definition at line 166 of file windprof.cc.

References ASSERT.

172 : WindProfile(X0, R0),
173 dZRef(dZRef),
174 VRef(pVRef),
175 dPower(dPower)
176 {
177  ASSERT(dZRef > 0.);
178  ASSERT(pVRef != 0);
179  // NOTE: should be < 1?
180  ASSERT(dPower > 0.);
181 }
DriveOwner VRef
Definition: windprof.h:87
const doublereal dZRef
Definition: windprof.h:86
const doublereal dPower
Definition: windprof.h:88
WindProfile(const Vec3 &X0, const Mat3x3 &R0)
Definition: windprof.cc:45
#define ASSERT(expression)
Definition: colamd.c:977
PowerLawWindProfile::~PowerLawWindProfile ( void  )
virtual

Definition at line 183 of file windprof.cc.

References NO_OP.

184 {
185  NO_OP;
186 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

bool PowerLawWindProfile::GetVelocity ( const Vec3 X,
Vec3 V 
) const
virtual

Implements Gust.

Definition at line 189 of file windprof.cc.

References DriveOwner::dGet(), dPower, dZRef, Mat3x3::GetVec(), grad::pow(), WindProfile::R0, VRef, and WindProfile::X0.

190 {
191  // dZ is the component of (X - X0) along axis 3 of R0
192  doublereal dZ = R0.GetVec(3)*(X - X0);
193  if (dZ <= 0.) {
194  return false;
195  }
196 
197  // V is projected along axis 1 of R0
198  V = R0.GetVec(1)*(VRef.dGet()*std::pow(dZ/dZRef, dPower));
199 
200  return true;
201 }
GradientExpression< BinaryExpr< FuncPow, LhsExpr, RhsExpr > > pow(const GradientExpression< LhsExpr > &u, const GradientExpression< RhsExpr > &v)
Definition: gradient.h:2961
DriveOwner VRef
Definition: windprof.h:87
const doublereal dZRef
Definition: windprof.h:86
Vec3 GetVec(unsigned short int i) const
Definition: matvec3.h:893
const doublereal dPower
Definition: windprof.h:88
const Mat3x3 R0
Definition: windprof.h:50
doublereal dGet(const doublereal &dVar) const
Definition: drive.cc:664
double doublereal
Definition: colamd.c:52
const Vec3 X0
Definition: windprof.h:49

Here is the call graph for this function:

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

Implements Gust.

Definition at line 204 of file windprof.cc.

References dPower, dZRef, DriveOwner::pGetDriveCaller(), WindProfile::R0, DriveCaller::Restart(), VRef, and WindProfile::X0.

205 {
206  out << "power law"
207  << ", reference position, " << X0
208  << ", reference orientation, " << R0
209  << ", reference elevation, " << dZRef
210  << ", reference velocity, ", VRef.pGetDriveCaller()->Restart(out)
211  << ", exponent, " << dPower;
212  return out;
213 }
DriveOwner VRef
Definition: windprof.h:87
const doublereal dZRef
Definition: windprof.h:86
virtual std::ostream & Restart(std::ostream &out) const =0
const doublereal dPower
Definition: windprof.h:88
const Mat3x3 R0
Definition: windprof.h:50
DriveCaller * pGetDriveCaller(void) const
Definition: drive.cc:658
const Vec3 X0
Definition: windprof.h:49

Here is the call graph for this function:

Member Data Documentation

const doublereal PowerLawWindProfile::dPower
protected

Definition at line 88 of file windprof.h.

Referenced by GetVelocity(), and Restart().

const doublereal PowerLawWindProfile::dZRef
protected

Definition at line 86 of file windprof.h.

Referenced by GetVelocity(), and Restart().

DriveOwner PowerLawWindProfile::VRef
protected

Definition at line 87 of file windprof.h.

Referenced by GetVelocity(), and Restart().


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