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

[swak4Foam] Validation of swak4Foam for lagrangian particle tracking

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By gschaider

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 20, 2013, 08:38
Exclamation Validation of swak4Foam for lagrangian particle tracking
  #1
Member
 
Sebastian W.
Join Date: Nov 2012
Location: Saxony, Germany
Posts: 43
Rep Power: 14
nero235 is on a distinguished road
Send a message via ICQ to nero235
Hello,

I am simulating several different multiphase flow regimes, consisting of 3 phases with multiphaseInterFoam. Additionally I need to inject a particle (not massless) to the flow and track it as it moves. I found that this can be done using swak4Foam libraries to add LPT (lagrangian particle tracking) methods to any solver. I set up several test cases, combining interFoam and swak4Foam with success.

However I need to validate this method in order to know if the calculated particle trajectory is physically correct. For this I have set up a 3D test case of a rectangular domain filled with air. A particle will be injected at the bottom of the domain with an initial velocity (in x and z-direction). Gravity is acting in negative z-direction. I am using interFoam for the calculation of the continuous phase and swak4Foam for the uncoupled particle tracking.

The result of this simulation should be a parabolic particle trajectory. However it seems that there is no gravity acting on the particle. Therefor the particle trajectory is linear.

I have uploaded my validation case in the hope somebody can tell me why the gravity is not considered here.

Thanks in advance!

Sebastian
Attached Files
File Type: gz S4F.3D.duct.interfom.tar.gz (3.7 KB, 123 views)
nero235 is offline   Reply With Quote

Old   September 20, 2013, 09:42
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by nero235 View Post
Hello,

I am simulating several different multiphase flow regimes, consisting of 3 phases with multiphaseInterFoam. Additionally I need to inject a particle (not massless) to the flow and track it as it moves. I found that this can be done using swak4Foam libraries to add LPT (lagrangian particle tracking) methods to any solver. I set up several test cases, combining interFoam and swak4Foam with success.

However I need to validate this method in order to know if the calculated particle trajectory is physically correct. For this I have set up a 3D test case of a rectangular domain filled with air. A particle will be injected at the bottom of the domain with an initial velocity (in x and z-direction). Gravity is acting in negative z-direction. I am using interFoam for the calculation of the continuous phase and swak4Foam for the uncoupled particle tracking.

The result of this simulation should be a parabolic particle trajectory. However it seems that there is no gravity acting on the particle. Therefor the particle trajectory is linear.

I have uploaded my validation case in the hope somebody can tell me why the gravity is not considered here.

Thanks in advance!

Sebastian
The lagrangian particles in swak add no submodels to the particles (basically swak only creates the cloud and at each timestep says "move the way you always move"). So in fact you're verifying the OF lagrangian particles. Haven't got the time to look at the case today. Have you switched on gravity (I think it is in the "forces"-subdict of the cloudDict)?
Anyway: when moving through the fluid the viscosity should also slow down the particle so it should at least come to a stand-still (especially with the high viscosities you usually have in interFoam)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   September 20, 2013, 09:57
Default
  #3
Member
 
Sebastian W.
Join Date: Nov 2012
Location: Saxony, Germany
Posts: 43
Rep Power: 14
nero235 is on a distinguished road
Send a message via ICQ to nero235
Quote:
Originally Posted by gschaider View Post
The lagrangian particles in swak add no submodels to the particles (basically swak only creates the cloud and at each timestep says "move the way you always move"). So in fact you're verifying the OF lagrangian particles. Haven't got the time to look at the case today. Have you switched on gravity (I think it is in the "forces"-subdict of the cloudDict)?
Anyway: when moving through the fluid the viscosity should also slow down the particle so it should at least come to a stand-still (especially with the high viscosities you usually have in interFoam)
Yes, I am using gravity and sphereDrag as body forces. However it doesn't show an effect on the particle trajectory when I change the value of "g" in the controlDict under the particle function.

Here is my particleCloudProperties file:

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

solution {
    active          on;
    coupled         false;
    transient         true;
    cellValueSourceCorrection on;

    interpolationSchemes
    {
        rho             cell;
        mu                cell;
        U               cellPoint;
//        DUcDt            cellPoint;
    }

    sourceTerms
    {
        schemes
        {
            rho             explicit 1;
            U               explicit 1;
        }
    }

    integrationSchemes
    {
        U               Euler;
    }
}


constantProperties
{
    parcelTypeId     1;
    rhoMin           1;
    minParticleMass  5.23e-10;
    rho0             2000;
    epsilon0         10;
    Pr               0.7;
    pMin               1;
    constantVolume   true;
    youngsModulus    1e9;
    poissonsRatio    0.35;
}

