CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   Add temperature to icoFoam in OpenFOAM 2.1.1 (

magnounibo October 24, 2012 11:24

Add temperature to icoFoam in OpenFOAM 2.1.1
1 Attachment(s)
Hi everybody,

I am a new OpenFOAM user, version 2.1.1 on OpenSUSE 12.1.
I installed OpenFOAM following the instructions that I found in the OF webpage:
The installation terminated successfully and I started to use the solver.

Now, I am trying to modify the solver icoFoam as suggested in the Wiki:

I copied and pasted the icoFoam folder with a new name (icoFoamTemp), renamed the .C file (icoFoamTemp.C), removed the old dependency file (icoFoam.dep), modified the /Make/files script, removed the linux64GccDPOpt folder. Now, as I run the "wmake" command to compile the new solver (still without any modification within any .C and .H file), I got the output error which you can find in the attached file.

Did anybody face the same problem and solved it, or does somebody have any suggestion?


p.s. I made the same on OF 1.6 installed on a OpenSUSE 11.4 machine and it worked perfectly.

Hisham October 25, 2012 10:57

Dear Mirco

Try this site:

Best regards,

magnounibo November 2, 2012 11:49

Thank you Hisham,

the link you provide is very interesting, with lots of useful information. Unfortunately, it wasn't of help in solving my problem. I tried to modify the IcoFoam solver following the guidelines included (they are for OF 1.6, mine is OF 2.1.1), but I received tha same error log message I got while following the Wiki steps.

Hisham November 2, 2012 12:37


It seems that the new solver is not linking to libfiniteVolume correctly. Have you changed anything with the "Make/options" file? Do you have more than one version of OpenFOAM installed?

It would help more if you compress the solver files and attach them.

Sorry, just read your post again. It seems you're using an extend solver on the OpenCFD OpenFOAM. There are some differences of both editions. So you need to compile your solver on an extend environment.


magnounibo November 2, 2012 13:32

1 Attachment(s)
Dear Hisham,

the Make/options file was not modified so it is equal to the original version within icoFoam. I don't have any other version of OF installed. I attach the compressed solver. When I run wmake from within this folder I got the error log attached above.
Please, could you give me more details to understand your last sentence? What do you mean for "extend solver on the OpenCFD OpenFOAM" and "extend environment"?
Thanks again!


Hisham November 2, 2012 14:11

Dear Mirco

I have just compiled your solver successfully. You need to change the destination of your solver though in Make/files:



I think you have a problem with your current OpenFOAM installation. Try to reinstall it!

There are two editions: the original OpenFOAM by OpenCFD (currently owned by ESI). The current version is 2.1.1. There is a community driven release called the extend project. The current release is OpenFOAM-ext-1.6. Both editions are not 100% compatible. So some solvers from the extend edition could not compile or work as expected if compiled under the openCFD edition and vice versa.


magnounibo November 5, 2012 05:02

Dear Hisham,

I really thank you for your precious tips and explanations! I installed the extended version of OF and now I've been able to compile the new IcoTempFoam solver. However, I realize that all my former cases, which were run with the OpenCFD version, do not work anymore with the extended software. As instance, the extended OF does not recognize the PIMPLE routine (maybe it is not implemented).
Thus, if I would decide to keep using the OpenCFD version of OF, do you know what should I do to compile successfully new solvers?

Best regards,


Hisham November 5, 2012 07:55

Hi Mirco

Sorry that I did not mention that earlier but I actually compiled your solver on an OpenCFD edition: OpenFOAM-2.0.1. I think it could be possible to use other versions as well. You just need to try it. I guess you need to re-install OpenFOAM (from OpenCFD). Or you can copy the icoFoam from the extend directory and modify it for temperature as you did. This should be the easiest way to do it.

Best regards

magnounibo November 5, 2012 09:33

Dear Hisham,

now I'm understanding a bit more the issue. Maybe all of this is due to the fact that I installed the OpenCFD version of OF (2.1.1) only by downloading the rpm packages for opensuse as suggested in this link:

Following the guidelines reported in the web page, I could install OF in few seconds, so I guess I did not install it from the source files (otherwise it would have taken more time, as the extend version did). It might be that, in this way, OF can be used as a CFD solver but it can not be compiled and new solvers can not be compiled. I'm gonna check if, by compiling it from sources, it may work or not and I will post it.
Thanks again,


magnounibo November 6, 2012 11:54

Dear Hisham,

I have installed OF 2.1.1 from sources following the guidelines of Alberto Passalacqua blog:

The installation terminated successfully without any problem! Finally, I was able to compile the new solver. Hence, I believe that in order to compile new solvers, the version of OF installed has to be that from source and not from rpm packages, which is useful only if the user does not need to compile new solvers.
I hope this will be of help for any new OF user (like me)!
Hisham, thanks you again,


zania April 11, 2013 14:47

I got a warning message
Following the instructions
after wmake I got :
/home/user/OpenFOAM/OpenFOAM-2.1.1/src/finiteVolume/lnInclude/readPISOControls.H:3:15: war: unused variable ‘nOuterCorr’ [-Wunused-variable]
/home/user/OpenFOAM/OpenFOAM-2.1.1/src/finiteVolume/lnInclude/readPISOControls.H:12:16: warning: unused variable ‘momentumPredictor’ [-Wunused-variable]
/home/user/OpenFOAM/OpenFOAM-2.1.1/src/finiteVolume/lnInclude/readPISOControls.H:15:16: warning: unused variable ‘transonic’ [-Wunused-variable]
may I carry on using the new solver?

wyldckat April 14, 2013 13:20

Greetings zania,

Those warnings are normal. I'll quote myself from a post I made back in 2010 :cool::

Originally Posted by wyldckat (Post 277669)
Those warnings are actually normal. AFAIK, those solvers use header files that are common to various solvers and not all solvers use those variables, therefore it triggers warning messages on those that don't use them.

You can safely proceed, if you only got warnings and no errors!

Best regards,

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