Source code for fastoad_cs25.models.aerodynamics.aerodynamics_low_speed

"""Computation of aerodynamic polar in low speed conditions."""
#  This file is part of FAST-OAD_CS25
#  Copyright (C) 2023 ONERA & ISAE-SUPAERO
#  FAST is free software: you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation, either version 3 of the License, or
#  (at your option) any later version.
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#  You should have received a copy of the GNU General Public License
#  along with this program.  If not, see <https://www.gnu.org/licenses/>.

import fastoad.api as oad
import openmdao.api as om
from fastoad.module_management.constants import ModelDomain

from .constants import (
    SERVICE_ALPHA,
    SERVICE_CD0,
    SERVICE_CD_TRIM,
    SERVICE_CL_ALPHA,
    SERVICE_INDUCED_DRAG_COEFFICIENT,
    SERVICE_INITIALIZE_CL,
    SERVICE_OSWALD_COEFFICIENT,
    SERVICE_POLAR,
    SERVICE_REYNOLDS_COEFFICIENT,
    PolarType,
)


[docs] @oad.RegisterOpenMDAOSystem("fastoad.aerodynamics.lowspeed.legacy", domain=ModelDomain.AERODYNAMICS) class AerodynamicsLowSpeed(om.Group): """ Models for low speed aerodynamics """
[docs] def setup(self): low_speed_option = {"low_speed_aero": True} ivc = om.IndepVarComp("data:aerodynamics:aircraft:takeoff:mach", val=0.2) self.add_subsystem("mach_low_speed", ivc, promotes=["*"]) self.add_subsystem( "compute_oswald_coeff", oad.RegisterSubmodel.get_submodel(SERVICE_OSWALD_COEFFICIENT, low_speed_option), promotes=["*"], ) self.add_subsystem( "compute_induced_drag_coeff", oad.RegisterSubmodel.get_submodel(SERVICE_INDUCED_DRAG_COEFFICIENT, low_speed_option), promotes=["*"], ) self.add_subsystem( "comp_re", oad.RegisterSubmodel.get_submodel(SERVICE_REYNOLDS_COEFFICIENT, low_speed_option), promotes=["*"], ) self.add_subsystem( "initialize_cl", oad.RegisterSubmodel.get_submodel(SERVICE_INITIALIZE_CL, low_speed_option), promotes=["*"], ) self.add_subsystem( "cd0_wing", oad.RegisterSubmodel.get_submodel(SERVICE_CD0, low_speed_option), promotes=["*"], ) self.add_subsystem( "cd_trim", oad.RegisterSubmodel.get_submodel(SERVICE_CD_TRIM, low_speed_option), promotes=["*"], ) polar_type_option = {"polar_type": PolarType.LOW_SPEED} self.add_subsystem( "get_polar", oad.RegisterSubmodel.get_submodel(SERVICE_POLAR, polar_type_option), promotes=["*"], ) self.add_subsystem( "compute_CLalpha", oad.RegisterSubmodel.get_submodel(SERVICE_CL_ALPHA, low_speed_option), promotes=["*"], ) self.add_subsystem( "compute_alpha", oad.RegisterSubmodel.get_submodel(SERVICE_ALPHA, low_speed_option), promotes=["*"], )