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

runTime function for coalParcels (parallel running)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 30, 2023, 05:57
Default runTime function for coalParcels (parallel running)
  #1
Senior Member
 
alainislas's Avatar
 
Alain Islas
Join Date: Nov 2019
Location: Mexico
Posts: 142
Rep Power: 6
alainislas is on a distinguished road
Hi OpenFOAM friends,


I'm struggling with making my runTime function to work under parallel running. I know there are the returnReduce and gatherList functions, but don't know how to make it work appropriately. Under serial run is OK.

Basically I have an injection of coalParcels trraveling through my domain. Whenever they fall inside a specified cellZone I want the function to remove the coalParcels.
I'm wondering how to loop over the processors to get all the coalParcels and all the cells from my cellZone ?

Any help / ideas are kindly appreciated



Code:
 codeExecute
#{

        word cellZoneName = "fluid_porousCells";

         const label cellZoneID = mesh().cellZones().findZoneID(cellZoneName);
        const labelList& cellLabels = mesh().cellZones()[cellZoneID];

        const reactingMultiphaseCloud& a = obr_.lookupObject<reactingMultiphaseCloud>("coalCloud1");
        basicReactingMultiphaseCloud * q = (basicReactingMultiphaseCloud*) &a;
        Info << returnReduce(q->size(), sumOp<scalar>()) << endl;

        typedef typename Foam::ReactingMultiphaseParcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam::KinematicParcel<Foam::particle>>>> parcelType;

        forAllIter(basicReactingMultiphaseCloud, *q, pIter)
         {
            if ( mesh().cellZones()[cellZoneID].whichCell(pIter().cell()) != -1 )
            {
                parcelType& p = pIter();
                q->deleteParticle(p);
            }
        }
#};

Last edited by alainislas; November 3, 2023 at 02:30.
alainislas is offline   Reply With Quote

Old   October 30, 2023, 08:32
Default
  #2
Senior Member
 
alainislas's Avatar
 
Alain Islas
Join Date: Nov 2019
Location: Mexico
Posts: 142
Rep Power: 6
alainislas is on a distinguished road
https://gifyu.com/image/S87H4
Attached Images
File Type: jpg video.jpg (92.7 KB, 6 views)
alainislas 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
Error in enabling the python wrapper Jinn SU2 Installation 2 April 23, 2022 13:52
[Other] mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 13 March 7, 2022 17:22
parallel running error B6_lacen OpenFOAM Running, Solving & CFD 0 March 1, 2022 10:55
Compile problem ivanyao OpenFOAM Running, Solving & CFD 1 October 12, 2012 09:31
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 14:00


All times are GMT -4. The time now is 19:05.