CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Sampling air passing through multiple windows (https://www.cfd-online.com/Forums/openfoam-post-processing/229608-sampling-air-passing-through-multiple-windows.html)

b.simpson August 17, 2020 06:08

Sampling air passing through multiple windows
 
Hi,

I have a model of a building which has open windows on each side. Inside I have several sources of CO2. What I need to do is predict the air velocity and total concentration of CO2 passing through the windows, both in and out of the building. Ideally I would like the field values for every cell within a plane along the centre of the windows.

I am using openFOAM v8 running buoyantSimpleFoam.

Does anyone know the best method for achieving this?

I have tried including a surfaces file in my controlDict where i tried to create a separate cuttingPlane for each window. But this resulted in the output files containing data for every cell along the x or y plane depending on the window location.

Kind regards,
Ben

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  v1812                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/

surfaces
{
    type            surfaces;
    libs            ("libsampling.so");
    writeControl    writeTime;

    surfaceFormat  raw;
    fields          (U T CO2);

    interpolationScheme cell;

    surfaces
    (
        Window1
        {
            type            cuttingPlane;
            planeType      pointAndNormal;
            pointAndNormalDict
            {
                point  (1.35 0.175 0.7);
                normal  (1 0 2);
            }
            interpolate    true;
        }
                Window2
        {
            type            cuttingPlane;
            planeType      pointAndNormal;
            pointAndNormalDict
            {
                point  (4.35 0.175 0.7);
                normal  (1 0 2);
            }
            interpolate    true;
        }
                Window3
        {
            type            cuttingPlane;
            planeType      pointAndNormal;
            pointAndNormalDict
            {
                point  (7.35 0.175 0.7);
                normal  (1 0 2);
            }
            interpolate    true;
        }
                Window4
        {
            type            cuttingPlane;
            planeType      pointAndNormal;
            pointAndNormalDict
            {
                point  (10.35 0.175 0.7);
                normal  (1 0 2);
            }
            interpolate    true;
        }
                Window5
        {
            type            cuttingPlane;
            planeType      pointAndNormal;
            pointAndNormalDict
            {
                point  (13.35 0.175 0.7);
                normal  (1 0 2);
            }
            interpolate    true;
        }
                Window6
        {
            type            cuttingPlane;
            planeType      pointAndNormal;
            pointAndNormalDict
            {
                point  (1.35 15.525 0.7);
                normal  (1 0 2);
            }
            interpolate    true;
        }
                Window7
        {
            type            cuttingPlane;
            planeType      pointAndNormal;
            pointAndNormalDict
            {
                point  (4.35 15.525 0.7);
                normal  (1 0 2);
            }
            interpolate    true;
        }
                Window8
        {
            type            cuttingPlane;
            planeType      pointAndNormal;
            pointAndNormalDict
            {
                point  (7.35 15.525 0.7);
                normal  (1 0 2);
            }
            interpolate    true;
        }
                Window9
        {
            type            cuttingPlane;
            planeType      pointAndNormal;
            pointAndNormalDict
            {
                point  (10.35 15.525 0.7);
                normal  (1 0 2);
            }
            interpolate    true;
        }
                Window10
        {
            type            cuttingPlane;
            planeType      pointAndNormal;
            pointAndNormalDict
            {
                point  (13.35 15.525 0.7);
                normal  (1 0 2);
            }
            interpolate    true;
        }
                Window11
        {
            type            cuttingPlane;
            planeType      pointAndNormal;
            pointAndNormalDict
            {
                point  (0.175 1.35 0.7);
                normal  (0 1 2);
            }
            interpolate    true;
        }
                Window12
        {
            type            cuttingPlane;
            planeType      pointAndNormal;
            pointAndNormalDict
            {
                point  (0.175 4.35 0.7);
                normal  (0 1 2);
            }
            interpolate    true;
        }
                Window13
        {
            type            cuttingPlane;
            planeType      pointAndNormal;
            pointAndNormalDict
            {
                point  (0.175 7.35 0.7);
                normal  (0 1 2);
            }
            interpolate    true;
        }
                Window14
        {
            type            cuttingPlane;
            planeType      pointAndNormal;
            pointAndNormalDict
            {
                point  (0.175 10.35 0.7);
                normal  (0 1 2);
            }
            interpolate    true;
        }
                Window15
        {
            type            cuttingPlane;
            planeType      pointAndNormal;
            pointAndNormalDict
            {
                point  (0.175 13.35 0.7);
                normal  (0 1 2);
            }
            interpolate    true;
        }
                Window16
        {
            type            cuttingPlane;
            planeType      pointAndNormal;
            pointAndNormalDict
            {
                point  (15.525 1.35 0.7);
                normal  (0 1 2);
            }
            interpolate    true;
        }
                Window17
        {
            type            cuttingPlane;
            planeType      pointAndNormal;
            pointAndNormalDict
            {
                point  (15.525 4.35 0.7);
                normal  (0 1 2);
            }
            interpolate    true;
        }
                Window18
        {
            type            cuttingPlane;
            planeType      pointAndNormal;
            pointAndNormalDict
            {
                point  (15.525 7.35 0.7);
                normal  (0 1 2);
            }
            interpolate    true;
        }
                Window19
        {
            type            cuttingPlane;
            planeType      pointAndNormal;
            pointAndNormalDict
            {
                point  (15.525 10.35 0.7);
                normal  (0 1 2);
            }
            interpolate    true;
        }
                Window20
        {
            type            cuttingPlane;
            planeType      pointAndNormal;
            pointAndNormalDict
            {
                point  (15.525 13.35 0.7);
                normal  (0 1 2);
            }
            interpolate    true;
        }
               
    );
}


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


b.simpson August 21, 2020 06:06

more information
 
1 Attachment(s)
To better explain the issue see the image attached.

As you can see the cuttingPlane is currently extending across the entire x and y axis. What I need is the plane to be located and the same size as the windows.

It may be that the cuttingPlane isn't designed to do what I want but I am assuming that there must be a way of getting the same data as the cuttingPlane but just for the cells in the centre of the windows.

Kind regards,
Ben

JNSN September 2, 2020 03:26

Hi Ben,


I have not tested, but maybe you can create faceZones for each window with topoSet, and then use these zones as input.


Best,
Jan

b.simpson September 4, 2020 08:07

Hi Jan,

Thank you for your reply.

Previously I have tried to set up faceZones within the windows and then use them as the inputs. Unfortunately I was unable to get it working in a satisfactory way.

I am sure it can be fixed this way, but I have instead found a solution by keeping the set up as it is, where by the surface provides the field values for all cells along the cuttingPlane. Then I have created a python script to strip out the cells that are within the windows based on their location.

Regards,
Ben


All times are GMT -4. The time now is 21:30.