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

Easy lagrangian fluid particle tracking

Register Blogs Community New Posts Updated Threads Search

Like Tree9Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 26, 2015, 05:36
Default
  #21
Senior Member
 
Albrecht vBoetticher
Join Date: Aug 2010
Location: Zürich, Swizerland
Posts: 240
Rep Power: 17
vonboett is on a distinguished road
Hi Mamadou,

have a look at the coneNozzleInjection in the sprayFoam/aachenBomb tutorial: massFlowRateProfile sets the mass flow at a certain time (t, m*).
Although the parcels per second are specified, there might be a possibility to get that calculated if the mass per parcel is fixed. Its only a guess based on
http://www.tfd.chalmers.se/~hani/kur...ing_report.pdf stating that "in a transient case, the time-step,
the duration of the injection, the mass flow rate and other properties defined are taken into account to calculate the number of parcels the injector is going to introduce
in the system per time-step in order to fulfill the user's requirements."
Looking at PatchFlowRateInjection.H seems to confirm that there are ways to adjust the number of parcels injected, because the user
specifies Injection target concentration/carrier volume flow rate and the parcel diameters are obtained by the distribution model which should allow constant values...

vonboett is offline   Reply With Quote

Old   February 5, 2016, 10:23
Default
  #22
Member
 
Peter
Join Date: Nov 2015
Location: Hamburg, Germany
Posts: 57
Rep Power: 11
potentialFoam is on a distinguished road
Dear Foamers,

the original question dealt with the tracking of massless particles and the latest answers as well as the proposed work from chalmers
http://www.tfd.chalmers.se/~hani/kur...LPT_120911.pdf
(and others) deal with solid particles (with a mass and diameter greater than zero).

How did the first question (tracking of massless particles) has been solved finally?

I think, one can modify a solver like here:
http://www.tfd.chalmers.se/~hani/kur...tonPersson.pdf
(chapter 3) and use another particle class instead of the 'solidParticle' one.
(Maybe the basic one from '$FOAM_SRC/lagrangian/basic/particle/'?)

Besides, why to write a new function therefor like in post #5:
http://www.cfd-online.com/Forums/ope...tml#post343725

Thanks
potentialFoam is offline   Reply With Quote

Old   February 5, 2016, 10:29
Default
  #23
Senior Member
 
Albrecht vBoetticher
Join Date: Aug 2010
Location: Zürich, Swizerland
Posts: 240
Rep Power: 17
vonboett is on a distinguished road
iconUncoupledKinematicParcelFoam worked for me to use particles as passive tracers and modifying that to a interFOAM version for open channel flow was straight forward.
potentialFoam and oumnion like this.
vonboett is offline   Reply With Quote

Old   February 8, 2016, 12:58
Default
  #24
Member
 
Peter
Join Date: Nov 2015
Location: Hamburg, Germany
Posts: 57
Rep Power: 11
potentialFoam is on a distinguished road
At first: thanks for your fast response!

Unfortunately, I don't understand how to use (ico)uncoupledKinematicFoam for massless tracer particles.
Hence, within the 'kinematicCloudProperties' dict file, you have to specify collision parameters ASO. Besides, running the solver tells the user how much mass has been added (mass introduced).
How to setup the solver for massless tracer particles?

Referring to this post
http://www.cfd-online.com/Forums/ope...tml#post277371
I produced a transient solution (with pimpleFoam) and used the case-folders for the simulation with icoUncoupledKinematicFoam.
But icoUncoupledKinematicFoam did'nt use the solution, but used a steady velocity field out of it.
According to what I understood, the icoUncoupledKinematicFoam-solver should read the solution and use it to calculate the positions of the tracer particles.
Why does'nt it work?
potentialFoam is offline   Reply With Quote

Old   February 10, 2016, 05:50
Default
  #25
Senior Member
 
Albrecht vBoetticher
Join Date: Aug 2010
Location: Zürich, Swizerland
Posts: 240
Rep Power: 17
vonboett is on a distinguished road
The particles take over the velocity field without momentum transfer to the fluid phase in icoUncoupledKinematicParcelFoam and I would start with the corresponding hopper tutorial in the lagrangian tutorial folder. Yes, the particles interact and that's OK because they will not leave your boundaries that way. What I do to use them as passive tracers is to define their diameter as neglectible small in kinematicCloudProperties:

parcelBasisType fixed;
sizeDistribution
{
type fixedValue;
fixedValueDistribution
{
value 1e-6;
}
}

