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

Modified interFoam compilation fails

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By voingiappone

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 12, 2012, 03:03
Default Modified interFoam compilation fails (SOLVED)
  #1
Member
 
Luca Giannelli
Join Date: Jun 2010
Location: Kobe, Japan
Posts: 58
Rep Power: 16
voingiappone is on a distinguished road
Howdy!

I have been looking for a solution for a mixing time determination problem in the postprocessing section and I have been introduced for the first time to the modification of OpenFOAM solvers. That created another bigger problem I don't seem to be able to solve.

Despite the addition of temperature in the simpleFoam worked as expected, I cannot compile the interFoam solver.... even before making any modification! The error I get is:

Code:
Make/linux64GccDPOpt/tracer_interFoam.o: In function `main':
tracer_interFoam.C:(.text.startup+0xe8c): undefined reference to `Foam::incompressible::turbulenceModel::New(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&)'
collect2: ld returned 1 exit status
make: *** [/home/piota/OpenFOAM/OpenFOAM-1.6/applications/bin/linux64GccDPOpt/tracer_interFoam] Error 1
I desperately searched inside the source to find something to solve the problem and I ended up identifying (probably) the .H file which causes trouble. I found that the references are in the turbulenceModel.H file which includes the volFieldsFwd.H file that defines fvPatchField and fvsPatchField.

I tried with my 0 (zero) knowledge to comment out the definitions of functions and run wmake again but it was obviously complaining that no definition of the variables was done.

Is there anybody who has an idea why the "out of the box" compiling of interFoam fails miserably like this??

Thank you in advance

Last edited by voingiappone; December 12, 2012 at 22:29. Reason: problem solved
voingiappone is offline   Reply With Quote

Old   December 12, 2012, 03:50
Default
  #2
Member
 
Luca Giannelli
Join Date: Jun 2010
Location: Kobe, Japan
Posts: 58
Rep Power: 16
voingiappone is on a distinguished road
to enrich the discussion I just found a bug which look similar to my error.

http://openfoam.org/mantisbt/print_b...php?bug_id=130

That got solved but unfortunately the same does not apply to my case.
I suspect it can be of some help though....
voingiappone is offline   Reply With Quote

Old   December 12, 2012, 04:51
Default
  #3
Member
 
Luca Giannelli
Join Date: Jun 2010
Location: Kobe, Japan
Posts: 58
Rep Power: 16
voingiappone is on a distinguished road
And then.....
he finally found the solution!!

I used the bug reported in the link in the previous post to do a comparison with my case. The compiler was complaining about the Foam::incompressible::turbulenceModel:: while the bug was reporting a complain about the Foam::interfaceProperties::interfaceProperties that could be solved by the -linterfaceProperties in the proper options file.

As in my case I already had it linked and as I was having problems with the "turbulence" I immediately realized that the problems were quite similar. I headed then for the /OpenFOAM-1.6/lib/linux64GccDPOpt folder and identified the library I needed (libincompressibleTurbulenceModel.so).
I modified the options file including the proper line and making it looking like this:

Code:
EXE_INC = \
    -I$(LIB_SRC)/transportModels \
    -I$(LIB_SRC)/transportModels/incompressible/lnInclude \
    -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
    -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
    -I$(LIB_SRC)/finiteVolume/lnInclude

EXE_LIBS = \
    -linterfaceProperties \
    -lincompressibleTransportModels \
    -lincompressibleRASModels \
    -lincompressibleLESModels \
    -lfiniteVolume \
    -lincompressibleTurbulenceModel
run wmake and ended up with a working interFoam executable!

It took me one day to figure out how to do this trivial thing but I worked out all by my self, so it was a good study session.

I'll leave it here for any future reference!

Luca
voingiappone is offline   Reply With Quote

Old   September 18, 2013, 10:41
Default
  #4
New Member
 
Samanta Busmayer
Join Date: May 2012
Posts: 10
Rep Power: 14
sbusmayer is on a distinguished road
Dear voingiappone, I read your posts and am trying to calculate residence time of a potable water tank that has an inlet and outlet. I want to use a tracer with the same characteristics as the water and visualize the concentration at the outlet over time.

Did you use Temperature as a tracer or Concentration?

I'm guessing that you succeeded with your case, so would like to ask if you could share with me your codes please?

Really appreciate your help!
=)
sbusmayer is offline   Reply With Quote

Old   September 19, 2013, 05:29
Default
  #5
Member
 
Luca Giannelli
Join Date: Jun 2010
Location: Kobe, Japan
Posts: 58
Rep Power: 16
voingiappone is on a distinguished road
Samanta, thanks for the interest in my posts!

Quote:
Originally Posted by sbusmayer View Post
Did you use Temperature as a tracer or Concentration?
I used a "passive scalar" that is, I added de-novo another equation in the InterFOAM which is solved separately from the main one. I used the same approach used with the temperature in icofoam (you probably already know this http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam). Have you tried that tutorial? I strongly suggest you to try it as it is not time consuming at all and you can learn a lot of things. It helps expecially when you will try to add other things later!

By the way the equation you want to end up with is:

\frac{\partial C}{\partial t}+\nabla \cdot \phi C + \nabla\cdot D \nabla C = 0

which reads in the code as

Code:
fvm::ddt(C)
+ fvm::div(phi, C)
+ fvm::laplacian(D, C)
Once that you have your equation in the solver you can use the diffusion coefficient for the tracer you want to simulate (I used NaCl with D=2 e-9) and you are good to go!

I think you can get everything working in half a day so try it.
If you will fail for some reason I will send the files but I will have to modify them back as I added tons of new modifications after this one. I am also not so sure that the modifications are compatible in all OF versions.

Let me know.

Luca
becher97 likes this.
voingiappone is offline   Reply With Quote

Old   September 20, 2013, 18:33
Default
  #6
New Member
 
Samanta Busmayer
Join Date: May 2012
Posts: 10
Rep Power: 14
sbusmayer is on a distinguished road
Dear voingiappone,
Thank you SO MUCH for your reply! It really helped me to understand what to do for now.
I used a modified icoFoam with NaCl as tracer in my tank geometry =)

My following steps are:
1) Just give a pulse of the tracer at t=0 for about 1min, and then plot the concentration curve at the outlet. Have you done this?
2) Add turbulence - Do you think pimpleFoam would do?


Thx mate!!
sbusmayer is offline   Reply With Quote

Old   October 1, 2013, 04:47
Default
  #7
Member
 
Luca Giannelli
Join Date: Jun 2010
Location: Kobe, Japan
Posts: 58
Rep Power: 16
voingiappone is on a distinguished road
Samanta, I wrote my reply back in the other thread.
voingiappone is offline   Reply With Quote

Reply

Tags
compilation error, interfoam, turbulence model


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
Pipe Junction with interFoam Pressure Bounday Fails mgdenno OpenFOAM 8 April 5, 2013 10:39
Error with modified interFoam solver robertmaier9 OpenFOAM 3 September 30, 2011 07:26
Compilation fails on Linuxx86 agrahn OpenFOAM Bugs 21 August 31, 2007 05:10
Modified boundaries for InterFoam kumar2 OpenFOAM Running, Solving & CFD 5 August 16, 2007 04:27
Compilation fails on suse linux 101 su_junwei OpenFOAM Bugs 2 July 20, 2007 05:56


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