Boundary Conditions

Boundary condition properties are defined using consecutively numbered blocks.

'BC_1' : {....},
'BC_2' : {....},

zCFD supports the following boundary condition types:

BC Type

Description

Wall

Wall boundaries

Farfield

Farfield boundaries with automatic inflow/outflow detection

Inflow

Pressure or massflow inflow boundaries

Outflow

Pressure or massflow outflow boundaries

Symmetry

Mirror boundary condition

Overset

The boundary of a mesh to be overset on a background mesh

Periodic

Repeating boundary condition, with flow from one periodic boundary mapped to the other.

“ref” and “zone”

Boundary conditions can be mapped to the mesh in two ways, depending on the mesh format used. Some mesh formats (for example Fluent) will have boundaries tagged with an integer (wall = 3, etc). These can be referenced directly using the “ref” keyword in your boundary condition definition. Alternatively, the mesh format may contain explicitly numbered zones (which can be determined by inspecting the mesh). In this case, the user can specify the list of zone numbers for each boundary condition using the “zone” keyword.

For example to apply BC_1 to boundaries tagged with value 3:

..
'BC_1' : {
          'ref' : 3,
          ..
}
..

Or to apply BC_1 to boundaries to zones with IDs 0,1,2 & 3:

..
'BC_1' : {
          'zone' : [0,1,2,3],
          ..
}
..

Note

If a ‘zone’ entry is provided it will override the IDs specified in ‘refs’

Wall

Wall boundaries in zCFD can be either slip walls, no-slip walls, or use automatic wall functions. No-slip walls are appropriate when the mesh is able to fully resolve the boundary layer (i.e \((y^{+} \leq 1)\)) otherwise automatic wall functions should be used. This behaviour is chosen by setting 'kind' in the wall specification below. Optionally it is possible to set wall velocity, roughness and temperature.

'type' allows you to choose between a standard 'wall' definition or 'immersed wall' boundaries. Immersed wall boundaries are only supported with meshes created by the using zM3 mesh generator. The zM3 mesh generator will determine vectors to represent the underlying geometry within the 3D Cartesian mesh. It will also generate additional information such as locations where data is to be sampled in order to define conditions at the geometry surface, and the subsequent halo boundary values.

Note

Immersed wall boundaries supports 'type' of 'slip', 'noslip' or 'wallfunction'.

If 'slip' conditions are chosen, there will be zero momentum normal to the underlying geometry.

If 'noslip' conditions are chosen, any values computed near the wall will linearly extrapolated from the donor (sample) point location associated with that point. This can potentially cause sensitivity and early flow separation in strong pressure gradients. Again, this can be alleviated to some extent with mesh refinement, however, this is associated with additional computational cost.

If 'wallfunction' conditions are chosen, any values computed near the wall will be based on the Musker wall model, which closely represents the flow along a flat plate in zero pressure gradient. As such, there are fundamental limitations on the accuracy of this model with highly curved surfaces and strong pressure gradients. This can be alleviated to some extent with mesh refinement, however, this is associated with additional computational cost.

Keyword

Required

Default

Valid values

Description

‘ref’

Yes

Integer

Mesh reference defined by this boundary condition

‘zone’

No

List of integers

Specifies list of mesh zones defined by this boundary condition

‘type’

No

‘wall’ or ‘immersed wall’

Specifies a solid wall boundary which defaults to adiabatic unless a temperature is specified

‘kind’

Yes

‘slip’, ‘noslip’, ‘wallfunction’

Specifies the type of wall boundary condition. Slip - zero viscosity wall boundary. noslip - viscous wall with y+ ~ 1 mesh resolution, wallfunction - viscous wall with automatic handling of mesh resolution between y+~1 to y+ > 100

‘immersed normal type’

No

‘STL’

‘STL’ or ‘immersed boundary vector’

For ‘immersed wall’ types. Specifies how the geometry unit normals are specified (from the STL directly or approximated by the vector from the face centre to the nearest surface point)

‘roughness’

No

See roughness

Specifies the surface roughness. If not specified the wall is specified as perfectly smooth. This requires the wall boundary condition kind to be set to wallfunction.

‘v’

No

See velocity

Wall velocity specification.

‘temperature’

No

See temperature

Specifies the wall temperature for an isothermal wall. If not specified the wall is treated as adiabatic

Example Wall BC with roughness and temperature set:

