当前位置: 首页>>代码示例>>C++>>正文


C++ Aircraft::get_htail_area方法代码示例

本文整理汇总了C++中Aircraft::get_htail_area方法的典型用法代码示例。如果您正苦于以下问题:C++ Aircraft::get_htail_area方法的具体用法?C++ Aircraft::get_htail_area怎么用?C++ Aircraft::get_htail_area使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Aircraft的用法示例。


在下文中一共展示了Aircraft::get_htail_area方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: fdm

bool Aeromatic::fdm()
{
    Aircraft *aircraft = _aircraft[_atype];
    std::vector<System*> systems = _aircraft[_atype]->get_systems();

    _engines = _MIN(_no_engines, 4);
    aircraft->_engines = _engines;


//***** METRICS ***************************************
    _payload = _max_weight;
    _stall_weight = _max_weight;

    // first, estimate wing loading in psf
    float wing_loading = aircraft->get_wing_loading();

    // if no wing area given, use wing loading to estimate
    bool wingarea_input;
    if (_wing.area == 0)
    {
        wingarea_input = false;
        _wing.area = _max_weight / wing_loading;
    }
    else
    {
        wingarea_input = true;
        wing_loading = _max_weight / _wing.area;
    }

    // calculate wing chord
    if (_wing.aspect == 0) {
        _wing.aspect = aircraft->get_aspect_ratio();
    } else {
        _user_wing_data++;
    }
    if (_wing.chord == 0)
    {
        if (_wing.aspect > 0) {
            _wing.chord = _wing.span / _wing.aspect;
        } else {
            _wing.chord = _wing.area / _wing.span;
        }
    }
    else {
        _user_wing_data++;
    }

    // calculate aspect ratio
    if (_wing.aspect == 0) {
        _wing.aspect = (_wing.span*_wing.span) / _wing.area;
    } else {
        _user_wing_data++;
    }

    if (_wing.taper == 0) {
        _wing.taper = 1.0f;
    }

    float TR = _wing.taper;
    _wing.chord_mean = 0.75f*_wing.chord*(1.0f+TR+TR*TR)/(1.0f+TR);
    _wing.de_da = 4.0f/(_wing.aspect+2.0f);

    // leading edge sweep
    // devide the span by two and account for fuselage width
    float span = 0.45f*_wing.span;
    float root_tip = _wing.chord*(1.0f - _wing.taper);

    if (_wing.sweep_le == 0)
    {
        _wing.sweep_le = atanf(root_tip/span);
        if (_wing.shape != DELTA) {
            _wing.sweep_le *= 0.5f;
        }
        _wing.sweep_le *= RAD_TO_DEG;
        _wing.sweep_le += _wing.sweep;
    }

    if (_wing.thickness == 0)
    {
        // Hofman equation for t/c
//      float Ws = _stall_weight;
        float Vs = _stall_speed * KNOTS_TO_FPS;
        float sweep = _wing.sweep * DEG_TO_RAD;
        float TC = 0.051f * _wing.area * powf(cosf(sweep), 5.0f)/Vs;
        _wing.thickness = TC * _wing.chord;
    }

    // for now let's use a standard 2 degrees wing incidence
    if (_wing.incidence == 0) {
        _wing.incidence = 2.0;
    }

    // estimate horizontal tail area
    if (_htail.area == 0) {
        _htail.area = _wing.area * aircraft->get_htail_area();
    }

    // estimate distance from CG to horizontal tail aero center
    if (_htail.arm == 0) {
        _htail.arm = _length * aircraft->get_htail_arm();
//.........这里部分代码省略.........
开发者ID:AEgisTG,项目名称:jsbsim,代码行数:101,代码来源:Aircraft.cpp


注:本文中的Aircraft::get_htail_area方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。