
[Sponsors] 
August 18, 2010, 10:29 
icoLagrangianFoam OF1.6 myNewParticleSolver

#1 
Senior Member
Join Date: Dec 2009
Posts: 112
Rep Power: 15 
Hi There,
i have downloaded icoLagrangianFoam and changed things so that it works on OpenFoam1.6 (I attached it below). I copy pasted the modified Files and added the necessary "# includes header.h" to a copy of the reactingFoamsolver... It works all fine to a point where he tries to compile: Code:
IncompressibleCloud cloud(vpi,U); Code:
myReactingParticleFoam.C:(.text+0x1aed): undefined reference to `Foam::IncompressibleCloud::IncompressibleCloud(Foam::volPointInterpolation const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&)' myReactingParticleFoam.C:(.text+0x52cb): undefined reference to `Foam::IncompressibleCloud::~IncompressibleCloud()' myReactingParticleFoam.C:(.text+0x5f45): undefined reference to `Foam::IncompressibleCloud::~IncompressibleCloud()' The destructor is also defined in "incompressibleCloud.C". So why does it work with the icoLagrangianFoam and not with the reactingFoam? I would appreciate any help!! THX! p.s.: The incompressibleCloud.C looks like this Code:
/**\ =========  \\ / F ield  OpenFOAM: The Open Source CFD Toolbox \\ / O peration  \\ / A nd  Copyright (C) 19912005 OpenCFD Ltd. \\/ M anipulation   License This file is part of OpenFOAM. OpenFOAM is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 021101301 USA Class IncompressibleCloud Description \**/ #include "IncompressibleCloud.H" namespace Foam { defineTypeNameAndDebug(IncompressibleCloud, 0); }; namespace Foam { // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // Construct from components IncompressibleCloud::IncompressibleCloud( const volPointInterpolation& vpi, const volVectorField& U ) : Cloud<HardBallParticle>(U.mesh(),false), constProps_( IOdictionary( IOobject ( "cloudProperties", U.time().constant(), U.db(), IOobject::MUST_READ, IOobject::NO_WRITE ) ) ), runTime_(U.time()), time0_(runTime_.value()), mesh_(U.mesh()), volPointInterpolation_(vpi), random_(666), U_(U), smoment_(mesh_.nCells(), vector::zero), cloudProperties_ ( IOobject ( "cloudProperties", U.time().constant(), U.db(), IOobject::MUST_READ, IOobject::NO_WRITE ) ), interpolationSchemes_(cloudProperties_.subDict("interpolationSchemes")) { HardBallParticle::readFields(*this); } // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // IncompressibleCloud::~IncompressibleCloud() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void IncompressibleCloud::evolve() { smoment_.setSize(U_.size()); smoment_ = vector::zero; autoPtr<interpolation<vector> > UInt = interpolation<vector>::New ( interpolationSchemes_, //remöved volPointInterpolation_, U_ ); HardBallParticle::trackData td(*this,UInt()); label particles=size(); this>move(td); this>inject(td); td.reportCounters(particles); } void IncompressibleCloud::move(HardBallParticle::trackData &td) { smoment_ = vector::zero; Cloud<HardBallParticle>::move(td); } void IncompressibleCloud::inject(HardBallParticle::trackData &td) { if(runTime_.time().value()<td.constProps().tStart_  runTime_.time().value()>td.constProps().tEnd_) { return; } scalar prop=random().scalar01(); if(prop<td.constProps().thres_) { vector tmp=(random().vector01()vector(0.5,0.5,0.5))*2; vector pos=td.constProps().center_+tmp*td.constProps().r0_; tmp=vector(random().GaussNormal(),random().GaussNormal(),random().GaussNormal())/sqrt(3.); vector vel=tmp*td.constProps().vel0_+td.constProps().vel1_; scalar d=fabs(random().GaussNormal())*td.constProps().d1_+td.constProps().d0_; label cellI=mesh_.findCell(pos); if(cellI>=0) { HardBallParticle* ptr=new HardBallParticle(*this,pos,cellI,d,vel); ptr>stepFraction() = 1; addParticle(ptr); td.countInject(); } } } // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // } // namespace Foam // ************************************************************************* // 

August 18, 2010, 11:37 

