CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Verification & Validation

Validation of swak4Foam for lagrangian particle tracking

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

Reply
 
LinkBack Thread Tools Display Modes
Old   September 20, 2013, 07:38
Exclamation Validation of swak4Foam for lagrangian particle tracking
  #1
New Member
 
Sebastian W.
Join Date: Nov 2012
Location: Saxony, Germany
Posts: 28
Rep Power: 4
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, 49 views)
nero235 is online now   Reply With Quote

Old   September 20, 2013, 08:42
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,912
Rep Power: 40
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, 08:57
Default
  #3
New Member
 
Sebastian W.
Join Date: Nov 2012
Location: Saxony, Germany
Posts: 28
Rep Power: 4
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 online now   Reply With Quote

Old   September 23, 2013, 18:59
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,912
Rep Power: 40
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, 21:05
Default
  #5
Member
 
luchen
Join Date: Jul 2011
Posts: 42
Rep Power: 5
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, 03:09
Default
  #6
New Member
 
Sebastian W.
Join Date: Nov 2012
Location: Saxony, Germany
Posts: 28
Rep Power: 4
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 online now   Reply With Quote

Old   May 31, 2015, 16:21
Default
  #7
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,912
Rep Power: 40
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, 21:36
Default
  #8
Member
 
luchen
Join Date: Jul 2011
Posts: 42
Rep Power: 5
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, 01:59
Default
  #9
Member
 
luchen
Join Date: Jul 2011
Posts: 42
Rep Power: 5
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, 02:12
Default
  #10
Member
 
luchen
Join Date: Jul 2011
Posts: 42
Rep Power: 5
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

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
dispersion model with lagragian particle tracking model for incompressible flows eelcovv OpenFOAM Running, Solving & CFD 48 January 31, 2015 11:10
Ubuntu 12.10 + openfoam2.2.0 ==> paraview error message peteryuan OpenFOAM Installation 6 August 18, 2013 18:00
ParaView ErrOr soheil nazmdeh OpenFOAM Paraview & paraFoam 1 August 17, 2013 07:40
injection problem Mark New FLUENT 0 August 4, 2013 01:30
Blood Damage Modelling via Particle Tracking in a Centrifugal Heart Pump scatman CFX 5 May 5, 2011 07:23


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