www.mooseframework.org
ElectricalConductivity.C
Go to the documentation of this file.
2 #include "libmesh/quadrature.h"
3 
4 template <>
5 InputParameters
7 {
8  InputParameters params = validParams<Material>();
9  params.addCoupledVar("temp", 300.0, "variable for temperature");
10  params.addParam<std::string>("base_name", "Material property base name");
11  params.addParam<Real>("length_scale", 1.0e-9, "Lengthscale of model");
12  params.addParam<Real>(
13  "ref_resistivity",
14  6.5e-6,
15  "Electrical resistivity of the material at reference temperature in ohm-m.");
16  params.addParam<Real>(
17  "temp_coeff",
18  0.0045,
19  "Temperature coefficient for calculating dependence of resistivity on temp.");
20  params.addParam<Real>("ref_temp", 300.0, "Reference temperature for Electrical resistivity in K");
21  return params;
22 }
23 
24 ElectricalConductivity::ElectricalConductivity(const InputParameters & parameters)
25  : DerivativeMaterialInterface<Material>(parameters),
26  _length_scale(getParam<Real>("length_scale")),
27  _ref_resis(getParam<Real>("ref_resistivity")),
28  _temp_coeff(getParam<Real>("temp_coeff")),
29  _ref_temp(getParam<Real>("ref_temp")),
30  _T(coupledValue("temp")),
31  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
32  _electric_conductivity(declareProperty<Real>(_base_name + "electrical_conductivity")),
33  _delectric_conductivity_dT(declarePropertyDerivative<Real>(
34  _base_name + "electrical_conductivity", getVar("temp", 0)->name()))
35 {
36 }
37 
38 void
40 {
41  const Real ref_resis = _ref_resis / _length_scale;
42  const Real resistivity = ref_resis * (1.0 + _temp_coeff * (_T[_qp] - _ref_temp));
43  const Real dresistivity_dT = ref_resis * _temp_coeff;
44  _electric_conductivity[_qp] = 1.0 / resistivity;
45  _delectric_conductivity_dT[_qp] = -1.0 / (resistivity * resistivity) * dresistivity_dT;
46 }
MaterialProperty< Real > & _delectric_conductivity_dT
MaterialProperty< Real > & _electric_conductivity
ElectricalConductivity(const InputParameters &parameters)
InputParameters validParams< ElectricalConductivity >()
const VariableValue & _T