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

This postprocessor computes the thermal conductivity of the bulk. More...

#include <ThermalConductivity.h>

Inheritance diagram for ThermalConductivity:
[legend]

Public Member Functions

 ThermalConductivity (const InputParameters &parameters)
 
virtual Real getValue ()
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Attributes

const Real _dx
 
const PostprocessorValue & _flux
 
const PostprocessorValue & _T_hot
 
const Real _length_scale
 
const Real _k0
 

Private Attributes

bool & _step_zero
 True if this is the zeroth timestep (timestep < 1). More...
 

Detailed Description

This postprocessor computes the thermal conductivity of the bulk.

Definition at line 23 of file ThermalConductivity.h.

Constructor & Destructor Documentation

◆ ThermalConductivity()

ThermalConductivity::ThermalConductivity ( const InputParameters &  parameters)

Definition at line 29 of file ThermalConductivity.C.

30  : SideAverageValue(parameters),
31  _dx(getParam<Real>("dx")),
32  _flux(getPostprocessorValue("flux")),
33  _T_hot(getPostprocessorValue("T_hot")),
34  _length_scale(getParam<Real>("length_scale")),
35  _k0(getParam<Real>("k0")),
36  _step_zero(declareRestartableData<bool>("step_zero", true))
37 {
38 }

Member Function Documentation

◆ getValue()

Real ThermalConductivity::getValue ( )
virtual

Definition at line 41 of file ThermalConductivity.C.

42 {
43  const Real T_cold = SideAverageValue::getValue();
44  Real Th_cond = 0.0;
45  if (_t_step >= 1)
46  _step_zero = false;
47 
48  // Calculate effective thermal conductivity in W/(length_scale-K)
49  if (std::abs(_T_hot - T_cold) > 1.0e-20)
50  Th_cond = std::abs(_flux) * _dx / std::abs(_T_hot - T_cold);
51 
52  if (_step_zero)
53  return _k0;
54  else
55  return Th_cond / _length_scale; // In W/(m-K)
56 }

◆ validParams()

InputParameters ThermalConductivity::validParams ( )
static

Definition at line 17 of file ThermalConductivity.C.

18 {
19  InputParameters params = SideAverageValue::validParams();
20  params.addRequiredParam<Real>("dx", "Length between sides of sample in length_scale");
21  params.addRequiredParam<PostprocessorName>(
22  "flux", "Heat flux out of 'cold' boundary in solution units, should always be positive");
23  params.addRequiredParam<PostprocessorName>("T_hot", "Temperature on 'hot' boundary in K");
24  params.addParam<Real>("length_scale", 1e-8, "Length scale of the solution, default is 1e-8");
25  params.addParam<Real>("k0", 0.0, "Initial value of the thermal conductivity");
26  return params;
27 }

Member Data Documentation

◆ _dx

const Real ThermalConductivity::_dx
protected

Definition at line 33 of file ThermalConductivity.h.

Referenced by getValue().

◆ _flux

const PostprocessorValue& ThermalConductivity::_flux
protected

Definition at line 34 of file ThermalConductivity.h.

Referenced by getValue().

◆ _k0

const Real ThermalConductivity::_k0
protected

Definition at line 37 of file ThermalConductivity.h.

Referenced by getValue().

◆ _length_scale

const Real ThermalConductivity::_length_scale
protected

Definition at line 36 of file ThermalConductivity.h.

Referenced by getValue().

◆ _step_zero

bool& ThermalConductivity::_step_zero
private

True if this is the zeroth timestep (timestep < 1).

At the zero timestep, the initial value of thermal conductivity should be returned. This boolean is delcared as a reference so that the variable is restartable data: if we restart, the code will not think it is the zero timestep again.

Definition at line 44 of file ThermalConductivity.h.

Referenced by getValue().

◆ _T_hot

const PostprocessorValue& ThermalConductivity::_T_hot
protected

Definition at line 35 of file ThermalConductivity.h.

Referenced by getValue().


The documentation for this class was generated from the following files:
ThermalConductivity::_T_hot
const PostprocessorValue & _T_hot
Definition: ThermalConductivity.h:35
ThermalConductivity::_dx
const Real _dx
Definition: ThermalConductivity.h:33
ThermalConductivity::_step_zero
bool & _step_zero
True if this is the zeroth timestep (timestep < 1).
Definition: ThermalConductivity.h:44
ThermalConductivity::_k0
const Real _k0
Definition: ThermalConductivity.h:37
ThermalConductivity::_flux
const PostprocessorValue & _flux
Definition: ThermalConductivity.h:34
validParams
InputParameters validParams()
ThermalConductivity::_length_scale
const Real _length_scale
Definition: ThermalConductivity.h:36