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

[OpenFOAM.com] Custom solver (TwoPhaseFlow) installation error in OpenFOAM v1812

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 31, 2022, 02:08
Default Custom solver (TwoPhaseFlow) installation error in OpenFOAM v1812
  #1
Member
 
L S
Join Date: Apr 2016
Posts: 63
Rep Power: 10
silviliril is on a distinguished road
I am trying to install TwoPhaseFlow solver which is compatible with OpenFOAM-v1812.

I installed OpenFOAM-v1812 already and now trying to compile TwoPhaseFlow. I am getting following error:

Code:
In file included from /home/arupdas/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/List.H:381:0,
                 from /home/arupdas/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/wordList.H:48,
                 from /home/arupdas/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/Enum.H:40,
                 from /home/arupdas/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/IOobject.H:79,
                 from /home/arupdas/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/regIOobject.H:41,
                 from /home/arupdas/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/GeometricField.H:42,
                 from /home/arupdas/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/GeometricScalarField.H:38,
                 from /home/arupdas/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/GeometricFields.H:34,
                 from /home/arupdas/OpenFOAM/OpenFOAM-v1812/src/finiteVolume/lnInclude/volFields.H:37,
                 from surfaceTensionForceModels/surfaceTensionForceModel/RDF/RDF.H:34,
                 from surfaceTensionForceModels/surfaceTensionForceModel/RDF/RDF.C:20:
/home/arupdas/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/List.C: In instantiation of ‘Foam::List<T>::List(InputIterator, InputIterator) [with InputIterator = int; T = long int]’:
surfaceTensionForceModels/surfaceTensionForceModel/RDF/RDF.C:124:43:   required from here
/home/arupdas/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/List.C:300:44: error: no matching function for call to ‘distance(int&, int&)’
     List<T>(begIter, endIter, std::distance(begIter, endIter))
                                            ^
In file included from /usr/include/c++/5/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/5/bits/char_traits.h:39,
                 from /usr/include/c++/5/string:40,
                 from /home/arupdas/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/string.H:52,
                 from /home/arupdas/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/word.H:43,
                 from /home/arupdas/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/int16.H:39,
                 from /home/arupdas/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/int.H:38,
                 from /home/arupdas/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/label.H:39,
                 from /home/arupdas/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/messageStream.H:50,
                 from /home/arupdas/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/error.H:51,
                 from /home/arupdas/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/typeInfo.H:56,
                 from surfaceTensionForceModels/surfaceTensionForceModel/RDF/RDF.H:33,
                 from surfaceTensionForceModels/surfaceTensionForceModel/RDF/RDF.C:20:
/usr/include/c++/5/bits/stl_iterator_base_funcs.h:114:5: note: candidate: template<class _InputIterator> typename std::iterator_traits<_Iterator>::difference_type std::distance(_InputIterator, _InputIterator)
     distance(_InputIterator __first, _InputIterator __last)
     ^
/usr/include/c++/5/bits/stl_iterator_base_funcs.h:114:5: note:   template argument deduction/substitution failed:
/usr/include/c++/5/bits/stl_iterator_base_funcs.h: In substitution of ‘template<class _InputIterator> typename std::iterator_traits<_Iterator>::difference_type std::distance(_InputIterator, _InputIterator) [with _InputIterator = int]’:
/home/arupdas/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/List.C:300:44:   required from ‘Foam::List<T>::List(InputIterator, InputIterator) [with InputIterator = int; T = long int]’
surfaceTensionForceModels/surfaceTensionForceModel/RDF/RDF.C:124:43:   required from here
/usr/include/c++/5/bits/stl_iterator_base_funcs.h:114:5: error: no type named ‘difference_type’ in ‘struct std::iterator_traits<int>’
make: *** [Make/linux64GccDPInt64Opt/surfaceTensionForceModels/surfaceTensionForceModel/RDF/RDF.o] Error 1
/usr/bin/ld: cannot find -lsurfaceForces
collect2: error: ld returned 1 exit status
make: *** [/home/arupdas/OpenFOAM/arupdas-v1812/platforms/linux64GccDPInt64Opt/bin/reconstructInterface] Error 1
/usr/bin/ld: cannot find -lsurfaceForces
collect2: error: ld returned 1 exit status
make: *** [/home/arupdas/OpenFOAM/arupdas-v1812/platforms/linux64GccDPInt64Opt/bin/multiRegionPhaseChangeFlow] Error 1
/usr/bin/ld: cannot find -lsurfaceForces
collect2: error: ld returned 1 exit status
make: *** [/home/arupdas/OpenFOAM/arupdas-v1812/platforms/linux64GccDPInt64Opt/bin/interFlow] Error 1
/usr/bin/ld: cannot find -lsurfaceForces
collect2: error: ld returned 1 exit status
make: *** [/home/arupdas/OpenFOAM/arupdas-v1812/platforms/linux64GccDPInt64Opt/bin/compressibleInterFlow] Error 1
Error messages:
/home/arupdas/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/List.C:300:44: error: no matching function for call to ‘distance(int&, int&)’

/usr/include/c++/5/bits/stl_iterator_base_funcs.h:114:5: error: no type named ‘difference_type’ in ‘struct std::iterator_traits<int>’

Please tell me, what am I doing wrong?
silviliril is offline   Reply With Quote

Old   June 9, 2022, 11:23
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Looks like usual problem with label size 64. If you construct something like the following:
Code:
label val = 100;
labelList test(5, val);
With label size 64 this is seen as labelList(int, long), but there is no constructor for that. You are hoping to get the first parameter seen as a label (int64) but it is still an int.


In OpenFOAM-v1812 and others, there was a list constructor taking two iterators, which is what the compiler is trying to use (and failing miserably). Which also explains why this constructor with two iterators was chucked out in later versions.


You can probably compile with somewhat newer OpenFOAM versions, but I did a quick test with 2112 + clang and there are still something that the DLR people need to update. I suggest that you create an issue on their tracker about what you are attempting. With some luck they can point you in the right direction.
olesen is offline   Reply With Quote

Reply

Tags
error, installation, openfoam, openfoam 1812, twophaseflow


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
viscosity udf don't use correct temperature and strain rate rezvani Fluent UDF and Scheme Programming 8 May 27, 2021 06:40
How to contribute to the community of OpenFOAM users and to the OpenFOAM technology wyldckat OpenFOAM 17 November 10, 2017 16:54
OpenFOAM v3.0+ ?? SBusch OpenFOAM 22 December 26, 2016 15:24
Problems with running a custom solver: "Unknown psiCombustionModel" AlexKam OpenFOAM Programming & Development 25 November 23, 2015 21:51
Can't get data from OpenFoam to external solver using externalCoupled perry OpenFOAM Running, Solving & CFD 4 May 26, 2014 09:09


All times are GMT -4. The time now is 11:57.