22 "linearfvkernels",
"List of LinearFVFluxKernels whose boundary fluxes are integrated.");
24 "Computes the side integral of selected LinearFVFluxKernel boundary flux contributions.");
30 _kernel_names(getParam<
std::vector<
std::string>>(
"linearfvkernels")),
37 paramError(
"linearfvkernels",
"At least one kernel must be provided.");
49 .condition<AttribThread>(
_tid);
54 std::vector<LinearFVFluxKernel *> kernels;
55 auto query = base_query.clone();
59 "The given LinearFVFluxKernel with name '",
61 "' was not found! This can be due to the kernel not existing in the " 62 "'LinearFVKernels' block or the kernel not inheriting from LinearFVFluxKernel.");
76 "All kernels in 'linearfvkernels' must act on the same variable name. The " 79 "' acts on variable '",
80 kernel_ptr->variable().name(),
81 "', while the first kernel acts on variable '",
90 .condition<AttribThread>(
_tid)
97 std::vector<LinearFVBoundaryCondition *> bcs;
98 auto bc_query_copy = bc_query;
99 bc_query_copy.condition<
AttribBoundaries>(std::set<BoundaryID>({boundary_id})).queryInto(bcs);
105 "' does not have a LinearFVBoundaryCondition on boundary '",
113 "' has multiple LinearFVBoundaryCondition objects on boundary '",
115 "', which is not currently supported.");
124 mooseAssert(fi,
"FaceInfo should not be null.");
125 mooseAssert(fi->
boundaryIDs().size() == 1,
"Expected exactly one boundary per face.");
127 const auto boundary_id = *fi->
boundaryIDs().begin();
131 mooseError(
"Cannot compute boundary flux on boundary '",
133 "' because the variable face type is not boundary-only.");
135 auto *
const bc = libmesh_map_find(
_boundary_bcs, boundary_id);
136 bc->setupFaceData(fi, face_type);
138 Real flux_value = 0.0;
141 kernel_ptr->setupFaceData(fi);
143 kernel_ptr->setCurrentFaceArea(1.0);
144 flux_value += kernel_ptr->computeBoundaryFlux(*bc);
153 mooseError(
"We should never call this function.");
const THREAD_ID _tid
Thread ID of this postprocessor.
unsigned int _variable_number
Cached variable number for all kernels (must be the same)
bool _qp_integration
Whether to integrate over quadrature points or FaceInfos.
const std::set< BoundaryID > & boundaryIDs() const
Const getter for every associated boundary ID.
std::string _variable_name
Cached variable name for all kernels (must be the same)
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
static InputParameters validParams()
static InputParameters validParams()
std::unordered_map< BoundaryID, LinearFVBoundaryCondition * > _boundary_bcs
Cached BC pointers on requested boundaries.
virtual void initialSetup() override
Gets called at the beginning of the simulation before this object is asked to do its job...
const std::string & getBoundaryName(const BoundaryID boundary_id) const
Return the name of the boundary given the id.
Computes the side integral of fluxes from selected LinearFVFluxKernel objects.
FEProblemBase & _fe_problem
Reference to the FEProblemBase for this user object.
std::vector< LinearFVFluxKernel * > _kernel_objects
Kernel objects to integrate.
This data structure is used to store geometric and variable related metadata about each cell face in ...
const std::string & name() const
Get the name of the class.
registerMooseObject("MooseApp", BoundaryLinearFVFluxIntegral)
const std::vector< std::string > & _kernel_names
Names of the kernels whose boundary flux we want to integrate.
TheWarehouse & theWarehouse() const
BoundaryLinearFVFluxIntegral(const InputParameters ¶meters)
AttribBoundaries tracks all boundary IDs associated with an object.
This postprocessor computes a surface integral of the specified variable on a sideset on the boundary...
virtual void initialSetup() override
Gets called at the beginning of the simulation before this object is asked to do its job...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Real computeFaceInfoIntegral(const FaceInfo *fi) override
unsigned int _system_number
Cached system number for all kernels (must be the same)
Query query()
query creates and returns an initialized a query object for querying objects from the warehouse...
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
QueryCache & condition(Args &&... args)
Adds a new condition to the query.
virtual Real computeQpIntegral() override
virtual const std::set< BoundaryID > & boundaryIDs() const
Return the boundary IDs for this object.
VarFaceNeighbors faceType(const std::pair< unsigned int, unsigned int > &var_sys) const
Returns which side(s) the given variable-system number pair is defined on for this face...