Permalink
Browse files

Merge pull request #12441 from gambka/layered_contact

Make thermal contact work in 2D geometries not confined to or parallel to the x-y plane
  • Loading branch information...
bwspenc committed Nov 20, 2018
2 parents 27911d7 + 77d709d commit 3b802870b6e6494b53f6a458b70cda2498930d7b
@@ -205,7 +205,14 @@ findContactPoint(PenetrationInfo & p_info,
}
else
{
p_info._normal = RealGradient(dxyz_dxi[0](1), -dxyz_dxi[0](0));
const Node * const * elem_nodes = master_elem->get_nodes();
const Point in_plane_vector1 = *elem_nodes[1] - *elem_nodes[0];
const Point in_plane_vector2 = *elem_nodes[2] - *elem_nodes[0];
Point out_of_plane_normal = in_plane_vector1.cross(in_plane_vector2);
out_of_plane_normal /= out_of_plane_normal.norm();
p_info._normal = dxyz_dxi[0].cross(out_of_plane_normal);
if (std::fabs(p_info._normal.norm()) > 1e-15)
p_info._normal /= p_info._normal.norm();
}
@@ -1200,7 +1200,14 @@ PenetrationThread::isFaceReasonableCandidate(const Elem * master_elem,
}
else if (dim - 1 == 1)
{
normal = RealGradient(dxyz_dxi[0](1), -dxyz_dxi[0](0));
const Node * const * elem_nodes = master_elem->get_nodes();
const Point in_plane_vector1 = *elem_nodes[1] - *elem_nodes[0];
const Point in_plane_vector2 = *elem_nodes[2] - *elem_nodes[0];
Point out_of_plane_normal = in_plane_vector1.cross(in_plane_vector2);
out_of_plane_normal /= out_of_plane_normal.norm();
normal = dxyz_dxi[0].cross(out_of_plane_normal);
}
else
{
@@ -4,8 +4,8 @@
# This test exercises 2D gap heat transfer for a constant conductivity gap.
#
# The mesh consists of an inner solid cylinder of radius = 1 unit, and outer
# hollow cylinder with an inner radius of 2. In other words, the gap between
# them is 1 radial unit in length.
# hollow cylinder with an inner radius of 2 in the x-y plane. In other words,
# the gap between them is 1 radial unit in length.
#
# The conductivity of both cylinders is set very large to achieve a uniform
# temperature in each cylinder. The temperature of the center node of the
@@ -0,0 +1,160 @@
#
# 2D Cylindrical Gap Heat Transfer Test.
#
# This test exercises 2D gap heat transfer for a constant conductivity gap.
#
# The mesh consists of an inner solid cylinder of radius = 1 unit, and outer
# hollow cylinder with an inner radius of 2 in the x-z plane. In other words,
# the gap between them is 1 radial unit in length.
#
# The calculated results are the same as for the cyl2D.i case in the x-y plane.
[GlobalParams]
order = SECOND
family = LAGRANGE
[]
[Mesh]
file = cyl2D.e
[]
[MeshModifiers]
[./rotate]
type = Transform
transform = ROTATE
vector_value = '0 90 0'
[../]
[]
[Functions]
[./temp]
type = PiecewiseLinear
x = '0 1'
y = '100 200'
[../]
[]
[Variables]
[./temp]
initial_condition = 100
[../]
[]
[AuxVariables]
[./gap_conductance]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[./heat_conduction]
type = HeatConduction
variable = temp
[../]
[]
[AuxKernels]
[./gap_cond]
type = MaterialRealAux
property = gap_conductance
variable = gap_conductance
boundary = 2
[../]
[]
[Materials]
[./heat1]
type = HeatConductionMaterial
block = '1 2'
specific_heat = 1.0
thermal_conductivity = 1000000.0
[../]
[]
[ThermalContact]
[./thermal_contact]
type = GapHeatTransfer
variable = temp
master = 3
slave = 2
gap_conductivity = 1
quadrature = true
gap_geometry_type = CYLINDER
cylinder_axis_point_1 = '0 0 0'
cylinder_axis_point_2 = '0 1 0'
[../]
[]
[BCs]
[./mid]
type = FunctionPresetBC
boundary = 1
variable = temp
function = temp
[../]
[./temp_far_right]
type = PresetBC
boundary = 4
variable = temp
value = 100
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
dt = 1
dtmin = 0.01
end_time = 1
nl_rel_tol = 1e-12
nl_abs_tol = 1e-7
[./Quadrature]
order = fifth
side_order = seventh
[../]
[]
[Outputs]
[./out]
type = Exodus
output_dimension = 3
[../]
[./Console]
type = Console
[../]
[]
[Postprocessors]
[./temp_left]
type = SideAverageValue
boundary = 2
variable = temp
[../]
[./temp_right]
type = SideAverageValue
boundary = 3
variable = temp
[../]
[./flux_left]
type = SideFluxIntegral
variable = temp
boundary = 2
diffusivity = thermal_conductivity
[../]
[./flux_right]
type = SideFluxIntegral
variable = temp
boundary = 3
diffusivity = thermal_conductivity
[../]
[]
@@ -0,0 +1,160 @@
#
# 2D Cylindrical Gap Heat Transfer Test.
#
# This test exercises 2D gap heat transfer for a constant conductivity gap.
#
# The mesh consists of an inner solid cylinder of radius = 1 unit, and outer
# hollow cylinder with an inner radius of 2 in the y-z plane. In other words,
# the gap between them is 1 radial unit in length.
#
# The calculated results are the same as for the cyl2D.i case in the x-y plane.
[GlobalParams]
order = SECOND
family = LAGRANGE
[]
[Mesh]
file = cyl2D.e
[]
[MeshModifiers]
[./rotate]
type = Transform
transform = ROTATE
vector_value = '0 90 90'
[../]
[]
[Functions]
[./temp]
type = PiecewiseLinear
x = '0 1'
y = '100 200'
[../]
[]
[Variables]
[./temp]
initial_condition = 100
[../]
[]
[AuxVariables]
[./gap_conductance]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[./heat_conduction]
type = HeatConduction
variable = temp
[../]
[]
[AuxKernels]
[./gap_cond]
type = MaterialRealAux
property = gap_conductance
variable = gap_conductance
boundary = 2
[../]
[]
[Materials]
[./heat1]
type = HeatConductionMaterial
block = '1 2'
specific_heat = 1.0
thermal_conductivity = 1000000.0
[../]
[]
[ThermalContact]
[./thermal_contact]
type = GapHeatTransfer
variable = temp
master = 3
slave = 2
gap_conductivity = 1
quadrature = true
gap_geometry_type = CYLINDER
cylinder_axis_point_1 = '0 0 0'
cylinder_axis_point_2 = '1 0 0'
[../]
[]
[BCs]
[./mid]
type = FunctionPresetBC
boundary = 1
variable = temp
function = temp
[../]
[./temp_far_right]
type = PresetBC
boundary = 4
variable = temp
value = 100
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
dt = 1
dtmin = 0.01
end_time = 1
nl_rel_tol = 1e-12
nl_abs_tol = 1e-7
[./Quadrature]
order = fifth
side_order = seventh
[../]
[]
[Outputs]
[./out]
type = Exodus
output_dimension = 3
[../]
[./Console]
type = Console
[../]
[]
[Postprocessors]
[./temp_left]
type = SideAverageValue
boundary = 2
variable = temp
[../]
[./temp_right]
type = SideAverageValue
boundary = 3
variable = temp
[../]
[./flux_left]
type = SideFluxIntegral
variable = temp
boundary = 2
diffusivity = thermal_conductivity
[../]
[./flux_right]
type = SideFluxIntegral
variable = temp
boundary = 3
diffusivity = thermal_conductivity
[../]
[]
Oops, something went wrong.

0 comments on commit 3b80287

Please sign in to comment.