include/vamos/body/Aerodynamic_Device.h

Go to the documentation of this file.
00001 //  Aerodynamic_Device.h - a particle that produces drag and lift.
00002 //
00003 //  Copyright (C) 2002 Sam Varner
00004 //
00005 //  This file is part of Vamos Automotive Simulator.
00006 //
00007 //  This program is free software; you can redistribute it and/or modify
00008 //  it under the terms of the GNU General Public License as published by
00009 //  the Free Software Foundation; either version 2 of the License, or
00010 //  (at your option) any later version.
00011 //
00012 //  This program is distributed in the hope that it will be useful,
00013 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 //  GNU General Public License for more details.
00016 //
00017 //  You should have received a copy of the GNU General Public License
00018 //  along with this program; if not, write to the Free Software
00019 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 
00021 #ifndef _AERODYNAMIC_DEVICE_H_
00022 #define _AERODYNAMIC_DEVICE_H_
00023 
00024 #include <vamos/body/Particle.h>
00025 #include <vamos/geometry/Three_Vector.h>
00026 
00027 namespace Vamos_Body
00028 {
00029   //* An Aerodynamic_Device is a particle that may produce drag or lift.
00030   class Aerodynamic_Device : public Particle
00031   {
00032   protected:
00033         // The current wind velocity vector.
00034         Vamos_Geometry::Three_Vector m_wind_vector;
00035 
00036         // The current air density.
00037         double m_density;
00038 
00039   public:
00040         //** Constructor
00041         Aerodynamic_Device (const Vamos_Geometry::Three_Vector& position);
00042 
00043         // Calculate the drag and lift due to WIND_VECTOR.  WIND_VECTOR is
00044         // supplied by the Body in the Body's frame.  DENSITY is the denisty
00045         // of the atmosphere.
00046         void wind (const Vamos_Geometry::Three_Vector& wind_vector, 
00047                            double density);
00048 
00049         // Find and store the forces, impulses, and torques for the
00050         // current configuration.
00051         virtual void find_forces () = 0;
00052   };
00053 
00054   //* An Aerodynamic_Device that produces drag.
00055   class Drag : public Aerodynamic_Device
00056   {
00057   protected:
00058         // The frontal area of the particle.
00059         double m_frontal_area;
00060 
00061         // The coefficient of drag.
00062         double m_drag_coefficient;
00063 
00064   public:
00065         //** Constructor
00066         Drag (const Vamos_Geometry::Three_Vector& position,
00067                   double frontal_area, double drag_coefficient);
00068 
00069         // Find and store the forces, impulses, and torques for the
00070         // current configuration.
00071         virtual void find_forces ();
00072   };
00073 
00074   class Wing : public Drag
00075   {
00076         // The area of the surface of the wing.
00077         double m_surface_area;
00078 
00079         // The coefficient of lift.
00080         double m_lift_coefficient;
00081 
00082         // The efficiency of the wing (< 1.0, > 0).
00083         double m_efficiency;
00084 
00085   public:
00086         //** Constructor
00087         Wing (const Vamos_Geometry::Three_Vector& position,
00088                   double frontal_area, double drag_coefficient,
00089                   double surface_area, double lift_coefficient,
00090                   double efficiency);
00091 
00092         // Find and store the forces, impulses, and torques for the
00093         // current configuration.
00094         void find_forces ();
00095   };
00096 }
00097 
00098 #endif // !_AERODYNAMIC_DEVICE_H_

Generated on Thu Oct 19 04:05:47 2006 by  doxygen 1.4.6