www.mooseframework.org
ADThermoDiffusion.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 "ADThermoDiffusion.h"
11 
13 
16  ADKernel,
17  params.addClassDescription(
18  "Calculates diffusion due to temperature gradient and Soret Coefficient");
19  params.addRequiredCoupledVar("temperature", "The coupled temperature variable.");
20  params.addParam<MaterialPropertyName>("soret_coefficient",
21  "soret_coefficient",
22  "The name of the Soret coefficient material property"););
23 
24 template <ComputeStage compute_stage>
25 ADThermoDiffusion<compute_stage>::ADThermoDiffusion(const InputParameters & parameters)
26  : ADKernel<compute_stage>(parameters),
27  _grad_temp(adCoupledGradient("temperature")),
28  _soret_coeff(getADMaterialProperty<Real>("soret_coefficient"))
29 {
30 }
31 
32 template <ComputeStage compute_stage>
33 ADReal
35 {
36  return _soret_coeff[_qp] * _grad_temp[_qp] * _grad_test[_i][_qp];
37 }
registerADMooseObject
registerADMooseObject("MiscApp", ADThermoDiffusion)
ADThermoDiffusion::ADThermoDiffusion
ADThermoDiffusion(const InputParameters &parameters)
Definition: ADThermoDiffusion.C:25
ADThermoDiffusion
Definition: ADThermoDiffusion.h:15
ADThermoDiffusion::computeQpResidual
virtual ADReal computeQpResidual() override
Definition: ADThermoDiffusion.C:34
defineADValidParams
defineADValidParams(ADThermoDiffusion, ADKernel, params.addClassDescription("Calculates diffusion due to temperature gradient and Soret Coefficient");params.addRequiredCoupledVar("temperature", "The coupled temperature variable.");params.addParam< MaterialPropertyName >("soret_coefficient", "soret_coefficient", "The name of the Soret coefficient material property");)
ADThermoDiffusion.h