https://mooseframework.inl.gov
INSADDisplaceBoundaryBC.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 "SystemBase.h"
12 #include "ImplicitEuler.h"
13 
15 
18 {
20  params.addClassDescription("Boundary condition for displacing a boundary");
21  params.addRequiredParam<MooseFunctorName>("velocity", "The velocity at which to displace");
22  params.addRequiredParam<unsigned short>(
23  "component", "What component of velocity/displacement this object is acting on.");
24  params.addRequiredParam<SubdomainName>(
25  "associated_subdomain",
26  "The subdomain that the boundary nodeset is associated with. This will be passed to the "
27  "coupled functor for unambigious evaluation (e.g. at the edge of the node-patch where we "
28  "might run into the intersection of subdomains");
29  return params;
30 }
31 
33  : ADNodalBC(parameters),
34  _velocity(getFunctor<ADRealVectorValue>("velocity")),
35  _u_old(_var.nodalValueOld()),
36  _component(getParam<unsigned short>("component")),
37  _sub_id(_mesh.getSubdomainID(getParam<SubdomainName>("associated_subdomain")))
38 {
39  if (!dynamic_cast<const ImplicitEuler *>(&_sys.getTimeIntegrator(_var.number())))
40  mooseError("This boundary condition hard-codes a displacement update with the form of an "
41  "implicit Euler discretization. Consequently please use the default time "
42  "integrator, ImplicitEuler.");
43 }
44 
45 ADReal
47 {
48  const std::set<SubdomainID> sub_id_set = {_sub_id};
49  const Moose::NodeArg nd{_current_node, &sub_id_set};
50  return _u - (_u_old + this->_dt * _velocity(nd, determineState())(_component));
51 }
InputParameters validParams()
registerMooseObject("NavierStokesApp", INSADDisplaceBoundaryBC)
const Moose::Functor< ADRealVectorValue > & _velocity
The velocity.
Increments the boundary displacement by the product of the surface velocity and the change in time th...
void mooseError(Args &&... args)
unsigned int number() const
const Moose::ADType< T >::type & _u
virtual ADReal computeQpResidual() override
DualNumber< Real, DNDerivativeType, true > ADReal
void addRequiredParam(const std::string &name, const std::string &doc_string)
SubdomainID getSubdomainID(const SubdomainName &subdomain_name, const MeshBase &mesh)
const Real & _u_old
The previous timestep value of the displacement.
MooseVariableFE< T > & _var
const Node *const & _current_node
const SubdomainID _sub_id
The subdomain ID along which the boundary nodeset, that this object is acting on, is associated with...
void addClassDescription(const std::string &doc_string)
INSADDisplaceBoundaryBC(const InputParameters &parameters)
const unsigned short _component
What component of velocity/displacement this object is acting on.
static InputParameters validParams()