#2  
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,224
Rep Power: 49 
Quote:
The use of that is discouraged as since 1.5 there are facilities in OF that make most of it obsolete. If you want an example how particles can be added with 10 lines of code or so (most of those are needed to make the particle believe that they are living in a compressible solver) to a normal solvers have a look at https://openfoamextend.svn.sourcefo...agrangianFoam/ which offers basically the same functionality 

August 19, 2010, 07:51 

#3 
Senior Member
Join Date: Dec 2009
Posts: 112
Rep Power: 15 
Hi Bernhard,
thanks for the answer! I will check it out... Best 

August 26, 2010, 13:37 

#4 
Senior Member
Join Date: Dec 2009
Posts: 112
Rep Power: 15 
Hi Bernhard (and other qualified persons),
so I have played around a little with it..as usual I did not get far. I added "basicKinematicCloud.H" an constructor for my cloud and an term to the Uequation. Also a file in my case, so it knows where to inject.. It compiles and is running. So I have some questions. 1. It does not write out any data (the tutorials write out the "lagrangian" folder as I would like it). How do I make him write the lagrangian Data? 2. the running solver says the following for each timestep: Code:
Cloud: ParticleCloud Total number of parcels added = 18 Total mass introduced = 0.0001 Current number of parcels = 0 Current mass in system = 0 3. general question: where are the equations for the lagrangian particles solved/ how do the move ?? Best 

August 27, 2010, 05:45 

#5  
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,224
Rep Power: 49 
Quote:
Quote:
Bernhard 

August 27, 2010, 08:55 

