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

Various problems compiling interFoam with CFDSupport's v1706 port of OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By dzordz

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 16, 2017, 03:35
Default Various problems compiling interFoam with CFDSupport's v1706 port of OpenFOAM
  #1
Senior Member
 
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12
ndtrong is on a distinguished road
Hi everyone,

I am using OpenFoam for window OF4Win 17.06 and I got following error when building my own code.

If I use default correctPhi.H file of OpenFoam v4. It shows errors like as shown in figure 1( file error1.png)

I think that is due to the change in file correctPhi.H then I use the old version of correctPhi.H (OpenFoam v 2.3) and rebuild my code. It shows error like in fig 2 (file error2.png)

The main error is due to the unqualified-id before { token.

I do not know clearly on this error. Could some one please help me to solve it.

Thank you very much

[Moderator note: Some of the posts below were moved from the thread How to compile Foam code using blueCFD - while several other posts were moved into this thread, given they are all regarding the same topic.]
Attached Images
File Type: png error 1.png (27.5 KB, 54 views)
File Type: png error 2.png (36.7 KB, 30 views)

Last edited by wyldckat; December 31, 2017 at 14:40. Reason: see "Moderator note:"
ndtrong is offline   Reply With Quote

Old   June 18, 2017, 22:38
Default
  #2
Senior Member
 
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12
ndtrong is on a distinguished road
Quote:
Originally Posted by piu58 View Post
There exist some OF pathway. Their software base is not identical. It is discussed for time to toime here.

At the moment, we have to live with that.
Dear Uwe Pilz

I have installed and run tutorial CFD case, it run well following the tutorial setup.
However, when I compile my own code, it showed error like this:
expected unqualified-id before '{' token.

I searched some guide on this error, however, it is not good to deal with this problem. Could you help me on this problem

The error shows like this
Attached Images
File Type: png error 2.png (36.7 KB, 27 views)

Last edited by wyldckat; December 31, 2017 at 14:18. Reason: merged posts 1 minute apart
ndtrong is offline   Reply With Quote

Old   June 19, 2017, 00:12
Default
  #3
Senior Member
 
piu58's Avatar
 
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15
piu58 is on a distinguished road
Quote:
Originally Posted by ndtrong View Post
The error shows like this
The error is in correctPhi.H. You have to analyze it.
__________________
Uwe Pilz
--
Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950)
piu58 is offline   Reply With Quote

Old   June 19, 2017, 06:33
Default
  #4
Senior Member
 
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12
ndtrong is on a distinguished road
Could you please guide me in more detail.
I just copy and build again interFoam solver from default of OpenFoam v-4.
The CorrectPhi.H file is as in the attached file.
Attached Files
File Type: zip interFoam.zip (32.0 KB, 8 views)
ndtrong is offline   Reply With Quote

Old   August 21, 2017, 02:20
Default correctPhi interFoam
  #5
Senior Member
 
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12
ndtrong is on a distinguished road
Hi everyone,

It would be appreciate if someone could help me on the following error during compilation of interFoam based on OpenFoam v17.06

Thanks

---

