CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Error while compiling icoLagrangian Foam (

sara November 28, 2008 02:59

Hi I've tried to compile icoL
I've tried to compile icoLagrangianFoam, but when I do wmake I get the following error message:

schairer@schairer-desktop:~/OpenFOAM/schairer-.5/run_execute/IcoLagrangianFoam$ wmake icoLagrangianFoam
Making dependency list for source file icoLagrangianFoam.C
could not open file particle.H for source file icoLagrangianFoam.C
Making dependency list for source file HardBallParticle.C
could not open file particle.H for source file HardBallParticle.C
Making dependency list for source file IncompressibleCloud.C
could not open file particle.H for source file IncompressibleCloud.C
SOURCE=icoLagrangianFoam.C ; g++ -m32 -Dlinux -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I/home/schairer/OpenFOAM/OpenFOAM-1.5/src/cfdTools/incompressible -I/home/schairer/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude -I/home/schairer/OpenFOAM/OpenFOAM-1.5/src/lagrangian/basic/lnInclude -I/home/schairer/OpenFOAM/OpenFOAM-1.5/src/cfdTools/general/lnInclude -I/home/schairer/OpenFOAM/OpenFOAM-1.5/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/schairer/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude -I/home/schairer/OpenFOAM/OpenFOAM-1.5/src/OSspecific/Unix/lnInclude -fPIC -pthread -c $SOURCE -o Make/linuxGccDPOpt/icoLagrangianFoam.o
In file included from icoLagrangianFoam.C:43:
HardBallParticle.H:40:22: error: particle.H: No such file or directory
In file included from icoLagrangianFoam.C:43:
HardBallParticle.H:56: error: expected template-name before '<' token
HardBallParticle.H:56: error: expected `{' before '<' token
HardBallParticle.H:56: error: expected unqualified-id before '<' token
icoLagrangianFoam.C:126: error: expected `}' at end of input
make: *** [Make/linuxGccDPOpt/icoLagrangianFoam.o] Error 1

The error message starts with complaining that the file particle.H isn't found. I can't find it either, it doesn't seem to be in the icoLagrangianFoam directory.
I use OpenFoam 1.5 and downloaded icoLagrangianFoam using the link given in the openfoamWiki.
Could someone please help me to solve this problem?
Cheers, Sara

ivan_cozza November 30, 2008 11:02

Hi Sara! Please post your fil
Hi Sara!
Please post your files in the make directory, maybe there's the problem...

sara November 30, 2008 21:02

Hi Ivan The files in the make
Hi Ivan
The files in the make directory look like this:



EXE = $(FOAM_USER_APPBIN)/icoLagrangianFoam


-I$(LIB_SRC)/cfdTools/incompressible \
-I$(LIB_SRC)/OpenFOAM/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/cfdTools/general/lnInclude \

EXE_LIBS = -lfiniteVolume \


dependencies up to date




- empty file -


# 1 "files"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "files"

EXE = $(FOAM_USER_APPBIN)/icoLagrangianFoam


EXE = $(FOAM_USER_APPBIN)/icoLagrangianFoam


- empty file -






# 1 "options"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "options"
EXE_INC = -I$(LIB_SRC)/cfdTools/incompressible -I$(LIB_SRC)/OpenFOAM/lnInclude -I$(LIB_SRC)/lagrangian/basic/lnInclude -I$(LIB_SRC)/cfdTools/general/lnInclude -I$(LIB_SRC)/finiteVolume/lnInclude

EXE_LIBS = -lfiniteVolume -llagrangian



Sorry for posting them all separately, I don't know how to do it all together.
Thanks for looking at them.

sara December 4, 2008 02:21

Me again I just realized that
Me again
I just realized that icoLagrangianFoam doesn't work with OpenFoam 1.5 which is the one I use. So that's probably the reason why it doesn't work for me.

floooo December 4, 2008 06:34

I have corrected the errors in
I have corrected the errors in order to use it on 1.5

The website upload does'nt work on my computer.

I use this solver to create a rhoPorousSimpleLagrangianFoam
which give the position of particule hiting a filter.

I am actually trying to make a model allowing only small particles to go by, and increasing the wall porosity bit by bit along with the number of molecules clinging on it.

It is very easy to understand what icoLagrangian does, but i have a lot of difficulties to modify it.

ivan_cozza December 4, 2008 07:20

@ Florian: How can I set icoL
@ Florian:
How can I set icoLagrangianFoam to implement a massless particles model? In my application I just need a lagrangian tracking of particles that do not interact with nothing, but only carry with them a random number value...

floooo December 4, 2008 08:03

Hi Ivan The density parame
Hi Ivan

The density parameter in the file cloudProperties means kg/m^3.
I think you have just to chose "density = 0".

gschaider December 4, 2008 09:21

There actually has been a vers
There actually has been a version of icoLagrangianFoam that is working with 1.5 in the SVN, I just never announced it and didn't update the Wiki-page (which I now did)

Nevertheless: be aware that the type of particles used in this solver does not reflect the state-of-the-art in 1.5. For that have look at the particle solvers that can be found in $FOAM_TUTORIALS or the demo-solver Hakan published here


ivan_cozza December 4, 2008 12:54

Florian, if I put density to
if I put density to 0, are there any other interactions between the particles?
Because I need just a lagrangian tracking without any interactions, I want that my particles only travel on the streamlines...

