-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move GapPerfectConductance from BISON to MOOSE. Closes #28963.
- Loading branch information
Showing
9 changed files
with
467 additions
and
17 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
modules/heat_transfer/doc/content/source/bcs/GapPerfectConductance.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# GapPerfectConductance | ||
|
||
!syntax description /BCs/GapPerfectConductance | ||
|
||
!alert note title=Often Created by an Action | ||
This object can be set up automatically by using the [ThermalContact](syntax/ThermalContact/index.md) action. | ||
|
||
## Description | ||
|
||
This class enforces that temperatures match across the gap. Specifically, the temperature on the secondary surface will match the temperature on the primary surface. This is accomplished through a penalty constraint. The residual is | ||
\begin{equation} | ||
r = k (T_s - T_p) | ||
\end{equation} | ||
where $k$ is the penalty value, $T_s$ is the temperature on the secondary surface, and $T_p$ is the temperature on the primary surface. | ||
|
||
## Example Input Syntax | ||
|
||
!listing test/tests/gap_perfect_transfer/gap_perfect_transfer.i block=ThermalContact | ||
|
||
!syntax parameters /BCs/GapPerfectConductance | ||
|
||
!syntax inputs /BCs/GapPerfectConductance | ||
|
||
!syntax children /BCs/GapPerfectConductance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
#pragma once | ||
|
||
#include "IntegratedBC.h" | ||
|
||
class GapPerfectConductance : public IntegratedBC | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
GapPerfectConductance(const InputParameters & parameters); | ||
|
||
virtual ~GapPerfectConductance() {} | ||
|
||
protected: | ||
virtual Real computeQpResidual(); | ||
virtual Real computeQpJacobian(); | ||
|
||
/// AuxVariable holding the gap_distance | ||
const VariableValue & _gap_distance; | ||
|
||
/// AuxVariable holding the temperature on the secondary surface | ||
const VariableValue & _gap_temp; | ||
|
||
const Real _penalty; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
#include "GapPerfectConductance.h" | ||
|
||
registerMooseObject("HeatTransferApp", GapPerfectConductance); | ||
|
||
InputParameters | ||
GapPerfectConductance::validParams() | ||
{ | ||
InputParameters params = IntegratedBC::validParams(); | ||
params.addClassDescription("Enforces equal temperatures across the gap."); | ||
params.addRequiredCoupledVar("gap_distance", "Distance across the gap."); | ||
params.addRequiredCoupledVar("gap_temp", "Temperature on the other side of the gap."); | ||
params.addParam<Real>("penalty", 1, "Penalty value to be applied to the constraint."); | ||
return params; | ||
} | ||
|
||
GapPerfectConductance::GapPerfectConductance(const InputParameters & parameters) | ||
: IntegratedBC(parameters), | ||
_gap_distance(coupledValue("gap_distance")), | ||
_gap_temp(coupledValue("gap_temp")), | ||
_penalty(getParam<Real>("penalty")) | ||
{ | ||
} | ||
|
||
Real | ||
GapPerfectConductance::computeQpResidual() | ||
{ | ||
return _penalty * (_u[_qp] - _gap_temp[_qp]); | ||
} | ||
|
||
Real | ||
GapPerfectConductance::computeQpJacobian() | ||
{ | ||
return _penalty; | ||
} |
132 changes: 132 additions & 0 deletions
132
modules/heat_transfer/test/tests/gap_perfect_transfer/gap_perfect_transfer.i
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
# | ||
# 1-D Gap Perfect Heat Transfer | ||
# | ||
# The mesh consists of two element blocks containing one element each. Each | ||
# element is a unit line. They sit next to one another with a unit between | ||
# them. | ||
# | ||
# The temperature of the far left boundary is ramped from 100 to 200 over one | ||
# second and then held fixed. The temperature of the far right boundary | ||
# follows due to the perfect heat transfer. | ||
# | ||
|
||
[Mesh] | ||
[left] | ||
type = GeneratedMeshGenerator | ||
dim = 1 | ||
boundary_name_prefix = left | ||
[] | ||
[right] | ||
type = GeneratedMeshGenerator | ||
dim = 1 | ||
xmin = 2 | ||
boundary_name_prefix = right | ||
boundary_id_offset = 2 | ||
[] | ||
[right_block] | ||
type = SubdomainIDGenerator | ||
input = right | ||
subdomain_id = 1 | ||
[] | ||
[collect] | ||
type = CombinerGenerator | ||
inputs = 'left right_block' | ||
[] | ||
[] | ||
|
||
[Functions] | ||
[temperature] | ||
type = PiecewiseLinear | ||
x = '0 1 2' | ||
y = '100 200 200' | ||
[] | ||
[] | ||
|
||
[Variables] | ||
[temperature] | ||
order = FIRST | ||
family = LAGRANGE | ||
initial_condition = 100 | ||
[] | ||
[] | ||
|
||
[Kernels] | ||
[heat] | ||
type = HeatConduction | ||
variable = temperature | ||
[] | ||
[] | ||
|
||
[BCs] | ||
[temp_far_left] | ||
type = FunctionDirichletBC | ||
boundary = 0 | ||
variable = temperature | ||
function = temperature | ||
[] | ||
[] | ||
|
||
[ThermalContact] | ||
[thermal_contact_1] | ||
type = GapPerfectConductance | ||
variable = temperature | ||
primary = 1 | ||
secondary = 2 | ||
[] | ||
[] | ||
|
||
[Materials] | ||
[heat1] | ||
type = HeatConductionMaterial | ||
block = 0 | ||
specific_heat = 1.0 | ||
thermal_conductivity = 1.0 | ||
[] | ||
[heat2] | ||
type = HeatConductionMaterial | ||
block = 1 | ||
specific_heat = 1.0 | ||
thermal_conductivity = 10.0 | ||
[] | ||
[] | ||
|
||
[Executioner] | ||
type = Transient | ||
|
||
solve_type = 'PJFNK' | ||
|
||
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package' | ||
petsc_options_value = 'lu superlu_dist' | ||
|
||
line_search = 'none' | ||
|
||
nl_abs_tol = 1e-8 | ||
nl_rel_tol = 1e-14 | ||
|
||
l_tol = 1e-3 | ||
l_max_its = 100 | ||
|
||
start_time = 0.0 | ||
dt = 1e-1 | ||
end_time = 2.0 | ||
num_steps = 50 | ||
[] | ||
|
||
[Postprocessors] | ||
[aveTempLeft] | ||
type = SideAverageValue | ||
boundary = 0 | ||
variable = temperature | ||
execute_on = 'initial timestep_end' | ||
[] | ||
[aveTempRight] | ||
type = SideAverageValue | ||
boundary = 3 | ||
variable = temperature | ||
execute_on = 'initial timestep_end' | ||
[] | ||
[] | ||
|
||
[Outputs] | ||
csv = true | ||
[] |
Oops, something went wrong.