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

Compilation error when using boost Bessel function in OpenFOAM

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 14, 2023, 11:54
Default Compilation error when using boost Bessel function in OpenFOAM
  #1
New Member
 
Join Date: Apr 2023
Posts: 1
Rep Power: 0
streamLiner is on a distinguished road
Hi,

I am trying to make a custom solver based on pimpleFoam, which includes a Bessel function in an equation which I added in the PIMPLE-loop. In the beginning of the solver, I have an include-statement which I believe I need to use the Bessel-function from boost:

Code:
#include <boost/math/special_functions/bessel.hpp>
However, I get a compilation error when I run "wmake" (here quoting selected parts of a long error message):

Code:
usr/include/boost/math/special_functions/detail/bernoulli_details.hpp: In function ‘std::size_t boost::math::detail::find_bernoulli_overflow_limit(const false_type&)’:
/usr/include/boost/math/special_functions/detail/bernoulli_details.hpp:104:63: error: call of overloaded ‘sqrt(double)’ is ambiguous
  104 |    double result = boost::math::tools::toms748_solve(fun, sqrt(double(t)), double(t), tol, max_iter).first / 2;
Code:
/opt/openfoam10/src/OpenFOAM/lnInclude/dimensionedScalar.H:65:19: note: candidate: ‘Foam::dimensionedScalar Foam::sqrt(const dimensionedScalar&)’
   65 | dimensionedScalar sqrt(const dimensionedScalar&);
      |                   ^~~~
make: *** [/opt/openfoam10/wmake/rules/General/transform:26: Make/linux64GccDPInt32Opt/cEHDfoam.o] Error 1
The solver compiles (and simulates) fine if I exclude the bessel-related "#include" statement and replace the bessel function with something else. Thus the error seems to be caused by the include-statement itself.

What could I do to solve this problem? If I include other boost library functions, for example "elliptic integral" from the "special functions" directory, then it compiles without error. So the error seems localized to bessel. And it seems the compiler is complaining about "sqrt( )" somehow (which I didn't type in or add anywhere, must come from boost).

Very strange! I'm thankful for any tips/suggestions you may have.
streamLiner is offline   Reply With Quote

Reply

Tags
bessel, boost, compilation, error, library

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Map of the OpenFOAM Forum - Understanding where to post your questions! wyldckat OpenFOAM 10 September 2, 2021 06:29
[swak4Foam] installation problem with version 0.2.3 Claudio87 OpenFOAM Community Contributions 9 May 8, 2013 11:20
[blockMesh] non-orthogonal faces and incorrect orientation? nennbs OpenFOAM Meshing & Mesh Conversion 7 April 17, 2013 06:42
latest OpenFOAM-1.6.x from git failed to compile phsieh2005 OpenFOAM Bugs 25 February 9, 2010 05:37
Droplet Evaporation Christian Main CFD Forum 2 February 27, 2007 07:27


All times are GMT -4. The time now is 06:10.