'BC_1' : {
          'ref' : 3,
          'type' : 'wall',
          'kind' : 'slip',
          'roughness' : {
                        'type' : 'height',
                        'scalar' : 0.001
                        },
          'temperature' : {
                          # Temperature in Kelvin
                          'scalar' : 280.0,
                          },
          },

Example Immersed Boundary Wall BC:

'BC_1' : {
          'ref' : 3,
          'type' : 'immersed wall',
          'kind' : 'wallfunction',
          'immersed normal type' : 'STL',
        },

Roughness

Keyword

Required

Default

Valid values

Description

‘type’

No

‘height’ or ‘length’

Specify how roughness is being specified.

‘scalar’

No

Positive float

Specify the value of roughness length or height in mesh units

‘field’

No

Valid filename

Specify the name of a file that defines a roughness field. This file needs to contain a node array called Roughness that is used to set the value by finding the nearest point to the mesh location.

Roughness can be specified as either a ‘height’ or ‘length’.

Roughness length is defined as the height at which the mean velocity profile of the flow is zero. In other words, at this distant above the surface, the flow is considered to be effectively smooth, and the velocity distribution approaches a logarithmic law.

Roughness height refers to the average height or magnitude of surface roughness elements on a solid boundary. It represents the scale of irregularities or protrusions on the surface, which disrupt the smooth flow and create additional drag or turbulence. Examples of roughness elements include bumps, ridges, or rough surface textures.

This value can be given as a single scaler value or a field file can be provided. This should be a VTP file containing a node array called “Roughness”. The roughness at each boundary face is then set by finding the nearest point to the face centre on the supplied VTK file with the roughness value looked up in a node based scalar array called ‘Roughness’

Velocity

The velocity keywords are used to apply a surface velocity, this is used to model cases with surfaces in relative motion. e.g. a car moving over a road surface or rotating tyre surface. The wall boundary condition supports either a linear velocity or a rotating one

The options for the ‘linear’ dictionary are:

Keyword

Required

Default

Valid values

Description

‘vector’

Yes

[x, y, z]: vector of numbers

Sets the velocity vector for the translation motion of the surface.

‘mach’

No

Number

Overrides the magnitude of the translation velocity vector

The options for the ‘rotating’ dictionary are:

Keyword

Required

Default

Valid values

Description

‘axis’

Yes

[x, y, z]: vector of numbers

Sets the axis of rotation

‘origin’

Yes

[x, y, z]: vector of numbers

Sets the origin of the rotation axis

‘omega’

Yes

Number

Sets the rotational velocity of the rotation in radians per second

Temperature

The temperature keywords are used to apply a surface temperature. A scalar temperature can be applied to the whole boundary or a VTP file provided containing a temperature ‘field’. When using a ‘field’ The temperature at each boundary face is set by finding the nearest point to the face centre on the supplied VTP file with the temperature value looked up in a node based scalar array called ‘Temperature’

The options for the ‘temperature’ dictionary are:

Keyword

Required

Default

Valid values

Description

‘scalar’

Yes

number

Specify the value of wall temperature in Kelvin

‘field’

No

Valid filename

Specify the name of a file that defines a temperature field. This file needs to contain a node array called Temperature that is used to set the value by finding the nearest point to the mesh location for an isothermal wall.

Farfield

Farfield boundary conditions are typically used for external flow simulations and automatically switch for inflows or outflows. This boundary condition cannot be used with the incompressible solver. The farfield boundary automatically determines whether the flow is locally an inflow or an outflow by solving a Riemann equation. The conditions on the farfield boundary are set by referring to an 'IC_' block. In addition to this an atmospheric boundary layer profile or a turbulence profile may be set.

Keyword

Required

Default

Valid values

Description

‘ref’

Yes

Integer

Mesh reference defined by this boundary condition

‘zone’

No

List of integers

Specifies list of mesh zones defined by this boundary condition

‘type’

Yes

‘farfield’

This sets the type of boundary condition to be associated with the zones.

‘kind’

Yes

‘riemann’

‘riemann’, ‘pressure’, ‘supersonic’ or ‘preconditioned’

This sets the specific model used for the farfield boundary condition:
  • riemann uses riemann invariants to provide a non reflecting inflow with a pressure outflow.

  • pressure uses a pressure boundary condition for both inflow (downstream pressure) and outflow (user specified pressure).

  • supersonic uses a supersonic boundary conditions by using upstream conditions for both inflow and outflow.

  • preconditioned uses a preconditioned variant of the riemann boundary condition.

