www.mooseframework.org
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 ()
 

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 24 of file ThermalConductivity.h.

Constructor & Destructor Documentation

◆ ThermalConductivity()

ThermalConductivity::ThermalConductivity ( const InputParameters &  parameters)

Definition at line 28 of file ThermalConductivity.C.

29  : SideAverageValue(parameters),
30  _dx(getParam<Real>("dx")),
31  _flux(getPostprocessorValue("flux")),
32  _T_hot(getPostprocessorValue("T_hot")),
33  _length_scale(getParam<Real>("length_scale")),
34  _k0(getParam<Real>("k0")),
35  _step_zero(declareRestartableData<bool>("step_zero", true))
36 {
37 }
const PostprocessorValue & _T_hot
bool & _step_zero
True if this is the zeroth timestep (timestep < 1).
const PostprocessorValue & _flux

Member Function Documentation

◆ getValue()

Real ThermalConductivity::getValue ( )
virtual

Definition at line 40 of file ThermalConductivity.C.

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

Member Data Documentation

◆ _dx

const Real ThermalConductivity::_dx
protected

Definition at line 32 of file ThermalConductivity.h.

Referenced by getValue().

◆ _flux

const PostprocessorValue& ThermalConductivity::_flux
protected

Definition at line 33 of file ThermalConductivity.h.

Referenced by getValue().

◆ _k0

const Real ThermalConductivity::_k0
protected

Definition at line 36 of file ThermalConductivity.h.

Referenced by getValue().

◆ _length_scale

const Real ThermalConductivity::_length_scale
protected

Definition at line 35 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 43 of file ThermalConductivity.h.

Referenced by getValue().

◆ _T_hot

const PostprocessorValue& ThermalConductivity::_T_hot
protected

Definition at line 34 of file ThermalConductivity.h.

Referenced by getValue().


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