AMCAX Kernel 1.0.0.0
Loading...
Searching...
No Matches
3D Boundary Layer Detailed JSON Example

Overview

This tutorial provides detailed configuration methods for using mesh generation and 3D boundary layers.

Functional Description

By denser mesh partitioning in the fluid region near object surfaces, it better captures changes in fluid velocity profiles and the effects of viscous fluid dynamics.
Input: Selected surface mesh (triangular/quadrilateral/mixed mesh); Output: Boundary layer mesh (prism/hexahedral).

BREP Model Explanation

Using a simple box CAD model as an example, its face numbering is shown below. This model will be used throughout the tutorial.

Basic JSON Template

Below is the most basic JSON configuration. For more complex configurations, see the Complex JSON Template.

{
"Distribution": [],
"BoundaryLayer":[
{
"DistributionType": "Separation",
"EntityType": "Face",
"FSPairs":
[
{
"F": 1,
"S": 1
},
{
"F": 2,
"S": 1
},
{
"F": 3,
"S": 1
},
{
"F": 4,
"S": 1
},
{
"F": 5,
"S": 1
},
{
"F": 6,
"S": 1
}
],
"Basic":
{
"InitLayerHeight":
{
"Absolute": 0.1
},
"GrowthRate":
{
"Constant": 1.1
},
"NLayers": 3,
"ProblematicAreasTreatment": "STOP"
}
}
],
"MeshSize": [
{
"CurvatureFactor": 0.2,
"GrowthRate": 1.1,
"MaxSize": 1,
"MinSize": 0.1,
"MeshingDim": 2,
"SelectedEntities": []
},
{
"CurvatureFactor": 0.2,
"GrowthRate": 1.1,
"MaxSize": 1,
"MinSize": 0.1,
"MeshingDim": 3,
"SelectedEntities": []
}
],
"ThreadNum": 1
}


Class Key Required Value Range Default Remarks
BoundaryLayer EntityType Yes [Face, Edge]
BoundaryLayer EFPairs/SelectedEntities Yes
BoundaryLayer-Basic GrowthRate Yes "Constant", "Variable"
[1.0,2.0]
Constant growth rate: "Constant" with a fixed value (uniform growth rate per layer)
Variable growth rate: "Variable" with an array of values (independent growth rate per layer)
BoundaryLayer-Basic InitLayerHeight Yes Absolute: [eps,MaxSize]
Aspect: [eps,1]
Absolute mode: Fixed initial layer height (constant value)
Aspect mode: Initial layer height = Local surface mesh length × specified factor
BoundaryLayer-Basic NLayers Yes [1, inf]
BoundaryLayer-Basic ProblematicAreasTreatment Yes STOP, COLLAPSE, EXCLUDE Problem area handling:
STOP: Stops generation when parameters cannot be met
COLLAPSE: Allows local collapsing of layers (may cause intersections, proximity issues, or quality degradation in boundary layers)
EXCLUDE: Permits exclusion of local regions (may result in discontinuous boundary layers with intersections or quality concerns)

Result from this basic JSON template:

Basic Configuration Guide

EntityType & EFPairs

"EntityType": "Face",
"FSPairs":
[
{
"F": 1,
"S": 1
},
{
"F": 2,
"S": 1
},
{
"F": 3,
"S": 1
},
{
"F": 4,
"S": 1
},
{
"F": 5,
"S": 1
},
{
"F": 6,
"S": 1
}
]

Within a solid, boundary layers grow from selected boundary faces towards the interior.
"EntityType": "Face" indicates generating 3D boundary layers from faces to solids. Specifies growth from XX face to XX solid. This example shows growth from faces (tags=1,2,3,4,5,6) to solid (tag=1). Note: Faces must be boundary edges of the solid.

Basic Parameter Settings

"Basic":
{
"InitLayerHeight":
{
"Absolute": 0.1 // Absolute, Aspect
},
"GrowthRate":
{
"Constant": 1.1 // Constant, Variable
},
"NLayers": 3,
"ProblematicAreasTreatment": "STOP" // STOP, COLLAPSE, EXCLUDE
}

InitLayerHeight

Initial layer height has two modes: Absolute and Aspect. Absolute mode means each node has fixed height (compared to Aspect mode), unaffected by local surface mesh size; Aspect mode means node heights may vary, defined by multiplying local surface mesh size, with values as factors of local surface mesh length.

"Absolute": 0.1

When setting initial height to Aspect mode with surface mesh size=1, first layer height becomes 1 * 0.1 = 0.1, theoretically identical to Absolute mode setting of 0.1, as shown:

"Aspect": 0.1

GrowthRate

Constant growth rate: Each layer grows at same rate factor (next layer vs current layer).

"Constant": 1.1 // Value range: [1,2]

Variable growth rate: From second layer onward, each layer has independent growth rate (note: first layer rate is always 0, matching layer count).

