https://mooseframework.inl.gov
FVPorousFlowHeatConduction.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 
11 #include "PorousFlowDictator.h"
12 
14 
17 {
19  params.addRequiredParam<UserObjectName>("PorousFlowDictator",
20  "The PorousFlowDictator UserObject");
21  params.set<unsigned short>("ghost_layers") = 2;
22  params.addClassDescription("Conductive heat flux");
23  return params;
24 }
25 
27  : FVFluxKernel(params),
28  _dictator(getUserObject<PorousFlowDictator>("PorousFlowDictator")),
29  _lambda_element(getADMaterialProperty<RealTensorValue>("PorousFlow_thermal_conductivity_qp")),
30  _lambda_neighbor(
31  getNeighborADMaterialProperty<RealTensorValue>("PorousFlow_thermal_conductivity_qp")),
32  _temperature_element(getADMaterialProperty<Real>("PorousFlow_temperature_qp")),
33  _temperature_neighbor(getNeighborADMaterialProperty<Real>("PorousFlow_temperature_qp")),
34  _grad_T(getADMaterialProperty<RealGradient>("PorousFlow_grad_temperature_qp"))
35 {
36 }
37 
38 ADReal
40 {
41  ADRealGradient gradT;
42  ADRealTensorValue coeff;
43 
44  // If we are on a boundary face, use the gradient computed in _grad_T
45  if (onBoundary(*_face_info))
46  {
47  gradT = -_grad_T[_qp];
48 
49  coeff = _lambda_element[_qp];
50  }
51  else
52  {
53  // If we are on an internal face, calculate the temperature gradient explicitly
54  const auto & T_elem = _temperature_element[_qp];
55  const auto & T_neighbor = _temperature_neighbor[_qp];
56 
57  gradT = (T_elem - T_neighbor) * _face_info->eCN() / _face_info->dCNMag();
58 
60  coeff,
63  gradT,
64  *_face_info,
65  true);
66  }
67 
68  return coeff * gradT * _normal;
69 }
const ADMaterialProperty< RealGradient > & _grad_T
Temperature gradient.
static InputParameters validParams()
const ADMaterialProperty< RealTensorValue > & _lambda_neighbor
FVPorousFlowHeatConduction(const InputParameters &params)
const FaceInfo * _face_info
T & set(const std::string &name, bool quiet_mode=false)
RealVectorValue _normal
DualNumber< Real, DNDerivativeType, true > ADReal
void addRequiredParam(const std::string &name, const std::string &doc_string)
bool onBoundary(const FaceInfo &fi) const
TensorValue< Real > RealTensorValue
static InputParameters validParams()
const unsigned int _qp
Real dCNMag() const
virtual ADReal computeQpResidual() override
const ADMaterialProperty< RealTensorValue > & _lambda_element
Thermal conductivity.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Point & eCN() const
const ADMaterialProperty< Real > & _temperature_element
Temperature.
This holds maps between the nonlinear variables used in a PorousFlow simulation and the variable numb...
registerADMooseObject("PorousFlowApp", FVPorousFlowHeatConduction)
void addClassDescription(const std::string &doc_string)
void interpolate(InterpMethod m, T &result, const T2 &value1, const T3 &value2, const FaceInfo &fi, const bool one_is_elem)
const ADMaterialProperty< Real > & _temperature_neighbor