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 25 of file HeatConductionMaterial.h.

Constructor & Destructor Documentation

◆ HeatConductionMaterial()

HeatConductionMaterial::HeatConductionMaterial ( const InputParameters &  parameters)

Definition at line 38 of file HeatConductionMaterial.C.

39  : Material(parameters),
40 
41  _has_temp(isCoupled("temp")),
42  _temperature(_has_temp ? coupledValue("temp") : _zero),
44  isParamValid("thermal_conductivity") ? getParam<Real>("thermal_conductivity") : 0),
45  _my_specific_heat(isParamValid("specific_heat") ? getParam<Real>("specific_heat") : 0),
46 
47  _thermal_conductivity(declareProperty<Real>("thermal_conductivity")),
48  _thermal_conductivity_dT(declareProperty<Real>("thermal_conductivity_dT")),
50  getParam<FunctionName>("thermal_conductivity_temperature_function") != ""
51  ? &getFunction("thermal_conductivity_temperature_function")
52  : NULL),
53 
54  _specific_heat(declareProperty<Real>("specific_heat")),
56  getParam<FunctionName>("specific_heat_temperature_function") != ""
57  ? &getFunction("specific_heat_temperature_function")
58  : NULL)
59 {
61  {
62  mooseError("Must couple with temperature if using thermal conductivity function");
63  }
64  if (isParamValid("thermal_conductivity") && _thermal_conductivity_temperature_function)
65  {
66  mooseError(
67  "Cannot define both thermal conductivity and thermal conductivity temperature function");
68  }
70  {
71  mooseError("Must couple with temperature if using specific heat function");
72  }
73  if (isParamValid("specific_heat") && _specific_heat_temperature_function)
74  {
75  mooseError("Cannot define both specific heat and specific heat temperature function");
76  }
77 }
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

◆ computeProperties()

void HeatConductionMaterial::computeProperties ( )
protectedvirtual

Definition at line 80 of file HeatConductionMaterial.C.

81 {
82  for (unsigned int qp(0); qp < _qrule->n_points(); ++qp)
83  {
84  Real qp_temperature = 0;
85  if (_has_temp)
86  {
87  qp_temperature = _temperature[qp];
88  if (_temperature[qp] < 0)
89  {
90  std::stringstream msg;
91  msg << "WARNING: In HeatConductionMaterial: negative temperature!\n"
92  << "\tResetting to zero.\n"
93  << "\t_qp: " << qp << "\n"
94  << "\ttemp: " << _temperature[qp] << "\n"
95  << "\telem: " << _current_elem->id() << "\n"
96  << "\tproc: " << processor_id() << "\n";
97  mooseWarning(msg.str());
98  qp_temperature = 0;
99  }
100  }
102  {
103  Point p;
105  _thermal_conductivity_temperature_function->value(qp_temperature, p);
107  _thermal_conductivity_temperature_function->timeDerivative(qp_temperature, p);
108  }
109  else
110  {
112  _thermal_conductivity_dT[qp] = 0;
113  }
114 
116  {
117  Point p;
118  _specific_heat[qp] = _specific_heat_temperature_function->value(qp_temperature, p);
119  }
120  else
121  {
123  }
124  }
125 }
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

◆ _has_temp

const bool HeatConductionMaterial::_has_temp
protected

Definition at line 33 of file HeatConductionMaterial.h.

Referenced by computeProperties(), and HeatConductionMaterial().

◆ _my_specific_heat

const Real HeatConductionMaterial::_my_specific_heat
protected

Definition at line 37 of file HeatConductionMaterial.h.

Referenced by computeProperties().

◆ _my_thermal_conductivity

const Real HeatConductionMaterial::_my_thermal_conductivity
protected

Definition at line 36 of file HeatConductionMaterial.h.

Referenced by computeProperties().

◆ _specific_heat

MaterialProperty<Real>& HeatConductionMaterial::_specific_heat
protected

Definition at line 43 of file HeatConductionMaterial.h.

Referenced by computeProperties().

◆ _specific_heat_temperature_function

Function* HeatConductionMaterial::_specific_heat_temperature_function
protected

Definition at line 44 of file HeatConductionMaterial.h.

Referenced by computeProperties(), and HeatConductionMaterial().

◆ _temperature

const VariableValue& HeatConductionMaterial::_temperature
protected

Definition at line 34 of file HeatConductionMaterial.h.

Referenced by computeProperties().

◆ _thermal_conductivity

MaterialProperty<Real>& HeatConductionMaterial::_thermal_conductivity
protected

Definition at line 39 of file HeatConductionMaterial.h.

Referenced by computeProperties().

◆ _thermal_conductivity_dT

MaterialProperty<Real>& HeatConductionMaterial::_thermal_conductivity_dT
protected

Definition at line 40 of file HeatConductionMaterial.h.

Referenced by computeProperties().

◆ _thermal_conductivity_temperature_function

Function* HeatConductionMaterial::_thermal_conductivity_temperature_function
protected

Definition at line 41 of file HeatConductionMaterial.h.

Referenced by computeProperties(), and HeatConductionMaterial().


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