https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
40{
41 ADRealGradient gradT;
43
44 // If we are on a boundary face, use the gradient computed in _grad_T
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
59 interpolate(Moose::FV::InterpMethod::Average,
60 coeff,
63 gradT,
65 true);
66 }
67
68 return coeff * gradT * _normal;
69}
DualNumber< Real, DNDerivativeType, true > ADReal
registerADMooseObject("PorousFlowApp", FVPorousFlowHeatConduction)
static InputParameters validParams()
RealVectorValue _normal
bool onBoundary(const FaceInfo &fi) const
const FaceInfo * _face_info
const unsigned int _qp
const ADMaterialProperty< RealTensorValue > & _lambda_neighbor
const ADMaterialProperty< Real > & _temperature_element
Temperature.
const ADMaterialProperty< Real > & _temperature_neighbor
const ADMaterialProperty< RealGradient > & _grad_T
Temperature gradient.
FVPorousFlowHeatConduction(const InputParameters &params)
virtual ADReal computeQpResidual() override
const ADMaterialProperty< RealTensorValue > & _lambda_element
Thermal conductivity.
static InputParameters validParams()
const Point & eCN() const
Real dCNMag() const
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
This holds maps between the nonlinear variables used in a PorousFlow simulation and the variable numb...