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

The "pairCollision" in "kinematicCloudProperties" makes the computation extremly slow

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 1, 2019, 08:30
Default The "pairCollision" in "kinematicCloudProperties" makes the computation extremly slow
  #1
New Member
 
Matthew
Join Date: Aug 2017
Posts: 28
Rep Power: 9
zhangxc0223 is on a distinguished road
Hi, all

I am using DPMFoam to solve a solid-gas simulations, and trying different models with and without the "pairCollision" collisionModel in "kinematicCloudProperties". The model with "pairCollision" makes the computation extremely slow than the model without "pairCollision". See the iteration log as follows.


The computation without any "pairCollision":
Code:
Courant Number mean: 0.261643 max: 0.516872
deltaT = 2.19405e-05
Time = 0.000126789

Evolving kinematicCloud

Solving 3-D cloud kinematicCloud
Cloud: kinematicCloud
    Current number of parcels       = 111000
    Current mass in system          = 3.47573e-06
    Linear momentum                 = (1.77481e-10 -1.27801e-06 1.67342e-11)
   |Linear momentum|                = 1.27801e-06
    Linear kinetic energy           = 2.65042e-07
    Injector model1:
      - parcels added               = 111000
      - mass introduced             = 3.47573e-06
    Parcel fate: system (number, mass)
      - escape                      = 0, 0
    Parcel fate: walls (number, mass)
      - escape                      = 0, 0
      - stick                       = 0, 0
    Rotational kinetic energy       = 0

PIMPLE: iteration 1
smoothSolver:  Solving for U.airx, Initial residual = 0.0504585, Final residual = 5.38595e-06, No Iterations 4
smoothSolver:  Solving for U.airy, Initial residual = 0.00803719, Final residual = 7.97837e-06, No Iterations 3
smoothSolver:  Solving for U.airz, Initial residual = 0.0504753, Final residual = 5.27993e-06, No Iterations 4
GAMG:  Solving for p, Initial residual = 0.162791, Final residual = 7.82297e-07, No Iterations 15
time step continuity errors : sum local = 9.27634e-08, global = 9.16899e-08, cumulative = 3.6652e-07
smoothSolver:  Solving for k.air, Initial residual = 0.0322806, Final residual = 5.65202e-06, No Iterations 4
bounding k.air, min: 0 max: 0.790085 average: 0.0532022
ExecutionTime = 9.54 s  ClockTime = 10 s

Courant Number mean: 0.310199 max: 0.607589
deltaT = 2.55122e-05
Time = 0.000152302

Evolving kinematicCloud

Solving 3-D cloud kinematicCloud
Cloud: kinematicCloud
    Current number of parcels       = 111000
    Current mass in system          = 3.47573e-06
    Linear momentum                 = (2.0881e-10 -1.51898e-06 4.08096e-12)
   |Linear momentum|                = 1.51898e-06
    Linear kinetic energy           = 3.74318e-07
    Injector model1:
      - parcels added               = 111000
      - mass introduced             = 3.47573e-06
    Parcel fate: system (number, mass)
      - escape                      = 0, 0
    Parcel fate: walls (number, mass)
      - escape                      = 0, 0
      - stick                       = 0, 0
    Rotational kinetic energy       = 0

PIMPLE: iteration 1
smoothSolver:  Solving for U.airx, Initial residual = 0.0583969, Final residual = 1.33926e-06, No Iterations 5
smoothSolver:  Solving for U.airy, Initial residual = 0.00928138, Final residual = 1.70783e-06, No Iterations 4
smoothSolver:  Solving for U.airz, Initial residual = 0.0584196, Final residual = 1.31097e-06, No Iterations 5
GAMG:  Solving for p, Initial residual = 0.169769, Final residual = 7.27294e-07, No Iterations 12
time step continuity errors : sum local = 1.15079e-07, global = 1.1378e-07, cumulative = 4.803e-07
smoothSolver:  Solving for k.air, Initial residual = 0.0371866, Final residual = 1.51605e-06, No Iterations 5
bounding k.air, min: 0 max: 0.792698 average: 0.0531554
ExecutionTime = 9.9 s  ClockTime = 11 s

The computation with a "pairCollision":
Code:
Courant Number mean: 0.261673 max: 0.516452
deltaT = 2.19405e-05
Time = 0.000126789

Evolving kinematicCloud

Solving 3-D cloud kinematicCloud
    1229 move-collide subCycles
