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


C++ IOdictionary::subOrEmptyDict方法代码示例

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


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

示例1: saveTurbulenceParameters

void saveTurbulenceParameters(const IOdictionary& RASProperties,
                              pt::ptree& settings)
{
    std::string dictName = "kOmegaSSTCoeffs";
    dictionary kOmegaSSTCoeffsDict
            (RASProperties.subOrEmptyDict(dictName));

    scalar alphaK1 = kOmegaSSTCoeffsDict.lookupOrDefault<scalar>("alphaK1", 0.85034);
    settings.put(dictName + "." + speeditcl::io::TURBULENCE_KOMEGASST_ALPHA_K1, alphaK1);

    scalar alphaK2 = kOmegaSSTCoeffsDict.lookupOrDefault<scalar>("alphaK2", 1.0);
    settings.put(dictName + "." + speeditcl::io::TURBULENCE_KOMEGASST_ALPHA_K2, alphaK2);

    scalar alphaOmega1 = kOmegaSSTCoeffsDict.lookupOrDefault<scalar>("alphaOmega1", 0.5);
    settings.put(dictName + "." + speeditcl::io::TURBULENCE_KOMEGASST_ALPHA_OMEGA1, alphaOmega1);

    scalar alphaOmega2 = kOmegaSSTCoeffsDict.lookupOrDefault<scalar>("alphaOmega2", 0.85616);
    settings.put(dictName + "." + speeditcl::io::TURBULENCE_KOMEGASST_ALPHA_OMEGA2, alphaOmega2);

    scalar gamma1 = kOmegaSSTCoeffsDict.lookupOrDefault<scalar>("gamma1", 0.5532);
    settings.put(dictName + "." + speeditcl::io::TURBULENCE_KOMEGASST_GAMMA1, gamma1);

    scalar gamma2 = kOmegaSSTCoeffsDict.lookupOrDefault<scalar>("gamma2", 0.4403);
    settings.put(dictName + "." + speeditcl::io::TURBULENCE_KOMEGASST_GAMMA2, gamma2);

    scalar beta1 = kOmegaSSTCoeffsDict.lookupOrDefault<scalar>("beta1", 0.0750);
    settings.put(dictName + "." + speeditcl::io::TURBULENCE_KOMEGASST_BETA1, beta1);

    scalar beta2 = kOmegaSSTCoeffsDict.lookupOrDefault<scalar>("beta2", 0.0828);
    settings.put(dictName + "." + speeditcl::io::TURBULENCE_KOMEGASST_BETA2, beta2);

    scalar betaStar = kOmegaSSTCoeffsDict.lookupOrDefault<scalar>("betaStar", 0.09);
    settings.put(dictName + "." + speeditcl::io::TURBULENCE_KOMEGASST_BETASTAR, betaStar);

    scalar a1 = kOmegaSSTCoeffsDict.lookupOrDefault<scalar>("a1", 0.31);
    settings.put(dictName + "." + speeditcl::io::TURBULENCE_KOMEGASST_A1, a1);

    scalar c1 = kOmegaSSTCoeffsDict.lookupOrDefault<scalar>("c1", 10);
    settings.put(dictName + "." + speeditcl::io::TURBULENCE_KOMEGASST_C1, c1);

    scalar Cmu = kOmegaSSTCoeffsDict.lookupOrDefault<scalar>("Cmu", 0.09);
    settings.put(dictName + "." + speeditcl::io::TURBULENCE_KOMEGASST_CMU, Cmu);

    scalar kappa = 0.41;
    settings.put(dictName + "." + speeditcl::io::TURBULENCE_KOMEGASST_KAPPA, kappa);

    scalar E = 9.8;
    settings.put(dictName + "." + speeditcl::io::TURBULENCE_KOMEGASST_E, E);

    scalar ypl = 11.0;
    for (int i = 0; i < 10; i++)
    {
        ypl = ::log(E*ypl)/kappa;
    }
    scalar yPlusLam = ypl;
    settings.put(dictName + "." + speeditcl::io::TURBULENCE_KOMEGASST_YPLUS_LAM, yPlusLam);

}
开发者ID:VratisLtd,项目名称:OpenFOAM_to_SpeedITCL_converters,代码行数:58,代码来源:OF2SITFCLSettings.cpp


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