https://mooseframework.inl.gov
Loading...
Searching...
No Matches
INSMomentumNoBCBCBase.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 "MooseMesh.h"
12#include "NS.h"
13
16{
18
19 params.addClassDescription("Base class for the 'No BC' boundary condition.");
20 // Coupled variables
21 params.addRequiredCoupledVar("u", "x-velocity");
22 params.addCoupledVar("v", "y-velocity"); // only required in 2D and 3D
23 params.addCoupledVar("w", "z-velocity"); // only required in 3D
24 params.addRequiredCoupledVar(NS::pressure, "pressure");
25
26 // Required parameters
27 params.addRequiredParam<RealVectorValue>("gravity", "Direction of the gravity vector");
28 params.addRequiredParam<unsigned>(
29 "component",
30 "0,1,2 depending on if we are solving the x,y,z component of the momentum equation");
31 params.addParam<bool>("integrate_p_by_parts",
32 true,
33 "Allows simulations to be run with pressure BC if set to false");
34
35 // Optional parameters
36 params.addParam<MaterialPropertyName>("mu_name", "mu", "The name of the dynamic viscosity");
37 params.addParam<MaterialPropertyName>("rho_name", "rho", "The name of the density");
38
39 return params;
40}
41
43 : IntegratedBC(parameters),
44
45 // Coupled variables
46 _u_vel(coupledValue("u")),
47 _v_vel(_mesh.dimension() >= 2 ? coupledValue("v") : _zero),
48 _w_vel(_mesh.dimension() == 3 ? coupledValue("w") : _zero),
49 _p(coupledValue(NS::pressure)),
50
51 // Gradients
52 _grad_u_vel(coupledGradient("u")),
53 _grad_v_vel(_mesh.dimension() >= 2 ? coupledGradient("v") : _grad_zero),
54 _grad_w_vel(_mesh.dimension() == 3 ? coupledGradient("w") : _grad_zero),
55
56 // Variable numberings
57 _u_vel_var_number(coupled("u")),
58 _v_vel_var_number(_mesh.dimension() >= 2 ? coupled("v") : libMesh::invalid_uint),
59 _w_vel_var_number(_mesh.dimension() == 3 ? coupled("w") : libMesh::invalid_uint),
60 _p_var_number(coupled(NS::pressure)),
61
62 // Required parameters
63 _gravity(getParam<RealVectorValue>("gravity")),
64 _component(getParam<unsigned>("component")),
65 _integrate_p_by_parts(getParam<bool>("integrate_p_by_parts")),
66
67 // Material properties
68 _mu(getMaterialProperty<Real>("mu_name")),
69 _rho(getMaterialProperty<Real>("rho_name"))
70{
71}
INSMomentumNoBCBCBase(const InputParameters &parameters)
static InputParameters validParams()
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void addCoupledVar(const std::string &name, const std::string &doc_string)
static InputParameters validParams()
static const std::string pressure
Definition NS.h:57
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...