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

Output cell face area from all patches

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 21, 2015, 11:31
Default Output cell face area from all patches
  #1
New Member
 
Nikolai Tauber
Join Date: Sep 2015
Location: Aarhus, Denmark
Posts: 14
Rep Power: 3
niko0807 is on a distinguished road
Dear Foamers,

I am trying to make my solver output the cell face area from all my boundary patches.

In createFields I have added

Code:
IOField<scalar> SfOut
(
    IOobject
    (
        "Sf",
        mesh.time().timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::AUTO_WRITE
    ),
    mesh.magSf().boundaryField()[1]
);

SfOut.write();
It outputs the correct values for patch number 1 during runtime like:

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


20
(
1e-07
1e-07
1e-07
1e-07
1e-07
1e-07
1e-07
1e-07
1e-07
1e-07
4.54238e-08
5.29882e-08
6.18123e-08
7.21058e-08
8.41136e-08
9.81209e-08
1.14461e-07
1.33522e-07
1.55757e-07
1.81695e-07
)


// ************************************************************************* //
I can see the values are correct for my first patch, but how do i loop through all patches and assign the values to each patch like the wallHeatFlux utility does it:

Code:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 3 -3 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    outlet
    {
        type            cyclic;
    }
    inlet
    {
        type            cyclic;
    }
    bottomLeft
    {
        type            symmetry;
    }
    bottomRight
    {
        type            symmetry;
    }
    topLeft
    {
        type            symmetry;
    }
    topRight
    {
        type            symmetry;
    }
    cylLeft
    {
        type            calculated;
        value           nonuniform List<scalar> 
60
(
-6069.48
-6117.97
-6190.55
-6273.09
-6361.34
-6458.12
-6559.21
-6668.83
-6784.17
-6906.63
-7034.82
-7170.15

.... and so on.
I need this, so I can sample the values and get the correct coordinates for each cell face area.
niko0807 is offline   Reply With Quote

Old   October 23, 2015, 09:03
Default
  #2
New Member
 
Nikolai Tauber
Join Date: Sep 2015
Location: Aarhus, Denmark
Posts: 14
Rep Power: 3
niko0807 is on a distinguished road
Apperantly the writeCellCentres utility writes the cell face areas of type:

- patch
- wall

but not for type

- symmetry
- cyclic

Why is this the case, and how do I modify the tool, so it writes the areas for all boundaries?
niko0807 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
Internal walls of zero thickness anger OpenFOAM Native Meshers: blockMesh 22 December 15, 2015 03:06
how to set periodic boundary conditions Ganesh FLUENT 13 January 22, 2014 05:11
non-orthogonal faces and incorrect orientation? nennbs OpenFOAM Native Meshers: blockMesh 7 April 17, 2013 05:42
Hydrostatic Pressure and Gravity miliante OpenFOAM Running, Solving & CFD 132 October 7, 2012 22:50
WARNING: non-positive face area exist. Alan Main CFD Forum 4 August 17, 2006 07:33


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