CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   problem with using exp() function (

sasookey September 26, 2012 04:27

problem with using exp() function
Im new user, and i use OpenFoam2.01
I want to make a new solver and when I use exp function every where in my program such as this:

forAll( Utot , celli ) {
if (Utot[celli] < exp(0.1) ) {

where Utot is a volScalarField,
I got this error when I want to wmake it :

pEqn.H:100: error:call of overloaded 'exp(double)' is ambiguous

but if I remove exp() or use sqr() function i got no error !
I need exp in my solver and I cant use the answer of exp(0.1) and I don't know how to use it.

very thanks to help me.

ngj September 26, 2012 04:43

Hi Reza,

It is because your compiler is confused, whether you want to use std::exp or Foam::exp versions of the exponential. Merely replace "exp" with "Foam::exp" and it will compile.

Kind regards,


sasookey October 1, 2012 12:19

dear Niels
very thanks to help me, I try that and it worked:).

All times are GMT -4. The time now is 05:49.