#6 
Senior Member
Join Date: Dec 2009
Posts: 112
Rep Power: 15 
Hi Bernhard,
thanks again! Elvis seems to be pretty quick!! The domain is 1m. Maximum speed is 53m/sec which leads to a minimum residence time of 0.018867925 sec. Time step size is 2.5e6sec. .. Im a little confused..if elvis travels upstream, would be strange...of he leaves through the sidewall(wedge), but there is only the jetspreadingvelocity in radial direction(towards sidewall) so... Code:
*/**\  =========    \\ / F ield  OpenFOAM: The Open Source CFD Toolbox   \\ / O peration  Version: 1.6   \\ / A nd  Web: www.OpenFOAM.org   \\/ M anipulation   \**/ Build : 1.6f802ff2d6c5a Exec : myParticleReactingFoam3 Date : Aug 27 2010 Time : 13:10:20 Host : prandtl PID : 14967 Case : /home/niko/Desktop/V10P1 nProcs : 1 SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 // using new solver syntax: rho { solver PCG; preconditioner DIC; tolerance 1e06; relTol 0; } // using new solver syntax: U { solver PBiCG; preconditioner DILU; tolerance 1e06; relTol 0; } // using new solver syntax: p { solver PCG; preconditioner DIC; tolerance 1e10; relTol 0; } // using new solver syntax: Yi { solver PBiCG; preconditioner DILU; tolerance 1e06; relTol 0; } // using new solver syntax: h { solver PBiCG; preconditioner DILU; tolerance 1e06; relTol 0; } // using new solver syntax: k { solver PBiCG; preconditioner DILU; tolerance 1e10; relTol 0; } // using new solver syntax: epsilon { solver PBiCG; preconditioner DILU; tolerance 1e10; relTol 0; } Reading chemistry properties Reading g Reading thermophysicalProperties Selecting psiChemistryModel ODEChemistryModel<gasThermoPhysics> Selecting thermodynamics package hPsiMixtureThermo<reactingMixture<gasThermoPhysics>> Selecting chemistryReader chemkinReader Selecting chemistrySolver sequential ODEChemistryModel: Number of species = 7 and reactions = 1 Reading field U Reading/calculating face flux field phi Creating turbulence model. Selecting turbulence model type RASModel Selecting RAS turbulence model kEpsilon kEpsilonCoeffs { Cmu 0.09; C1 1.44; C2 1.92; C3 0.33; sigmak 1; sigmaEps 1.3; Prt 1; } Creating field DpDt Courant Number mean: 0.0012324 max: 0.259161 > FOAM Warning : From function Cloud<ParticleType>::initCloud(const bool checkClass) in file /home/niko/OpenFOAM/OpenFOAM1.6/src/lagrangian/basic/lnInclude/CloudIO.C at line 51 Cannot read particle positions file "/home/niko/Desktop/V10P1/0/lagrangian/ParticleCloud" assuming the initial cloud contains 0 particles. Selecting DispersionModel StochasticDispersionRAS Selecting DragModel SphereDrag Selecting InjectionModel ManualInjection Constructing 2D injection Selecting pdfType RosinRammler Selecting PatchInteractionModel StandardWallInteraction Selecting PostProcessingModel none Selecting U IntegrationScheme Euler Starting time loop Courant Number mean: 0.0012324 max: 0.259161 Time = 2.5e06 Solving chemistry diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 > Cloud: ParticleCloud Added 18 new parcels Cloud: ParticleCloud Total number of parcels added = 18 Total mass introduced = 0.0001 Current number of parcels = 0 Current mass in system = 0 DILUPBiCG: Solving for Ux, Initial residual = 9.89937e06, Final residual = 1.25774e09, No Iterations 1 DILUPBiCG: Solving for Uy, Initial residual = 1, Final residual = 2.06847e09, No Iterations 2 DILUPBiCG: Solving for Uz, Initial residual = 1, Final residual = 3.13513e08, No Iterations 2 DILUPBiCG: Solving for CH4, Initial residual = 1.08956e06, Final residual = 1.60948e10, No Iterations 1 DILUPBiCG: Solving for O2, Initial residual = 1.08956e06, Final residual = 1.45812e10, No Iterations 1 DILUPBiCG: Solving for H2O, Initial residual = 0, Final residual = 0, No Iterations 0 DILUPBiCG: Solving for CO2, Initial residual = 0, Final residual = 0, No Iterations 0 DILUPBiCG: Solving for H2, Initial residual = 1.08956e06, Final residual = 1.60948e10, No Iterations 1 DILUPBiCG: Solving for C6H14, Initial residual = 0, Final residual = 0, No Iterations 0 DILUPBiCG: Solving for h, Initial residual = 1.32325e06, Final residual = 2.00099e10, No Iterations 1 DICPCG: Solving for p, Initial residual = 0.99998, Final residual = 2.74215e11, No Iterations 16 DICPCG: Solving for p, Initial residual = 1.83512e11, Final residual = 1.83512e11, No Iterations 0 DICPCG: Solving for p, Initial residual = 1.83512e11, Final residual = 1.83512e11, No Iterations 0 diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 time step continuity errors : sum local = 2.49531e16, global = 7.59107e17, cumulative = 7.59107e17 DILUPBiCG: Solving for epsilon, Initial residual = 0.000535399, Final residual = 6.64667e14, No Iterations 3 DILUPBiCG: Solving for k, Initial residual = 7.86551e06, Final residual = 3.30353e12, No Iterations 2 ExecutionTime = 4.69 s ClockTime = 5 s T gas min/max = 292.966, 293.04 Courant Number mean: 0.00123257 max: 0.259161 Time = 5e06 Solving chemistry diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 Cloud: ParticleCloud Total number of parcels added = 18 Total mass introduced = 0.0001 Current number of parcels = 0 Current mass in system = 0 DILUPBiCG: Solving for Ux, Initial residual = 1.04882e05, Final residual = 1.89928e09, No Iterations 1 DILUPBiCG: Solving for Uy, Initial residual = 0.0115728, Final residual = 1.241e09, No Iterations 2 DILUPBiCG: Solving for Uz, Initial residual = 0.329735, Final residual = 1.26857e08, No Iterations 2 DILUPBiCG: Solving for CH4, Initial residual = 1.87996e06, Final residual = 4.79358e10, No Iterations 1 DILUPBiCG: Solving for O2, Initial residual = 1.87996e06, Final residual = 4.34921e10, No Iterations 1 DILUPBiCG: Solving for H2O, Initial residual = 0, Final residual = 0, No Iterations 0 DILUPBiCG: Solving for CO2, Initial residual = 0, Final residual = 0, No Iterations 0 DILUPBiCG: Solving for H2, Initial residual = 1.87996e06, Final residual = 4.79358e10, No Iterations 1 DILUPBiCG: Solving for C6H14, Initial residual = 0, Final residual = 0, No Iterations 0 DILUPBiCG: Solving for h, Initial residual = 2.15118e06, Final residual = 5.853e10, No Iterations 1 DICPCG: Solving for p, Initial residual = 0.0183647, Final residual = 4.49163e11, No Iterations 13 DICPCG: Solving for p, Initial residual = 2.42097e11, Final residual = 2.42097e11, No Iterations 0 DICPCG: Solving for p, Initial residual = 2.42097e11, Final residual = 2.42097e11, No Iterations 0 diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 time step continuity errors : sum local = 8.26453e16, global = 3.35086e17, cumulative = 1.09419e16 DILUPBiCG: Solving for epsilon, Initial residual = 0.000492396, Final residual = 6.30958e14, No Iterations 3 DILUPBiCG: Solving for k, Initial residual = 0.000379847, Final residual = 1.27046e13, No Iterations 3 ExecutionTime = 6.6 s ClockTime = 7 s T gas min/max = 292.952, 293.088 Courant Number mean: 0.00123284 max: 0.259161 Time = 7.5e06 Solving chemistry diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 Cloud: ParticleCloud Total number of parcels added = 18 Total mass introduced = 0.0001 Current number of parcels = 0 Current mass in system = 0 DILUPBiCG: Solving for Ux, Initial residual = 1.11296e05, Final residual = 2.50938e09, No Iterations 1 DILUPBiCG: Solving for Uy, Initial residual = 0.00956692, Final residual = 1.15139e09, No Iterations 2 DILUPBiCG: Solving for Uz, Initial residual = 0.199243, Final residual = 7.0912e09, No Iterations 2 DILUPBiCG: Solving for CH4, Initial residual = 2.88929e06, Final residual = 1.05279e09, No Iterations 1 DILUPBiCG: Solving for O2, Initial residual = 2.88929e06, Final residual = 9.77396e10, No Iterations 1 DILUPBiCG: Solving for H2O, Initial residual = 0, Final residual = 0, No Iterations 0 DILUPBiCG: Solving for CO2, Initial residual = 0, Final residual = 0, No Iterations 0 DILUPBiCG: Solving for H2, Initial residual = 2.88929e06, Final residual = 1.05279e09, No Iterations 1 DILUPBiCG: Solving for C6H14, Initial residual = 0, Final residual = 0, No Iterations 0 DILUPBiCG: Solving for h, Initial residual = 3.30352e06, Final residual = 1.25508e09, No Iterations 1 DICPCG: Solving for p, Initial residual = 0.00778431, Final residual = 7.47355e11, No Iterations 12 DICPCG: Solving for p, Initial residual = 4.86441e11, Final residual = 4.86441e11, No Iterations 0 DICPCG: Solving for p, Initial residual = 4.86441e11, Final residual = 4.86441e11, No Iterations 0 diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 time step continuity errors : sum local = 2.74574e15, global = 4.83536e17, cumulative = 1.57773e16 DILUPBiCG: Solving for epsilon, Initial residual = 0.000844266, Final residual = 1.26724e13, No Iterations 3 DILUPBiCG: Solving for k, Initial residual = 0.000431396, Final residual = 1.61195e13, No Iterations 3 ExecutionTime = 8.5 s ClockTime = 9 s best! 

