Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
大家好,最近对一个标量场自定义边界条件时遇到个问题,我对scalarField用max函数时很困惑,有小伙伴有什么建议吗?谢谢!
scalarField a = Cf&vector(0,0,1); scalarField a = max(0,2a-3); //取非负
报错如下
error: cannot convert ‘Foam::tmp<Foam::Field<double> >’ to ‘Foam::scalar {aka double}’ in initialization
试的过程中还有报错如下:
error: no matching function for call to ‘max(int, Foam::tmp<Foam::Field<double> >)’
上面发帖时笔误字母写错了 第一行是
scalarField c = Cf&vector(0,0,1);
1、检查Cf的类型 2、max函数参数应该是没有int版本,把0改成0.0
@BlookCFD 谢谢!已经解决