‘condition’

Yes

String reference to IC

Set the reference flow conditions block that relates to these boundaries, see IC_*.

Example boundary condition block for a farfield boundary:

'BC_2' : {
         # Zone type tag
         'ref' : 9,
         # Optional: Specific zone boundary condition override
         'zone' : [0,1,2,3],
         # Required: Boundary condition type
         'type' : 'farfield',
         # Required: Kind of farfield options (riemann, pressure or supersonic)
         'kind' : 'riemann',
         # Required: Farfield conditions
         'condition' : 'IC_1',
         # Optional: Atmospheric Boundary Layer
 },

Inflow

zCFD can specify two kinds of inflow boundary condition: pressure or massflow, selected using the 'kind' key. When using the pressure inflow the boundary condition is specified by a total pressure ratio and a total temperature ratio that needs to be defined by the condition this refers to. When using the massflow condition a total temperature ratio and mass flow ratio or a mass flow rate is required. Note the mass flow ratio is defined relative to the condition set in the 'reference' key. By default the flow direction is normal to the boundary but either a single vector or a python function can be used to specify the inflow normal vector of each face on the surface.

Keyword

Required

Default

Valid values

Description

‘ref’

Yes

Integer

Mesh reference defined by this boundary condition

‘zone’

No

List of integers

Specifies list of mesh zones defined by this boundary condition

‘type’

Yes

‘inflow’

This sets the type of boundary condition to be associated with the zones.

‘kind’

Yes

‘default’

‘default’ or ‘massflow’

This sets the how the user wants to specify the inflow boundary condition:
  • default. Pressure inflow. Velocity and density are calculated from the user provided total pressure ratio and total temperature ratio set in the reference condition. The direction of the velocity vector uses the surface normal but a specific direction can also be provided by the user. Local static pressure is used to compute a local mach number from the total pressure ratio. If the user specifies a mach number this is used to set the static pressure from the total pressure ratio.

  • massflow The velocity is set from the massflow set in the reference condition.

‘condition’

Yes

String reference to IC

Set the reference flow conditions block that relates to these boundaries, see IC_*.

Example boundary condition for setting up a pressure inflow condition based on flow conditions defined in IC_2:

'BC_3' : {
         'ref' : 4,
         'type' : 'inflow',
         'kind' : 'default',
         'condition' : 'IC_2',
         },
'IC_1' : {
         'temperature' : 293.0,
         'pressure' : 101325.0,
         'V': {
              'vector' : [1.0,0.0,0.0],
              'Mach' : 0.20,
              },
         'Reynolds No' : 1.0e6,
         'Reference Length' : 1.0,
         'turbulence intensity' : 0.1,
         'eddy viscosity ratio' : 1.0,
         },
'IC_2' : {
         'reference' : 'IC_1',
         'total temperature ratio' : 1.0,
         'total pressure ratio' : 1.0,
         # Optional - specify mach number to set
         # static pressure at inflow from total pressure
         'mach' : 0.1,
},

Example boundary condition for setting up a massflow inflow condition based on flow conditions defined in IC_2:

'BC_3' : {
         'ref' : 4,
         'type' : 'inflow',
         'kind' : 'massflow',
         'condition' : 'IC_2',
},
'IC_1' : {
         'temperature' : 293.0,
         'pressure' : 101325.0,
         'V': {
              'vector' : [1.0,0.0,0.0],
              'Mach' : 0.20,
              },
         'Reynolds No' : 1.0e6,
         'Reference Length' : 1.0,
         'turbulence intensity' : 0.1,
         'eddy viscosity ratio' : 1.0,
},
'IC_2' : {
         'reference' : 'IC_1',
         'total temperature ratio' : 1.0,
         'mass flow rate' : 10.0,
},

Outflow

Pressure or massflow outflow boundaries are specified in a similar manner to the Inflow boundary. They can be of 'kind' 'pressure', 'radial pressure gradient' or 'massflow'. When the boundary condition 'kind' is either 'pressure' or 'radial pressure gradient', the 'IC_' conditions it refers to must set a static pressure ratio. When the boundary condition 'kind' is 'massflow', a mass flow ratio or mass flow rate must be set in the 'IC_' conditions. Note the mass flow ratio is defined relative to the condition set in the 'reference' key.

