double CalculateAreaRadiative(ModularFI.ModularFlightIntegrator fi, Part part, FARAeroPartModule aeroModule)
 {
     //double dragCubeExposed = fi.BaseFICalculateAreaExposed(part);
     if ((object)aeroModule == null)
         return fi.BaseFICalculateAreaRadiative(part);
     else
     {
         return aeroModule.ProjectedAreas.totalArea;
     }
 }
 double CalculateAreaExposed(ModularFI.ModularFlightIntegrator fi, Part part, FARAeroPartModule aeroModule)
 {
     double dragCubeExposed = fi.BaseFICalculateAreaExposed(part);
     if (aeroModule == null)
         return dragCubeExposed;
     else
     {
         double cubeRadiative = fi.BaseFICalculateAreaRadiative(part);
         if (cubeRadiative > 0)
             return aeroModule.ProjectedAreas.totalArea * dragCubeExposed / cubeRadiative;
         else
             return aeroModule.ProjectedAreas.totalArea;
     }
 }
        void UpdateThermodynamicsPre(ModularFI.ModularFlightIntegrator fi)
        {
            for (int i = 0; i < fi.PartThermalDataCount; i++)
            {
                Part part = fi.partThermalDataList[i].part;
                if (!part.Modules.Contains("FARAeroPartModule"))
                    continue;

                PartModule module = part.Modules["FARAeroPartModule"];

                FARAeroPartModule aeroModule = (FARAeroPartModule)module;

                double stockRadArea = fi.BaseFICalculateAreaRadiative(part);

                part.radiativeArea = CalculateAreaRadiative(fi, part, aeroModule);
                part.exposedArea = part.machNumber > 0 ? CalculateAreaExposed(fi, part, aeroModule) : part.radiativeArea;

                if (part.radiativeArea < stockRadArea)
                    SkinThermalMassShenanigansForShieldedParts(fi, part, stockRadArea, part.radiativeArea);     //very hacky method to deal with the fact that stock assumes that radiative area is also the skin area for the part.  This causes issues for parts that cannot radiate to the environment because they are completely enclosed

                if (part.exposedArea > part.radiativeArea)
                    part.exposedArea = part.radiativeArea;      //sanity check just in case
            }
            //Debug.Log("MFI: " + fi.CoM + " " + Planetarium.GetUniversalTime());
        }