Cloud: kinematicCloud
    Current number of parcels       = 111000
    Current mass in system          = 3.47573e-06
    Linear momentum                 = (-9.41127e-09 -1.28595e-06 2.29829e-08)
   |Linear momentum|                = 1.28619e-06
    Linear kinetic energy           = 9.06e-06
    Injector model1:
      - parcels added               = 111000
      - mass introduced             = 3.47573e-06
    Parcel fate: system (number, mass)
      - escape                      = 0, 0
    Parcel fate: walls (number, mass)
      - escape                      = 0, 0
      - stick                       = 0, 0
    Rotational kinetic energy       = 1.61479e-07

PIMPLE: iteration 1
smoothSolver:  Solving for U.airx, Initial residual = 0.0494236, Final residual = 5.28895e-06, No Iterations 4
smoothSolver:  Solving for U.airy, Initial residual = 0.00784295, Final residual = 7.78953e-06, No Iterations 3
smoothSolver:  Solving for U.airz, Initial residual = 0.0493783, Final residual = 5.18723e-06, No Iterations 4
GAMG:  Solving for p, Initial residual = 0.264627, Final residual = 7.53492e-07, No Iterations 18
time step continuity errors : sum local = 1.63482e-07, global = 1.62444e-07, cumulative = 5.38434e-07
smoothSolver:  Solving for k.air, Initial residual = 0.0322477, Final residual = 5.64453e-06, No Iterations 4
bounding k.air, min: 0 max: 0.789998 average: 0.0532002
ExecutionTime = 508.43 s  ClockTime = 509 s

Courant Number mean: 0.310239 max: 0.60703
deltaT = 2.55122e-05
Time = 0.000152302

Evolving kinematicCloud

Solving 3-D cloud kinematicCloud
    1422 move-collide subCycles
Cloud: kinematicCloud
    Current number of parcels       = 111000
    Current mass in system          = 3.47573e-06
    Linear momentum                 = (-3.64091e-09 -1.52865e-06 2.60327e-08)
   |Linear momentum|                = 1.52887e-06
    Linear kinetic energy           = 8.65779e-06
    Injector model1:
      - parcels added               = 111000
      - mass introduced             = 3.47573e-06
    Parcel fate: system (number, mass)
      - escape                      = 0, 0
    Parcel fate: walls (number, mass)
      - escape                      = 0, 0
      - stick                       = 0, 0
    Rotational kinetic energy       = 1.93013e-07

PIMPLE: iteration 1
smoothSolver:  Solving for U.airx, Initial residual = 0.0582215, Final residual = 1.34184e-06, No Iterations 5
smoothSolver:  Solving for U.airy, Initial residual = 0.00921795, Final residual = 1.69717e-06, No Iterations 4
smoothSolver:  Solving for U.airz, Initial residual = 0.0582291, Final residual = 1.31366e-06, No Iterations 5
GAMG:  Solving for p, Initial residual = 0.251617, Final residual = 6.69706e-07, No Iterations 17
time step continuity errors : sum local = 1.07168e-07, global = 1.05871e-07, cumulative = 6.44305e-07
smoothSolver:  Solving for k.air, Initial residual = 0.0371372, Final residual = 1.51477e-06, No Iterations 5
bounding k.air, min: 0 max: 0.792594 average: 0.053153
ExecutionTime = 609.77 s  ClockTime = 610 s

My "kinematicCloudProperties" file:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.0.0                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "constant";
    object      particleProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solution
{
    active          true;
    coupled         true;
    transient       yes;
    cellValueSourceCorrection off;

    interpolationSchemes
    {
        rho.air         cell;
        U.air           cellPoint;
        mu.air          cell;
    }

    integrationSchemes
    {
        U               Euler;
    }

    sourceTerms
    {
        schemes
        {
            U semiImplicit 1;
        }
    }
}

constantProperties
{
    rho0            1200;
    youngsModulus   1e8;
    poissonsRatio   0.35;
    alphaMax        0.99;
}

