CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

inject particles of different densities - kinematiccloud

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 17, 2015, 04:44
Default inject particles of different densities - kinematiccloud
  #1
New Member
 
Join Date: Feb 2015
Posts: 18
Rep Power: 11
benz25 is on a distinguished road
Dear all,

I would like to inject particles of different densities into a domain using one of the lagrangian solvers. for example DPMFoam. The code used to inject a particular type of particle is:

Code:
constantProperties
{
    parcelTypeId 2;

    rhoMin          1e-15;
    minParticleMass 1e-15;

    rho0            8940;
    youngsModulus   1.1e11;
    poissonsRatio   0.33;

    constantVolume  false;

    alphaMax        0.99;
}

subModels
{
    particleForces
    {
        sphereDrag;
	gravity;
	SaffmanMeiLiftForce
	{
		U U.air;
	}
	pressureGradient
	{
		U U.air;
	}
    }

    injectionModels
    {
        model1
        {
            type            patchInjection;
            massTotal       0.0025;
            SOI             0;
            parcelBasisType mass;
            patchName       inlet;
            duration        3;
            parcelsPerSecond 300;
            U0              (2 0 1);
            flowRateProfile constant 1;
            sizeDistribution
            {
                type        fixedValue;
                fixedValueDistribution
                {
                    value   0.001;
                }
            }
        }
    }
I'm trying to inject particles of different densities but I couldn't get it to work...I tried various methods such as the one shown below but it didn't work i.e.:

Code:
constantProperties
{
    parcelTypeId 1;

    rhoMin          1e-15;
    minParticleMass 1e-15;

    rho0            2600;
    youngsModulus   1e10;
    poissonsRatio   0.20;

    constantVolume  false;

    alphaMax        0.99;

    rhoMin          1e-15;
    minParticleMass 1e-15;

    rho0            8940;
    youngsModulus   1.1e11;
    poissonsRatio   0.33;

    constantVolume  false;

    alphaMax        0.99;
}
I would be very grateful if someone can provide any guidance!

Many thanks in advance,

Kevin
benz25 is offline   Reply With Quote

Old   April 19, 2015, 11:53
Default
  #2
New Member
 
Amjad
Join Date: May 2012
Posts: 21
Rep Power: 14
Amjad Asad is on a distinguished road
Dear Kevin,
as I know it is not much easy to define parcels with different densities. I guess, The problem that one needs to add new variables taking into account the different parcels properties in constantProperties in KinematicParcelI.H. As I can see the kinematicCloud class is created just for one kind of Parcels. The paramter parcelTypeId is used to distinguish different clouds. If you could solve your problem, post please your soluation.

Best regards,
Amjad
Amjad Asad is offline   Reply With Quote

Old   April 21, 2015, 08:59
Default different materials
  #3
New Member
 
Join Date: Feb 2015
Posts: 18
Rep Power: 11
benz25 is on a distinguished road
Hi Amjad,

Thank you very much for your assistance. I'll check those files and try and modify the code accordingly. Interestingly, I came across with a similar solver called coalChemistryFOAM where it can inject two different materials hence two cloud properties files (limestone, coal). I'll study that code as well, I'll let you know how it goes.

Thanks again,
Kevin
benz25 is offline   Reply With Quote

Old   June 14, 2015, 06:42
Default
  #4
New Member
 
Amjad
Join Date: May 2012
Posts: 21
Rep Power: 14
Amjad Asad is on a distinguished road
Hello Benz,
have you find a solution for your problem?

Thanks,
Amjad
Amjad Asad is offline   Reply With Quote

Old   June 25, 2015, 09:37
Default KinematicCloud..
  #5
New Member
 
Join Date: Feb 2015
Posts: 18
Rep Power: 11
benz25 is on a distinguished road
Dear Amjad,

I apologize for the late reply.

I did manage to use the 'parcelInjectionProperties' in the reactingParcelFoam solver. I managed to simulate particles of two or more densities in a 2D plain channel. I haven't done the same with a more complex model yet. Here is the website:

https://github.com/OpenFOAM/OpenFOAM...tionProperties

I will try and adapt this tool with DPMFoam. Hope this helps.

Best regards,

Benz
Rémi Pradeau likes this.
benz25 is offline   Reply With Quote

Old   August 25, 2015, 03:59
Default
  #6
New Member
 
Join Date: Jul 2015
Posts: 17
Rep Power: 11
Ameya T is on a distinguished road
Hi benz25,

How did you inject 2d particles? In case of spheres will they be injected as discs? I want to inject particles in a 2d channel. Could you please elaborate a bit.
Ameya T is offline   Reply With Quote

Old   August 25, 2015, 08:13
Default
  #7
New Member
 
Amjad
Join Date: May 2012
Posts: 21
Rep Power: 14
Amjad Asad is on a distinguished road
Hello Benz,
I found an easier way to inject particles with different densities and typeID to distunguish the different types of particles in the flow field. Here, one must define an injection model for each particle type.
For this purpose, I modified the patchInjection by defining new variables for the density and the typeId, which are used to initialize the density of the particles injected by this model. Also, the density and typId must be given in the model in the kinematicCloudProperties. You can find an example of my code here in the attachment.
Attached Files
File Type: gz ParticlePatchInjection.tar.gz (6.8 KB, 326 views)
Amjad Asad is offline   Reply With Quote

Old   August 31, 2015, 06:19
Default poly-disperse particles
  #8
New Member
 
Join Date: Feb 2015
Posts: 18
Rep Power: 11
benz25 is on a distinguished road
Hello Amjad,

Thank you very much for your kind assistance. I went through your code and noted the modifications you've made such as particle density (rho) and typeID. Very interesting indeed.

However, the one thing I don't quite understand is in this file: ParticlePatchInjectionBaseC...I've noticed the slight differences in the original and your modified code (see below highlighted in red). But I'm not sure why your modified code doesn't include the code highlighted in red i.e. ifPstream::master()....areaFraction...etc.

In your ParticlePatchInjectionBase.C file:

Code:
void Foam::ParticlePatchInjectionBase::setPositionAndCell
(
    const polyMesh& mesh,
    cachedRandom& rnd,
    vector& position,
    label& cellOwner,
    label& tetFaceI,
    label& tetPtI
)

{
    if (cellOwners_.size() > 0)
    {
        // determine which processor to inject from
        scalar areaFraction = rnd.position<scalar>(0, patchArea_);

        label procI = 0;
        forAllReverse(sumTriMagSf_, i)
        {
            if (areaFraction > sumTriMagSf_[i])
            {
                procI = i;
                break;
            }
        }
However, in the original OpenFOAM PatchInjectionBaseC
HTML Code:
https://github.com/OpenFOAM/OpenFOAM-2.3.x/blob/master/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.C
Code:
void Foam::patchInjectionBase::setPositionAndCell
(
    const polyMesh& mesh,
    cachedRandom& rnd,
    vector& position,
    label& cellOwner,
    label& tetFaceI,
    label& tetPtI
)
{
    scalar areaFraction = 0;

    if (Pstream::master())
    {
        areaFraction = rnd.position<scalar>(0, patchArea_);
    }

    Pstream::scatter(areaFraction);

    if (cellOwners_.size() > 0)
    {
        // Determine which processor to inject from
        label procI = 0;
        forAllReverse(sumTriMagSf_, i)
        {
            if (areaFraction >= sumTriMagSf_[i])
            {
                procI = i;
                break;
            }
        }
Thank you again for your assistance and time. I Look forward to your reply.

Best regards

Kevin
benz25 is offline   Reply With Quote

Old   August 31, 2015, 06:27
Default
  #9
New Member
 
Join Date: Jul 2015
Posts: 17
Rep Power: 11
Ameya T is on a distinguished road
Hi benz25,
Could you also elaborate about how you introduced particles in a 2D channel? Can you introduce them as 2D disks? Or is it always as 3D spheres?
Ameya T is offline   Reply With Quote

Old   August 31, 2015, 06:31
Default Inject 2D particles
  #10
New Member
 
Join Date: Feb 2015
Posts: 18
Rep Power: 11
benz25 is on a distinguished road
Quote:
Originally Posted by Ameya T View Post
Hi benz25,

How did you inject 2d particles? In case of spheres will they be injected as discs? I want to inject particles in a 2d channel. Could you please elaborate a bit.
Hello Ameya,

I actually used patchInjection file to inject the particles. For example in this file:

HTML Code:
https://github.com/OpenFOAM/OpenFOAM-2.3.x/blob/master/tutorials/lagrangian/DPMFoam/Goldschmidt/constant/kinematicCloudProperties
I modified the default patch injection to the following:

Also, if you plan to use patchInjection, delete the kinematicCloudPositions file in your constant directory as that is only applicable to manualInjection.

I'm not too sure what you mean by discs?

Code:
injectionModels
    {
        model1
        {
            type            patchInjection;
            massTotal       0;
            SOI             0.2; // my timestep in controlDict is, for example, 0.0005s. start injection particles at t=0.2s, end entire simulation at 1s.
            parcelBasisType fixed;
            patchName       inlet;
            duration        1; //end simulation at 1s.
            parcelsPerSecond  50;
	    nParticle 1;
            U0              (0.5 0 0);
            flowRateProfile constant 1;
            sizeDistribution
            {
                type        fixedValue;
                fixedValueDistribution
                {
                    value   0.001;
                }
            }
        }
    }
Hope this helps

Best regards

Kevin
benz25 is offline   Reply With Quote

Old   August 31, 2015, 06:38
Default
  #11
New Member
 
Join Date: Jul 2015
Posts: 17
Rep Power: 11
Ameya T is on a distinguished road
Thanks for the reply Kevin.

Actually my confusion was that how can you inject 3d particles (spheres) into 2D channels. Meaning in open foam for making a 2D mesh we set the number of cells along 3rd dimension as 1. But when you inject particles, they still are 3D. Can that cause any problem?
Ameya T is offline   Reply With Quote

Old   August 31, 2015, 22:56
Default Spheres
  #12
New Member
 
Join Date: Feb 2015
Posts: 18
Rep Power: 11
benz25 is on a distinguished road
Hi Ameya,

I've designed my geometry in a CAD software or sometimes using ANSYS geometry designer modeler. I then use the mesh conversion utilities available in OpenFOAM to execute 2D simulations. Then I use paraview for post processing. Please note that irrespective of 2D or 3D geometry, the particles will shown as 2D particles but the issue here is that Paraview makes it look like 3D particles because the gylph feature (in paraview) is set to Surface by default; this then makes it looks misleading as we're dealing with 2D channels with 2D particles...but it is actually 2D. If you're using paraview for post-processing, you'll need to change from Surface to Point or Wireframe to have a realistic 2D look of the particles. So don't worry it's a post processing view it doesn't in any way affect the results or physics of the case study. I recall a colleague of mine had the same case post processing with ANSYS Fluent or something.

Furthermore, it is not possible to inject other shapes (at least with some of the solvers like DPMFoam to the best of my understanding) as that may require modifying some of the code somewhere.

Regards
Kevin
benz25 is offline   Reply With Quote

Old   September 2, 2015, 11:48
Default
  #13
New Member
 
Join Date: Jul 2015
Posts: 17
Rep Power: 11
Ameya T is on a distinguished road
Thanks for the explanation Kevin. I tried simulating in both 2d and 3d cases(laminar flow over a backstep case). The problem I now face is that the particle and the fluid do not seem to interact at all. There is no wake formation nor does it show any kind of disturbance in the streamline as the particle passes through the geometry. I have ensured that "coupled" in "kinematicCloudProperties" is set to "true". I also re-checked my geometry and boundary conditions many times.What else could be the problem? Where else to look?
Ameya T is offline   Reply With Quote

Old   September 6, 2015, 07:09
Default
  #14
New Member
 
Join Date: Feb 2015
Posts: 18
Rep Power: 11
benz25 is on a distinguished road
Hi Ameya,

In order to get the effects of two-way coupling or in other words particulate phase influence on the fluid, that will depend on a number of factors, such as particle void fraction of the entire domain at any given time, inter-particle spacing, flow reynolds number, domain dimensions,etc. It's best if you provide more info on your simulation settings such as kinematic cloud properties, domain size, etc...it's possible your particle packing is not sufficient to directly influence of fluid trajectory. Please provide more information on your simulation and solver settings and I think we can figure out a way to resolve your issue. Hint- try and first get some sort of particle deposition and aggregation in a clear channel (i.e. use air as fluid and some heavy particles) so you can see influence of particle-fluid interactions and vice-versa.

As an aside, for more detailed info on two way coupling see Page. 5 of this PDF doc:

HTML Code:
http://www.tfd.chalmers.se/~hani/kurser/OS_CFD_2009/JelenaAndric/reportJelenaAndric_Final.pdf
Cheers
Kevin
benz25 is offline   Reply With Quote

Old   September 7, 2015, 11:29
Default
  #15
New Member
 
Amjad
Join Date: May 2012
Posts: 21
Rep Power: 14
Amjad Asad is on a distinguished road
Dear Benz,
sorry for the late answer. Actually, as i remember I did not include these lines in the code. I think they were already in the code.
Best regards,
Amjad
Amjad Asad is offline   Reply With Quote

Old   September 14, 2015, 09:58
Default kinematicCloud
  #16
New Member
 
Join Date: Feb 2015
Posts: 18
Rep Power: 11
benz25 is on a distinguished road
Thank you for the clarification Amjad.

I modified the code. But after the simulations, I only got only particle type.

I suspect it's to do with my kinematicCloud property file. I think I may have included the parcelTypeId and/or patchInjection properties incorrectly.

First I tried:

Code:
constantProperties
{
    parcelTypeId 1;

    rhoMin          1e-15;
    minParticleMass 1e-15;

    rho0            2600;
    youngsModulus   1e10;
    poissonsRatio   0.30;

    constantVolume  false;

    alphaMax        0.99;
}
 
constantProperties
{
    parcelTypeId 2;

    rhoMin          1e-15;
    minParticleMass 1e-15;

    rho0            400;
    youngsModulus   500000000;
    poissonsRatio   0.20;

    constantVolume  false;

    alphaMax        0.99;
}

subModels
{
    particleForces
    {
        sphereDrag;
	gravity;
    }

    injectionModels
    {
        model1
        {
            type            patchInjection;
            massTotal       0;
            SOI             0.2;
            parcelBasisType fixed;
            patchName       inlet;
            duration        1;
            parcelsPerSecond 200;
	    nParticle 1;
            U0              (0.5 0 0);
	    rho	2600;
 	    ID	1;
            flowRateProfile constant 1;
            sizeDistribution
            {
                type        fixedValue;
                fixedValueDistribution
                {
                    value   0.00015;
                }
            }
        }

	model2
        {
            type            patchInjection;
            massTotal       0;
            SOI             0.25;
            parcelBasisType fixed;
            patchName       inlet;
            duration        1;
            parcelsPerSecond 200;
	    nParticle 1;
            U0              (0.5 0 0);
	    rho	400;
 	    ID	2;
            flowRateProfile constant 1;
            sizeDistribution
            {
                type        fixedValue;
                fixedValueDistribution
                {
                    value   0.00015;
                }
            }
        }
    }
Then this:

Code:
constantProperties
{
    parcelTypeId 1;

    rhoMin          1e-15;
    minParticleMass 1e-15;

    rho0            2600;
    youngsModulus   1e10;
    poissonsRatio   0.30;

    constantVolume  false;

    alphaMax        0.99;
}

constantProperties
{
    parcelTypeId 2;

    rhoMin          1e-15;
    minParticleMass 1e-15;

    rho0            400;
    youngsModulus   500000000;
    poissonsRatio   0.20;

    constantVolume  false;

    alphaMax        0.99;
}

subModels
{
    particleForces
    {
        sphereDrag;
	gravity;
    }

    injectionModels
    {
        model1
        {
            type            patchInjection;
            massTotal       0;
            SOI             0.2;
            parcelBasisType fixed;
            patchName       inlet;
            duration        1;
            parcelsPerSecond 200;
	    nParticle 1;
            U0              (0.5 0 0);
            flowRateProfile constant 1;
            sizeDistribution
            {
                type        fixedValue;
                fixedValueDistribution
                {
                    value   0.00015;
                }
            }
        }

	model2
        {
            type            patchInjection;
            massTotal       0;
            SOI             0.25;
            parcelBasisType fixed;
            patchName       inlet;
            duration        1;
            parcelsPerSecond 200;
	    nParticle 1;
            U0              (0.5 0 0);
            flowRateProfile constant 1;
            sizeDistribution
            {
                type        fixedValue;
                fixedValueDistribution
                {
                    value   0.00015;
                }
            }
        }
    }
Or replace format for constantproperties with this:

Code:
constantProperties
{
    parcelTypeId 1;

    rhoMin          1e-15;
    minParticleMass 1e-15;

    rho0            2600;
    youngsModulus   1e10;
    poissonsRatio   0.30;

    constantVolume  false;

    alphaMax        0.99;

    parcelTypeId 2;

    rhoMin          1e-15;
    minParticleMass 1e-15;

    rho0            400;
    youngsModulus   500000000;
    poissonsRatio   0.20;

    constantVolume  false;

    alphaMax        0.99;
}
So I'm not too sure where I went wrong ??

I would be very grateful if you can provide assistance

Many thanks,

Kevin.
zizi63 likes this.
benz25 is offline   Reply With Quote

Old   March 21, 2016, 05:40
Default Hi,
  #17
New Member
 
Muhammad Usman
Join Date: Nov 2015
Location: Germay
Posts: 15
Rep Power: 11
msman is on a distinguished road
Hi everyone,

Can we use DPMFoam for a two-dimensional geometry? I am using DMPFoam for 3D geometry too but the simulation is too slow for 2D gometry even for very simple geometry.
msman is offline   Reply With Quote

Old   March 29, 2016, 07:37
Unhappy Criteria for 'stick' boundry condition in KinematicCloudParticles
  #18
New Member
 
Muhammad Usman
Join Date: Nov 2015
Location: Germay
Posts: 15
Rep Power: 11
msman is on a distinguished road
Hi everyone,

I want to know the criteria for stick boundry condition for particles. I mean, Is DPMFoam calculate the Lift Force, drag force, friction force & adhesive force and then depending on their results? afterwards DPMFoam decides which particle gonna stick to wall or not. Am i right?

Any help?
msman is offline   Reply With Quote

Old   April 18, 2016, 19:51
Default
  #19
New Member
 
sahel
Join Date: Apr 2016
Posts: 1
Rep Power: 0
sah2016 is on a distinguished road
Quote:
Originally Posted by benz25 View Post
Kevin.
Hi Kevin,

I was wondering if you could finally figure out how to solve for particles with different densities?
Many thanks
sah2016 is offline   Reply With Quote

Old   August 17, 2016, 23:21
Default
  #20
New Member
 
Zahra Hsh
Join Date: May 2016
Posts: 3
Rep Power: 10
zizi63 is on a distinguished road
Quote:
Originally Posted by benz25 View Post
Thank you for the clarification Amjad.

I modified the code. But after the simulations, I only got only particle type.

I suspect it's to do with my kinematicCloud property file. I think I may have included the parcelTypeId and/or patchInjection properties incorrectly.

First I tried:

Code:
constantProperties
{
    parcelTypeId 1;

    rhoMin          1e-15;
    minParticleMass 1e-15;

    rho0            2600;
    youngsModulus   1e10;
    poissonsRatio   0.30;

    constantVolume  false;

    alphaMax        0.99;
}
 
constantProperties
{
    parcelTypeId 2;

    rhoMin          1e-15;
    minParticleMass 1e-15;

    rho0            400;
    youngsModulus   500000000;
    poissonsRatio   0.20;

    constantVolume  false;

    alphaMax        0.99;
}

subModels
{
    particleForces
    {
        sphereDrag;
	gravity;
    }

    injectionModels
    {
        model1
        {
            type            patchInjection;
            massTotal       0;
            SOI             0.2;
            parcelBasisType fixed;
            patchName       inlet;
            duration        1;
            parcelsPerSecond 200;
	    nParticle 1;
            U0              (0.5 0 0);
	    rho	2600;
 	    ID	1;
            flowRateProfile constant 1;
            sizeDistribution
            {
                type        fixedValue;
                fixedValueDistribution
                {
                    value   0.00015;
                }
            }
        }

	model2
        {
            type            patchInjection;
            massTotal       0;
            SOI             0.25;
            parcelBasisType fixed;
            patchName       inlet;
            duration        1;
            parcelsPerSecond 200;
	    nParticle 1;
            U0              (0.5 0 0);
	    rho	400;
 	    ID	2;
            flowRateProfile constant 1;
            sizeDistribution
            {
                type        fixedValue;
                fixedValueDistribution
                {
                    value   0.00015;
                }
            }
        }
    }
Then this:

Code:
constantProperties
{
    parcelTypeId 1;

    rhoMin          1e-15;
    minParticleMass 1e-15;

    rho0            2600;
    youngsModulus   1e10;
    poissonsRatio   0.30;

    constantVolume  false;

    alphaMax        0.99;
}

constantProperties
{
    parcelTypeId 2;

    rhoMin          1e-15;
    minParticleMass 1e-15;

    rho0            400;
    youngsModulus   500000000;
    poissonsRatio   0.20;

    constantVolume  false;

    alphaMax        0.99;
}

subModels
{
    particleForces
    {
        sphereDrag;
	gravity;
    }

    injectionModels
    {
        model1
        {
            type            patchInjection;
            massTotal       0;
            SOI             0.2;
            parcelBasisType fixed;
            patchName       inlet;
            duration        1;
            parcelsPerSecond 200;
	    nParticle 1;
            U0              (0.5 0 0);
            flowRateProfile constant 1;
            sizeDistribution
            {
                type        fixedValue;
                fixedValueDistribution
                {
                    value   0.00015;
                }
            }
        }

	model2
        {
            type            patchInjection;
            massTotal       0;
            SOI             0.25;
            parcelBasisType fixed;
            patchName       inlet;
            duration        1;
            parcelsPerSecond 200;
	    nParticle 1;
            U0              (0.5 0 0);
            flowRateProfile constant 1;
            sizeDistribution
            {
                type        fixedValue;
                fixedValueDistribution
                {
                    value   0.00015;
                }
            }
        }
    }
Or replace format for constantproperties with this:

Code:
constantProperties
{
    parcelTypeId 1;

    rhoMin          1e-15;
    minParticleMass 1e-15;

    rho0            2600;
    youngsModulus   1e10;
    poissonsRatio   0.30;

    constantVolume  false;

    alphaMax        0.99;

    parcelTypeId 2;

    rhoMin          1e-15;
    minParticleMass 1e-15;

    rho0            400;
    youngsModulus   500000000;
    poissonsRatio   0.20;

    constantVolume  false;

    alphaMax        0.99;
}
So I'm not too sure where I went wrong ??

I would be very grateful if you can provide assistance

Many thanks,

Kevin.
Dear Kevin,
any solutions? I have the same problem
zizi63 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 to inject DPM particles using DEFINE_EXECUTE_AT_END(name) ? bawammo Fluent UDF and Scheme Programming 1 October 30, 2017 14:20
how to inject many particles in fluent? elah599 FLUENT 16 April 21, 2017 06:18
inject different sized particles czhao86 OpenFOAM Running, Solving & CFD 8 July 8, 2015 21:06
How to inject certain number of particles asal FLUENT 0 April 8, 2013 19:21
Function to inject particles only once? KK CFX 0 March 4, 2008 16:45


All times are GMT -4. The time now is 21:28.