Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

wakevortex.h

Go to the documentation of this file.
00001 //***************************************************************************
00002 #ifndef WAKEVORTEX_H
00003 #define WAKEVORTEX_H
00004 //***************************************************************************
00005 #include <vector>
00006 #include <stdio.h>
00007 #ifdef HPUX
00008 #include <iostream.h>
00009 #else
00010 #include <iostream>
00011 #endif
00012 #include "alloc.h"
00013 #include "wing.h"
00014 #include "airplane.h"
00015 #ifdef _WIN32
00016 using namespace std;
00017 #endif
00018 //***************************************************************************
00019 enum { VWING_STOP_TRACKING = 0, VWING_DELETE };
00020 //***************************************************************************
00021 class Vortex
00022 {
00023 private:
00024  friend ostream &operator << (ostream &Out, Vortex &V);
00025  void movewings(int wingID);
00026  void shiftwake(int wingID);
00027  void movewakes(int wingID);
00028  void wakevel(int wingID);
00029  void agewake(int wingID);
00030  void findUVW(double u0, double v0, double w0, double delta, double upmag, double x, double y, double z, double *uu, double *vv, double *ww);
00031  inline void inducedvel(Wing *wing, int i, int j, double *vx, double *vy, double *vz, int sign);
00032  inline void inducedvel(Wing *wing, int i1, int j1, int i2, int j2, double *vx, double *vy, double *vz, int sign, int sign2);
00033  void inducedvel(double x1, double y1, double z1, double x2, double y2, double z2, double x, double y, double z, double *velx, double *vely, double *velz, double gamma, double eps);
00034  void Initialize();
00035 
00036 public:
00038  int nwings;
00041  int ntotal;
00043  int nToBeDeleted;
00046  int nOutOfRange;
00048  int nwakemax;
00050  double temperature;
00052  double dt;
00054  double u0;
00056  double v0;
00058  double w0;
00060  double delta;
00062  double upmag;
00064  double gtime;
00066  double glimit;
00069  double max_tracking_distance;
00071  int inducedvelocity_flag;
00073  int iter;
00076  int kn;
00078  int nvort;
00080  double curtime;
00082  vector<Wing> wing;
00083 
00085  Vortex(int n = 0);
00087  ~Vortex();
00089  void MarkAllDeleted();
00091  void CleanUp();
00092 
00095  inline int NextWing(int i);
00098  inline int NextInRange(int i);
00100  inline int Begin(void);
00102  inline int NextToBeDeleted();
00104  Vortex &operator= (const Vortex &);
00107  int AddWing(bool allocate_flag = true);
00109  int AddWingWithoutAllocation();
00111  void ReAlloc(int n);
00113  void Allocate(int i);
00115  void Compress();
00117  void deleteWing(int i);
00119  void undeleteWing(int i);
00121  void stopTrackingWing(int i);
00123  int CheckForOutOfRangeAircraft(double airport_center[3], int option);
00125  void ReadInputFile(char *inpfile, int nwake_max);
00128  double ComputeWake();
00131  int ComputeWake(int wingID);
00133  void WriteTecplotFile(int iter);
00136  int AddNewWing(char *trajfile, char *name, char *type, double x0, double y0, double z0, double span, double area, double weight);
00138  int AddRandomWing(char *trajfile, double x0, double y0, double z0);
00140  int Copy(Vortex *dest);
00141 };
00142 //***************************************************************************
00143 inline int Vortex::NextWing(int i)
00144 {
00145 int j = i+1;
00146 while ((j < nwings) && wing[j].ToBeDeleted) ++j;
00147 
00148 return j;
00149 }
00150 //***************************************************************************
00151 inline int Vortex::Begin(void)
00152 {
00153 int j = 0;
00154 while ((j < nwings) && wing[j].ToBeDeleted) ++j;
00155 
00156 return j;
00157 }
00158 //***************************************************************************
00159 inline int Vortex::NextInRange(int i)
00160 {
00161 int j = (i+1)%nwings;
00162 while ((j < nwings) && (wing[j].ToBeDeleted || wing[j].OutOfRange)) ++j;
00163 
00164 return (j%nwings);
00165 }
00166 //***************************************************************************
00167 inline int Vortex::NextToBeDeleted()
00168 {
00169 int j = 0;
00170 while ((j < nwings) && (wing[j].ToBeDeleted == 0)) ++j;
00171 
00172 return j;
00173 }
00174 //***************************************************************************
00175 #include "packvortex.h"
00176 //***************************************************************************
00177 #endif // WAKEVORTEX_H
00178 /***************************************************************************/

Generated on Sun Jun 16 17:36:42 2002 for Anirudh's Vortex-Wake Simulation Code by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001