https://mooseframework.inl.gov
MfrPostprocessor.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 "MfrPostprocessor.h"
11 #include "MooseMesh.h"
12 #include "libmesh/elem.h"
13 
14 registerMooseObject("NavierStokesApp", MfrPostprocessor);
15 
18 {
20  params.addClassDescription("Object for outputting boundary mass fluxes in conjunction with "
21  "FVFluxBC derived objects that support it");
22  return params;
23 }
24 
26  : SideIntegralPostprocessor(parameters)
27 {
28 }
29 
30 Real
32 {
33  mooseError("We should never call this");
34 }
35 
36 void
37 MfrPostprocessor::setMfr(const FaceInfo * const fi, const Real mfr, const bool includes_area)
38 {
39  _fi_to_mfr[fi] = mfr * (includes_area ? Real(1) : (fi->faceArea() * fi->faceCoord()));
40 }
41 
42 Real
44 {
46  if (!fi)
47  {
48  const Elem * const neighbor = _current_elem->neighbor_ptr(_current_side);
49  mooseAssert(neighbor,
50  "If current elem doesn't own a FaceInfo then there must be a neighbor who does.");
51  const auto neigh_side = neighbor->which_neighbor_am_i(_current_elem);
52  fi = _mesh.faceInfo(neighbor, neigh_side);
53  mooseAssert(fi, "We must have found a FaceInfo by now");
54  }
55  auto it = _fi_to_mfr.find(fi);
56  mooseAssert(it != _fi_to_mfr.end(), "We should have found the FaceInfo");
57  return it->second;
58 }
const unsigned int & _current_side
static InputParameters validParams()
This postprocessor computes the volumetric flow rate through a boundary.
Real & faceCoord()
std::unordered_map< const FaceInfo *, Real > _fi_to_mfr
registerMooseObject("NavierStokesApp", MfrPostprocessor)
Real faceArea() const
const std::vector< const FaceInfo *> & faceInfo() const
static InputParameters validParams()
virtual Real computeQpIntegral() override
void setMfr(const FaceInfo *fi, Real mfr, bool includes_area=true)
MfrPostprocessor(const InputParameters &parameters)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void mooseError(Args &&... args) const
void addClassDescription(const std::string &doc_string)
const Elem *const & _current_elem
virtual Real computeIntegral() override