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

Access particle data in main function

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   July 18, 2011, 11:20
Default Access particle data in main function
  #1
New Member
 
Join Date: Oct 2010
Posts: 13
Rep Power: 15
moritzhoefert is on a distinguished road
Hello,

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:
Code:
    
volVectorField effU
    (   IOobject
        (   "effU",
            mesh.time().timeName(),
            U.mesh(),
            IOobject::NO_READ,
            IOobject::AUTO_WRITE
        ),
        mesh,
        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:
Code:
    
forAll(parcels, pI) 
    {   
        Info << pI << endl;
    }
Within that loop I would like to do someting like this ("pseudocode")
Code:
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,
Moritz

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

 


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
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 17:27


All times are GMT -4. The time now is 11:23.