D:/Basile/VisualCppProjects/hydroMEX3/hydroMEX3/hydro_source/aero_coeff_control.cpp

Go to the documentation of this file.
00001 
00009 #include "math.h"
00010 #include "mex.h"  
00011 #include "string.h"
00012 
00013 #include "Datas.h"
00014 #include "aero_coeff_control.h"
00015 
00016 
00017 #ifndef PI_DEF
00018 #define pi 3.141592653589793
00019 #define PI 3.141592653589793
00020 #endif
00021 
00022 
00023 void aero_coeff_control(datas *d)
00024 {
00025         d->Chord_right = d->Chord_max - (d->Chord_max - d->Chord_min)*(d->EE_right/d->E_foils);
00026         d->Chord_left = d->Chord_max - (d->Chord_max - d->Chord_min)*(d->EE_left/d->E_foils);
00027 
00028         d->A_left = 0.5*(d->Chord_left + d->Chord_min)*(d->E_foils - d->EE_left);
00029         d->A_right = 0.5*(d->Chord_right + d->Chord_min)*(d->E_foils - d->EE_right);
00030         d->A_yaw = d->Chord*(d->E_yaw - d->EE_yaw);
00031 
00032         d->AR_left = (pow(d->E_foils-d->EE_left,2))/d->A_left;
00033         d->AR_right = (pow(d->E_foils-d->EE_right,2))/d->A_right;
00034 
00035         d->AR_yaw = d->A_yaw/pow(d->Chord,2);
00036         d->AR_pitch = d->A_pitch/pow(d->Chord,2);
00037 
00038         d->AR_sail = 4.4;
00039 
00040 //%Lift reduction due to AR is supposed polynomial, degree gamma
00041 
00042         d->gamma = 1;
00043 
00044 
00045         d->CL_left = (1 - pow((d->EE_left/d->E_foils),d->gamma))*6.3802*d->Tan_AoA_left;
00046         d->CD_left = 0.00485054892829 + 0.09060697805806*pow(d->Tan_AoA_left,2) + 0.5*pow(d->CL_left,2)/(pi*d->AR_left);
00047 
00048         d->CL_right = (1 - pow(d->EE_right/d->E_foils,d->gamma))*6.3802*d->Tan_AoA_right;
00049         d->CD_right = 0.00485054892829 + 0.09060697805806*pow(d->Tan_AoA_right,2) + 0.5*pow(d->CL_right,2)/(pi*d->AR_right);
00050 
00051         d->CL_yaw = 6.3802*d->Tan_AoA_yaw;
00052         d->CD_yaw = 0.00485054892829 + 0.09060697805806*pow(d->Tan_AoA_yaw,2) + 0.5*pow(d->CL_yaw,2)/(pi*d->AR_yaw);
00053 
00054         d->CL_pitch = 6.3802*d->Tan_AoA_pitch;
00055         d->CD_pitch = 0.00485054892829 + 0.09060697805806*pow(d->Tan_AoA_pitch,2) + pow(d->CL_pitch,2)/(pi*d->AR_pitch);
00056 
00057 //%CL_sail = 2*Tan_AoA_sail;//%tanCal_sail;
00058 //%CD_sail = 0.009 + 0.02*Tan_AoA_sail + 0.26*Tan_AoA_sail^2;//% + CL_sail^2/(pi*AR_sail);
00059 
00060         d->CL_sail = 1*d->Tan_AoA_sail;//%tanCal_sail;
00061         d->CD_sail = 0.0044 + 0.0102*d->Tan_AoA_sail + 0.1285*pow(d->Tan_AoA_sail,2);//% + CL_sail^2/(pi*AR_sail);
00062 }

Generated on Fri Jun 9 19:10:20 2006 for hydroMex3 by  doxygen 1.4.6-NO