August 27, 2010, 10:29 

#7  
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,224
Rep Power: 49 
Quote:
Check your casesetup. Especially the injection (maybe you're shooting in the wrong direction) Bernhard 

August 27, 2010, 10:36 

#8 
Senior Member
Join Date: Dec 2009
Posts: 112
Rep Power: 15 
Hi Bernhard,
me again... I figured it out.. ELVIS does not like to sit on the inlet patch ...then he seems to be scared and does not enter the domain. I placed ELVIS inside now and it is running fine. Thanks again and have a nice weekend! Cheers!! 

October 1, 2010, 08:19 
icoLagrangianFoam as http://www.tfd.chalmers.se/~hani/kurser/OS_CFD_2009/AureliaValli

#9 
New Member
Join Date: Jan 2010
Posts: 9
Rep Power: 15 
I have compiled the icoLagrangian foam under OF 1.6 and I have two questions regarding this solver.
1. I am wondering why the particles are not leaving the computational domain when they reach the outlet of my test case. How and where do you define your outlet as a particle outlet too? 2. I am running into trouble running the case in parallel. Is there any known bug and/or solution to the problem? Kind regards, Antonio The icoLagrangianFoam was compiled as described in: http://www.tfd.chalmers.se/~hani/kur...m_reviewed.pdf 

October 1, 2010, 10:42 

#10  
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,224
Rep Power: 49 
Quote:
@1: any _patch_ should force particles to leave. walls bounce it back @2: there seems to be an issue, but for the reasons given above I never investigated it thoroughly But all this has been discussed elsewhere on the forum. LKook for icoLagrangianFoam and sort the results by time 

October 13, 2010, 16:59 

#11 
New Member
Join Date: Jan 2010
Posts: 9
Rep Power: 15 
Hi Bernhard,
Thank you for your answer and advice. I will probably follow as you say, however I do have one question. The HardBallParticle.C .H and respective clouds are nowhere to be seen in the OF 1.6 version. Are there any alternative and similar clases I should use? Kind Regards, Antonio 

October 14, 2010, 03:25 

#12 
New Member
Join Date: Mar 2010
Posts: 13
Rep Power: 14 
You could have a deeper look in the solidparticle.C/H or the submodels of the sprayclasses. They seems to be very similar.


October 14, 2010, 08:37 

#13  
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,224
Rep Power: 49 
Quote:
Bernhard 

October 19, 2010, 11:21 

#14 
New Member
Join Date: Jan 2010
Posts: 9
Rep Power: 15 
Hi Senior Member,
Di you have any luck embedding the intermediate lagrangian libraries into your solver? Any example you could share? As far, i have not had any luck. Kind regards, 

October 28, 2010, 04:13 

#15 
New Member
Join Date: Mar 2010
Posts: 13
Rep Power: 14 
Hi Foamers,
I have a very strange fault in my simulation. When I try to run a simulation with particles m>10^12 kg the small particles stick on the wallpatch! What's wrong with my case? I vary the restitutionscoefficient e between 0 and 1 with the same results. With heavier particles the case runs well. 

February 10, 2012, 09:03 

#16  
New Member
Jonas L. Ansoni
Join Date: Jun 2011
Location: Brazil
Posts: 22
Rep Power: 13 
Quote:
I'm intending simulate a multiphase flow in a cilyndrical bioreactor. The tank is composed by a tangential inlet and an internal outlet. I plan to simulate a flow with homogeneous particles with water using one or twoway coupling. Is possible apply icoLagrangianFoam to acess this kind of flow? How I download the newest version of the solver on of1.6? Do you know any tutorial? Thank's in advance. 

February 11, 2012, 06:15 

#17  
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,224
Rep Power: 49 
Quote:
Bernhard 

May 11, 2020, 05:15 

#18 
Member
Simon
Join Date: Sep 2019
Location: Germany
Posts: 51
Rep Power: 5 
Hello,
is there a version of icoLagrangianFoam that is compatible with OpenFOAM v7? Or any alternative that is only doing the additional particle tracking? 

May 11, 2020, 09:46 

#19  
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,224
Rep Power: 49 
Quote:
There is a function object icoUncoupledKinematicCloud that allows adding a particle cloud to the solver
__________________
Note: I don't use "Friend"feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request 

May 11, 2020, 16:53 

#20 
Member
Simon
Join Date: Sep 2019
Location: Germany
Posts: 51
Rep Power: 5 

Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Parallel using icoLagrangianFoam  flying  OpenFOAM Running, Solving & CFD  37  March 25, 2011 06:02 
Arbitrary crack propagation using OF1.6  gilav  OpenFOAM Programming & Development  1  May 22, 2010 07:52 
compressibleInterDyMFoam on OF1.6  lucadauria  OpenFOAM Running, Solving & CFD  2  February 24, 2010 21:18 
rhoSimpleFoam OF1.6  sheintz  OpenFOAM  4  September 3, 2009 08:41 
icoLagrangianFoam parallelizatrion problem  shchepan  OpenFOAM Running, Solving & CFD  3  July 28, 2009 09:48 