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

output lagrangian particle volume fraction "reactingParcelFoam"

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

Like Tree1Likes
  • 1 Post By jurich

Reply
 
LinkBack Thread Tools Display Modes
Old   March 22, 2016, 09:11
Default output lagrangian particle volume fraction "reactingParcelFoam"
  #1
Member
 
Bijan Darbari
Join Date: Nov 2015
Posts: 45
Rep Power: 3
bijan darbari is on a distinguished road
Sponsored Links
hello

I,m using "reactingParcelFoam" and I want to output volume fraction of lagrangian particles from this solver.
So I add these lines in the end of createfields.H and delete createcloud.H

Code:
Info<< "\nConstructing reacting cloud" << endl;
basicReactingMultiphaseCloud parcels
(
    "reactingCloud1",
    rho,
    U,
    g,
    slgThermo
);



volScalarField alphac
(
    IOobject
    (
        "alphac",
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::AUTO_WRITE
    ),
    mesh,
    dimensionedScalar("0", dimless, 0)
);

alphac = max(1.0 - parcels.theta(), 0.01);
This solver compiled and run without any problem but:


1- If I solve the case with my modified solver. the output volume fraction (alphac) have uniform value "1" all over the domain. the output file is:

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

dimensions      [0 0 0 0 0 0 0];

internalField   uniform 1;

boundaryField
{
    top
    {
        type            calculated;
        value           uniform 1;
    }
    bottom
    {
        type            calculated;
        value           uniform 1;
    }
    inlet
    {
        type            calculated;
        value           uniform 1;
    }
    outlet
    {
        type            calculated;
        value           uniform 1;
    }
    frontAndBack
    {
        type            empty;
    }
}


// ************************************************************************* //
2- If I first solve the case with original "reactingParcelFoam" and after a one output write, solve with my modified solver. the output volume fraction file have real and true value and it is:

Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "8050";
    object      alphac;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 0 0 0 0];

internalField   nonuniform List<scalar> 
4000
(
0.9664896784
0.9413569371
0.979056049
0.9821976416
0.9958112098
0.9979056049
.
.
.
.
.
outlet
    {
        type            calculated;
        value           nonuniform List<scalar> 
40
(
1
1
0.9895280245
0.9623008882
0.9560177028
0.9539233077
0.9507817151
0.9497345175
0.9413569371
0.9560177028
0.9497345175
0.9539233077
0.9570649004
0.9591592955
0.939262542
0.9476401224
0.9549705053
0.9602064931
0.9476401224
0.958112098
0.9465929249
0.958112098
0.9424041347
0.939262542
0.9434513322
0.9591592955
0.9507817151
0.9413569371
0.9549705053
0.9455457273
0.9424041347
0.9507817151
0.9507817151
0.9350737518
0.9706784686
0.9444985298
0.9717256661
0.9874336294
1
1
)
;
    }
    frontAndBack
    {
        type            empty;
    }
}


// ************************************************************************* //
Is there any way to solve the case with my modified solver and output real value of lagrangian particles volume fraction?? ( like 2nd output )
What's the problem??

the modified solver attached.

the case uploaded to:
http://s000.tinyupload.com/index.php...81446598054142


thanks very much and excuse me for poor english.

Bijan.
Attached Files
File Type: zip myDPM.zip (11.4 KB, 10 views)
bijan darbari is offline   Reply With Quote
Sponsored Links

Old   March 22, 2016, 11:23
Default
  #2
Member
 
Bijan Darbari
Join Date: Nov 2015
Posts: 45
Rep Power: 3
bijan darbari is on a distinguished road
I run some cases and understand that my modified solver output lagrangian volume fraction from the last data writed by "reactionParcelFoam". and dont calculate the volume fraction from the present data.

how can I solve this problem??
bijan darbari is offline   Reply With Quote

Old   March 22, 2016, 22:35
Default
  #3
New Member
 
Joseph Urich
Join Date: Mar 2009
Location: Pittsburgh, PA
Posts: 14
Rep Power: 10
jurich is on a distinguished road
Hello Bijan,

createFields.H is called only when reactingParcelFoam starts up. So your line alphac = max(1.0 - parcels.theta(), 0.01) is done one time, right after you initialize the parcels. So the parcels haven't been traced yet, and the call to theta() class returns zero.

Move alphac = max(1.0 - parcels.theta(), 0.01) to reactingParcelFoam.C, right after the call to parcels.evolve(). Then it will be done each time step.
bijan darbari likes this.
jurich is offline   Reply With Quote

Old   March 23, 2016, 05:21
Default
  #4