subModels
{
    particleForces
    {
        ErgunWenYuDrag
        {
            alphac alpha.air;
        }
        gravity;
    }

    injectionModels
    {
        model1
        {
            type            manualInjection;
            massTotal       0;
            parcelBasisType fixed;
            nParticle       1;
            SOI             0;
            positionsFile   "kinematicCloudPositions";
            U0              (0 0 0);
            sizeDistribution
            {
                type        fixedValue;
                fixedValueDistribution
                {
                    value   60e-6;
                }
            }
        }
    }

    dispersionModel none;

    patchInteractionModel  standardWallInteraction; 

    heatTransferModel       none;
    surfaceFilmModel        none;
    stochasticCollisionModel none;
    collisionModel          pairCollision; //none;
    // radiation            off;

    pairCollisionCoeffs
    {
        maxInteractionDistance  60e-6;

        writeReferredParticleCloud no;

        pairModel pairSpringSliderDashpot;

        pairSpringSliderDashpotCoeffs
        {
            useEquivalentSize   no;
            alpha               0.02;
            b                   1.5;
            mu                  0.10;
            cohesionEnergyDensity 0;
            collisionResolutionSteps 12;
        };

        wallModel wallSpringSliderDashpot;

        wallSpringSliderDashpotCoeffs
        {
            useEquivalentSize no;
            collisionResolutionSteps 12;
            youngsModulus   1e8;
            poissonsRatio   0.23;
            alpha           0.01;
            b               1.5;
            mu              0.09;
            cohesionEnergyDensity 0;
        };
        U     U.air;
    }

    standardWallInteractionCoeffs
    {
        type rebound;
		e    0.97;
    	mu   0.09;
    }

}

cloudFunctions
{
}


// ************************************************************************* //
Here is my code for the "kinematicCloudProperties". I am setting the parameters according to the "Goldschmidt" tutorial. I can run that tutorial model with quick speed despite turn on the "pairCollision" model, but not for mine. So is there any parameter related to this problem?

Very much appreciate for any suggestions and kind regards.
zhangxc0223 is offline   Reply With Quote

Old   April 1, 2019, 16:39
Default
  #2
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16
mAlletto will become famous soon enough
Do you have a lot of particles in a small volume? This can lead to high computational cost s since collition detection scales with the square oft the particle number if not well treated
mAlletto is offline   Reply With Quote

Old   April 1, 2019, 20:15
Default
  #3
New Member
 
Matthew
Join Date: Aug 2017
Posts: 28
Rep Power: 9
zhangxc0223 is on a distinguished road
Hi, Michael

Thanks for your reply. I have totally 111,000 particles in an 8e-4 m^3 domain. Do you mean a lot of particles in a computational grid? I have tried to refine the mesh a bit. The time cost for each timestep does decrease, but the timestep scale also decreases, which makes the total time still at the same slow level.

Here you mentioned the collision detection scales, where I can find this coefficient?

Cheers.
zhangxc0223 is offline   Reply With Quote

Old   April 2, 2019, 03:27
Default
  #4
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16
mAlletto will become famous soon enough
I mean if you have a lot of particles within the interaction distance the algorithm will be slow.

Is there a reason you want to consider collision of very small paticles. For small paticles the influence of collisions is rather small because of the small relative velocity
mAlletto is offline   Reply With Quote

Old   April 2, 2019, 19:18
Default
  #5
New Member
 
Matthew
Join Date: Aug 2017
Posts: 28
Rep Power: 9
zhangxc0223 is on a distinguished road
I just need to test whether the particle collision causes a disagreement between my simulation and experiment. Is that the interaction distance should be the same as particle diameter if my particles are monodispersed? Does it make sense if the interaction distance less than the particle diameter?
zhangxc0223 is offline   Reply With Quote

Old   April 3, 2019, 17:22
Default
  #6
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16
mAlletto will become famous soon enough
I just saw you have a lot of collision subcycles. The place it is detrminend is here https://github.com/OpenFOAM/OpenFOAM...liderDashpot.C

The time required to resolve the collisions is proportional to the particles diameter -> your small partcle diameter leads to a lot of subcycles
mAlletto is offline   Reply With Quote

Old   April 5, 2019, 12:45
Default
  #7
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16
mAlletto will become famous soon enough
I just run two cases from the Goldschmidt tutorial. One for a particle diameter of 0.0025 and one of 0.000025. There is a huge speed difference.

The log file for the case of a diameter of 0.0025 :


Code:
 PIMPLE: iteration 1
smoothSolver:  Solving for U.airx, Initial residual = 0.311276, Final residual = 1.54609e-07, No Iterations 1
smoothSolver:  Solving for U.airy, Initial residual = 0.313808, Final residual = 1.26206e-07, No Iterations 1
smoothSolver:  Solving for U.airz, Initial residual = 0.859083, Final residual = 3.18035e-07, No Iterations 1
GAMG:  Solving for p, Initial residual = 0.715197, Final residual = 0.00210485, No Iterations 2
time step continuity errors : sum local = 0.000111098, global = 2.2251e-05, cumulative = 2.20113e-05
GAMG:  Solving for p, Initial residual = 0.00331905, Final residual = 7.11471e-07, No Iterations 25
time step continuity errors : sum local = 5.73624e-08, global = 1.93669e-08, cumulative = 2.20307e-05
ExecutionTime = 1.29 s  ClockTime = 1 s
Courant Number mean: 0.0577722 max: 0.181594
Time = 6e-05
Evolving kinematicCloud
Solving 3-D cloud kinematicCloud
    2 move-collide subCycles
