[version 12][version 11][version 10][version 9][version 8][version 7][version 6]
6.1 Patch selection in field files
There are three different ways an entry can be specified for a patch in the boundaryField of a field file: 1) by patch name; 2) by group name; 3) matching a patch name with a regular expression. They are listed here in order of precedence which is obeyed if multiple entries are valid of a particular patch. The different specifications can be illustrated by imagining a mesh with the following patches.
- inlet: a generic patch.
- lowerWall and upperWall: two wall patches.
- outletSmall, outletMedium and outletLarge: three outlet patches of generic type, all in a patch group named outlet.
Then imagine the following boundaryField for a field, e.g. p, corresponding to the patches above.
boundaryField
{
inlet
{
type zeroGradient;
}
".*Wall"
{
type zeroGradient;
}
outletSmall
{
type fixedValue;
value uniform 1;
}
outlet
{
type fixedValue;
value uniform 0;
}
}
The outletMedium and outletLarge patches do not have matching entries in the field file, so they instead the outlet entry will be applied (rule 2), since it matches the group name to which the patches belong. Note that the outletSmall patch does not use the outlet entry because a matching patch entry takes precedence over a matching group entry.
Finally, the lowerWall and upperWall match the regular expression ".*Wall". Regular expressions are described in section 4.2.12 ; they must be included in double quotations "…". The ".*" component matches any expression (including nothing), so matches the wall patch names here. The regular expression could use word grouping to provide a more precise match to the patch names, e.g.
"(lower|upper)Wall"
{
type zeroGradient;
}
wall
{
type zeroGradient;
}