Skip to content

Commit

Permalink
fix tang check (idaholab#29777)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnezdyur committed Feb 3, 2025
1 parent 32662f9 commit 77ebc15
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 4 deletions.
8 changes: 6 additions & 2 deletions framework/src/geomsearch/PenetrationThread.C
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
}
Expand Down
123 changes: 123 additions & 0 deletions test/tests/geomsearch/3d_penetration_locator/close_tet.i
Original file line number Diff line number Diff line change
@@ -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
[]
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Binary file not shown.
7 changes: 7 additions & 0 deletions test/tests/geomsearch/3d_penetration_locator/tests
Original file line number Diff line number Diff line change
Expand Up @@ -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."
[]
[]

0 comments on commit 77ebc15

Please sign in to comment.