https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ThermoDiffusion.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
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
40RealGradient
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
55Real
60
61Real
66
67Real
69{
70 if (jvar == _temperature_index)
71 {
74 return coeff * _grad_test[_i][_qp] * _u[_qp] *
76 }
77 return 0;
78}
registerMooseObject("MiscApp", ThermoDiffusion)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
unsigned int _qp
unsigned int _j
unsigned int _i
const VariablePhiValue & _phi
static InputParameters validParams()
const VariablePhiGradient & _grad_phi
const VariableTestGradient & _grad_test
const VariableValue & _u
Models thermo-diffusion (aka Soret effect, thermophoresis, etc.).
const MaterialProperty< Real > & _heat_of_transport
const unsigned int _temperature_index
const Real _gas_constant
RealGradient thermoDiffusionVelocity() const
virtual Real computeQpResidual()
const VariableGradient & _grad_temperature
virtual Real computeQpJacobian()
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
Computes contribution from grad( T ) / T^2 term.
ThermoDiffusion(const InputParameters &parameters)
static InputParameters validParams()
const VariableValue & _temperature
const MaterialProperty< Real > & _mass_diffusivity