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

How to implement regionSizeDistribution

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 4 Post By wyldckat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 23, 2013, 01:13
Default How to implement regionSizeDistribution
  #1
New Member
 
Join Date: Sep 2013
Posts: 5
Rep Power: 12
tong is on a distinguished road
Hi,

I have completed an analysis using twoPhaseEulerFoam solver and have some results files. My case is similar to the tutorial bubblecolumn case where bubble flows up to the outlet at the top of the domain.

I want to get a plot of the droplet size distribution at the outlet. I have found that there is a function called 'regionSizeDistribution' and there is an example showing the inputs and outputs of the function, however where and how do I implement this function? ie. do I copy, for example, this function:

regionSizeDistribution1
{
type regionSizeDistribution;
functionObjectLibs ("libfieldFunctionObjects.so");
...
field alpha;
patches (outlet);
threshold 0.4;
fields (p U);
nBins 100;
maxDiameter 0.5e-4;
minDiameter 0;
setFormat gnuplot;
}

into the controldict file and then re-run the solver again at the time I want?

Thank you in advance,
Tong
tong is offline   Reply With Quote

Old   October 12, 2013, 01:22
Default
  #2
New Member
 
Join Date: Sep 2013
Posts: 5
Rep Power: 12
tong is on a distinguished road
please, any help will be great.
tong is offline   Reply With Quote

Old   October 14, 2013, 04:39
Default regionSizeDistribution plot
  #3
New Member
 
Join Date: Sep 2013
Posts: 5
Rep Power: 12
tong is on a distinguished road
Hi,

I had successfully ran the regionSizeDistribtion function in controlDict for my case which is suppose to plot a histogram of droplet sizes vs frequency they occur on a specified patch. After running the case, two new files appear in the latest time file: alpha1_background and alpha1_liquidCore. However, there was no histogram to be found anywhere. I was just wondering how does the output for regionSizeDistribution work? Where does the histogram saved to?

Regards,
Tong
tong is offline   Reply With Quote

Old   November 9, 2013, 14:09
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Tong,

I got your private message and I'll answer here on the forum, since more people can take advantage of this.

I've tested this on the tutorial "multiphase/twoPhaseEulerFoam/bubbleColumn" and used the following "system/controDict":
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.2.2                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     twoPhaseEulerFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         20;

deltaT          0.002;

writeControl    runTime;

writeInterval   0.5;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression uncompressed;

timeFormat      general;

timePrecision   6;

runTimeModifiable yes;

adjustTimeStep  no;

maxCo           0.5;

maxDeltaT       1;

functions
{
    fieldAverage1
    {
        type            fieldAverage;
        functionObjectLibs ( "libfieldFunctionObjects.so" );
        outputControl   outputTime;
        fields
        (
            U1
            {
                 mean        on;
                 prime2Mean  off;
                 base        time;
            }

            U2
            {
                 mean        on;
                 prime2Mean  off;
                 base        time;
            }

            alpha1
            {
                 mean        on;
                 prime2Mean  off;
                 base        time;
            }

            p
            {
                 mean        on;
                 prime2Mean  off;
                 base        time;
            }
        );
    }

    regionSizeDistribution1
    {
        type            regionSizeDistribution;
        functionObjectLibs ("libfieldFunctionObjects.so");
        outputControl   outputTime;
        field           alpha1;
        patches         (inlet);
        threshold       0.5;
        fields          (p U);
        nBins           100;
        maxDiameter     0.5;
        setFormat       gnuplot;
    }
}


// ************************************************************************* //
As you can see, this is essentially what's described in the Doxygen generated code documentation. Specifically, the part that was added was this:
Code:
    regionSizeDistribution1
    {
        type            regionSizeDistribution;
        functionObjectLibs ("libfieldFunctionObjects.so");
        outputControl   outputTime;
        field           alpha1;
        patches         (inlet);
        threshold       0.5;
        fields          (p U);
        nBins           100;
        maxDiameter     0.5;
        setFormat       gnuplot;
    }
As for the resulting files (available only after running twoPhaseEulerFoam with the new "controlDict"), they are located inside the folder "postProcessing/regionSizeDistribution1", more specifically inside each dedicated time folder.
Inside each one of those time folders you'll find Gnuplot scripts, which can be executed by giving them to the gnuplot command, e.g.:
Code:
gnuplot postProcessing/regionSizeDistribution1/0.5/diameter_count.gplt
The downside is that all of the plots will save the resulting plot into the file "diameter.ps".

Best regards,
Bruno
francescomarra, tong, HPE and 1 others like this.
__________________
wyldckat is offline   Reply With Quote

Old   May 13, 2014, 07:24
Default
  #5
New Member
 
Join Date: Sep 2013
Posts: 5
Rep Power: 12
tong is on a distinguished road
Hi,

Are max and min diameter set to meters or millimeters by default?

Thanks
tong 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
Implement constant heat flux boundary condition new_at_this Main CFD Forum 2 April 6, 2012 23:35
Problems to implement a coordinate change mateusps OpenFOAM 3 September 22, 2011 13:20
How to implement vorticity calculations mortain Main CFD Forum 0 July 1, 2010 13:26
How to implement implicit TVD limiter? Kmlin Main CFD Forum 3 March 28, 2010 08:52
implement tangential boundary condition in simple jhuang Main CFD Forum 4 July 10, 2006 04:01


All times are GMT -4. The time now is 18:45.