Cubit 17.02 User Documentation

Hyperbolic Tan Sizing Function

A new mesh sizing capability developed to improve mesh quality and control. This function can be specified on curves to ensure that the mesh transitions smoothly and accurately, enhancing the overall quality of the simulation. The command syntax for specifying this mesh sizing function is as follows:

Curve <curve_id_range> Sizing Function Tanh 
[start_vertex <id>] 
[start_size <value>]
[end_size <value>] 
[stretch_para <value>] 
[interval <int>] 
[Type {"TANH_HALF"|"TANH_FULL"}]

In the below Figure 1, the TANH_HALF function shows that the mesh size increases linearly at the start_vertex (Para t = 0.0) and mesh size gradation decreases as the parameter, t, goes towards 1.0. Figure 2 shows the mesh generated by placing nodes on the curve using TANH_HALF sizing function.

In the below Figure 1, TANH_FULL shows that the mesh size increases gradually at start_vertex, which might be desirable in capturing boundary layers. Then mesh size increases linearly and finally the mesh size gradation flattens resulting in uniform mesh size in the far field.

high_curve_nurb00.gif

Figure 1: Hyperbolic Tanh half and full symmetry function

 

high_curve_nurb00.gif

Figure 2: Hyperbolic Tanh half sizing function along the radial curves to create boundary layers

 

The below Cubit® commands demonstrate the different options of the Hyperbolic Tan Sizing Function. A simple geometry, such as a brick, is used for the demo.

Option 1: Sizing function type TANH_HALF and TANH_FULL

The mesh generated using the TANH_HALF type shows that the mesh edges grow faster at the start vertex. Therefore, TANH_HALF results in fewer intervals along the curve compared to TANH_FULL

brick x 10 y 35 z 50
curve 3 sizing func tanh start_vertex 4 start_size 0.1 end_size 4 stretch_para 1 type "TANH_HALF"
mesh curve 3
brick x 10 y 35 z 50
curve 3 sizing func tanh start_vertex 4 start_size 0.1 end_size 4 stretch_para 1 type "TANH_FULL"
mesh curve 3

high_curve_nurb00.gif

Figure 3: TANH_HALF produces less intervals than TANH_FULL

 

Option 2: Stretching parameter stretch_para

This example demonstrates the basic application of the Hyperbolic Tan Sizing Function with a single stretch parameter and type "TANH_HALF".

This example illustrates the flexibility of the Hyperbolic Tan Sizing Function in handling multiple stretch parameters. As the stretch_para increases, the mesh size grows faster and will result in fewer mesh edges on the curve.

brick x 10 y 35 z 50
curve 3 sizing func tanh start_vertex 4 start_size 0.1 end_size 4 stretch_para 1 type "TANH_HALF"
mesh curve 3
brick x 10 y 35 z 50
curve 3 sizing func tanh start_vertex 4 start_size 0.1 end_size 4 stretch_para 5 type "TANH_HALF"
mesh curve 3

high_curve_nurb00.gif

Figure 4: Mesh edge grown rate is controlled by stretch_para

 

 

Option 3: start_size, end_size, and interval

The Hyperbolic Tanh Sizing Function allows specification of start_size and end_size; however, when interval is also specified the priority will be given to interval than respecting the start and end sizes. When interval is set to 0, only the start and end size will be respected and tanh sizing function is free to choose any number of interval.

brick x 10 y 35 z 50
curve 3 sizing func tanh start_vertex 4 start_size 0.1 end_size 4 stretch_para 5 interval 0 type "TANH_HALF"
mesh curve 3
brick x 10 y 35 z 50
curve 3 sizing func tanh start_vertex 4 start_size 0.1 end_size 4 stretch_para 5 interval 30 type "TANH_HALF"
mesh curve 3

high_curve_nurb00.gif

Figure 4: Interval overrides the start_size and end_size

 

Python Inputs for UGRID:

UGRID is a Python script developed at Sandia for automething mesh generation for aero simulations. The ugrid_inputs.py Python script specifies the input arguments for the Hyperbolic Tan Sizing Function. UGRID then calls Cubit's tanh command using the arguments specified in ugrid_inputs.py. Below are examples of ugrid_inputs.py demonstrating sizing control in both radial and axial directions:

Example 1: Sizing control using TANH_HALF

# ugrid_inputs.py
curve_id_range = "3"
start_vertex = 4
start_size = 0.1
end_size = 4
stretch_para = 1
tanh_type = "TANH_HALF"
# Command to be executed by UGRID
command = f"Curve {curve_id_range} Sizing Function Tanh start_vertex {start_vertex} start_size {start_size} end_size {end_size} stretch_para {stretch_para} type {tanh_type}"

Example 2: Specified interval overrides the default Tanh sizing function

# ugrid_inputs.py
curve_id_range = "3"
start_vertex = 4
start_size = 0.1
end_size = 4
stretch_para = 5
interval = "30"
tanh_type = "TANH_HALF"
# Command to be executed by UGRID
command = f"Curve {curve_id_range} Sizing Function Tanh start_vertex {start_vertex} start_size {start_size} end_size {end_size} stretch_para {stretch_para} interval {interval} type {tanh_type}"