https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
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
29
30Real
32{
33 mooseError("We should never call this");
34}
35
36void
37MfrPostprocessor::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
42Real
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}
registerMooseObject("NavierStokesApp", MfrPostprocessor)
Real faceArea() const
Real & faceCoord()
void addClassDescription(const std::string &doc_string)
This postprocessor computes the volumetric flow rate through a boundary.
virtual Real computeQpIntegral() override
MfrPostprocessor(const InputParameters &parameters)
std::unordered_map< const FaceInfo *, Real > _fi_to_mfr
virtual Real computeIntegral() override
static InputParameters validParams()
void setMfr(const FaceInfo *fi, Real mfr, bool includes_area=true)
void mooseError(Args &&... args) const
const std::vector< const FaceInfo * > & faceInfo() const
static InputParameters validParams()
const unsigned int & _current_side
const Elem *const & _current_elem