https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
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<Real>(NS::porosity))
28{
29 if (isNodal())
30 mooseError("This AuxKernel only supports Elemental fields");
31}
32
33Real
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}
registerMooseObject("NavierStokesApp", HasPorosityJumpFace)
const Elem *const & _current_elem
static InputParameters validParams()
Shows whether an element has any attached porosity jump faces.
HasPorosityJumpFace(const InputParameters &parameters)
Real computeValue() override
const Moose::Functor< Real > & _eps
The porosity.
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void mooseError(Args &&... args) const
const std::vector< const FaceInfo * > & faceInfo() const
Moose::StateArg determineState() const
bool elemHasFaceInfo(const Elem &elem, const Elem *const neighbor)
std::tuple< bool, T, T > isPorosityJumpFace(const Moose::FunctorBase< T > &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:119
static const std::string porosity
Definition NS.h:108