https://mooseframework.inl.gov
Loading...
Searching...
No Matches
INSFVMassAdvectionOutflowBC.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
12#include "SubProblem.h"
13#include "MooseMesh.h"
14#include "NS.h"
15
17
20{
23 params.addClassDescription("Outflow boundary condition for advecting mass.");
24 params.addRequiredParam<MooseFunctorName>(NS::density, "The functor for the density");
25 params.declareControllable("rho");
26 params.addRequiredParam<MooseFunctorName>("u", "The velocity in the x direction.");
27 params.addParam<MooseFunctorName>("v", "The velocity in the y direction.");
28 params.addParam<MooseFunctorName>("w", "The velocity in the z direction.");
29 return params;
30}
31
33 : FVFluxBC(params),
35 _rho(getFunctor<ADReal>(NS::density)),
36 _u(getFunctor<ADReal>("u")),
37 _v(isParamValid("v") ? &getFunctor<ADReal>("v") : nullptr),
38 _w(isParamValid("w") ? &getFunctor<ADReal>("w") : nullptr),
39 _dim(_subproblem.mesh().dimension())
40{
41 if (_dim >= 2 && !_v)
43 "In two or more dimensions, the v velocity must be supplied using the 'v' parameter");
44 if (_dim >= 3 && !_w)
45 mooseError("In threedimensions, the w velocity must be supplied using the 'w' parameter");
46}
47
50{
51 const auto boundary_face = singleSidedFaceArg();
52 const auto state = determineState();
53
54 ADRealVectorValue v(_u(boundary_face, state));
55 if (_v)
56 v(1) = (*_v)(boundary_face, state);
57 if (_w)
58 v(2) = (*_w)(boundary_face, state);
59
60 return _normal * v * _rho(boundary_face, state);
61}
DualNumber< Real, DNDerivativeType, true > ADReal
const double v
registerADMooseObject("NavierStokesApp", INSFVMassAdvectionOutflowBC)
Moose::FaceArg singleSidedFaceArg(const FaceInfo *fi=nullptr, Moose::FV::LimiterType limiter_type=Moose::FV::LimiterType::CentralDifference, bool correct_skewness=false, const Moose::StateArg *state_limiter=nullptr) const
ADRealVectorValue _normal
static InputParameters validParams()
A parent class for INSFV fully developed flow boundary conditions.
static InputParameters validParams()
A class for finite volume fully developed outflow boundary conditions for the mass equation It advect...
const Moose::Functor< ADReal > *const _v
y-velocity
const Moose::Functor< ADReal > & _u
x-velocity
virtual ADReal computeQpResidual() override
const Moose::Functor< ADReal > & _rho
Density.
const Moose::Functor< ADReal > *const _w
z-velocity
INSFVMassAdvectionOutflowBC(const InputParameters &params)
const unsigned int _dim
the dimension of the simulation
void declareControllable(const std::string &name, std::set< ExecFlagType > execute_flags={})
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 mooseError(Args &&... args) const
Moose::StateArg determineState() const
MeshBase & mesh
static const std::string density
Definition NS.h:34