https://mooseframework.inl.gov
Loading...
Searching...
No Matches
SideAverageValue.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 "SideAverageValue.h"
11
13
16{
18 params.addClassDescription("Computes the average value of a variable on a "
19 "sideset. Note that this cannot be used on the "
20 "centerline of an axisymmetric model.");
21 return params;
22}
23
25 : SideIntegralVariablePostprocessor(parameters), _volume(0)
26{
27}
28
29void
35
36void
42
43Real
45{
46 if (MooseUtils::absoluteFuzzyEqual(_volume, 0.0))
47 {
49 mooseError("The total area of the boundary is zero. This could be due to "
50 "using a boundary on the centerline of an axisymmetric model.");
51 else
52 mooseError("The total area of the boundary is zero.");
53 }
54
55 return _integral_value / _volume;
56}
57
58Real
63
64void
66{
68 const auto & pps = static_cast<const SideAverageValue &>(y);
69 _volume += pps._volume;
70}
71
72void
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
registerMooseObject("MooseApp", SideAverageValue)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
This postprocessor computes a volume integral of the specified variable.
virtual void finalize() override
This is called after execute() and after threadJoin()! This is probably where you want to do MPI comm...
virtual Real getValue() const override
This will get called to actually grab the final value the postprocessor has calculated.
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
SideAverageValue(const InputParameters &parameters)
virtual Real volume()
Compute the volume of the current face.
virtual void execute() override
Execute method.
static InputParameters validParams()
virtual void threadJoin(const UserObject &y) override
Must override.
Real _volume
Volume of the entire surface to average over.
virtual void threadJoin(const UserObject &y) override
Must override.
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
Real _integral_value
Holds the postprocessor result, the integral.
virtual void execute() override
Execute method.
This postprocessor computes a surface integral of the specified variable.
const Real & _current_side_volume
void gatherSum(T &value)
Gather the parallel sum of the variable passed in.
Base class for user-specific data.
Definition UserObject.h:20
const Moose::CoordinateSystemType & _coord_sys
Coordinate system.
Definition UserObject.h:66
@ COORD_RZ
Definition MooseTypes.h:866