"Variable":[0,1,2] // From second layer, value range: [1,2]

NLayers

NLayers: Number of boundary layers to generate.

"NLayers": 3, // Value range: [1,inf]

ProblematicAreasTreatment

When boundary layer generation encounters issues due to local geometric features or insufficient space for required layers, the following methods can be employed.

1.When boundary layer generation encounters issues, stop the process.

"ProblematicAreasTreatment": "STOP"

2.Collapse layers in local regions to overcome intersection, proximity, or quality issues.

"ProblematicAreasTreatment": "COLLAPSE"

3.Exclude problematic local regions to overcome intersection, proximity, or quality issues.

"ProblematicAreasTreatment": "EXCLUDE"

Advanced Json Template

{
"Distribution": [],
"BoundaryLayer":[
{
"DistributionType": "Separation",
"EntityType": "Face",
"FSPairs":
[
{
"F": 1,
"S": 1
},
{
"F": 2,
"S": 1
},
{
"F": 3,
"S": 1
},
{
"F": 4,
"S": 1
},
{
"F": 5,
"S": 1
},
{
"F": 6,
"S": 1
}
],
"Basic":
{
"InitLayerHeight":
{
"Absolute": 0.1
},
"GrowthRate":
{
"Constant": 1.1
},
"NLayers": 3,
"AdditionalOuterLayers": 3,
"LastAspect": 0.6,
"ProblematicAreasTreatment": "COLLAPSE",
"FailureRetainValidLayers": false,
"MaxNumberOfConsecutiveCollapsedLayers": [true,1]
},
"SideTreatment":
{
"AutoConnectAngleLimit": true,
"ConnectLimitAngle": 60
},
"VectorTreatment":
{
"SmoothTopCapShellMesh": true,
"SmoothVectors": [true,60]
},
"GrowthControls":
{
"MaxTopFacetEquiareaSkewness": [true,0.95],
"MaxTopFacetWarping": false,
"MaxLayerAspect": false,
"MaxAllowedAspectProceed": false
}
}
],
"MeshSize": [
{
"CurvatureFactor": 0.2,
"GrowthRate": 1.1,
"MaxSize": 1,
"MinSize": 0.1,
"MeshingDim": 2,
"SelectedEntities": []
},
{
"CurvatureFactor": 0.2,
"GrowthRate": 1.1,
"MaxSize": 1,
"MinSize": 0.1,
"MeshingDim": 3,
"SelectedEntities": []
}
],
"ThreadNum": 1
}


Class Key Required Value Range Default

Remarks

BoundaryLayer-Basic AdditionalOuterLayers No [0, inf] 0 Extra layers to match the last boundary layer with adjacent element size
BoundaryLayer-Basic LastAspect No [eps, 1] 0 Activated when AdditionalOuterLayers is non-zero, aspect ratio of final layer
BoundaryLayer-Basic FailureRetainValidLayers No true, false false Only effective when "STOP" is activated, determines whether to retain valid boundary layers upon failure
BoundaryLayer-Basic MaxNumberOfConsecutiveCollapsedLayers No true, [1,inf]
false
false Only effective when "COLLAPSE" is activated, maximum consecutive collapsed layers
BoundaryLayer-SideTreatment AutoConnectAngleLimit No true, false false Whether to auto-connect boundary layers with adjacent surface meshes
BoundaryLayer-SideTreatment ConnectLimitAngle No [0,90] 60

Maximum allowed angle between boundary layer and adjacent surface mesh

BoundaryLayer-VectorTreatment SmoothTopCapShellMesh No true, false true Allow vectors to deviate from original normal position; otherwise grow orthogonally
BoundaryLayer-VectorTreatment SmoothVectors No True, [0,180]
false
[true,45]

Maximum allowed angular deviation from initial position

BoundaryLayer-GrowthControls MaxTopFacetEquiarealSkewness No true, [1,0]
false
false Maximum equiareal skewness of top triangular facets​. If enabled, boundary layer growth will terminate when the maximum equiareal skewness of the top triangular facets exceeds the specified threshold.
BoundaryLayer-GrowthControls MaxTopFacetWarping No true,[inf,0]
false
false Maximum warping value of top quadrilateral facets​. If enabled, boundary layer growth will stop when the maximum warping value of top quadrilateral facets exceeds the specified threshold.
BoundaryLayer-GrowthControls MaxLayerAspect No true,[eps,inf]
false
false Maximum aspect ratio
BoundaryLayer-GrowthControls MaxAllowedAspectProceed No true,"LocalCollapse","ConstantHeight"
false
false When reaching max aspect ratio: ConstantHeight-maintains constant height; LocalCollapse-locally collapses layers (requires "COLLAPSE" activation)

Using this complex JSON template produces results as shown below:

Advanced Configuration Guide

Basic Parameter Settings

