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.");
registerMooseObject("MooseApp", BoundaryLinearFVFluxIntegral)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
AttribBoundaries tracks all boundary IDs associated with an object.
Computes the side integral of fluxes from selected LinearFVFluxKernel objects.
unsigned int _system_number
Cached system number for all kernels (must be the same)
const std::vector< std::string > & _kernel_names
Names of the kernels whose boundary flux we want to integrate.
std::string _variable_name
Cached variable name for all kernels (must be the same)
static InputParameters validParams()
virtual Real computeFaceInfoIntegral(const FaceInfo *fi) override
BoundaryLinearFVFluxIntegral(const InputParameters ¶meters)
std::vector< LinearFVFluxKernel * > _kernel_objects
Kernel objects to integrate.
virtual Real computeQpIntegral() override
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.
unsigned int _variable_number
Cached variable number for all kernels (must be the same)
virtual const std::set< BoundaryID > & boundaryIDs() const
Return the boundary IDs for this object.
TheWarehouse & theWarehouse() const
This data structure is used to store geometric and variable related metadata about each cell face in ...
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.
const std::set< BoundaryID > & boundaryIDs() const
Const getter for every associated boundary ID.
const std::string & name() const
Get the name of the class.
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 ...
const std::string & getBoundaryName(const BoundaryID boundary_id) const
Return the name of the boundary given the id.
This postprocessor computes a surface integral of the specified variable on a sideset on the boundary...
bool _qp_integration
Whether to integrate over quadrature points or FaceInfos.
static InputParameters validParams()
virtual void initialSetup() override
Gets called at the beginning of the simulation before this object is asked to do its job.
QueryCache & condition(Args &&... args)
Adds a new condition to the query.
Query query()
query creates and returns an initialized a query object for querying objects from the warehouse.
FEProblemBase & _fe_problem
Reference to the FEProblemBase for this user object.
const THREAD_ID _tid
Thread ID of this postprocessor.