CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   A quetion about function trunc() (https://www.cfd-online.com/Forums/openfoam-programming-development/136721-quetion-about-function-trunc.html)

killsecond June 3, 2014 05:29

A quetion about function trunc()
 
Hi all,
In my turbulence model, I want to use the function trunc(), its' type is "double trunc(double)", something went wrong when I compiled.
Example:
Fblend_(F2()*max(scalar(1)-trunc(k_/Cblend_/omega_/nu()), scalar(0))),

and the error is:
error: cannot convert ‘Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >’ to ‘double’ for argument ‘1’ to ‘double trunc(double)’

I wonder that whether I can't use the "k_/Cblend_/omega_/nu()" in trunc() directly, because "k_/Cblend_/omega_/nu()" is flow field datas, which is not "double" type.

How can I solve this problem? Thank you!

jherb June 28, 2014 19:05

I am not sure, but nu() is a scalar with some dimensions whereas trunc wants an double as argument. Try nu().value()


All times are GMT -4. The time now is 07:08.