Nabla Logo user
  Advanced Search
  
  Send us a comment/query
 
  Back to main web site
 
  OpenFOAM guides
  - User guide
  - Programmer’s guide
 
  Index
 
  Changes from OpenFOAM 2.2 to 2.3
 
  Trademarks in the guides
  ©2000-2007 Nabla Ltd.

6.2 Boundaries

In this section we discuss the way in which boundaries are treated in OpenFOAM. The subject of boundaries is a little involved because their role in modelling is not simply that of a geometric entity but an integral part of the solution and numerics through boundary conditions or inter-boundary ‘connections’. A discussion of boundaries sits uncomfortably between a discussion on meshes, fields, FoamX, discretisation, computational processing etc. Its placement in this Chapter on meshes is a choice of convenience.

We first need to consider that, for the purpose of applying boundary conditions, a boundary is generally broken up into a set of patches. One patch may include one or more enclosed areas of the boundary surface which do not necessarily need to be physically connected.

There are four attributes associated with a patch that are described below in their natural hierarchy and Figure 6.3 shows the names of different patch types introduced at each level of the hierarchy. The hierarchy described below is very similar, but not identical, to the class hierarchy used in the OpenFOAM library.

Base type
The type of patch described purely in terms of geometry or a data ‘communication link’.
Primitive type
The base numerical patch condition assigned to a field variable on the patch.
Derived type
A complex patch condition, derived from the primitive type, assigned to a field variable on the patch.
Physical type
A type describing the boundary conditions in the physical world which may include specification of derived or primitive types on one or more fields, e.g. an inlet in fluid flow may be a fixedValue condition on U  \special {t4ht= and fixedGradient condition on p  \special {t4ht=.


                                           symmetry
                                            empty
                                            wedge
Base type               patch                 cyclic
                                             wall

                                           processor

                     fixedValue
                    fixedGradient
                    zeroGradient
Primitive type           mixed
                   directionMixed

                     calculated

Derived type        e.g. inletOutlet
              see Table 6.3 for full list

                e.g. inlet, specifying

Physical type   fixedValue  on velocity,
              fixedGradient on pressure
\special {t4ht=

Figure 6.3: Patch attributes


6.2.1 Specification of patch types in OpenFOAM

The patch types are specified in the mesh and field files of a OpenFOAM case. More precisely:

  • the base type is specified under the type keyword for each patch in the boundary file, located in the constant/polyMesh directory;
  • the numerical patch type, be it a primitive or derived type, is specified under the type keyword for each patch in a field file.

The base type and numerical type are sufficient for the OpenFOAM case to run. However, there is one further optional entry:

  • the physical type can be specified under the physicalType keyword for each patch in the boundary file.

This entry is generated by FoamX and corresponds to the configuration of physical patch types for individual OpenFOAM solvers. FoamX reads the entry when a case is opened but if it does not exist, it will need to be specified by the user.

An example boundary file is shown below for a sonicFoam case, followed by a pressure field file, p, for the same case:


31  
32  6
33  (
34  inlet
35  {
36      type patch;
37      physicalType inletFixedTemp;
38      nFaces 50;
39      startFace 10325;
40  }
41  
42  outlet
43  {
44      type patch;
45      physicalType pressureTransmissiveOutlet;
46      nFaces 40;
47      startFace 10375;
48  }
49  
50  bottom
51  {
52      type symmetryPlane;
53      physicalType symmetryPlane;
54      nFaces 25;
55      startFace 10415;
56  }
57  
58  top
59  {
60      type symmetryPlane;
61      physicalType symmetryPlane;
62      nFaces 125;
63      startFace 10440;
64  }
65  
66  obstacle
67  {
68      type patch;
69      physicalType wallAdiabatic;
70      nFaces 110;
71      startFace 10565;
72  }
73  
74  defaultFaces
75  {
76      type empty;
77      nFaces 10500;
78      startFace 10675;
79  }
80  )
81  
82  // ************************************************************************* //


31  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32  
33  
34  dimensions      [1 -1 -2 0 0 0 0];
35  
36  internalField   uniform 1;
37  
38  boundaryField
39  {
40      inlet
41      {
42          type            fixedValue;
43          value           uniform 1;
44      }
45  
46      outlet
47      {
48          type            pressureTransmissive;
49          pInf            1;
50      }
51  
52      bottom
53      {
54          type            symmetryPlane;
55      }
56  
57      top
58      {
59          type            symmetryPlane;
60      }
61  
62   obstacle
63   {
64       type            zeroGradient;
65   }
66  
67      defaultFaces
68      {
69          type            empty;
70      }
71  }
72  
73  
74  // ************************************************************************* //

The type in the boundary file is patch for all patches except those that patches that have some geometrical constraint applied to them, i.e. the symmetryPlane and empty patches. The p file includes primitive types applied to the inlet and bottom faces, and a more complex derived type applied to the outlet. Comparison of the two files shows that the base and numerical types are consistent where the base type is not a simple patch, i.e. for the symmetryPlane and empty patches.

The physicalType for each patch in the boundary file correspond to a named type in the FoamX configuration file for sonicFoam. For example, the inlet is inletFixedTemp which is configured to be a standard supersonic inlet condition with fixedValue on all fields: pressure p; velocity U; and temperature T. The type applied to inlet in the p file corresponds accordingly.

6.2.2 Base types

The base and geometric types are described below; the keywords used for specifying these types in OpenFOAM are summarised in Table 6.1.


       wedge patch  2



 5o                                   Axis of symmetry



                          wedge  patch 1







wedge aligned along
coordinate plane
\special {t4ht=


Figure 6.4: Axi-symmetric geometry using the wedge patch type.



Selection Key Description


patch generic patch
symmetryPlane plane of symmetry
empty front and back planes of 2D geometry
wedge wedge front and back
cyclic cyclic plane
wall wall (used for wall functions in turbulent flows)
processor inter-processor boundary



Table 6.1: Basic patch types.

patch
The basic patch type for a patch condition that contains no geometric or topological information about the mesh (with the exception of wall), e.g. an inlet or an outlet.
wall
For cases which require wall turbulence modelling, a wall must be specified with a wall patch type, so that the distance from the wall of the cell centres next to the wall are stored as part of the patch.
symmetryPlane
For a symmetry plane.
empty
While OpenFOAM always generates geometries in 3 dimensions, it can be instructed to solve in 2 (or 1) dimensions by specifying a special empty condition on each patch whose plane is normal to the 3rd (and 2nd) dimension for which no solution is required.
wedge
For 2 dimensional axi-symmetric cases, e.g. a cylinder, the geometry is specified as a wedge of 5o \special {t4ht= angle and 1 cell thick running along the plane of symmetry, straddling one of the coordinate planes, as shown in Figure 6.4. The axi-symmetric wedge planes must be specified as separate patches of wedge type. The details of generating wedge-shaped geometries using blockMesh are described in subsection 6.3.3.
cyclic
Enables two patches to be treated as if they are physically connected; used for repeated geometries, e.g. heat exchanger tube bundles. A single cyclic patch splits the faces in its faceList into two, and links the two sets of faces as shown in Figure 6.5. Each face-face pair must be of the same area but the faces do not need to be of the same orientation.
processor
If a code is being run in parallel, on a number of processors, then the mesh must be divided up so that each processor computes on roughly the same number of cells. The boundaries between the different parts of the mesh are called processor boundaries.


                                          Repeated  geometry

           cyclic
          faceList
          1

          2
          3
          4
          5

          6




1                   4
2                   5
3                   6

    computational  links
\special {t4ht=


Figure 6.5: Repeated geometry using the cyclic patch type.


6.2.3 Primitive types

The primitive types are listed in Table 6.2.


Type

Description of condition for patch field f  \special {t4ht=

Data to specify




fixedValue

Value of f  \special {t4ht= is specified

value

fixedGradient

Normal gradient of f  \special {t4ht= is specified

gradient

zeroGradient

Normal gradient of f  \special {t4ht= is zero

--

calculated

Boundary field f  \special {t4ht= derived from other fields

--

mixed

Mixed fixedValue/ fixedGradient condition depending on the value in valueFraction

refValue, refGradient, valueFraction, value

directionMixed

A mixed condition normal to the patch with a fixedGradient condition tangential to the patch

refValue, refGradient, valueFraction, value





Table 6.2: Primitive patch field types.

6.2.4 Derived types

The derived types are listed in Table 6.3.


Types derived from fixedValue

Data to specify




movingWallVelocity

Replaces the normal of the patch value so the flux across the patch is zero

value

pressureInletVelocity

When p  \special {t4ht= is known at inlet, U  \special {t4ht= is evaluated from the flux, normal to the patch

value

pressureDirectedInletVelocity

When p  \special {t4ht= is known at inlet, U  \special {t4ht= is calculated from the flux in the inletDirection

value, inletDirection

surfaceNormalFixedValue

Specifies a vector boundary condition, normal to the patch, by its magnitude; +ve for vectors pointing out of the domain

value

totalPressure

Total pressure          1    2
p0 = p + 2r|U |   \special {t4ht= is fixed; when U  \special {t4ht= changes, p  \special {t4ht= is adjusted accordingly

p0

turbulentInlet

Calculates a fluctuating variable based on a scale of a mean value

referenceField, fluctuationScale

Types derived from fixedGradient/zeroGradient



fluxCorrectedVelocity

Calculates normal component of U  \special {t4ht= at inlet from flux

value

wallBuoyantPressure

Sets fixedGradient pressure based on the atmospheric pressure gradient

--

Types derived from mixed



inletOutlet

Switches U  \special {t4ht= and p  \special {t4ht= between fixedValue and zeroGradient depending on direction of U  \special {t4ht=

inletValue, value

outletInlet

Switches U  \special {t4ht= and p  \special {t4ht= between fixedValue and zeroGradient depending on direction of U  \special {t4ht=

outletValue, value

pressureInletOutletVelocity

Combination of pressureInletVelocity and inletOutlet

value

pressureDirectedInletOutletVelocity

Combination of pressureDirectedInletVelocity and inletOutlet

value, inletDirection

pressureTransmissive

Transmits supersonic pressure waves to surrounding pressure p oo  \special {t4ht=

pInf

supersonicFreeStream

Transmits oblique shocks to surroundings at p
  oo  \special {t4ht=, T
 o o  \special {t4ht=, U
 o o  \special {t4ht=

pInf, TInf, UInf

Other types



slip

zeroGradient if f  \special {t4ht= is a scalar; if f  \special {t4ht= is a vector, normal component is fixedValue zero, tangential components are zeroGradient

--

partialSlip

Mixed zeroGradient/ slip condition depending on the valueFraction; = 1 for slip

valueFraction




Note: p  \special {t4ht= is pressure, U  \special {t4ht= is velocity

Table 6.3: Derived patch field types.