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/)
-   -   How to use y_ as dimensionless argument? (https://www.cfd-online.com/Forums/openfoam-programming-development/166941-how-use-y_-dimensionless-argument.html)

klausb February 19, 2016 15:41

How to use y_ as dimensionless argument?
 
Hello,

I want to extend the function to calculate nut_ by multiplication with 0.1*tanh(pow((0.003*y_),6)).

nut_ = ((existing function)*(0.1*tanh(pow((0.003*y_),6))));

Compilation works fine but when I use the new turbulence model, I get an error:
[0] --> FOAM FATAL ERROR:
[0] Argument of trancendental function not dimensionless
[0]
[0] From function trans(const dimensionSet&)
[0] in file dimensionSet/dimensionSet.C at line 430.
[0]
FOAM parallel run aborting
...

I assume y_ is not a dimensionless argument for tanh().

How can I deal with that?

Klaus

alexeym February 19, 2016 15:53

Hi,

You can do something like:

Code:

dimensionedScalar unitY_("y_", y_.dimensions(), 1.0);

nut_ = ((existing function)*(0.1*tanh(pow((0.003*y_/unitY_),6))));


jherb February 23, 2016 05:09

Have you tried y_.value()?


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