https://mooseframework.inl.gov
INSADEnergyAmbientConvection.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 "INSADObjectTracker.h"
12 #include "FEProblemBase.h"
13 
15 
18 {
20  params.addClassDescription(
21  "Computes a heat source/sink due to convection from ambient surroundings.");
22  params.addRequiredParam<Real>("alpha",
23  "The heat transfer coefficient from the ambient surroundings");
24  params.addRequiredParam<Real>("T_ambient", "The ambient temperature");
25  return params;
26 }
27 
29  : ADKernelValue(parameters),
30  _temperature_ambient_convection_strong_residual(
31  getADMaterialProperty<Real>("temperature_ambient_convection_strong_residual"))
32 {
33  // Bypass the UserObjectInterface method because it requires a UserObjectName param which we
34  // don't need
35  auto & obj_tracker = const_cast<INSADObjectTracker &>(
36  _fe_problem.getUserObject<INSADObjectTracker>("ins_ad_object_tracker"));
37  for (const auto block_id : blockIDs())
38  {
39  obj_tracker.set("has_ambient_convection", true, block_id);
40  obj_tracker.set("ambient_convection_alpha", getParam<Real>("alpha"), block_id);
41  obj_tracker.set("ambient_temperature", getParam<Real>("T_ambient"), block_id);
42  }
43 }
44 
45 ADReal
47 {
49 }
registerMooseObject("NavierStokesApp", INSADEnergyAmbientConvection)
T & getUserObject(const std::string &name, unsigned int tid=0) const
static InputParameters validParams()
void set(const std::string &name, const T &value, SubdomainID sub_id)
Set the internal parameter name to value.
virtual const std::set< SubdomainID > & blockIDs() const
INSADEnergyAmbientConvection(const InputParameters &parameters)
DualNumber< Real, DNDerivativeType, true > ADReal
void addRequiredParam(const std::string &name, const std::string &doc_string)
FEProblemBase & _fe_problem
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
const ADMaterialProperty< Real > & _temperature_ambient_convection_strong_residual
Computes a heat source/sink due to convection from ambient surroundings.
Object for tracking what kernels have been added to an INSAD simulation.
unsigned int _qp