CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

problem with using exp() function

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   September 26, 2012, 04:27
Unhappy problem with using exp() function
  #1
New Member
 
reza
Join Date: Apr 2012
Posts: 7
Rep Power: 5
sasookey is on a distinguished road
Hi
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.
sasookey is offline   Reply With Quote

Old   September 26, 2012, 04:43
Default
  #2
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,607
Rep Power: 25
ngj will become famous soon enoughngj will become famous soon enough
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,

Niels
ngj is offline   Reply With Quote

Old   October 1, 2012, 12:19
Smile
  #3
New Member
 
reza
Join Date: Apr 2012
Posts: 7
Rep Power: 5
sasookey is on a distinguished road
dear Niels
very thanks to help me, I try that and it worked.
sasookey is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile problem ivanyao OpenFOAM Running, Solving & CFD 1 October 12, 2012 09:31
error message with modeling a cube with a hold at the center hsingtzu OpenFOAM Native Meshers: blockMesh 2 March 14, 2012 10:56
OpenFOAM static build on Cray XT5 asaijo OpenFOAM Installation 9 April 6, 2011 12:21
OpenFoam 14 installation problem gfcoppola OpenFOAM Installation 20 November 2, 2007 14:38
Problem in CFX5POST Chart function. windhair CFX 2 September 20, 2004 07:49


All times are GMT -4. The time now is 21:37.