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


C++ FlowField::getRHSEpsilon方法代码示例

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


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

示例1: apply

void KEStencil::apply(FlowField& flowField, int i, int j) {
  // calculate new value from old value and rhs
  flowField.getTke(i, j) += _parameters.timestep.dt * flowField.getRHSTke(i, j);
  flowField.getTke(i, j) *= flowField.getTke(i, j) < 0.0 ? 0.0 : 1.0;

  flowField.getEpsilon(i, j) +=
      _parameters.timestep.dt * flowField.getRHSEpsilon(i, j);
  flowField.getEpsilon(i, j) *= flowField.getEpsilon(i, j) < 0.0 ? 0.0 : 1.0;
}
开发者ID:cqql,项目名称:turbulence,代码行数:9,代码来源:KEStencil.cpp

示例2: apply

void RHSStencil::apply(FlowField& flowField, int i, int j, int k) {
  //  loadLocalNu3D(_parameters, flowField, _localNu, i, j, k);
  loadLocalVelocity3D(flowField, _localVelocity, i, j, k);
  loadLocalMeshsize3D(_parameters, _localMeshsize, i, j, k);

  // load TKE
  loadLocal3D([&flowField](FLOAT* local, int ii, int jj, int kk) mutable {
    *(local + 0) = flowField.getTke(ii, jj, kk);
  }, _localTKE, i, j, k);

  // load epsilon
  loadLocal3D([&flowField](FLOAT* local, int ii, int jj, int kk) mutable {
    *(local + 0) = flowField.getEpsilon(ii, jj, kk);
  }, _localEpsilon, i, j, k);

  // load Fmu*Nut
  loadLocal3D([&flowField](FLOAT* local, int ii, int jj, int kk) mutable {
    *(local + 0) = flowField.getFmu(ii, jj, kk) * flowField.getNu(ii, jj, kk);
    //    *(local+0) = 0;
  }, _localFmuNut, i, j, k);

  const FLOAT sijsij = computeSijSij3D(_localVelocity, _localMeshsize);
  const FLOAT f1 = flowField.getF1(i, j, k);
  const FLOAT f2 = flowField.getF2(i, j, k);
  const FLOAT f3 = flowField.getF3(i, j, k);
  const FLOAT D = flowField.getD(i, j, k);
  const FLOAT E = flowField.getE(i, j, k);
  const FLOAT nut = flowField.getNu(i, j, k);

  flowField.getsijsij(i, j, k) = sijsij;

  // load nu + nut/sigmaK
  loadLocal3D([&flowField, this](FLOAT* local, int ii, int jj, int kk) mutable {
    *(local + 0) = this->_parameters.flow.visc +
                   flowField.getNu(ii, jj, kk) / this->_parameters.kEpsilon.sigmaK;
  }, _localNu, i, j, k);

  flowField.getRHSTke(i, j, k) =
      computeRHStke(_parameters, _localVelocity, _localMeshsize, _localNu,
                    _localTKE, _localEpsilon, nut, sijsij, f3, D);

  // load nu + nut/sigmaE
  loadLocal3D([&flowField, this](FLOAT* local, int ii, int jj, int kk) mutable {
    *(local + 0) = this->_parameters.flow.visc +
                   flowField.getNu(ii, jj, kk) / this->_parameters.kEpsilon.sigmaE;
  }, _localNu, i, j, k);

  flowField.getRHSEpsilon(i, j, k) =
      computeRHSepsilon(_parameters, _localVelocity, _localMeshsize, _localNu,
                        _localTKE, _localEpsilon, nut, sijsij, f1, f2, E);
}
开发者ID:cqql,项目名称:turbulence,代码行数:51,代码来源:RHSStencil.cpp


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