diff --git a/src/shared/algorithms/MEA/MEA.cpp b/src/shared/algorithms/MEA/MEA.cpp index 0408f3d51695aee19633d7407bdcb38aee0e47d0..494bcaab6d330e89ee94501cb6a1abdd63a97867 100644 --- a/src/shared/algorithms/MEA/MEA.cpp +++ b/src/shared/algorithms/MEA/MEA.cpp @@ -63,9 +63,10 @@ MEA::MEA(const Config &config) baroR{config.baroR}, P{config.P}, x{0, 0, config.initialMass}, mass{config.initialMass}, accelThresh{config.accelThresh}, speedThresh{config.speedThresh}, Kt{config.Kt}, alpha{config.alpha}, - c{config.c}, coeffs{config.coeffs}, crossSection{config.crossSection}, - ae{config.ae}, p0{config.p0}, minMass{config.minMass}, maxMass{ - config.maxMass} + c{config.c}, coeffs{config.coeffs}, + crossSection{config.crossSection}, ae{config.ae}, p0{config.p0}, + minMass{config.minMass}, maxMass{config.maxMass}, + cdCorrectionFactor(config.cdCorrectionFactor) { updateState(); } @@ -113,7 +114,7 @@ void MEA::computeForce(const Step &step) mach = Aeroutils::computeMach(-step.mslAltitude, step.verticalSpeed, Constants::MSL_TEMPERATURE); - cd = Aeroutils::computeCd(coeffs, mach); + cd = cdCorrectionFactor * Aeroutils::computeCd(coeffs, mach); rho = Aeroutils::computeRho(-step.mslAltitude, Constants::MSL_TEMPERATURE); // Dynamic pressure diff --git a/src/shared/algorithms/MEA/MEA.h b/src/shared/algorithms/MEA/MEA.h index 795761e43e8c0abf7f6cba62de4d9fef0f2d9cfd..fbe18c7e6ae05627128e335635e0c782f0da10fa 100644 --- a/src/shared/algorithms/MEA/MEA.h +++ b/src/shared/algorithms/MEA/MEA.h @@ -64,6 +64,9 @@ public: float minMass; //< Minimum mass used for predicted apogee float maxMass; //< Maximum mass used for predicted apogee + + float cdCorrectionFactor; // Factor to account for extra drag generated + // by the plume }; struct Step @@ -147,6 +150,8 @@ private: float minMass; float maxMass; + float cdCorrectionFactor; + MEAState state; };