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


C++ Tank::findVolume方法代码示例

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


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

示例1: init

void QualEngine::init()
{
    if (engineState != QualEngine::OPENED) return;

    // ... initialize node concentrations & tank volumes

    for (Node* node : network->nodes)
    {
        if ( network->qualModel->type == QualModel::TRACE ) node->quality = 0.0;
        else node->quality = node->initQual;
        if ( node->type() == Node::TANK )
        {
            Tank* tank = static_cast<Tank*>(node);
            tank->volume = tank->findVolume(tank->initHead);
        }
    }

    // ... initialize reaction model and quality solver

    qualSolver->init();
    network->qualModel->init(network);
    qualStep = network->option(Options::QUAL_STEP);
    if ( qualStep <= 0 ) qualStep = 300;
    qualTime = 0;
    engineState = QualEngine::INITIALIZED;
}
开发者ID:bradleyjeck,项目名称:epanet-dev,代码行数:26,代码来源:qualengine.cpp

示例2: getTankValue

int getTankValue(int param, Node* node, double* value, Network* nw)
{
    double lcf = nw->ucf(Units::LENGTH);
    double vcf = lcf * lcf * lcf;
    *value = 0.0;
    if ( node->type() != Node::TANK ) return 0;
    Tank* tank = static_cast<Tank*>(node);
    switch (param)
    {
    case EN_TANKLEVEL:
        *value = (tank->head - tank->elev) * lcf;
        break;
    case EN_INITVOLUME:
        *value = tank->findVolume(tank->head) * vcf;
        break;
    case EN_MIXMODEL:
        *value = tank->mixingModel.type;
        break;
    case EN_MIXZONEVOL:
        *value = (tank->mixingModel.fracMixed * tank->maxVolume) * vcf;
        break;
    case EN_TANKDIAM:
        *value = tank->diameter * lcf;
        break;
    case EN_MINVOLUME:
        *value = tank->minVolume * vcf;
        break;
    case EN_VOLCURVE:
        if ( tank->volCurve )
        {
            string name = tank->volCurve->name;
            int index = nw->indexOf(Element::CURVE, name);
            *value = index;
            if ( index < 0 ) return 205;
        }
        else *value = -1.0;
        break;
    case EN_MINLEVEL:
        *value = (tank->minHead - tank->elev) * lcf;
        break;
    case EN_MAXLEVEL:
        *value = (tank->maxHead - tank->elev) * lcf;
        break;
    case EN_MIXFRACTION:
        *value = tank->mixingModel.fracMixed;
        break;
    case EN_TANK_KBULK:
        *value = tank->bulkCoeff ;
        break;
    case EN_TANKVOLUME:
        *value = tank->volume * vcf;
        break;
    default: return 203;
    }
    return 0;
}
开发者ID:OpenWaterAnalytics,项目名称:epanet-dev,代码行数:56,代码来源:datamanager.cpp


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