"Basic":
{
"InitLayerHeight":
{
"Absolute": 0.1 // "Absolute": xx/"Aspect": xx
},
"GrowthRate":
{
"Constant": 1.1 // "Constant": xx/"Variable":[xx,...,xx]
},
"NLayers": 3,
"AdditionalOuterLayers": 3,
"LastAspect": 0.6,
"ProblematicAreasTreatment": "COLLAPSE", // STOP/COLLAPSE/EXCLUDE
"FailureRetainValidLayers": false, // true/false
"MaxNumberOfConsecutiveCollapsedLayers": [true,1] // [true,value]/false
}

AdditionalOuterLayers

AdditionalOuterLayers: Number of extra boundary layers added to match the size of adjacent triangular elements. If the size of the last boundary layer exceeds nearby triangular elements, this parameter defaults to 0 even when set.

"AdditionalOuterLayers": 3, // Value range: [0,inf], Default: 0

LastAspect

Aspect ratio (height/width) of the final layer. This parameter can only be set when AdditionalOuterLayers is non-zero.

"LastAspect": 0.6, // Value range: [eps,1], Default: 0

Side Treatment Options

"SideTreatment":
{
"AutoConnectAngleLimit": true, // true/false
"ConnectLimitAngle": 60 // [0,90]
}

AutoConnectAngleLimit,ConnectLimitAngle

Activate this function, the boundary layer will automatically connect with adjacent surface meshes, and the surface meshes will be automatically reconstructed (the surface meshes in the area connected to the volume mesh will be consistent with the volume mesh surface in size and node position; the surface mesh types in non-connected areas will remain unchanged, and the surface meshes near the outer layer of the boundary layer will be partially reconstructed). The maximum allowable angle between the boundary layer and adjacent surface meshes needs to be specified for adjustment and connection.

"AutoConnectAngleLimit": true,
"ConnectLimitAngle": 60

As shown in the figure below, modify FSPairs to only set face 6. At this time, the connection angle between face 6 and adjacent faces 1, 2, 3, and 4 is 0 degrees. When this option is activated, the boundary layer will connect with these faces, and these faces will be automatically reconstructed.

"FSPairs":
[
{
"F": 6,
"S": 1
}
]

If this function is not activated, the boundary layer will not connect with adjacent surface meshes.

"AutoConnectAngleLimit": false

For this case, if this option is not activated, it may lead to generation failure.

Vector Treatment Options

"VectorTreatment":
{
"SmoothTopCapShellMesh": true, // Value range: {false,true}
"SmoothVectors": [true,90], // Value range: {false,[true,[0,180°]]}, default value: [true,45]
}

SmoothTopCapShellMesh

If this option is activated, vectors are allowed to move from their original normal position; if not activated, the layers will grow orthogonally. This operation allows the generation of more layers because the mesh "opens up" more in enclosed areas, but may result in poorer quality (less orthogonal) meshes.

SmoothVectors

If this option is activated, the user can specify the maximum allowable angle deviation from the original normal position. This operation allows the generation of more layers because the mesh "opens up" more in enclosed areas, but may result in poorer quality (less orthogonal) meshes.

Growth Controls

"GrowthControls":
{
"MaxTopFacetEquiareaSkewness": [true,0.95], // For triangular surface meshes, [true,quality]/false
"MaxTopFacetWarping": false, // For quadrilateral surface meshes, [true,quality]/false
"MaxLayerAspect": false, // [true,value]/false
"MaxAllowedAspectProceed": false // [true,string]/false
}

MaxTopFacetEquiareaSkewness,MaxTopFacetWarping

When the boundary layer grows from a non-flat starting surface, the top surface mesh may develop severely distorted elements, leading to poor quality tetrahedral generation.
If the MaxTopFacetEquiareaSkewness option is enabled, when the distortion of the top triangular surface mesh elements exceeds the set threshold, the boundary layer growth will stop. It is generally recommended to enable this option and set the threshold above 0.95.
If the MaxTopFacetWarping option is enabled, when the warping value of the top quadrilateral surface mesh elements exceeds the set threshold, the boundary layer growth will stop.

MaxLayerAspect,MaxAllowedAspectProceed

When growing boundary layers using absolute mode in areas with small surface element lengths, excessive boundary layer growth may sometimes occur, and these layers may become abnormally high. By specifying the maximum layer aspect ratio (layer element height/layer element base width), the layer height can be kept within a reasonable range.

When the boundary layer aspect ratio reaches this limit:

  1. ConstantHeight - Maintain constant height after reaching the threshold: When the maximum allowable layer aspect ratio is reached, continue growing at a constant layer height.
  2. LocalCollapse - Locally collapse layers after reaching the threshold: When the maximum allowable layer aspect ratio is reached, immediately stop layer growth in this area and collapse in this area (requires COLLAPSE to be activated).

Click here example05 to get the full source code of the 3D boundary layer detailed JSON example. Everyone can download it as needed.