Cloud: kinematicCloud
    Current number of parcels       = 24750
    Current mass in system          = 0.511478
    Linear momentum                 = (-0.000450741 -3.39649e-06 -0.000185044)
   |Linear momentum|                = 0.000487258
    Linear kinetic energy           = 8.39182e-07
    Injector model1:
      - parcels added               = 24750
      - mass introduced             = 0.511478
    Parcel fate: system (number, mass)
      - escape                      = 0, 0
    Parcel fate: patch top (number, mass)
      - escape                      = 0, 0
      - stick                       = 0, 0
    Parcel fate: patch bottom (number, mass)
      - escape                      = 0, 0
      - stick                       = 0, 0
    Parcel fate: patch walls (number, mass)
      - escape                      = 0, 0
      - stick                       = 0, 0
    Parcel fate: patch frontAndBack (number, mass)
      - escape                      = 0, 0
      - stick                       = 0, 0
    Rotational kinetic energy       = 0
and the one for a diameter of 0.000025

Code:
PIMPLE: iteration 1
smoothSolver:  Solving for U.airx, Initial residual = 0.331392, Final residual = 4.25323e-08, No Iterations 1
smoothSolver:  Solving for U.airy, Initial residual = 0.516133, Final residual = 6.78851e-08, No Iterations 1
smoothSolver:  Solving for U.airz, Initial residual = 0.989072, Final residual = 1.28107e-07, No Iterations 1
GAMG:  Solving for p, Initial residual = 0.0055655, Final residual = 5.38469e-05, No Iterations 18
time step continuity errors : sum local = 8.0674e-07, global = 2.3601e-07, cumulative = -4.42296e-09
GAMG:  Solving for p, Initial residual = 0.0173291, Final residual = 8.5847e-07, No Iterations 33
time step continuity errors : sum local = 6.67296e-11, global = -1.95574e-11, cumulative = -4.44252e-09
ExecutionTime = 64.91 s  ClockTime = 66 s
Courant Number mean: 0.00750003 max: 0.0075002
Time = 6e-05
Evolving kinematicCloud
Solving 3-D cloud kinematicCloud
    195 move-collide subCycles
Cloud: kinematicCloud
    Current number of parcels       = 24750
    Current mass in system          = 5.11478e-07
    Linear momentum                 = (-6.874e-15 6.81769e-14 6.92634e-09)
   |Linear momentum|                = 6.92634e-09
    Linear kinetic energy           = 4.74871e-11
    Injector model1:
      - parcels added               = 24750
      - mass introduced             = 5.11478e-07
    Parcel fate: system (number, mass)
      - escape                      = 0, 0
    Parcel fate: patch top (number, mass)
      - escape                      = 0, 0
      - stick                       = 0, 0
    Parcel fate: patch bottom (number, mass)
      - escape                      = 0, 0
      - stick                       = 0, 0
    Parcel fate: patch walls (number, mass)
      - escape                      = 0, 0
      - stick                       = 0, 0
    Parcel fate: patch frontAndBack (number, mass)
      - escape                      = 0, 0
      - stick                       = 0, 0
    Rotational kinetic energy       = 0
So this is the confirmation I said before that the main reason of the long computational time is the large number of subcycles required to resolve the collision for the small particle diameter.

Best

Michael
mAlletto is offline   Reply With Quote

Old   April 5, 2019, 18:30
Default
  #8
New Member
 
Matthew
Join Date: Aug 2017
Posts: 28
Rep Power: 9
zhangxc0223 is on a distinguished road
Much appreciate, Michael.
Now I got it. Really a brilliant idea to test with the numbers in tutorial case.

Cheers.
zhangxc0223 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
pimpleDyMFoam computation randomly stops babapeti OpenFOAM Running, Solving & CFD 5 January 24, 2018 06:28
Regarding slow computation hemmt Fluent UDF and Scheme Programming 1 February 21, 2017 04:27
the speed of parallel computation for over 3 million grid is very slow liujmljm SU2 7 June 27, 2014 17:45
Foam is running extremly slow chitharenjan OpenFOAM 1 May 6, 2011 15:23
Why the parallel computation is slow ztdep OpenFOAM Running, Solving & CFD 1 May 1, 2008 05:55


All times are GMT -4. The time now is 01:00.