subModels
{
    particleForces
    {
        gravity;
        sphereDrag;
//        pressureGradient
//        {
//            U U;
//        }
        //virtualMass off;
    }

    injectionModels
    {
        model1
        {
            type            manualInjection;
            massTotal       1.05e-6;
            parcelBasisType mass;
            nParticle       1;
            SOI             0;                 //Start Of Injection
            positionsFile   "tracerParticlePositions";
            U0              (0.1 0 0.1);     //the calculated 'linear momentum' is p=m*v
            sizeDistribution
            {
                type        fixedValue;
                fixedValueDistribution
                {
                    value   1e-3;
                }
            }
        }
    }


    dispersionModel none;

    patchInteractionModel standardWallInteraction;

    heatTransferModel none;

    radiation       off;


    standardWallInteractionCoeffs
    {
        type            rebound;
        mu                0;
    }

    surfaceFilmModel none;
}

cloudFunctions
{
    particleTracks
    {
        trackInterval   1;
        maxSamples      1000000;
        resetOnWrite    yes;
    }
}


// ************************************************************************* //
and the controlDict

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.2.0                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     interFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         20;

deltaT          0.005;

writeControl    adjustableRunTime;

writeInterval   20;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression uncompressed;

timeFormat      general;

timePrecision   6;

runTimeModifiable yes;

adjustTimeStep  no;

maxCo             1;

maxAlphaCo        1;

maxDeltaT       0.005;


libs
(
    "libsimpleFunctionObjects.so"
    "libsimpleLagrangianFunctionObjects.so"
    "libswakLagrangianCloudSourcesFunctionPlugin.so"
    "libswakFunctionObjects.so"
);

functions
{
    mu
    {
        type expressionField;
        expression "1.7894e-5";
        fieldName mu;
        autowrite true;
    }
    Particle
    {
        type evolveKinematicCloud;
        cloudName ParticleCloud;
        g "down" [0 1 -2 0 0 0 0] (0 0 -9.81 );
        rhoName rho;
        muName mu;
        UName U;
    }
}

// ************************************************************************* //
Greetings, Sebastian.
nero235 is offline   Reply With Quote

Old   September 23, 2013, 19:59
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by nero235 View Post
Yes, I am using gravity and sphereDrag as body forces. However it doesn't show an effect on the particle trajectory when I change the value of "g" in the controlDict under the particle function.
OK. I think I found the problem. The clouds want a reference to the gravity vector. The swak-functionObjects were passing a value ... the cloud took a reference to the temporary value which turned into garbage .... it's painfully obvious once you found it.

Anyway. The fix is just one additional char (it will be in the next release):

Code:
diff --git a/Libraries/simpleLagrangianFunctionObjects/EvolveCloudFunctionObject.H b/Lib
--- a/Libraries/simpleLagrangianFunctionObjects/EvolveCloudFunctionObject.H
+++ b/Libraries/simpleLagrangianFunctionObjects/EvolveCloudFunctionObject.H
@@ -105,7 +105,7 @@
 
     autoPtr<CloudType> &cloud() { return cloud_; }
 
-    const dimensionedVector g() const { return g_; }
+    const dimensionedVector &g() const { return g_; }
 
     const objectRegistry &obr() const { return obr_; }
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   May 28, 2015, 22:05
Default
  #5
Member
 
luchen
Join Date: Jul 2011
Posts: 44
Rep Power: 15
luchen2408 is on a distinguished road
Dear gschaider,
I also have this problem in my simulation, but I don't konw how to solve it in the simulation. can you explain more about that or give a solution with more details?
luchen2408 is offline   Reply With Quote

Old   May 29, 2015, 04:09
Default
  #6
Member
 
Sebastian W.
Join Date: Nov 2012
Location: Saxony, Germany
Posts: 43
Rep Power: 14
nero235 is on a distinguished road
Send a message via ICQ to nero235
Quote:
Originally Posted by luchen2408 View Post
Dear gschaider,
I also have this problem in my simulation, but I don't konw how to solve it in the simulation. can you explain more about that or give a solution with more details?
You have to modify the file:
Code:
/home/$USER/OpenFOAM/.../swak4Foam/Libraries/simpleLagrangianFunctionObjects/EvolveCloudFunctionObject.H
Change the line 109 to:
Code:
const dimensionedVector &g() const { return g_; }
Where the "&" is missing. Recompile swak4Foam and it then it should work.
nero235 is offline   Reply With Quote

Old   May 31, 2015, 17:21
Default
  #7
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by nero235 View Post
You have to modify the file:
Code:
/home/$USER/OpenFOAM/.../swak4Foam/Libraries/simpleLagrangianFunctionObjects/EvolveCloudFunctionObject.H
Change the line 109 to:
Code:
const dimensionedVector &g() const { return g_; }
Where the "&" is missing. Recompile swak4Foam and it then it should work.
Which version of swak are you talking about? I just checked in the repository and this is fixed since September 2013 so it should be in the last 2 releases (at least)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   May 31, 2015, 22:36
Default
  #8
