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

pimpleFoam compilation error

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 1, 2022, 06:00
Default pimpleFoam compilation error
  #1
New Member
 
Marcin
Join Date: Jun 2022
Posts: 2
Rep Power: 0
marcinm is on a distinguished road
by mistake I post this thread two times, sorry!




Dear All,

I'm using OF2112 installed on WSL2 version of Ubuntu. I want to create a custom solver based on pimpleFoam, but I have a problem with compilation. To test it, I've copied pimpleFoam directory to my local dir ($WM_PROJECT_USER_DIR/applications/solvers/incompressible), changed everything relevant (names, Make/files), but I did not make any changes in the code. And when I'm trying to wmake the following errors appear:
Code:
In file included from testPimpleFoam.C:82:
CorrectPhi.H:2:1: error: expected constructor, destructor, or type conversion before ‘(’ token
    2 | (
      | ^
In file included from CorrectPhi.H:11,
                 from testPimpleFoam.C:82:
/usr/lib/openfoam/openfoam2112/src/finiteVolume/lnInclude/continuityErrs.H:34:1: error: expected unqualified-id before
{’ token
   34 | {
      | ^
In file included from testPimpleFoam.C:158:
correctPhi.H: In function ‘int main(int, char**)’:
correctPhi.H:1:1: error: ‘CorrectPhi’ was not declared in this scope; did you mean ‘correctPhi’?
    1 | CorrectPhi
      | ^~~~~~~~~~
      | correctPhi

make: *** [/usr/lib/openfoam/openfoam2112/wmake/rules/General/transform:35: Make/linux64GccDPInt32Opt/testPimpleFoam.o] Error 1
I don't understand what's going on here.
From my investigation OF has a problem with similar names of two files: CorrectPhi.H (with capital "C", from $FOAM_SRC/finiteVolume/cfdTools/general/CorrectPhi/CorrectPhi.H) and correctPhi.H (lowercase "c", from pimpleFoam local dir). Both files are included in pimpleFoam (in my version CorrectPhi.H in line 82 and correctPhi.H in line 158).

I found two fixes of the issue:
  • provide full path when including CorrectPhi.H (in my case "/usr/lib/openfoam/openfoam2112/src/finiteVolume/cfdTools/general/CorrectPhi/CorrectPhi.H" or "/usr/lib/openfoam/openfoam2112/src/finiteVolume/lnInclude/CorrectPhi.H", both are working);
  • rename "correctPhi.H" inside pimpleFoam dir and change #include directive inside PIMPLE algorithm.
After any of the fix, wmake finishes smoothly and the solver seems to work fine.

But I want to know the reason of this error. It looks strange for me.

Last edited by marcinm; June 2, 2022 at 02:43. Reason: by mistake I post this thread two times, please delete
marcinm 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
Pressure outlet boundary condition rolando OpenFOAM Running, Solving & CFD 62 September 18, 2017 06:45
DPM udf error haghshenasfard FLUENT 0 April 13, 2016 06:35
[OpenFOAM] Native ParaView Reader Bugs tj22 ParaView 270 January 4, 2016 11:39
Compiling problems with hello worldC fw407 OpenFOAM Installation 21 January 6, 2008 17:38
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51


All times are GMT -4. The time now is 23:27.