diff --git a/framework/src/geomsearch/PenetrationThread.C b/framework/src/geomsearch/PenetrationThread.C index c3844fb0a310..f98a25b2b58f 100644 --- a/framework/src/geomsearch/PenetrationThread.C +++ b/framework/src/geomsearch/PenetrationThread.C @@ -427,8 +427,12 @@ PenetrationThread::operator()(const NodeIdRange & range) } while (i < p_info.size() && best < p_info.size()); if (best < p_info.size()) { - switchInfo(info, p_info[best]); - info_set = true; + // Ensure final info is within the tangential tolerance + if (p_info[best]->_tangential_distance <= _tangential_tolerance) + { + switchInfo(info, p_info[best]); + info_set = true; + } } } } diff --git a/test/tests/geomsearch/3d_penetration_locator/close_tet.i b/test/tests/geomsearch/3d_penetration_locator/close_tet.i new file mode 100644 index 000000000000..77c2ca5812ba --- /dev/null +++ b/test/tests/geomsearch/3d_penetration_locator/close_tet.i @@ -0,0 +1,123 @@ +[Problem] + solve = false +[] +[Mesh] + [block_one] + type = GeneratedMeshGenerator + dim = 3 + nx = 3 + ny = 3 + nz = 1 + xmin = 4.5 + xmax = 5.5 + ymin = 4.5 + ymax = 5.5 + zmin = 0.001 + zmax = 1.001 + boundary_name_prefix = 'ball' + elem_type = TET4 + [] + [block_two] + type = GeneratedMeshGenerator + dim = 3 + nx = 10 + ny = 10 + nz = 1 + xmin = 3 + xmax = 7 + ymin = 3 + ymax = 7 + zmin = -2 + zmax = 0 + boundary_name_prefix = 'base' + boundary_id_offset = 10 + elem_type = TET4 + [] + [block_one_id] + type = SubdomainIDGenerator + input = block_one + subdomain_id = 1 + [] + [block_two_id] + type = SubdomainIDGenerator + input = block_two + subdomain_id = 2 + [] + [combine] + type = MeshCollectionGenerator + inputs = ' block_one_id block_two_id' + [] +[] + +[AuxVariables] + [penetration] + order = FIRST + family = LAGRANGE + [] + [closest_point_x] + order = FIRST + family = LAGRANGE + [] + [closest_point_y] + order = FIRST + family = LAGRANGE + [] + [closest_point_z] + order = FIRST + family = LAGRANGE + [] + [tang_dist] + order = FIRST + family = LAGRANGE + [] +[] + +[AuxKernels] + [penetrate] + type = PenetrationAux + variable = penetration + boundary = base_front + paired_boundary = ball_back + quantity = distance + [] + + [close_x] + type = PenetrationAux + variable = closest_point_x + boundary = base_front + paired_boundary = ball_back + quantity = closest_point_x + [] + + [close_y] + type = PenetrationAux + variable = closest_point_y + boundary = base_front + paired_boundary = ball_back + quantity = closest_point_y + [] + + [close_z] + type = PenetrationAux + variable = closest_point_z + boundary = base_front + paired_boundary = ball_back + quantity = closest_point_z + [] + [tang_dist] + type = PenetrationAux + variable = tang_dist + boundary = base_front + paired_boundary = ball_back + quantity = tangential_distance + [] +[] + +[Executioner] + type = Steady +[] + +[Outputs] + exodus = true + execute_on = TIMESTEP_END +[] diff --git a/test/tests/geomsearch/3d_penetration_locator/gold/3d_rings_out_values_0001.csv b/test/tests/geomsearch/3d_penetration_locator/gold/3d_rings_out_values_0001.csv index 7c142aa4c5f3..60bc4f2f13a0 100644 --- a/test/tests/geomsearch/3d_penetration_locator/gold/3d_rings_out_values_0001.csv +++ b/test/tests/geomsearch/3d_penetration_locator/gold/3d_rings_out_values_0001.csv @@ -105,7 +105,7 @@ id,penet,x,y,z 103,0,0.023321254371987,0.085147669460424,0.52757575757576 104,0,0.01343582997789,0.080003415385772,0.52757575757576 105,0,0.001228247892379,0.074916002753794,0.52757575757576 -106,-0.02,-0.012040599039569,0.069254560506297,0.52757575757576 +106,0,-0.012040599039569,0.069254560506297,0.52757575757576 107,0,-0.025369449981148,0.062763432388308,0.52757575757576 108,0,-0.038217981421365,0.056264603033665,0.52757575757576 109,0,-0.050385926211285,0.049932986944693,0.52757575757576 @@ -145,7 +145,7 @@ id,penet,x,y,z 143,0,0.019784304947665,0.093759659737193,0.52757575757576 144,0,0.0088307662446221,0.091722688900273,0.52757575757576 145,0,-0.0046421167912178,0.08945169640657,0.52757575757576 -146,-0.02,-0.019286003603324,0.084658690550919,0.52757575757576 +146,0,-0.019286003603324,0.084658690550919,0.52757575757576 147,0,-0.033194217610861,0.077133564062727,0.52757575757576 148,0,-0.046129505898724,0.069631033321947,0.52757575757576 149,0,-0.058420538219503,0.061937694966137,0.52757575757576 diff --git a/test/tests/geomsearch/3d_penetration_locator/gold/close_tet_out.e b/test/tests/geomsearch/3d_penetration_locator/gold/close_tet_out.e new file mode 100644 index 000000000000..3ec219884305 Binary files /dev/null and b/test/tests/geomsearch/3d_penetration_locator/gold/close_tet_out.e differ diff --git a/test/tests/geomsearch/3d_penetration_locator/tests b/test/tests/geomsearch/3d_penetration_locator/tests index 166f96de81b4..b712f3e8cf6a 100644 --- a/test/tests/geomsearch/3d_penetration_locator/tests +++ b/test/tests/geomsearch/3d_penetration_locator/tests @@ -33,4 +33,11 @@ "point search leads to element Jacobian computations too far from the element for " "the Jacobian to be non-negative." [] + [close_tet_mesh] + type = Exodiff + input = 'close_tet.i' + exodiff = 'close_tet_out.e' + recover = false # steady solve + requirement = "The system will shall be able to ensure contact points are within tangential tolerances." + [] []