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

problem with using exp() function

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 3 Post By ngj

Reply
 
LinkBack Thread Tools Search this Thread 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: 13
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: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
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
babakflame, Kirils and a.Asadi like this.
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: 13
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


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 Off
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
[blockMesh] error message with modeling a cube with a hold at the center hsingtzu OpenFOAM Meshing & Mesh Conversion 2 March 14, 2012 09: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 13:38
Problem in CFX5POST Chart function. windhair CFX 2 September 20, 2004 07:49


All times are GMT -4. The time now is 00:13.