www.mooseframework.org
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
AnisoHeatConduction Class Reference

#include <AnisoHeatConduction.h>

Inheritance diagram for AnisoHeatConduction:
[legend]

Public Member Functions

 AnisoHeatConduction (const InputParameters &parameters)
 

Protected Member Functions

virtual Real computeQpResidual ()
 
virtual Real computeQpJacobian ()
 

Private Attributes

const unsigned _dim
 
const MaterialProperty< Real > * _k_i [3]
 
const MaterialProperty< Real > * _k_i_dT [3]
 

Detailed Description

Definition at line 12 of file AnisoHeatConduction.h.

Constructor & Destructor Documentation

AnisoHeatConduction::AnisoHeatConduction ( const InputParameters &  parameters)

Definition at line 20 of file AnisoHeatConduction.C.

21  : Kernel(parameters), _dim(_subproblem.mesh().dimension())
22 {
23  _k_i[0] = _k_i[1] = _k_i[2] = NULL;
24  _k_i_dT[0] = _k_i_dT[1] = _k_i_dT[2] = NULL;
25 
26  if (hasMaterialProperty<Real>("thermal_conductivity_x"))
27  _k_i[0] = &getMaterialProperty<Real>("thermal_conductivity_x");
28 
29  if (hasMaterialProperty<Real>("thermal_conductivity_x_dT"))
30  _k_i_dT[0] = &getMaterialProperty<Real>("thermal_conductivity_x_dT");
31 
32  if (hasMaterialProperty<Real>("thermal_conductivity_y"))
33  _k_i[1] = &getMaterialProperty<Real>("thermal_conductivity_y");
34 
35  if (hasMaterialProperty<Real>("thermal_conductivity_y_dT"))
36  _k_i_dT[1] = &getMaterialProperty<Real>("thermal_conductivity_y_dT");
37 
38  if (hasMaterialProperty<Real>("thermal_conductivity_z"))
39  _k_i[2] = &getMaterialProperty<Real>("thermal_conductivity_z");
40 
41  if (hasMaterialProperty<Real>("thermal_conductivity_z_dT"))
42  _k_i_dT[2] = &getMaterialProperty<Real>("thermal_conductivity_z_dT");
43 
44  if (!_k_i[0])
45  mooseError("No thermal conductivity was defined");
46 
47  if (!_k_i[0] && _k_i[1])
48  mooseError("Cannot define y conductivity but not x");
49 
50  if (_k_i[2] && (!_k_i[0] || !_k_i[1]))
51  mooseError("Cannot define z conductivty but not x and y");
52 
53  if (_dim == 2 && !_k_i[1])
54  mooseError("Must define x and y thermal conductivities for 2D");
55 
56  if (_dim == 3 && (!_k_i[1] || !_k_i[2]))
57  mooseError("Must define x, y, and z thermal conductivities for 3D");
58 
59  if (_dim == 2 && !(_k_i_dT[0] && _k_i_dT[1]))
60  mooseError("Must define k_x_dT and k_y_dT for 2D");
61 
62  if (_dim == 3 && !(_k_i_dT[0] && _k_i_dT[1] && _k_i_dT[2]))
63  mooseError("Must define k_x_dT, k_y_dT, and k_z_dT for 3D");
64 }
const MaterialProperty< Real > * _k_i_dT[3]
const MaterialProperty< Real > * _k_i[3]

Member Function Documentation

Real AnisoHeatConduction::computeQpJacobian ( )
protectedvirtual

Definition at line 94 of file AnisoHeatConduction.C.

95 {
96  Real jac(0);
97  for (unsigned i(0); i < _dim; ++i)
98  {
99  jac += _grad_test[_i][_qp](i) * (*_k_i[i])[_qp] * _grad_phi[_j][_qp](i);
100  if (_k_i_dT[i])
101  {
102  jac += (*_k_i_dT[i])[_qp] * _phi[_j][_qp] *
103  (_grad_test[_i][_qp](i) * (*_k_i[i])[_qp] * _grad_u[_qp](i));
104  }
105  }
106  return jac;
107 }
const MaterialProperty< Real > * _k_i_dT[3]
const MaterialProperty< Real > * _k_i[3]
Real AnisoHeatConduction::computeQpResidual ( )
protectedvirtual

Definition at line 67 of file AnisoHeatConduction.C.

68 {
69  Real r(0);
70  // r = _k[_qp]*Diffusion::computeQpResidual();
71  // if (!libmesh_isnan(r))
72  // {
73  // }
74  // else
75  // {
76  // Moose::err << "NaN found at " << __LINE__ << " in " << __FILE__ << "!\n"
77  // << "Processor: " << libMesh::processor_id() << "\n"
78  // << "_k[_qp]: " << _k[_qp] << "\n"
79  // << "Diffusion resid: " << Diffusion::computeQpResidual() << "\n"
80  // << "Elem: " << _current_elem->id() << "\n"
81  // << "Qp: " << _qp << "\n"
82  // << "Qpoint: " << _q_point[_qp] << "\n"
83  // << std::endl;
84  // }
85  // return r;
86  for (unsigned i(0); i < _dim; ++i)
87  {
88  r += _grad_test[_i][_qp](i) * (*_k_i[i])[_qp] * _grad_u[_qp](i);
89  }
90  return r;
91 }
const MaterialProperty< Real > * _k_i[3]

Member Data Documentation

const unsigned AnisoHeatConduction::_dim
private

Definition at line 23 of file AnisoHeatConduction.h.

Referenced by AnisoHeatConduction(), computeQpJacobian(), and computeQpResidual().

const MaterialProperty<Real>* AnisoHeatConduction::_k_i[3]
private

Definition at line 25 of file AnisoHeatConduction.h.

Referenced by AnisoHeatConduction(), computeQpJacobian(), and computeQpResidual().

const MaterialProperty<Real>* AnisoHeatConduction::_k_i_dT[3]
private

Definition at line 26 of file AnisoHeatConduction.h.

Referenced by AnisoHeatConduction(), and computeQpJacobian().


The documentation for this class was generated from the following files: