www.mooseframework.org
GapConductanceConstraint.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
8 
9 template <>
10 InputParameters
12 {
13  InputParameters params = validParams<FaceFaceConstraint>();
14  params.addClassDescription(
15  "Computes the residual and Jacobian contributions for the 'Lagrange Multiplier' "
16  "implementation of the thermal contact problem. For more information, see the "
17  "detailed description here: http://tinyurl.com/gmmhbe9");
18 
19  params.addRequiredParam<Real>("k", "Gap conductance");
20  return params;
21 }
22 
23 GapConductanceConstraint::GapConductanceConstraint(const InputParameters & parameters)
24  : FaceFaceConstraint(parameters), _k(getParam<Real>("k"))
25 {
26 }
27 
29 
30 Real
32 {
33  Real l = (_phys_points_master[_qp] - _phys_points_slave[_qp]).norm();
34  return (_k * (_u_master[_qp] - _u_slave[_qp]) / l - _lambda[_qp]) * _test[_i][_qp];
35 }
36 
37 Real
38 GapConductanceConstraint::computeQpResidualSide(Moose::ConstraintType res_type)
39 {
40  switch (res_type)
41  {
42  case Moose::Master:
43  return _lambda[_qp] * _test_master[_i][_qp];
44  case Moose::Slave:
45  return -_lambda[_qp] * _test_slave[_i][_qp];
46  default:
47  return 0;
48  }
49 }
50 
51 Real
53 {
54  return -_phi[_j][_qp] * _test[_i][_qp];
55 }
56 
57 Real
58 GapConductanceConstraint::computeQpJacobianSide(Moose::ConstraintJacobianType jac_type)
59 {
60  Real l = (_phys_points_master[_qp] - _phys_points_slave[_qp]).norm();
61  switch (jac_type)
62  {
63  case Moose::MasterMaster:
64  return (_k / l) * _phi[_j][_qp] * _test_master[_i][_qp];
65  case Moose::MasterSlave:
66  return -(_k / l) * _phi[_j][_qp] * _test_slave[_i][_qp];
67 
68  case Moose::SlaveMaster:
69  return _phi[_j][_qp] * _test_master[_i][_qp];
70  case Moose::SlaveSlave:
71  return -_phi[_j][_qp] * _test_slave[_i][_qp];
72  default:
73  return 0;
74  }
75 }
virtual Real computeQpResidualSide(Moose::ConstraintType res_type)
Computes the "lambda * (v^(1) - Pv^(2))" residual term in the primal equation.
virtual Real computeQpJacobianSide(Moose::ConstraintJacobianType jac_type)
Handles Jacobian contributions for both the LM equation and the primal equation.
virtual Real computeQpResidual()
Computes the residual for the LM equation, lambda = (k/l)*(T^(1) - PT^(2)).
virtual Real computeQpJacobian()
Computes the Jacobian of the LM equation wrt lambda, i.e.
GapConductanceConstraint(const InputParameters &parameters)
Real _k
Thermal conductivity of the gap medium (e.g. air).
InputParameters validParams< GapConductanceConstraint >()