CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Example of use of the solidParticlesolidParticleCloud classes (

alberto June 14, 2007 19:23

Hello, is there any example of
Hello, is there any example of how to use the solidParticle/solidParticleCloud classes of OpenFOAM 1.4?


braveandi February 27, 2008 10:18

Hi Alberto I am also trying
Hi Alberto

I am also trying to include the solidParticle/solidParticleCloud classes in OpenFOAM 1.4.1 with moderate success. Whenever I call solidParticleCloud's constructor I receive a compile error "undefinded reference".

Did you procceed any further?


hani October 4, 2008 06:42

Hi, Any news on how to use

Any news on how to use the solidParticle class? I made a grep on the entire OpenFOAM-1.5 installation, and it seems like there is no example.

There seems to be some problem since a copy of icoFoam will not compile if I simply add a link to the solidParticle and lagrangian classes in Make/options:
-lfiniteVolume \
-llagrangian \
No other modifications are made to icoFoam!

The error message is:
/home/hani/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/ undefined reference to `Foam::Cloud<foam::solidparticle>::typeName'

The same error occurs also without the -llagrangian, and with other combinations of added libraries, so the problem seems to be related to -lsolidParticle. I tried re-compiling the solidParticle class, which went through nicely, but the problem is still there.

Any idea?


mattijs October 4, 2008 12:00

Make sure you use 1.5.x, 1.5 i
Make sure you use 1.5.x, 1.5 is missing a few bits.

#include "solidParticleCloud.H"

In the main create a cloud

solidParticleCloud particles(mesh);

and the gravity g. (readEnvironmentalProperties.H)

Somewhere in your time loop do a


hani October 7, 2008 04:20

Thanks a lot Mattijs! I hav
Thanks a lot Mattijs!

I have added a code and case at the following location for anyone who would like to test the solidParticleCloud class:


wikstrom October 7, 2008 09:15

Splendid! /Niklas


sachin October 14, 2008 13:13

Hi All, The wikipage explains
Hi All,
The wikipage explains that solver is only for demo purpose, can anyone help me out how to use it for real world simulation.
Shall i try and compare this one with i correct ? if not is there any other way ?


hani October 14, 2008 15:26

Hi Sachin, The purpose of t
Hi Sachin,

The purpose of that case was just to set up something for people to start with, so that you know what is needed to have something running. If you have a look at it you will see that it does not solve for any fluid motion, so if your 'real world' simulation has a need for that you must include it. I did not check every detail of the solidParticleCloud class yet, but at least I know that the particles do not interact and there is only one-way coupling. Again, if your 'real world' simulation requires this you must include it. For some 'real world' simulations the case set-up and its assumptions might be alright, the question is how you define your 'real world'. We always do assumptions of different kinds.

My advice: Use anything any way you like, but remember that you are responsible for the conclusions you draw from those results yourself. In other words - make sure what the code does, and validate it as much as you can before you draw any important conclusions.

dieselEngineFoam is of course much more developed, but it is also much more complicated. Also, it is not an example of the solidParticleCloud class, which was the purpose of the present test case.

Good luck!

sachin October 17, 2008 09:54

Thanks Håkan, I now want to k
Thanks Håkan,
I now want to know what is e and mu in solidParticleCloud class...I am not even able to guess these values


hani October 17, 2008 10:11

Hi Sachin, Check the follow
Hi Sachin,

Check the following ang get back with a detailed explanation:

For instance:
void Foam::solidParticle::hitWallPatch
const wallPolyPatch& wpp,
solidParticle::trackData& td
vector nw = wpp.faceAreas()[wpp.whichFace(face())];
nw /= mag(nw);

scalar Un = U_ & nw;
vector Ut = U_ - Un*nw;

if (Un > 0)
U_ -= (1.0 + td.spc().e())*Un*nw;

U_ -= td.spc().mu()*Ut;

Have a nice weekend!

sachin October 17, 2008 17:00

Hi Håkan, Infact i should hav
Hi Håkan,
Infact i should have mentioned in previous post...i was thinking whether it is related to elasticity factor and it correct ?

i m trying to model dusty jet flow and i m not really sure which approach should i follow
1-As taken in this example
2-or the one taken in the sample code of icoLagrangianFoam (available on wikipages)
If 2 one is better somebody please explain me these lines (from IncompressibleCloud.c)

vector tmp=(random.vector01()-vector(0.5,0.5,0.5))*2;
vector pos=center+tmp*r0;
tmp=vector(random.GaussNormal(),random.GaussNormal (),random.GaussNormal())/sqrt( 3.);
vector vel=tmp*vel0+vel1;

scalar d=fabs(random.GaussNormal())*d1+d0;

label cellI=mesh_.findCell(pos);

...Are particle diameter,position,velocity generated randomly that case..i think approach 1 would be nice as my particle would be injected from inlet boundary (i.e. position would be predefined)

Also is there any papers over implementation of lagrangian libraries in OpenFOAM...just to give some idea about it


sripplinger October 23, 2008 13:12

Håkan, Thanks for that wiki

Thanks for that wiki page! I'm hoping that it provides a good starting point for my thesis simulations. I plan on integrating some surface forces (van der waals, and double layer) into the solver to simulate a colloidal suspension. I will also be adding two-way coupling and inter-particle collisions. Perhaps I'll post a new solver with just these as an intermediate step.

hani November 15, 2008 17:44

Hi, I just added a new exam

I just added a new example in the Wiki, where I modify the interFoam solver and the damBreak tutorial so that the solidParticles are included in that case. You have a step-by-step description at: k

By coincidence the splash hits one of the particles so that it hits the wall. The other particle falls to the surface, decelerates in the heavy fluid due to buoyancy, and follows the fluid motion.

Have a nice evening!

hjasak March 13, 2009 08:27

I have just checked in some up
I have just checked in some updates - my fault (out of sync).

Please update and try again - works now.


P.S. Impressive work, Hakan!

egp March 13, 2009 09:36

Hrv, Thanks. That fixed it.
Hrv, Thanks. That fixed it. I'm putting a bunch of the community developments off the Wiki into a openSuse + OpenFOAM-1.5-dev virtual machine for a training class, and a few were broken.

zhoubinwx March 28, 2009 04:51

still undefined reference problem
Hi Håkan,

I have followed the following step:
1. git clone git://, so that I can get OF 1.5.x;
2. svn checkout http://openfoam-extend.svn.sourcefor...dParticleFoam/
3. cd solidParticleFoam/solidParticleFoam
4. wmake
5. However, I get the same error as in OpenFOAM 1.5 when I compile icoLagrantiamFoam solver:
Make/linuxGccDPOpt/solidParticleFoam.o: In function `Foam::Cloud<Foam::solidParticle>::type() const':
solidParticleFoam.C:(.text._ZNK4Foam5CloudINS_13so lidParticleEE4typeEv[Foam::Cloud<Foam::solidParticle>::type() const]+0x11): undefined reference to `Foam::Cloud<Foam::solidParticle>::typeName'
collect2: ld returned 1 exit status
make: *** [/home/zhou/OpenFOAM/zhou-1.5/applications/bin/linuxGccDPOpt/solidParticleFoam] Error 1

Would you please test it? Thank you for attention.


hani March 30, 2009 13:04

I don't see in your steps that you compiled 1.5.x. Did you?


zhoubinwx March 30, 2009 13:12

Hi, Håkan,

You are right, just now I have found this stupid problem.

I add OpenFOAM 1.5.x/etc/barshrc in $HOME/.bashrc & first, then use ./Allwmake under the directory: OpenFOAM/OpenFOAM-1.5.x to compile it.

It is running now.

Thank you for your reply.


zhoubinwx March 31, 2009 16:17

Hi, Håkan,

Update my condition: I can use solidParticleFoam as you suggested in wiki. It is impressive.

Thank you.


zhoubinwx April 20, 2009 10:33

Hi, Håkan and other Foamers,

After I get my flow field(steady-state), I use this flow field to move my particles. It works fine here.

Now I want to generate particles continuously at each time step as well as move the previous generated particles.

Do you have any suggestions for this? I am thinking about this now.

Best regards,


All times are GMT -4. The time now is 15:30.