https://mooseframework.inl.gov
INSADMomentumMeshAdvection.h
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 #pragma once
11 
12 #include "ADKernelValue.h"
13 #include "INSADObjectTracker.h"
14 
19 {
20 public:
23  template <typename T>
24  static void setDisplacementParams(T & mesh_convection_obj);
25 
27 
28 protected:
29  virtual ADRealVectorValue precomputeQpResidual() override;
30 
34 };
35 
36 template <typename T>
37 void
39 {
40  auto check_coupled = [&](const auto & var_name)
41  {
42  if (mesh_convection_obj.coupledComponents(var_name) > 1)
43  mesh_convection_obj.paramError(
44  var_name, "Only one variable should be used for '", var_name, "'");
45  if (mesh_convection_obj.isCoupledConstant(var_name))
46  mesh_convection_obj.paramError(var_name, "Displacement variables cannot be constants");
47  };
48  check_coupled("disp_x");
49  check_coupled("disp_y");
50  check_coupled("disp_z");
51 
52  if (mesh_convection_obj._tid == 0)
53  {
54  // Bypass the UserObjectInterface method because it requires a UserObjectName param which we
55  // don't need
56  auto & obj_tracker = mesh_convection_obj._fe_problem.template getUserObject<INSADObjectTracker>(
57  "ins_ad_object_tracker");
58  for (const auto block_id : mesh_convection_obj.blockIDs())
59  {
60  obj_tracker.set("has_advected_mesh", true, block_id);
61  obj_tracker.set("disp_x", mesh_convection_obj.coupledName("disp_x"), block_id);
62  if (mesh_convection_obj.isParamValid("disp_y"))
63  obj_tracker.set("disp_y", mesh_convection_obj.coupledName("disp_y"), block_id);
64  if (mesh_convection_obj.isParamValid("disp_z"))
65  obj_tracker.set("disp_z", mesh_convection_obj.coupledName("disp_z"), block_id);
66  }
67  }
68 }
Subtracts the mesh velocity from the convection term in the Navier-Stokes momentum equation...
static InputParameters displacementParams()
virtual ADRealVectorValue precomputeQpResidual() override
static InputParameters validParams()
const InputParameters & parameters() const
const ADMaterialProperty< RealVectorValue > & _advected_mesh_strong_residual
The strong residual for this object, computed by material classes to eliminate computation duplicatio...
INSADMomentumMeshAdvection(const InputParameters &parameters)
static void setDisplacementParams(T &mesh_convection_obj)