https://mooseframework.inl.gov
SemiconductorLinearConductivity.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
11 #include "libmesh/quadrature.h"
12 
14 
17 {
19  params.addRequiredCoupledVar("temp", "Variable for temperature in Kelvin.");
20  params.addParam<std::string>("base_name", "Material property base name");
21  params.addRequiredParam<Real>("sh_coeff_A", "Steinhart_Hart coefficient A of the material");
23  "sh_coeff_B", "sh_coeff_B != 0", "Steinhart_Hart coefficient B of the material.");
24 
25  params.addClassDescription(
26  "Calculates electrical conductivity of a semiconductor from temperature");
27 
28  return params;
29 }
30 
33  _sh_coeff_A(getParam<Real>("sh_coeff_A")),
34  _sh_coeff_B(getParam<Real>("sh_coeff_B")),
35  _T(coupledValue("temp")),
36  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
37  _electric_conductivity(declareProperty<Real>(_base_name + "electrical_conductivity")),
38  _delectric_conductivity_dT(
39  isCoupledConstant("temp")
40  ? nullptr
41  : &declarePropertyDerivative<Real>(_base_name + "electrical_conductivity",
42  coupledName("temp", 0)))
43 {
44 }
45 
46 void
48 {
49  mooseAssert(MooseUtils::absoluteFuzzyGreaterThan(_T[_qp], 0.0),
50  "Encountered zero or negative temperature in SemiconductorLinearConductivity");
51 
52  mooseAssert(_sh_coeff_B != 0, "Divided by zero as _sh_coeff_B = 0");
53 
56  (*_delectric_conductivity_dT)[_qp] =
58 }
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
auto exp(const T &)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
Calculates resistivity and electrical conductivity as a function of temperature.
MaterialProperty< Real > & _electric_conductivity
void addRequiredParam(const std::string &name, const std::string &doc_string)
static InputParameters validParams()
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
MaterialProperty< Real > * _delectric_conductivity_dT
void addClassDescription(const std::string &doc_string)
registerMooseObject("HeatTransferApp", SemiconductorLinearConductivity)
SemiconductorLinearConductivity(const InputParameters &parameters)
bool absoluteFuzzyGreaterThan(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)