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

SoretDiffusion adds the soret effect in the split form of the Cahn-Hilliard equation. More...

#include <SoretDiffusion.h>

Inheritance diagram for SoretDiffusion:
[legend]

Public Member Functions

 SoretDiffusion (const InputParameters &parameters)
 

Protected Member Functions

virtual Real computeQpResidual ()
 
virtual Real computeQpJacobian ()
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar)
 
virtual Real computeQpCJacobian ()
 

Protected Attributes

unsigned int _T_var
 int label for temperature variable More...
 
const VariableValue & _T
 Coupled variable for the temperature. More...
 
const VariableGradient & _grad_T
 Variable gradient for temperature. More...
 
const bool _is_coupled
 is the kernel used in a coupled form? More...
 
unsigned int _c_var
 int label for the Concentration More...
 
const VariableValue & _c
 Variable value for the concentration. More...
 
const MaterialProperty< Real > & _D
 Diffusivity material property. More...
 
const MaterialProperty< Real > & _Q
 Heat of transport material property. More...
 
const Real _kB
 Boltzmann constant. More...
 

Detailed Description

SoretDiffusion adds the soret effect in the split form of the Cahn-Hilliard equation.

Definition at line 24 of file SoretDiffusion.h.

Constructor & Destructor Documentation

◆ SoretDiffusion()

SoretDiffusion::SoretDiffusion ( const InputParameters &  parameters)

Definition at line 32 of file SoretDiffusion.C.

33  : Kernel(parameters),
34  _T_var(coupled("T")),
35  _T(coupledValue("T")),
36  _grad_T(coupledGradient("T")),
37  _is_coupled(isCoupled("c")),
38  _c_var(_is_coupled ? coupled("c") : _var.number()),
39  _c(_is_coupled ? coupledValue("c") : _u),
40  _D(getMaterialProperty<Real>("diff_name")),
41  _Q(getMaterialProperty<Real>("Q_name")),
42  _kB(8.617343e-5) // Boltzmann constant in eV/K
43 {
44 }
const MaterialProperty< Real > & _D
Diffusivity material property.
const Real _kB
Boltzmann constant.
const VariableGradient & _grad_T
Variable gradient for temperature.
const MaterialProperty< Real > & _Q
Heat of transport material property.
const VariableValue & _c
Variable value for the concentration.
unsigned int _c_var
int label for the Concentration
const VariableValue & _T
Coupled variable for the temperature.
const bool _is_coupled
is the kernel used in a coupled form?
unsigned int _T_var
int label for temperature variable

Member Function Documentation

◆ computeQpCJacobian()

Real SoretDiffusion::computeQpCJacobian ( )
protectedvirtual

Definition at line 76 of file SoretDiffusion.C.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

77 {
78  // Calculate the Jacobian for the c variable
79  return _D[_qp] * _Q[_qp] * _phi[_j][_qp] * _grad_T[_qp] / (_kB * _T[_qp] * _T[_qp]) *
80  _grad_test[_i][_qp];
81 }
const MaterialProperty< Real > & _D
Diffusivity material property.
const Real _kB
Boltzmann constant.
const VariableGradient & _grad_T
Variable gradient for temperature.
const MaterialProperty< Real > & _Q
Heat of transport material property.
const VariableValue & _T
Coupled variable for the temperature.

◆ computeQpJacobian()

Real SoretDiffusion::computeQpJacobian ( )
protectedvirtual

Definition at line 54 of file SoretDiffusion.C.

55 {
56  return _is_coupled ? 0.0 : computeQpCJacobian();
57 }
const bool _is_coupled
is the kernel used in a coupled form?
virtual Real computeQpCJacobian()

◆ computeQpOffDiagJacobian()

Real SoretDiffusion::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Definition at line 60 of file SoretDiffusion.C.

61 {
62  // c Off-Diagonal Jacobian
63  if (_c_var == jvar)
64  return computeQpCJacobian();
65 
66  // T Off-Diagonal Jacobian
67  if (_T_var == jvar)
68  return _D[_qp] * _Q[_qp] * _c[_qp] * _grad_test[_i][_qp] *
69  (_grad_phi[_j][_qp] - 2.0 * _grad_T[_qp] * _phi[_j][_qp] / _T[_qp]) /
70  (_kB * _T[_qp] * _T[_qp]);
71 
72  return 0.0;
73 }
const MaterialProperty< Real > & _D
Diffusivity material property.
const Real _kB
Boltzmann constant.
const VariableGradient & _grad_T
Variable gradient for temperature.
const MaterialProperty< Real > & _Q
Heat of transport material property.
const VariableValue & _c
Variable value for the concentration.
unsigned int _c_var
int label for the Concentration
const VariableValue & _T
Coupled variable for the temperature.
virtual Real computeQpCJacobian()
unsigned int _T_var
int label for temperature variable

◆ computeQpResidual()

Real SoretDiffusion::computeQpResidual ( )
protectedvirtual

Definition at line 47 of file SoretDiffusion.C.

48 {
49  const Real T_term = _D[_qp] * _Q[_qp] * _c[_qp] / (_kB * _T[_qp] * _T[_qp]);
50  return T_term * _grad_T[_qp] * _grad_test[_i][_qp];
51 }
const MaterialProperty< Real > & _D
Diffusivity material property.
const Real _kB
Boltzmann constant.
const VariableGradient & _grad_T
Variable gradient for temperature.
const MaterialProperty< Real > & _Q
Heat of transport material property.
const VariableValue & _c
Variable value for the concentration.
const VariableValue & _T
Coupled variable for the temperature.

Member Data Documentation

◆ _c

const VariableValue& SoretDiffusion::_c
protected

Variable value for the concentration.

Definition at line 51 of file SoretDiffusion.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

◆ _c_var

unsigned int SoretDiffusion::_c_var
protected

int label for the Concentration

Definition at line 48 of file SoretDiffusion.h.

Referenced by computeQpOffDiagJacobian().

◆ _D

const MaterialProperty<Real>& SoretDiffusion::_D
protected

Diffusivity material property.

Definition at line 54 of file SoretDiffusion.h.

Referenced by computeQpCJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

◆ _grad_T

const VariableGradient& SoretDiffusion::_grad_T
protected

Variable gradient for temperature.

Definition at line 42 of file SoretDiffusion.h.

Referenced by computeQpCJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

◆ _is_coupled

const bool SoretDiffusion::_is_coupled
protected

is the kernel used in a coupled form?

Definition at line 45 of file SoretDiffusion.h.

Referenced by computeQpJacobian().

◆ _kB

const Real SoretDiffusion::_kB
protected

Boltzmann constant.

Definition at line 60 of file SoretDiffusion.h.

Referenced by computeQpCJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

◆ _Q

const MaterialProperty<Real>& SoretDiffusion::_Q
protected

Heat of transport material property.

Definition at line 57 of file SoretDiffusion.h.

Referenced by computeQpCJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

◆ _T

const VariableValue& SoretDiffusion::_T
protected

Coupled variable for the temperature.

Definition at line 39 of file SoretDiffusion.h.

Referenced by computeQpCJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

◆ _T_var

unsigned int SoretDiffusion::_T_var
protected

int label for temperature variable

Definition at line 36 of file SoretDiffusion.h.

Referenced by computeQpOffDiagJacobian().


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