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 15 of file AnisoHeatConduction.h.

Constructor & Destructor Documentation

◆ AnisoHeatConduction()

AnisoHeatConduction::AnisoHeatConduction ( const InputParameters &  parameters)

Definition at line 24 of file AnisoHeatConduction.C.

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

Member Function Documentation

◆ computeQpJacobian()

Real AnisoHeatConduction::computeQpJacobian ( )
protectedvirtual

Definition at line 98 of file AnisoHeatConduction.C.

99 {
100  Real jac(0);
101  for (unsigned i(0); i < _dim; ++i)
102  {
103  jac += _grad_test[_i][_qp](i) * (*_k_i[i])[_qp] * _grad_phi[_j][_qp](i);
104  if (_k_i_dT[i])
105  {
106  jac += (*_k_i_dT[i])[_qp] * _phi[_j][_qp] *
107  (_grad_test[_i][_qp](i) * (*_k_i[i])[_qp] * _grad_u[_qp](i));
108  }
109  }
110  return jac;
111 }
const MaterialProperty< Real > * _k_i_dT[3]
const MaterialProperty< Real > * _k_i[3]

◆ computeQpResidual()

Real AnisoHeatConduction::computeQpResidual ( )
protectedvirtual

Definition at line 71 of file AnisoHeatConduction.C.

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

Member Data Documentation

◆ _dim

const unsigned AnisoHeatConduction::_dim
private

Definition at line 26 of file AnisoHeatConduction.h.

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

◆ _k_i

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

Definition at line 28 of file AnisoHeatConduction.h.

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

◆ _k_i_dT

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

Definition at line 29 of file AnisoHeatConduction.h.

Referenced by AnisoHeatConduction(), and computeQpJacobian().


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