CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   FanPressure BC direction reversal (https://www.cfd-online.com/Forums/openfoam-solving/196550-fanpressure-bc-direction-reversal.html)

HouchinM December 7, 2017 10:26

FanPressure BC direction reversal
 
Hi FOAMers,

I am trying to set a fanPressure boundary condition within a ducted fan, using the createBaffles function to create two patches within a ducted fan casing.

I have created the baffles and assigned them as fanPressure boundaries in the p initial conditions as such:

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  3.0.x                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
|*---------------------------------------------------------------------------*|
|* OpenFOAM for Windows 16.06 (v1)                                          *|
|* Built by CFD Support, www.cfdsupport.com (based on Symscape).            *|
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      binary;
    class      volScalarField;
    location    "0";
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField  uniform 0;

boundaryField
{
    atmosphereBoundary
    {
        type            fixedValue;
        value          uniform 0;
    }
    ductWork
    {
        type            zeroGradient;
    }
    fanCasing
    {
        type            zeroGradient;
    }
    plenumWall
    {
        type            zeroGradient;
    }
    systemBoundary
    {
        type            fixedValue;
        value          uniform 0;
    }
    fanOutlet
    {
        type            fanPressure;
                fileName        "fanCurve";
                outOfBounds    clamp;
                direction      out;              // in | out
                p0              uniform 0;
                value          uniform 50;
                gamma                        0;
    }
    fanInlet
    {
        type            fanPressure;
                fileName        "fanCurve";
                outOfBounds    clamp;
                direction      in;              // in | out
                p0              uniform 0;
                value          uniform -50;
                gamma                        0;
    }
}

I cannot seem to reverse the direction of the fan by switching the direction within the p initial conditions file. Is the direction of the boundary condition reversible?

Regards,

Matt

HouchinM December 11, 2017 08:42

All,

I have found a solution to the above problem in case you are looking for a solution...

The direction of the fan can be switched by reversing the actions.sourceInfo.options variable from master to slave in the toposet dict:

Code:


/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  3.0.x                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    object      topoSetDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
actions
(
        {
                name        fanSource;
                type        faceZoneSet;
                action        new;
                source        searchableSurfaceToFaceZone;
                sourceInfo
                {
                        surface triSurfaceMesh;
                        name        baffle_1.stl;
                }
        }
        {
                name        fanSourceSlave;
                type        cellSet;
                action        new;
                source        faceZoneToCell;
                sourceInfo
                {
                        name        fanSource;
                        option        slave;
                }
        }
        {
                name                fanSourceFace;
                type                faceZoneSet;
                action                new;
                source                setsToFaceZone;
                sourceInfo
                {
                        faceSet        fanSource;
                        cellSet        fanSourceSlave;
                }
        }
);

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



All times are GMT -4. The time now is 14:53.