Keyword

Required

Default

Valid values

Description

‘ref’

Yes

Integer

Mesh reference defined by this boundary condition

‘zone’

No

List of integers

Specifies list of mesh zones defined by this boundary condition

‘type’

Yes

‘outflow’

This sets the type of boundary condition to be associated with the zones.

‘kind’

Yes

‘pressure’ or ‘massflow’ or ‘radial pressure gradient’

This sets how the user wants to specify the outflow conditions:
  • pressure Sets the pressure at the outflow using the user specified static pressure ratio set in the reference condition.

  • massflow Scales the local velocity so that the total integrated massflow across all the zones meets the user specified value.

‘condition’

Yes

String reference to IC

Set the reference flow conditions block that relates to these boundaries, see IC_*.

‘reference radius’

Yes

Number

'BC_4' : {
         # Zone type tag
         'ref' : 5,
         # Optional: Specific zone boundary condition override
         'zone' : [0,1,2,3],
         # Boundary condition type
         'type' : 'outflow',
         # Kind of outflow 'pressure, 'massflow' or 'radial pressure gradient'
         'kind' : 'pressure',
         # Required only when using 'radial pressure gradient'
         # Radius at which the static pressure ratio is defined
         'reference radius' : 1.0,
         # Outflow conditions
         'condition' : 'IC_2',
         },

Symmetry

Keyword

Required

Default

Valid values

Description

‘ref’

Yes

Integer

Mesh reference defined by this boundary condition

‘zone’

No

List of integers

Specifies list of mesh zones defined by this boundary condition

‘type’

Yes

‘symmetry’

This sets the type of boundary condition to be associated with the zones.

Example symmetry boundary condition:

'BC_5' : {
         'ref' : 7,
         'type' : 'symmetry',
},

Periodic

This boundary condition needs to be specified in pairs with opposing transformations. The transforms specified should map each zone onto each other.

Note

Each periodic boundary needs to provide the correct vector to the opposite matching boundary.

Keyword

Required

Default

Valid values

Description

‘ref’

Yes

Integer

Mesh reference defined by this boundary condition

‘zone’

No

List of integers

Specifies list of mesh zones defined by this boundary condition

‘type’

Yes

‘periodic’

This sets the type of boundary condition to be associated with the zones.

‘kind’

Yes

‘rotated’ or ‘linear’ dictionary (see below)

The definition of the periodic transformations, can either be a ‘rotated’ or ‘linear’ dictionary

The options for the ‘linear’ dictionary are:

Keyword

Required

Default

Valid values

Description

‘vector’

Yes

[x, y, z]: vector of numbers

Defines the translation vector to map this zone onto the matching periodic zone

Example linear periodic boundary condition:

'BC_6' : {
         'zone' : [1],
         'type' : 'periodic',
         'kind' : {
                  # Linear periodic settings
                  'linear' : {
                             'vector' : [1.0,0.0,0.0],
                             },
          },
},

The options for the ‘rotated’ dictionary are:

Keyword

Required

Default

Valid values

Description

‘axis’

Yes

[x, y, z]: vector of numbers

Defines the axis of rotation used to map this boundary onto the matching periodic zone

‘origin’

Yes

[x, y, z]: vector of numbers

Defines the origin of the axis of rotation

‘theta’

Yes

Number

Defines the angle of rotation about the axis (in radians)

Example rotated periodic boundary condition:

'BC_6' : {
         'zone' : [1],
         'type' : 'periodic',
         'kind' : {
                  # Rotated periodic settings
                  'rotated' : {
                              'theta' : math.radians(120.0),
                              'axis' : [1.0,0.0,0.0],
                              'origin' : [-1.0,0.0,0.0],
                              },
                },
}

Overset

The overset boundary condition should be applied to the boundaries of a mesh to be overset on top of a larger background mesh.

Keyword

Required

Default

Valid values

Description

‘ref’

Yes

Integer

Mesh reference defined by this boundary condition

‘zone’

No

List of integers

Specifies list of mesh zones defined by this boundary condition

‘type’

Yes

‘overset’

This sets the type of boundary condition to be associated with the zones.

Example overset boundary condition:

'BC_7' : {
         'zone': [1,2,3,4],
         'type' : 'overset',
},