CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (http://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Sampling Temperature and omega (rate k-dissipation) (http://www.cfd-online.com/Forums/openfoam-post-processing/129840-sampling-temperature-omega-rate-k-dissipation.html)

lfrigeri3 February 14, 2014 04:33

Sampling Temperature and omega (rate k-dissipation)
 
Hi,

I have a strange problem. In my sampleDict file it's all write correctly, and I have to sample U,T,R,omega,nut,k in 7 station (S1,S2,S3.....S7).

If I give command "sample" openFoam doesn't create 6 files for each station, but:
S1_U
S1_R
S1_T_omega
S1_k_nut

Why T-omega and k-nut are writed in the same file??
I should run sample 4 times.. one for "T, U, R" ; one for "omega" ; one for "k" ; and one for "nut" .

Is there a solution? it's very boring!
Thank you

wyldckat February 15, 2014 12:30

Greetings Luca,

Two questions:
  1. Which OpenFOAM version are you using?
  2. Can you share your "sampleDict" file?
Best regards,
Bruno

lfrigeri3 February 15, 2014 13:06

Hi Bruno,

I'm using OF 2.2.x on a remote cluster.

This is my sampleDict

Code:


FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "system";
    object      sampleDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

interpolationScheme cellPoint;

setFormat      gnuplot;

sets
(
    S1
    {
        type    uniform;
        axis    z;
        start  ( 1.3 3.7 0 );
        end    ( 1.3 3.7 2.4 );
        nPoints 200;
    }
    S2
    {
        type    uniform;
        axis    z;
        start  ( 1.3 3.4 0 );
        end    ( 1.3 3.4 2.4 );
        nPoints 200;
    }
    S3
    {
        type    uniform;
        axis    z;
        start  ( 1.3 3.1 0 );
        end    ( 1.3 3.1 2.4 );
        nPoints 200;
    }
    S4
    {
        type    uniform;
        axis    z;
        start  ( 1.3 2.0 0 );
        end    ( 1.3 2.0 2.4 );
        nPoints 200;
    }
    S5
    {
        type    uniform;
        axis    z;
        start  ( 1.3 1.0 0 );
        end    ( 1.3 1.0 2.4 );
        nPoints 200;
    }
    S6
    {
        type    uniform;
        axis    z;
        start  ( 2.1 1.0 0 );
        end    ( 2.1 1.0 2.4 );
        nPoints 200;
    }
    S7
    {
        type    uniform;
        axis    z;
        start  ( 2.1 3.7 0 );
        end    ( 2.1 3.7 2.4 );
        nPoints 200;
    }
    );

fields        (
                T
                U
                R
                k
                omega
                nut
              );

// ************************************************************************* //

I have to comment some fields to have no problem. I can sample U R k and omega together. But I have that problem when I sample T or nut with k and/or omega.

Thanks

wyldckat February 15, 2014 14:12

Hi Luca,

OK, after testing with the tutorial "heatTransfer/buoyantSimpleFoam/buoyantCavity", I've finally remembered about this. The problem is that the sampling source code will group data by type:
  1. U - is a vector field
  2. R - is a tensor field
  3. T omega - are scalar fields
  4. k nut - are also scalar fields... so they should have been placed along with "T omega"...
The logic behind this is that it's more optimal to sample all fields of the same type at the same time and to write them to the same file, instead of placing each one in independent files.

If you want separate files for all, then perhaps it's easiest to configure function objects that will sample while the simulation is running, where you can then re-use the settings from a previous function object... if I could only find such an example here on the forum...

OK, on this post: http://www.cfd-online.com/Forums/ope...tml#post433597 post #13 - see how "$Average_left" is used in "totalPressure_left"? Basically what it does is load the same settings from "$Average_left" and then overrides only the settings you want to be different. But keep in mind that this is for sampling while the simulation is running. Although, you could rely on this: http://openfoamwiki.net/index.php/Ex...unctionObjects - more specifically, on this: https://github.com/wyldckat/execFunctionObjects

Best regards,
Bruno

lfrigeri3 February 15, 2014 14:22

Hi Bruno,

Thanks for the perfect explanation.. I still have a lot of things to learn!
However... I already setted up a function in controlDict that write every 30min the result. The problem is that I have made a executable script that clean sample's file, of each fields ,from non-numerical terms and that directly plot with octave.. I earn a lot of time in this way. So it's more proficius to do sample 3 times than write another script from zero :)

Thanks again!
Luca


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