在曳力模型中植入网格中心到边界距离的问题
-
请教各位前辈:
我以wenyu.C为基础,想把y_(wallDist::New(mesh).y())植入到曳力计算公式中:/ * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::dragModels::wallEffect::wallEffect ( const dictionary& dict, const phasePair& pair, const bool registerObject, const fvMesh& mesh ) : dragModel(dict, pair, registerObject), residualRe_("residualRe", dimless, dict), y_(wallDist::New(mesh).y()) {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // Foam::tmp<Foam::volScalarField> Foam::dragModels::wallEffect::CdRe() const { const volScalarField alpha2 ( max(1 - pair_.dispersed(), pair_.continuous().residualAlpha()) ); //const volScalarField Res(alpha2*pair_.Re()); const volScalarField Re(pair_.Re()); const volScalarField Cp(y_/pair_.dispersed().d()); const volScalarField CdsRe ( neg(Re - 1000)*(24*(1.0 + 0.15*pow(Re, 0.687))*pow(Cp,0.565) + pos0(Re - 1000)*0.44*max(Re, residualRe_) );
编译可以通过,但查看未定义符号情况时出现如下问题:
计算时也出现错误
不知这个y_(wallDist::New(mesh).y())该如何正确植入呢?
-
如果改变写法:
Foam::dragModels::wallEffect::wallEffect ( const dictionary& dict, const phasePair& pair, const bool registerObject ) : dragModel(dict, pair, registerObject), residualRe_("residualRe", dimless, dict), y_(nullptr) {} Foam::dragModels::wallEffect::wallEffect ( const dictionary& dict, const phasePair& pair, const bool registerObject, const fvMesh& mesh ) : dragModel(dict, pair, registerObject), residualRe_("residualRe", dimless, dict), y_(&wallDist::New(mesh).y()) {}
计算的时候会报错:
@李东岳 也烦请东岳老师帮忙看看这个问题如何实现~ 三月再您的课上还问过您这个问题,但是下来自己搞没搞通