Member
 
luchen
Join Date: Jul 2011
Posts: 44
Rep Power: 15
luchen2408 is on a distinguished road
Dear Sebastian and Bernhard,
Thanks for your reply, I took the swak version 0.3.1 in which the problem is solved in the code. The "&" is in the code. But the gravity seems doesn't on the particles.
luchen2408 is offline   Reply With Quote

Old   June 2, 2015, 02:59
Default
  #9
Member
 
luchen
Join Date: Jul 2011
Posts: 44
Rep Power: 15
luchen2408 is on a distinguished road
Dear Sebastian and Bernhard,
I have cross checked my code in the ContolDict file.
I found I took the EvolveKinematicCloud, not EvolveCloud and I thinkd I need to modified the EvolveKinematicCloudFunctionObject.H, but there is not codes to adjust as you mentioned, how can I adjust code in the EvolveKinematicCloudFunctionObject.H? Thanks
luchen2408 is offline   Reply With Quote

Old   June 2, 2015, 03:12
Default
  #10
Member
 
luchen
Join Date: Jul 2011
Posts: 44
Rep Power: 15
luchen2408 is on a distinguished road
Dear Sebastian and Bernhard,
You mean I have to remove the "&" and then recompile the swak4foam. Thanks your feedback.
luchen2408 is offline   Reply With Quote

Old   January 15, 2017, 10:05
Default
  #11
New Member
 
zhaoshiyu
Join Date: Nov 2016
Posts: 8
Rep Power: 10
zhaoshiyu is on a distinguished road
Hi Have you solved the problem?
I also want to add LPT to interFoam using the swak4Foam, but I donnot know how to compile the swak4Foam with interFoam, and is that right now?
zhaoshiyu is offline   Reply With Quote

Old   January 24, 2017, 17:11
Default
  #12
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by zhaoshiyu View Post
Hi Have you solved the problem?
I also want to add LPT to interFoam using the swak4Foam, but I donnot know how to compile the swak4Foam with interFoam, and is that right now?
You don't have to compile swak4foam "with" interFoam. You compile it on its own and add function objects to it with the libs and functions entries in the controlDict. Examples can be found in the swak-sources in Examples/Lagrangian/functionObjects (admitedly not with interFoam. for that look at Examples/FromPresentations/OSCFD_cleaningTank2D although that case probably won't run on current OF-versions. But it will give you an idea how to calculate a muField so that particles float on the surface)
pbachant likes this.
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   March 26, 2017, 11:48
Default
  #13
New Member
 
zhaoshiyu
Join Date: Nov 2016
Posts: 8
Rep Power: 10
zhaoshiyu is on a distinguished road
Quote:
Originally Posted by gschaider View Post
You don't have to compile swak4foam "with" interFoam. You compile it on its own and add function objects to it with the libs and functions entries in the controlDict. Examples can be found in the swak-sources in Examples/Lagrangian/functionObjects (admitedly not with interFoam. for that look at Examples/FromPresentations/OSCFD_cleaningTank2D although that case probably won't run on current OF-versions. But it will give you an idea how to calculate a muField so that particles float on the surface)
Thanks for the reply.
I am very curious whether the LPT model can simulate the particles part in debris flow, can friction between particles be realized, or the particle can only work as tracer moving along the flow?
zhaoshiyu is offline   Reply With Quote

Old   March 28, 2017, 06:45
Default
  #14
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by zhaoshiyu View Post
Thanks for the reply.
I am very curious whether the LPT model can simulate the particles part in debris flow, can friction between particles be realized, or the particle can only work as tracer moving along the flow?
Depending on the OF-Version there are models for particle-interactions but they are limited. Check out $FOAM_TUTORIALS/lagrangian and look for collisionModel. For better collisions of large particles look at http://www.cfdem.com/node/414
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Particle tracking error alchem OpenFOAM Bugs 5 May 6, 2017 17:30
Request for Lagrangian Particle Tracking Validation or Verification Paper Mojtaba.a OpenFOAM Verification & Validation 6 May 23, 2016 02:47
Lagrangian Particle Tracking in Eulerian-Eulerian Multiphase Flow DarrenC CFX 5 April 7, 2016 15:50
Ubuntu 12.10 + openfoam2.2.0 ==> paraview error message peteryuan OpenFOAM Installation 6 August 18, 2013 19:00
injection problem Mark New FLUENT 0 August 4, 2013 02:30


All times are GMT -4. The time now is 12:54.