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

Simple material with constant properties. More...

#include <HeatConductionMaterial.h>

Inheritance diagram for HeatConductionMaterial:
[legend]

Public Member Functions

 HeatConductionMaterial (const InputParameters &parameters)
 

Protected Member Functions

virtual void computeProperties ()
 

Protected Attributes

const bool _has_temp
 
const VariableValue & _temperature
 
const Real _my_thermal_conductivity
 
const Real _my_specific_heat
 
MaterialProperty< Real > & _thermal_conductivity
 
MaterialProperty< Real > & _thermal_conductivity_dT
 
Function * _thermal_conductivity_temperature_function
 
MaterialProperty< Real > & _specific_heat
 
Function * _specific_heat_temperature_function
 

Detailed Description

Simple material with constant properties.

Definition at line 22 of file HeatConductionMaterial.h.

Constructor & Destructor Documentation

HeatConductionMaterial::HeatConductionMaterial ( const InputParameters &  parameters)

Definition at line 34 of file HeatConductionMaterial.C.

35  : Material(parameters),
36 
37  _has_temp(isCoupled("temp")),
38  _temperature(_has_temp ? coupledValue("temp") : _zero),
40  isParamValid("thermal_conductivity") ? getParam<Real>("thermal_conductivity") : 0),
41  _my_specific_heat(isParamValid("specific_heat") ? getParam<Real>("specific_heat") : 0),
42 
43  _thermal_conductivity(declareProperty<Real>("thermal_conductivity")),
44  _thermal_conductivity_dT(declareProperty<Real>("thermal_conductivity_dT")),
46  getParam<FunctionName>("thermal_conductivity_temperature_function") != ""
47  ? &getFunction("thermal_conductivity_temperature_function")
48  : NULL),
49 
50  _specific_heat(declareProperty<Real>("specific_heat")),
52  getParam<FunctionName>("specific_heat_temperature_function") != ""
53  ? &getFunction("specific_heat_temperature_function")
54  : NULL)
55 {
57  {
58  mooseError("Must couple with temperature if using thermal conductivity function");
59  }
60  if (isParamValid("thermal_conductivity") && _thermal_conductivity_temperature_function)
61  {
62  mooseError(
63  "Cannot define both thermal conductivity and thermal conductivity temperature function");
64  }
66  {
67  mooseError("Must couple with temperature if using specific heat function");
68  }
69  if (isParamValid("specific_heat") && _specific_heat_temperature_function)
70  {
71  mooseError("Cannot define both specific heat and specific heat temperature function");
72  }
73 }
MaterialProperty< Real > & _thermal_conductivity_dT
Function * _thermal_conductivity_temperature_function
MaterialProperty< Real > & _thermal_conductivity
Function * _specific_heat_temperature_function
const VariableValue & _temperature
MaterialProperty< Real > & _specific_heat

Member Function Documentation

void HeatConductionMaterial::computeProperties ( )
protectedvirtual

Definition at line 76 of file HeatConductionMaterial.C.

77 {
78  for (unsigned int qp(0); qp < _qrule->n_points(); ++qp)
79  {
80  Real qp_temperature = 0;
81  if (_has_temp)
82  {
83  qp_temperature = _temperature[qp];
84  if (_temperature[qp] < 0)
85  {
86  std::stringstream msg;
87  msg << "WARNING: In HeatConductionMaterial: negative temperature!\n"
88  << "\tResetting to zero.\n"
89  << "\t_qp: " << qp << "\n"
90  << "\ttemp: " << _temperature[qp] << "\n"
91  << "\telem: " << _current_elem->id() << "\n"
92  << "\tproc: " << processor_id() << "\n";
93  mooseWarning(msg.str());
94  qp_temperature = 0;
95  }
96  }
98  {
99  Point p;
101  _thermal_conductivity_temperature_function->value(qp_temperature, p);
103  _thermal_conductivity_temperature_function->timeDerivative(qp_temperature, p);
104  }
105  else
106  {
108  _thermal_conductivity_dT[qp] = 0;
109  }
110 
112  {
113  Point p;
114  _specific_heat[qp] = _specific_heat_temperature_function->value(qp_temperature, p);
115  }
116  else
117  {
119  }
120  }
121 }
MaterialProperty< Real > & _thermal_conductivity_dT
Function * _thermal_conductivity_temperature_function
MaterialProperty< Real > & _thermal_conductivity
Function * _specific_heat_temperature_function
const VariableValue & _temperature
MaterialProperty< Real > & _specific_heat

Member Data Documentation

const bool HeatConductionMaterial::_has_temp
protected

Definition at line 30 of file HeatConductionMaterial.h.

Referenced by computeProperties(), and HeatConductionMaterial().

const Real HeatConductionMaterial::_my_specific_heat
protected

Definition at line 34 of file HeatConductionMaterial.h.

Referenced by computeProperties().

const Real HeatConductionMaterial::_my_thermal_conductivity
protected

Definition at line 33 of file HeatConductionMaterial.h.

Referenced by computeProperties().

MaterialProperty<Real>& HeatConductionMaterial::_specific_heat
protected

Definition at line 40 of file HeatConductionMaterial.h.

Referenced by computeProperties().

Function* HeatConductionMaterial::_specific_heat_temperature_function
protected

Definition at line 41 of file HeatConductionMaterial.h.

Referenced by computeProperties(), and HeatConductionMaterial().

const VariableValue& HeatConductionMaterial::_temperature
protected

Definition at line 31 of file HeatConductionMaterial.h.

Referenced by computeProperties().

MaterialProperty<Real>& HeatConductionMaterial::_thermal_conductivity
protected

Definition at line 36 of file HeatConductionMaterial.h.

Referenced by computeProperties().

MaterialProperty<Real>& HeatConductionMaterial::_thermal_conductivity_dT
protected

Definition at line 37 of file HeatConductionMaterial.h.

Referenced by computeProperties().

Function* HeatConductionMaterial::_thermal_conductivity_temperature_function
protected

Definition at line 38 of file HeatConductionMaterial.h.

Referenced by computeProperties(), and HeatConductionMaterial().


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