www.mooseframework.org
ThermoDiffusion.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
10 #include "ThermoDiffusion.h"
11 
13 
16 {
18  params.addRequiredCoupledVar("temp", "Coupled temperature");
19  params.addParam<Real>("gas_constant", 8.3144621, "Gas constant");
20  params.addParam<std::string>(
21  "heat_of_transport", "heat_of_transport", "Property name for the heat of transport.");
22  params.addParam<std::string>(
23  "mass_diffusivity", "mass_diffusivity", "Property name for the diffusivity.");
24 
25  params.addClassDescription("Kernel for thermo-diffusion (Soret effect, thermophoresis, etc.)");
26  return params;
27 }
28 
30  : Kernel(parameters),
31  _temperature(coupledValue("temp")),
32  _grad_temperature(coupledGradient("temp")),
33  _mass_diffusivity(getMaterialProperty<Real>(getParam<std::string>("mass_diffusivity"))),
34  _heat_of_transport(getMaterialProperty<Real>(getParam<std::string>("heat_of_transport"))),
35  _gas_constant(getParam<Real>("gas_constant")),
36  _temperature_index(coupled("temp"))
37 {
38 }
39 
42 {
43  // The thermo-diffusion term looks like grad( v * C ) where v is like a diffusive
44  // velocity. If the concentration C does not couple back into the heat equation,
45  // then the one-way coupling of temperature means that thermo-diffusion of C
46  // behaves like advection. Then v is the velocity:
47  //
48  // v = D Qstar grad(T) / ( R T^2 )
49  //
52  return coeff * _grad_temperature[_qp];
53 }
54 
55 Real
57 {
59 }
60 
61 Real
63 {
65 }
66 
67 Real
69 {
70  if (jvar == _temperature_index)
71  {
74  return coeff * _grad_test[_i][_qp] * _u[_qp] *
76  }
77  return 0;
78 }
static InputParameters validParams()
const VariableGradient & _grad_temperature
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
static InputParameters validParams()
const MaterialProperty< Real > & _heat_of_transport
const VariablePhiGradient & _grad_phi
virtual Real computeQpJacobian()
registerMooseObject("MiscApp", ThermoDiffusion)
const MaterialProperty< Real > & _mass_diffusivity
virtual Real computeQpResidual()
const Real _gas_constant
RealGradient thermoDiffusionVelocity() const
const VariableValue & _temperature
unsigned int _i
ThermoDiffusion(const InputParameters &parameters)
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
Computes contribution from grad( T ) / T^2 term.
Models thermo-diffusion (aka Soret effect, thermophoresis, etc.).
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
unsigned int _j
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const unsigned int _temperature_index
const VariableTestGradient & _grad_test
void addClassDescription(const std::string &doc_string)
const VariablePhiValue & _phi
const VariableValue & _u
unsigned int _qp