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/)
-   -   Extracting cell centre values WITHOUT interpolation (http://www.cfd-online.com/Forums/openfoam-post-processing/122358-extracting-cell-centre-values-without-interpolation.html)

dalaron August 17, 2013 23:35

Extracting cell centre values WITHOUT interpolation
 
1 Attachment(s)
I would like to extract cell centre values without using any interpolation schemes. My sampleDict file is as follows:
PHP Code:

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

interpolationScheme cell;    

setFormat       raw;

sets
(
    
centrePatch
    
{
        
type    uniform;
        
axis    x;
        
start   0 0 0 ); // start of sample region
        
end     8.11734270322 0 0 ); // end point of sample region
        
nPoints 50;
    }
);

fields          Ux p T );


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

The problem I am having is what to do with nPoints. I would ideally like to have this automatically match the number of cells I have without me having to specify it. For example if my grid hasd 50 cells in the horizontal direction I could go
PHP Code:

 nPoints nDomain

(or some other keyword), instead of having to specify manually
PHP Code:

 nPoints 50

Is this something that can be done?

Using nPoints 50; gives me the following temperature plot. As you can see, towards the end of the domain the sample points from my solution are more noticeably clustered in pairs.

dalaron August 18, 2013 00:39

1 Attachment(s)
I believe I have solved my problem. Here is the sampleDict with modifications:
Code:

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

interpolationScheme cell;   

setFormat      raw;

sets
(
    centrePatch
    {
        type    midPoint;
        axis    x;
        start  ( 0 0 0 );
        end    ( 8.11734270322 0 0 );
    }
);

fields
(
    Ux
    p
    T
);


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

I used
Code:

type    midPoint;
and removed the nPoints part of the sampleDict file.

I still have the issue of 'clustered' pairs of temperature points and am not sure what is causing that, though they now much more closely match the theoretical predication. Is this something I should even be looking into? Plots for Pressure, Density, and Mach number do not have this issue (or if they do it much, much less obvious).


All times are GMT -4. The time now is 08:22.