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
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
00058
00059
00060 d->CL_sail = 1*d->Tan_AoA_sail;
00061 d->CD_sail = 0.0044 + 0.0102*d->Tan_AoA_sail + 0.1285*pow(d->Tan_AoA_sail,2);
00062 }