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

Error about correctPhi during compilation

Register Blogs Community New Posts Updated Threads Search

Like Tree8Likes
  • 7 Post By Genji
  • 1 Post By danielece04

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 11, 2016, 02:11
Default Error about correctPhi during compilation
  #1
New Member
 
Federica
Join Date: Oct 2015
Posts: 13
Rep Power: 11
fkika is on a distinguished road
Hi everybody,

I'm trying to compile a new solver, but during the compilation I have this error:

correctPhi.H:2:1: error: expected constructor, destructor, or type conversion before ‘(’ token
(
^
In file included from correctPhi.H:11:0,
from myInterPhaseChangeFoam.C:41:
/opt/OpenFOAM/OpenFOAM-3.0.0/src/finiteVolume/lnInclude/continuityErrs.H:32:1: error: expected unqualified-id before ‘{’ token
{
^

What is wrong with my solver?

The correctPhi.H file is this:

CorrectPhi
(
U,
phi,
p_rgh,
dimensionedScalar("rAUf", dimTime/rho.dimensions(), 1),
geometricZeroField(),
pimple
);

#include "continuityErrs.H"

I am using OpenFoam 3.0.0

Thank you!
fkika is offline   Reply With Quote

Old   January 26, 2017, 15:16
Default
  #2
Member
 
Linyan X
Join Date: Dec 2015
Posts: 43
Rep Power: 10
linyanx is on a distinguished road
Hi my friend,

Were you create your solver based on 'interFoam' solver? Is there anything updated for this system's complaint? I am also facing this problem.

Regards,
Linyan
linyanx is offline   Reply With Quote

Old   June 16, 2017, 07:27
Default
  #3
Senior Member
 
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12
ndtrong is on a distinguished road
Quote:
Originally Posted by fkika View Post
Hi everybody,

I'm trying to compile a new solver, but during the compilation I have this error:

correctPhi.H:2:1: error: expected constructor, destructor, or type conversion before ‘(’ token
(
^
In file included from correctPhi.H:11:0,
from myInterPhaseChangeFoam.C:41:
/opt/OpenFOAM/OpenFOAM-3.0.0/src/finiteVolume/lnInclude/continuityErrs.H:32:1: error: expected unqualified-id before ‘{’ token
{
^

What is wrong with my solver?

The correctPhi.H file is this:

CorrectPhi
(
U,
phi,
p_rgh,
dimensionedScalar("rAUf", dimTime/rho.dimensions(), 1),
geometricZeroField(),
pimple
);

#include "continuityErrs.H"

I am using OpenFoam 3.0.0

Thank you!
Dear Federica

Have you solved your problem, could you please share with me the way to overcome it?

Thanks in advance
ndtrong is offline   Reply With Quote

Old   November 1, 2017, 19:55
Default
  #4
New Member
 
Join Date: Sep 2017
Posts: 7
Rep Power: 9
Genji is on a distinguished road
Hi
I faced the same error while trying to build a custom interFoam solver. What solved it was being more specific about the include CorrectPhi.H (Capital C) . So, at the includes before main I changed
#include "CorrectPhi.H" with
#include "cfdTools/general/CorrectPhi/CorrectPhi.H", and added

-I$(LIB_SRC)/finiteVolume \
to my options file.

We are not using the same version of OpenFOAM but I hope this helps.

Last edited by Genji; November 2, 2017 at 12:04.
Genji is offline   Reply With Quote

Old   November 27, 2017, 16:53
Default
  #5
Senior Member
 
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12
ndtrong is on a distinguished road
Quote:
Originally Posted by Genji View Post
Hi
I faced the same error while trying to build a custom interFoam solver. What solved it was being more specific about the include CorrectPhi.H (Capital C) . So, at the includes before main I changed
#include "CorrectPhi.H" with
#include "cfdTools/general/CorrectPhi/CorrectPhi.H", and added

-I$(LIB_SRC)/finiteVolume \
to my options file.

We are not using the same version of OpenFOAM but I hope this helps.
Hi Genji,

It works well.
Thank you very much for your suggestion.
ndtrong is offline   Reply With Quote

Old   December 2, 2020, 08:03
Default
  #6
New Member
 
Daniele
Join Date: Oct 2016
Posts: 2
Rep Power: 0
danielece04 is on a distinguished road
Quote:
Originally Posted by Genji View Post
Hi
I faced the same error while trying to build a custom interFoam solver. What solved it was being more specific about the include CorrectPhi.H (Capital C) . So, at the includes before main I changed
#include "CorrectPhi.H" with
#include "cfdTools/general/CorrectPhi/CorrectPhi.H", and added

-I$(LIB_SRC)/finiteVolume \
to my options file.

We are not using the same version of OpenFOAM but I hope this helps.
I faced the same error while trying to compile ihFoam on Mac (via Docker). Thanks to your suggestion, I solved modifying the main, in which I changed
#include "CorrectPhi.H" with
#include "path/where/CorrectPhi/is/effectively/located", (in my case /opt/OpenFOAM/OpenFOAM-v2006/src/finiteVolume/lnInclude/CorrectPhi.H)

Thank you very much!
sherlock45 likes this.
danielece04 is offline   Reply With Quote

Old   June 5, 2021, 17:03
Default
  #7
New Member
 
Deshik
Join Date: Jun 2021
Location: India
Posts: 5
Rep Power: 5
sherlock45 is on a distinguished road
Hi! I have tried all the suggestions you gave in this thread. Earlier I used to get errors, and when I followed all your suggestions, now I didn't get any. But when I run a test case I didn't get the results. (you can see in the image)
If anyone resolved this issue completely please help..
I have also attached the appropriate files....

Thanks in advance..
Attached Images
File Type: jpg Screenshot 2021-06-06 012519.jpg (48.3 KB, 37 views)
Attached Files
File Type: c myInterPhaseChangeFoam.C (4.1 KB, 12 views)
File Type: h correctPhi.H (166 Bytes, 16 views)
File Type: h createFields.H (2.2 KB, 8 views)
sherlock45 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
Compilation error for OpenFOAM-ext on Ubantu 10.04 32 bit Sargam05 OpenFOAM Installation 13 March 22, 2014 06:21
[swak4Foam] swak4Foam compilation for OF-2.0.0 camoesas OpenFOAM Community Contributions 19 December 10, 2012 14:24
Compilation Error (V 1.7.1; Icc 12.1.0, OpenMPI 1.4.3) floydfan OpenFOAM Installation 7 December 20, 2011 06:56
errors during compilation and installation of OpenFOAM-1.7.x on Ubuntu 10.04 ftec OpenFOAM Installation 7 February 23, 2011 07:07
Compilation Error.... Arnab Siemens 4 September 12, 2004 16:54


All times are GMT -4. The time now is 07:05.