A million particles have then about 5e-10 kg mass in my water flow. However, my main whish was to have more control about when to write the particle positions, so I implemented the lagrangian parts looking through the interSettlingFoam and LPT for erosion modeling project reports (Chalmers University of Technology, Pedram Ramin / Alejandro Lopez) and the Coupling of VOF with LPT in OpenFOAM by Aurelia Vallier LTH Lund University and some others I cant remember right now but I could look it up. The result was an implementation I try to show step by step: I decided to go for kinematicCloud but the code allows to go for a particleCloud implementation, too, making use of particle classes defined in a src dictionary created in your OpenFOAM user dictionary so you can modify them if you need to. To have the modified classes in your solver from lagrangian/intermediate so the make/options file starts with:
LIB_USER_SRC = $(WM_PROJECT_USER_DIR)/src

then one needs (or at least I put it in here):

-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
-I$(LIB_USER_SRC)/lagrangian/intermediate/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
...
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude
and at the libraries (EXE_LIBS =)
-llagrangian \
-llagrangianIntermediate \
-lthermophysicalFunctions \
-lfluidThermophysicalModels \
-lspecie \
-lradiationModels \

I copied the solidParticle and solidParticleCloud class files into my solver folder and in my solver.c file I added the headers:

#include "basicKinematicCollidingCloud.H"
#include "solidParticleCloud.H"

before the main method. In the main method, the very first thing to do is

argList::addOption
(
"cloudName",
"name",
"specify alternative cloud name. default is 'kinematicCloud'"
);

In the solver in the runTime.run(), all you need is:

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// kinematic cloud AND particle cloud

mu = mixture.nu()*rhoInfValue; // needed for cloud
kinematicCloud.evolve();
if (false)//(runTime.value()-lastIOTime>lagInterval)
{
//Info <<runTime.times()[0].value();
kinematicCloud.writeFields();
lastIOTime = runTime.value();
}
// particleCloud addresses Uc as fluid velocity
//Uc = U;

/*particles.move(g);commented out, only kinematic cloud
if (runTime.value()-lastIOTime>lagInterval)
{
//Info <<runTime.times()[0].value();
particles.writeFields();
lastIOTime = runTime.value();
}*/


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

but in the createFields.H you need to specify the missing fields, the fluid density as the lagrangian phase asks for it:

volScalarField rhoInf
(
IOobject
(
"rhoInf",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
rhoInfValue
);

and maybe gravitation, (at least in interFoam):

volScalarField gh("gh", g & mesh.C());
surfaceScalarField ghf("ghf", g & mesh.Cf());

and finally:

word kinematicCloudName("kinematicCloud");
args.optionReadIfPresent("cloudName", kinematicCloudName);

Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
basicKinematicCollidingCloud kinematicCloud
(
kinematicCloudName,
rhoInf,
U,
mu,
g
);

IOobject Hheader
(
"H",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
);

autoPtr<volVectorField> HPtr;

if (Hheader.headerOk())
{
Info<< "\nReading field H\n" << endl;

HPtr.reset(new volVectorField (Hheader, mesh));
}

IOobject HdotGradHheader
(
"HdotGradH",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
);

autoPtr<volVectorField> HdotGradHPtr;

if (HdotGradHheader.headerOk())
{
Info<< "Reading field HdotGradH" << endl;

HdotGradHPtr.reset(new volVectorField(HdotGradHheader, mesh));
}

#include "createNonInertialFrameFields.H"


Info<< "Constructing particleCloud commented out, only kinematiClouds" << endl;
//solidParticleCloud particles(mesh);

the createNonInertialFrameFields.H file looks like:


Info<< "Reading non-inertial frame fields" << endl;

IOobject linearAccelerationHeader
(
"linearAcceleration",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
);

autoPtr<uniformDimensionedVectorField> linearAccelerationPtr;

if (linearAccelerationHeader.headerOk())
{
Info<< " Reading " << linearAccelerationHeader.name() << endl;

linearAccelerationPtr.reset
(
new uniformDimensionedVectorField(linearAccelerationHe ader)
);
}


IOobject angularVelocityHeader
(
"angularVelocity",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
);

autoPtr<uniformDimensionedVectorField> angularVelocityPtr;

if (angularVelocityHeader.headerOk())
{
Info<< " Reading " << angularVelocityHeader.name() << endl;

angularVelocityPtr.reset
(
new uniformDimensionedVectorField(angularVelocityHeade r)
);
}


IOobject angularAccelerationHeader
(
"angularAcceleration",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
);

autoPtr<uniformDimensionedVectorField> angularAccelerationPtr;

if (angularAccelerationHeader.headerOk())
{
Info<< " Reading " << angularAccelerationHeader.name() << endl;

angularAccelerationPtr.reset
(
new uniformDimensionedVectorField(angularAccelerationH eader)
);
}


IOobject centreOfRotationHeader
(
"centreOfRotation",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
);

autoPtr<uniformDimensionedVectorField> centreOfRotationPtr;

if (centreOfRotationHeader.headerOk())
{
Info<< " Reading " << centreOfRotationHeader.name() << endl;

centreOfRotationPtr.reset
(
new uniformDimensionedVectorField(centreOfRotationHead er)
);
}


and you put it in your solver folder. Hope this helps. However, in case you want to go for a two-way coupling, I recommend the way it is done in DPMFoam (source terms in the pressure equation), that worked well for me to get a stable coupled lagrangian interMixingFoam version.
potentialFoam and rezaeimahdi like this.
vonboett is offline   Reply With Quote

Old   July 25, 2016, 16:44
Default
  #26
Member
 
Yong Wang
Join Date: Apr 2009
Posts: 34
Rep Power: 17
ywang is on a distinguished road
Quote:
Originally Posted by potentialFoam View Post
At first: thanks for your fast response!

Unfortunately, I don't understand how to use (ico)uncoupledKinematicFoam for massless tracer particles.
Hence, within the 'kinematicCloudProperties' dict file, you have to specify collision parameters ASO. Besides, running the solver tells the user how much mass has been added (mass introduced).
How to setup the solver for massless tracer particles?

Referring to this post
http://www.cfd-online.com/Forums/ope...tml#post277371
I produced a transient solution (with pimpleFoam) and used the case-folders for the simulation with icoUncoupledKinematicFoam.
But icoUncoupledKinematicFoam did'nt use the solution, but used a steady velocity field out of it.
According to what I understood, the icoUncoupledKinematicFoam-solver should read the solution and use it to calculate the positions of the tracer particles.
Why does'nt it work?
Hi Peter,

Did you finally find the answer? I am also thinking about using uncoupledKinematicFoam to read pre-calculated transient flow field.
ywang is offline   Reply With Quote

Old   April 14, 2017, 08:22
Default
  #27
New Member
 
zhaoshiyu
Join Date: Nov 2016
Posts: 8
Rep Power: 10
zhaoshiyu is on a distinguished road
Hi, Vonbotte, I also work on the debris flow simulation. I am quite curious about the particle method in openFoam coupled with interFoam, but in my case, it is only weightless tracers, is it possible to use it as the way in CFD-DEM coupling?
zhaoshiyu is offline   Reply With Quote

Old   January 10, 2020, 00:55
Default
  #28
Member
 
methma Rajamuni
Join Date: Jul 2015
Location: Victoria, Australia
Posts: 40
Rep Power: 11
meth is on a distinguished road
Dear MIchael,

Can you please share your files with me, if I am not too late?

Thank you
Methma



Quote:
Originally Posted by michaelb View Post
Hi Bernhard,

I managed to inject some particles with kinematicCloud classes in the pimpleFoam transient solver. Here's an example with around 5000 particles in a 3D lid-driven cavity. Works fine in parallel too. Tell me if you want me to share.

However, I'm still wondering about the kinematicCloudProperties file, and yet not sure whether I specified correct parameters for massless fluid particles.
The reason I'm doubting is that when I turn off the particleForces, particles aren't moving anymore. And much of the parameters are still very obscure to me.

I'm doubting whether I should start I new thread about the correct use of "kinematicCloudProperties". Would somebody be able to tell us a little bit more about it ?

Cheers,

Michael

meth is offline   Reply With Quote

Reply


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
Blood Damage Modelling via Particle Tracking in a Centrifugal Heart Pump scatman CFX 7 January 8, 2018 01:59
Lagrangian Particle Tracking Initial step Bruce Hartley OpenFOAM Programming & Development 4 September 2, 2015 06:32
Lagrangian particle tracking skabilan OpenFOAM Running, Solving & CFD 7 July 15, 2014 13:40
Particle tracking without "Particle interaction with continuous phase" Peter023 Fluent UDF and Scheme Programming 0 November 30, 2011 10:08
cod for lagrangian particle tracking mazdak Main CFD Forum 2 December 29, 2009 03:53


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