Member
 
Bijan Darbari
Join Date: Nov 2015
Posts: 45
Rep Power: 3
bijan darbari is on a distinguished road
Hello jurich,
thank you very much and you,re right.
I,m do that and it,s working.
now my modified solver, outputing real lagrangian particles volume fraction at each time step.
bijan darbari is offline   Reply With Quote

Old   March 23, 2016, 16:22
Default
  #5
Member
 
Bijan Darbari
Join Date: Nov 2015
Posts: 45
Rep Power: 3
bijan darbari is on a distinguished road
The modified solver attached.and working perfectly.

this modified solver outputs lagrangian particle volume fraction ( alphap ) and continuous phase volume fraction ( alphac ) at each time step.
also shows min/avg/max of this arrays on terminal when running case (for each time step).
Attached Files
File Type: zip myDPM.zip (8.8 KB, 19 views)
bijan darbari is offline   Reply With Quote

Old   May 25, 2016, 02:19
Default
  #6
Member
 
Ping Chang
Join Date: Feb 2016
Location: Perth
Posts: 88
Rep Power: 3
chpjz0391 is on a distinguished road
Quote:
Originally Posted by bijan darbari View Post
The modified solver attached.and working perfectly.

this modified solver outputs lagrangian particle volume fraction ( alphap ) and continuous phase volume fraction ( alphac ) at each time step.
also shows min/avg/max of this arrays on terminal when running case (for each time step).
Hey bijian,

I am using the same solver now, do you know how to output the particles concentration(kg/m3) ?

Ping?
chpjz0391 is offline   Reply With Quote

Old   May 25, 2016, 02:44
Default
  #7
Member
 
Ping Chang
Join Date: Feb 2016
Location: Perth
Posts: 88
Rep Power: 3
chpjz0391 is on a distinguished road
Quote:
Originally Posted by chpjz0391 View Post
Hey bijian,

I am using the same solver now, do you know how to output the particles concentration(kg/m3) ?

Ping?
I mean if I multiply rho directly? the solver will consider this rho to air flow's density. What should I do, do you have any suggestion?
chpjz0391 is offline   Reply With Quote

Old   May 26, 2016, 00:42
Default
  #8
Member
 
Bijan Darbari
Join Date: Nov 2015
Posts: 45
Rep Power: 3
bijan darbari is on a distinguished road
Dear chpjz0391

I don,t understand what you mean??
You can multiply particles density (kg/m3) to lagrangian particles concentration (m3/m3) and then you have ( kg/m3)


a much easier way for exporting lagrangian particles concentration:

paste these lines at the end of "reactingcloud1properties"
Code:
cloudFunctions
{
voidFraction
{ 
type voidFraction;
}
    
}
bijan darbari is offline   Reply With Quote

Old   May 26, 2016, 00:45
Default
  #9
Member
 
Ping Chang
Join Date: Feb 2016
Location: Perth
Posts: 88
Rep Power: 3
chpjz0391 is on a distinguished road
Quote:
Originally Posted by bijan darbari View Post
Dear chpjz0391

I don,t understand what you mean??
You can multiply particles density (kg/m3) to lagrangian particles concentration (m3/m3) and then you have ( kg/m3)


a much easier way for exporting lagrangian particles concentration:

paste these lines at the end of "reactingcloud1properties"
Code:
cloudFunctions
{
voidFraction
{ 
type voidFraction;
}
    
}
Dear Bijan
Actually, I have already put the code under reactingcloud1properties, but I get no output for the voidFraction. Is the parameter which called reactingCloud1Theta stands for the volume fraction in paraview?

Regards

PIng
chpjz0391 is offline   Reply With Quote

Old   May 26, 2016, 04:49
Default
  #10
Member
 
Ping Chang
Join Date: Feb 2016
Location: Perth
Posts: 88
Rep Power: 3
chpjz0391 is on a distinguished road
Hi bijian,
Sorry to disturb you again. Firstly, thanks very much, voidFraction has worked. I used calculator function in paraview to multiply the particles density and got the concentration.

However, I have a another small question. I tried to output concentration directly by modifying the solver.

I add this code to my main function.

