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

Adding particles/parcels to kinematicCloud

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By schf

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 25, 2017, 09:39
Default Adding particles/parcels to kinematicCloud
  #1
New Member
 
Join Date: Aug 2017
Posts: 10
Rep Power: 8
schf is on a distinguished road
Hello everybody,
I hope you can help me understanding the kinematicCloud. I created one like this:

Code:
const word kinematicCloudName
(
    args.optionLookupOrDefault<word>("cloudName", "mykinematicCloud")
);

Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
basicKinematicCloud mykinematicCloud
(
    kinematicCloudName,
    rho,
    U,
    mu,
    g
);
And now I want to add some particles by hand with a given velocity and diameter in a own function KinematicCloud<CloudType>::injectLPT(...).
As far as I understand, the kinematicCloud uses just parcels. So if i want to add single particles, I have to use one parcel per particle.

I implemented something similar for the solidCloud for adding particles to the cloud:
Code:
    solidParticle* ptr1 = new solidParticle(mesh_, coordinates_, celli_, tetFacei_, tetPti_,tempDiam, tempU);
    
    Cloud<solidParticle>::addParticle(ptr1);
But for the KinematicParcel I don't get it working

For this:
Code:
    KinematicParcel* ptr1 = new KinematicParcel(mesh_, coordinates_, celli_, tetFacei_, tetPti_);//,tempDiam, tempU);
I get this error:
Code:
In file included from xxx/src/lagrangian/intermediate/lnInclude/KinematicCloud.H:645:0,
                 from xxx/src/lagrangian/intermediate/lnInclude/basicKinematicCloud.H:36,
                 from myInterFoam.C:54:

xxx/src/lagrangian/intermediate/lnInclude/KinematicCloud.C: In Elementfunktion »void Foam::KinematicCloud<CloudType>::injectLPT(const vector&, const scalar&, const vector&)«:
xxx/src/lagrangian/intermediate/lnInclude/KinematicCloud.C:807:20: Fehler: missing template arguments before »*« token
     KinematicParcel* ptr1 = new KinematicParcel(mesh_, coordinates_, celli_, tetFacei_, tetPti_);//,tempDiam, tempU);
But which template arguments are missing?
schf is offline   Reply With Quote

Old   September 26, 2017, 01:14
Default
  #2
Member
 
Vishwesh Ravi Shrimali
Join Date: Aug 2017
Posts: 43
Rep Power: 8
vishwesh is on a distinguished road
Hi!

I am also trying to do a similar thing. I have a questions regarding this.

1. What OpenFOAM Version are you using?
2. According to the error a template argument is missing so most probably you are missing an argument. Try referring to the template of kinematicParcel and kinematicCloud to find out the arguments to define a new kinematicParcel.

Also, how are you adding a particle to the existing kinematicCloud?
I have a solver which detects a droplet during the runtime and is able to find out the following information about the droplet:
  • Position of the center of the droplet
  • Velocity of the droplet
  • Diameter of the droplet
  • Volume of the droplet

Now since I don't know when a particle will be detected by my solver, I can't get an SOI where all the particles have to be added to the kinematicCloud for tracking. So, I want to keep my SOI as 0 and then add any newly detected particle to the cloud for further tracking. How are you adding a particle/parcel to your kinematicCloud?
vishwesh is offline   Reply With Quote

Old   September 28, 2017, 03:14
Default
  #3
New Member
 
Join Date: Aug 2017
Posts: 10
Rep Power: 8
schf is on a distinguished road
Hey!
I'm using OpenFOAM 5.0

The constructors for the KinematicParcel-Template are:
Code:
...
    // Constructors

        //- Construct from mesh, coordinates and topology
        //  Other properties initialised as null
        inline KinematicParcel
        (
            const polyMesh& mesh,
            const barycentric& coordinates,
            const label celli,
            const label tetFacei,
            const label tetPti
        );

        //- Construct from a position and a cell, searching for the rest of the
        //  required topology. Other properties are initialised as null.
        inline KinematicParcel
        (
            const polyMesh& mesh,
            const vector& position,
            const label celli
        );

        //- Construct from components
        inline KinematicParcel
        (
            const polyMesh& mesh,
            const barycentric& coordinates,
            const label celli,
            const label tetFacei,
            const label tetPti,
            const label typeId,
            const scalar nParticle0,
            const scalar d0,
            const scalar dTarget0,
            const vector& torque0,
            const constantProperties& constProps
        );
...
So that should be fine.

For the missing template I think it should be something like:
Code:
    KinematicCloud<ParcelType>* ptr1 = new KinematicParcel(mesh_, coordinates_, celli_, tetFacei_, tetPti_);
but then I get the error, that the »ParcelType« was not defined. And I don't know which files I have to include...

Quote:
how are you adding a particle to the existing kinematicCloud?
I thought it's possible (similar to the solidParticle) to create a parcel and add it's pointer to the KinematicCloud.
But now I'm not sure if it's possible and was hoping for some help here...
vishwesh likes this.
schf is offline   Reply With Quote

Old   December 1, 2017, 08:34
Smile
  #4
New Member
 
Sandip Wadekar
Join Date: Oct 2014
Posts: 17
Rep Power: 11
wadekar is on a distinguished road
Hi VIshwesh

I want to sample the spray particles at specified location/cell. I am using OF2.2.x
I am writing for loop over the particle like this:
Quote:

const basicSprayParcel* sprayPtr = new basicSprayParcel (mesh, false) ;

for (basicSprayParcel::const_iterator elmnt = sprayPtr->begin(); elmnt != sprayPtr->end();
++elmnt)
{
vector p = elmnt().position();
....
}
but, the error is element is not defined. Can you give some hint about that....
can you please share your code to sample the particle ?

Thanks
Sandip
wadekar 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
How I can introduce my power heat (W) in chtMultiRegionFoam? aminem OpenFOAM Pre-Processing 32 August 29, 2019 02:23
chtMultiRegionSimpleFoam: crash on parallel run student666 OpenFOAM Running, Solving & CFD 3 April 20, 2017 11:05
conjugateHeatFoam + interFoam farhagim OpenFOAM Programming & Development 15 July 19, 2016 07:55
chtMultiRegionSimpleFoam 3D problem Lucie OpenFOAM Pre-Processing 2 June 21, 2016 05:23
chtMultiRegionSimpleFoam samiam1000 OpenFOAM Running, Solving & CFD 39 March 31, 2016 08:43


All times are GMT -4. The time now is 22:04.