CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Programming & Development

Access particle data in main function

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   July 18, 2011, 11:20
Default Access particle data in main function
New Member
Join Date: Oct 2010
Posts: 13
Rep Power: 7
moritzhoefert is on a distinguished road

I would like to write a post processing tool for Euler-Lagrange-Simulations that reads particle properties and stores for each cell the particle mass weighted velocity of all particles located in the respective cell.

I created a vector field:
volVectorField effU
    (   IOobject
        (   "effU",
        dimensionedVector("effU", dimensionSet(0,1,-1,0,0,0,0), vector(0,0,0))
I was also able to create a loop through something that is related to the particles:
forAll(parcels, pI) 
        Info << pI << endl;
Within that loop I would like to do someting like this ("pseudocode")
forAll(parcels, pI)
{  Foam::label cellI = parcels[pI].cell();
   effU[cellI] += parcels[pI].Volume()*parcels[pI].rho()*parcels[parcelI].U();
   w[cellI] += parcels[pI].Volume()*parcels[pI].rho();
effU = effU/w;
How can I access particle velocities, diameters and IDs of the cells the particles are located in within the above loop or rather how can I make the above idea work in OF?

I am sorry that I ask such a basic question but I have never programmed on that level in OpenFOAM. Thank you for any help!

All the best,

The template solver for my post processing tool is porousExplicitSourceReactingParcelFoam from OF 2.0.x.
moritzhoefert is offline   Reply With Quote


Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile problem ivanyao OpenFOAM Running, Solving & CFD 1 October 12, 2012 09:31
Error with Wmake skabilan OpenFOAM Installation 3 July 28, 2009 00:35
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51
Saving particle (DPM) data to file? Philip FLUENT 2 June 12, 2006 01:41
How to update polyPatchbs localPoints liu OpenFOAM Running, Solving & CFD 6 December 30, 2005 18:27

All times are GMT -4. The time now is 20:54.