sara December 5, 2008 02:57

Hi Bernhard Thanks a lot, I m
Hi Bernhard
Thanks a lot, I managed to compile icoLagrangianFoam now.
I've tried to work it out but I'm kind of stuck: could you please explain what the expressions in "injection" are?

I guess center is the place where the particles are injected, d is the diameter and tStart to tEnd the period over which particles are injected. vel1 is the velocity.
But what is vel0 since it's a scalar? And what are r0 and thres?

Would be nice if you could give me a short explanation.
Thanks, Sara

floooo December 5, 2008 05:26

In this solver there is no int
In this solver there is no interaction between the particles

Massless particles will follow exatly the stream's lines.

thres (i think particule injection by step)
center (center of the sphere of injection)
r0 (radius of the sphere of injection)

vel0, vel1 (in the solver vel=tmp*vel1+vel0 with tmp a vector)

vel0 is vmin
d0, d1 (in the solver d=random*d1+d0)
d0 is the dmin

tStart (start time of injection)
tEnd (start end of injection)

sara December 8, 2008 03:11

Hi Florian Thanks for your an
Hi Florian
Thanks for your answer. Your explanations concerning vel0, vel1, d0, d1, tStart and tEnd sound good to me. However I don't think that thres can be the number of particles injected per time step.
Thres is set to 0.2 in the cavity example. And however I change it in my file, the number of particles stays the same.
What do you mean by "shpere of injection"? That the particles are injected forming a sphere? Anyway, it doesn't work for me. Sometimes when I change r0 from 0 to nonzero there's no particle injected ( but there was when r0 was 0).
I'm really confused about this.
Has anyone some experience with this solver and can give me a hint what I'm missing here?
Cheers, Sara

floooo December 8, 2008 04:28

Hi, Sara In the code the im
Hi, Sara

In the code the implementation is :
pos = td.consProps().center_+tmp*td.constProps().ro_
tmp = (random().vect01()-vect(0.5,0.5,0.5))*2

In a easier langage the position of the particule is :
pos = center + (a random vector) * ro

Are you sure that the sphere is completely include in your mesh.

thres appears just before

scalar prop=random().scalar01();

I think thres=1 mean injection each step
thres=0.2 means that the probability of injection during a step is 20%.


andersking December 8, 2008 20:35

Hi Sara, I have modified i
Hi Sara,

I have modified icoLagrangianFoam previously to inject a number of particles in each time step (I think by default it only injects one). I have attached two modified files (hopefully they still are compatible)

you will need to add a line "nParts 10;" to the injection section of the cloudProperties dictionary, and a recompile is required of course. IncompressibleCloud.H IncompressibleCloud.C

Also, florian is correct with the threshold. If you set thresh to 1, you'll get nParts every step. Otherwise you may not always get a particle injected.

I hope this helps.


andersking December 8, 2008 21:46

Hi Again, I attached the w
Hi Again,

I attached the wrong files. (They're for 1.4.1).

Here are the correct files. HardBallParticle.H HardBallParticle.C IncompressibleCloud.C


sachin January 6, 2009 16:37

hi, Andrew King : I tried to
Andrew King : I tried to put these files for OpenFOAM1.5 in icoLagrangianFoam but there were some failures related to density (which is because in icoLagrangianFoam density was defined in HardBallparticle class whereas in these files it is done in constantProperties class) also there was failure of constProp function (which is not at all defined in icoLagrangianFoam). I tried to modify but my C++ knowledge is very limited as when i solved these problems something else started failing?
Please help me out?
thanks florian about thres and sphere of injection ,I was searching for it. there is still one question regarding these dimensions...
blockMeshdict we provide a multiplying factor on top 'converttoMetres'
the dimesions given for injection are the absolute values in metres(dimesion of domain per say)or even these dimension will be multiplied by the factor mentioned in blockmeshdict
thanks in advance

floooo January 7, 2009 05:51

blockmesh has an influence onl
blockmesh has an influence only on mesh files during the mesh generation (file contain in Constant/polymesh).
You must specify initial value (velocity.. ) in the defauts units.

sachin January 12, 2009 15:47

hi all, Thanks florian, I ha
hi all,
Thanks florian,
I have 2 more questions
1. I wanted to know the actual equation (if anyone can provide me some ref document it would be helpful) we are solving in the term relax, coeff in hardBallParticle from icoLagrangianFoam , so that i can understand whether i need to add few more terms in that calculation.
2. where and how are we calculating smoment_

thanks in advance

gschaider January 12, 2009 17:45

Hi Sachin! @1: that relax-s
Hi Sachin!

@1: that relax-stuff is just a reformulation of the naive U_new = U_old+dt * dragForce/m (explicit Euler) in a way that makes sure that U_new will not exceed the gas-velocity for too large deltaT

@2: That is just the momentum source for the gas (which is the negative sum of the momentum changes all the particles are seeing)


sachin January 13, 2009 03:24

hi all, Thanks Bernhard I w
hi all,
Thanks Bernhard
I would like to add thermal effect for drag force calculation and eventually to the momentum change in would like to know where are the calculation for smoment_ is done so that i can add these term...smoment_ is actually defined just above tsource calculation where it is used then where are the calculations for smoment_ done

thanks in advance

All times are GMT -4. The time now is 14:34.