Code:
    while (simple.loop())
    {
        Info<< "Time = " << runTime.timeName() << nl << endl;

        parcels.evolve();
      
        
        concen = parcels.rhoEff();
        Info<< "concen min/avg/max   = " << min(concen).value() << ", "
        << average(concen).value() << ", "<< max(concen).value() << endl;
And this in createFields.H

Code:
volScalarField concen
(
    IOobject
    (
        "concen",
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::AUTO_WRITE
    ),
    mesh,
    dimensionedScalar("0", dimDensity, 0)
But is doesn't work .The concen is always zero.

Do you have any suggestion?

Regards,

Ping
Attached Files
File Type: gz simpleParticlesFoam.tar.gz (3.4 KB, 2 views)
chpjz0391 is offline   Reply With Quote

Old   June 27, 2016, 07:15
Default
  #11
New Member
 
Join Date: Apr 2015
Posts: 9
Rep Power: 4
Kabra is on a distinguished road
Hi all,
I actually have a very similar problem. I inject my particles using swak4foam and to get the theta-fields I wrote at the bottom of kinematicCloudProperties:


Code:
cloudFunctions {
voidFraction {  
type voidFraction; }
}
Now I get a file called kinematicCloudTheta in the time folders, but it doesn't calculate anything as it always looks like this for each time-step:

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

dimensions      [0 0 0 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    leftWall
    {
        type            calculated;
        value           uniform 0;
    }
    rightWall
    {
        type            calculated;
        value           uniform 0;
    }
    outlet
    {
        type            calculated;
        value           uniform 0;
    }
    inlet
    {
        type            calculated;
        value           uniform 0;
    }
    front
    {
        type            calculated;
        value           uniform 0;
    }
    back
    {
        type            calculated;
        value           uniform 0;
    }
    probe
    {
        type            calculated;
        value           uniform 0;
    }
}


// ************************************************************************* //
Does anyone have any suggestions?
Kabra is offline   Reply With Quote

Old   June 28, 2016, 01:09
Default
  #12
Member
 
Bijan Darbari
Join Date: Nov 2015
Posts: 45
Rep Power: 3
bijan darbari is on a distinguished road
Dear Kabra


I think there is no particles in domain when you export "voidfraction". or particle injection didn't started.
bijan darbari is offline   Reply With Quote

Old   June 28, 2016, 02:54
Default
  #13
New Member
 
Join Date: Apr 2015
Posts: 9
Rep Power: 4
Kabra is on a distinguished road
Dear Bijan,
at this point there are several thousand particles in my domain. I also made sure that they are all active. Another case with freshly injected particles yields the same results. Additionally the particle diameter ist also > 0.
Kabra is offline   Reply With Quote

Old   June 28, 2016, 06:19
Default
  #14
Member
 
Bijan Darbari
Join Date: Nov 2015
Posts: 45
Rep Power: 3
bijan darbari is on a distinguished road
Dear Kabra

Sorry. I don't have any idea.


- delete your "kinematiccloudteta" file in your case and run again.
- I use openfoam 3.0.1. and "reactingparcelfoam" solver. may be this is a bug in old versions.
bijan darbari is offline   Reply With Quote

Old   May 23, 2017, 09:36
Default
  #15
Member
 
Maria
Join Date: Jul 2013
Posts: 47
Rep Power: 6
marialhm is on a distinguished road
Quote:
Originally Posted by Kabra View Post
Hi all,
I actually have a very similar problem. I inject my particles using swak4foam and to get the theta-fields I wrote at the bottom of kinematicCloudProperties:


Code:
cloudFunctions {
voidFraction {  
type voidFraction; }
}
Now I get a file called kinematicCloudTheta in the time folders, but it doesn't calculate anything as it always looks like this for each time-step:

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

dimensions      [0 0 0 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    leftWall
    {
        type            calculated;
        value           uniform 0;
    }
    rightWall
    {
        type            calculated;
        value           uniform 0;
    }
    outlet
    {
        type            calculated;
        value           uniform 0;
    }
    inlet
    {
        type            calculated;
        value           uniform 0;
    }
    front
    {
        type            calculated;
        value           uniform 0;
    }
    back
    {
        type            calculated;
        value           uniform 0;
    }
    probe
    {
        type            calculated;
        value           uniform 0;
    }
}


// ************************************************************************* //
Does anyone have any suggestions?

Dear Kabra,

Have you solved this problem? I have the same problem now.

Maria
marialhm 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
alphaEqn.H in twoPhaseEulerFoam cheng1988sjtu OpenFOAM Bugs 15 May 1, 2016 16:12
how to set periodic boundary conditions Ganesh FLUENT 13 January 22, 2014 05:11
Difference between Volume Fraction and Mass Fraction in CEL foo7 CFX 0 September 21, 2011 08:45
On the damBreak4phaseFine cases paean OpenFOAM Running, Solving & CFD 0 November 14, 2008 22:14
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55

Sponsored Links


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