[Moderator note: Answer for this problem was given here: Error about correctPhi during compilation - post #4]
Attached Images
File Type: jpg 20989061_845806052267134_2525165368760504740_o.jpg (137.1 KB, 38 views)

Last edited by wyldckat; December 31, 2017 at 14:27. Reason: see "Moderator note:"
ndtrong is offline   Reply With Quote

Old   October 11, 2017, 03:47
Default error in compilation openfoam based on OpenFOAM v17.06 for windows
  #6
Senior Member
 
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12
ndtrong is on a distinguished road
Dear Foamer,

I am using OpenFOAM 17.06 Windows version for my CFD. I have errors during compilation as follows:
undefined reference to "Foam::xxxxx"
Even this code can compile well based on OpenFOAM-dev for Ubuntu.
I understand there are different between Linux and Windows version in dynamics linking library but it is difficult for me to correct the error.
It would be appreciated if someone could help me to correct it.

Thanks
Attached Images
File Type: jpg error-bug.jpg (203.1 KB, 26 views)
File Type: jpg error-bug-02.jpg (198.8 KB, 20 views)
ndtrong is offline   Reply With Quote

Old   December 31, 2017, 14:51
Default
  #7
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings to all!

@ndtrong: I've moved several posts that you have about this topic into this single thread, so that it's easier to help you with this problem.

Even though you have solved several of the intermediate problems, there is one critical flaw in how you are trying to do the development of your custom solver.
If I understood correctly what you are trying to do, then what you need to do is as follows:
  1. Use the source code of the solver "interFoam" from the version of OpenFOAM that you are using. This is because this is the source code that is confirmed to work properly with the version that you are using.
  2. Then you need to take the source code on the custom solver that you are trying to use, and compare it with the original source code on which that solver was created.
  3. Then when you know which changes were made between the two solvers (the ones for a specific version of OpenFOAM), then you should make the same changes on the solver for the current version of OpenFOAM.

If you do not do it like this, you will get all of those errors. This is because OpenFOAM has changed considerably between versions, which makes it not very practical to use a solver from an older version of OpenFOAM directly on a more recent version of OpenFOAM.

The latest error message that you have above is a sign of this. The file "Make/options" in the source code provided by CFDSupport, has a fix for that exact problem.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   January 8, 2018, 17:37
Default
  #8
Senior Member
 
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12
ndtrong is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Greetings to all!

@ndtrong: I've moved several posts that you have about this topic into this single thread, so that it's easier to help you with this problem.

Even though you have solved several of the intermediate problems, there is one critical flaw in how you are trying to do the development of your custom solver.
If I understood correctly what you are trying to do, then what you need to do is as follows:
  1. Use the source code of the solver "interFoam" from the version of OpenFOAM that you are using. This is because this is the source code that is confirmed to work properly with the version that you are using.
  2. Then you need to take the source code on the custom solver that you are trying to use, and compare it with the original source code on which that solver was created.
  3. Then when you know which changes were made between the two solvers (the ones for a specific version of OpenFOAM), then you should make the same changes on the solver for the current version of OpenFOAM.

If you do not do it like this, you will get all of those errors. This is because OpenFOAM has changed considerably between versions, which makes it not very practical to use a solver from an older version of OpenFOAM directly on a more recent version of OpenFOAM.

The latest error message that you have above is a sign of this. The file "Make/options" in the source code provided by CFDSupport, has a fix for that exact problem.

Best regards,
Bruno
Dear Bruno,
Thank you very much for your useful suggestions
ndtrong is offline   Reply With Quote

Old   July 20, 2018, 02:09
Default
  #9
Member
 
Join Date: May 2016
Posts: 39
Rep Power: 9
dzordz is on a distinguished road
Quote:
Originally Posted by ndtrong View Post

If I use default correctPhi.H file of OpenFoam v4. It shows errors like as shown in figure 1( file error1.png)
I would refer you to this.
https://stackoverflow.com/questions/...clude-filename

So what works for me is to change in the interFoam.C the line
#include "CorrectPhi.H" to #include <CorrectPhi.H>

Then it compiles it without errors.
Hope it helps
ndtrong likes this.
dzordz is offline   Reply With Quote

Old   April 10, 2020, 11:56
Default
  #10
New Member
 
Depei Song
Join Date: Mar 2020
Posts: 1
Rep Power: 0
Fr13ndSDP is on a distinguished road
Hi, everyone

I have the same issue on WSL, that the code is exactly the same as original interFoam but something went wrong with correctPhi.H. I noticed that in interFoam.C there are two headers, one is "CorrectPhi.H" and another "correctPhi.H", it seems that compiler has mix these two things up.

Change #include "CorrectPhi.H" to #include <CorrectPhi.H> would help but I am realy confused why is it.

Another solution is to rename correctPhi.H, so that this header is unambiguous to the compiler.

Have no idea if this only happen on windows based platform, if anyone knows more about this, please let me know, I will be appreciated.
Fr13ndSDP 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
Some problems in naca 0012 V&V case of NASA TMR and DPW using OpenFOAM chengdi OpenFOAM Running, Solving & CFD 7 October 5, 2019 13:20
interface smearing. InterFoam, OpenFOAM 2.3.0 and higher vagnerserge OpenFOAM Running, Solving & CFD 4 February 4, 2019 07:56
OpenFOAM freelancer required to port case from interFoam to compressibleInterFoam SFr CFD Freelancers 3 December 7, 2017 23:34
How to contribute to the community of OpenFOAM users and to the OpenFOAM technology wyldckat OpenFOAM 17 November 10, 2017 15:54
OpenFOAM 4.0 Released CFDFoundation OpenFOAM Announcements from OpenFOAM Foundation 2 October 6, 2017 05:40


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