https://mooseframework.inl.gov
HasPorosityJumpFace.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 
10 #include "HasPorosityJumpFace.h"
11 #include "MooseMesh.h"
12 #include "NS.h"
13 #include "NSFVUtils.h"
14 
15 registerMooseObject("NavierStokesApp", HasPorosityJumpFace);
16 
19 {
21  params.addClassDescription("Shows whether an element has any attached porosity jump faces");
22  params.addRequiredParam<MooseFunctorName>(NS::porosity, "The porosity");
23  return params;
24 }
25 
27  : AuxKernel(parameters), _eps(getFunctor<ADReal>(NS::porosity))
28 {
29  if (isNodal())
30  mooseError("This AuxKernel only supports Elemental fields");
31 }
32 
33 Real
35 {
36  for (const auto s : _current_elem->side_index_range())
37  if (const Elem * const neighbor = _current_elem->neighbor_ptr(s))
38  {
39  const FaceInfo * const fi =
42  : _mesh.faceInfo(neighbor, neighbor->which_neighbor_am_i(_current_elem));
43  mooseAssert(fi, "This should be non-null");
44  if (std::get<0>(NS::isPorosityJumpFace(_eps, *fi, determineState())))
45  return 1;
46  }
47 
48  return 0;
49 }
bool elemHasFaceInfo(const Elem &elem, const Elem *const neighbor)
Moose::StateArg determineState() const
Shows whether an element has any attached porosity jump faces.
std::tuple< bool, ADReal, ADReal > isPorosityJumpFace(const Moose::Functor< ADReal > &porosity, const FaceInfo &fi, const Moose::StateArg &time)
Checks to see whether the porosity value jumps from one side to the other of the provided face...
Definition: NSFVUtils.C:58
const Moose::Functor< ADReal > & _eps
The porosity.
DualNumber< Real, DNDerivativeType, true > ADReal
void addRequiredParam(const std::string &name, const std::string &doc_string)
static const std::string porosity
Definition: NS.h:104
const std::vector< const FaceInfo *> & faceInfo() const
Real computeValue() override
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
HasPorosityJumpFace(const InputParameters &parameters)
void mooseError(Args &&... args) const
const Elem *const & _current_elem
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
registerMooseObject("NavierStokesApp", HasPorosityJumpFace)