Line data Source code
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 "SideIntegralVariablePostprocessor.h" 11 : #include "MathFVUtils.h" 12 : 13 : #include "metaphysicl/raw_type.h" 14 : 15 : registerMooseObject("MooseApp", SideIntegralVariablePostprocessor); 16 : 17 : InputParameters 18 189861 : SideIntegralVariablePostprocessor::validParams() 19 : { 20 189861 : InputParameters params = SideIntegralPostprocessor::validParams(); 21 189861 : params.addRequiredCoupledVar("variable", 22 : "The name of the variable which this postprocessor integrates"); 23 189861 : params.addClassDescription("Computes a surface integral of the specified variable"); 24 189861 : return params; 25 0 : } 26 : 27 2277 : SideIntegralVariablePostprocessor::SideIntegralVariablePostprocessor( 28 2277 : const InputParameters & parameters) 29 : : SideIntegralPostprocessor(parameters), 30 : MooseVariableInterface<Real>(this, 31 : false, 32 : "variable", 33 : Moose::VarKindType::VAR_ANY, 34 : Moose::VarFieldType::VAR_FIELD_STANDARD), 35 2277 : _u(coupledValue("variable")), 36 2277 : _grad_u(coupledGradient("variable")), 37 4554 : _fv(_fv_variable || _linear_fv_variable) 38 : { 39 2277 : addMooseVariableDependency(&mooseVariableField()); 40 : 41 2277 : _qp_integration = !_fv; 42 2277 : } 43 : 44 : Real 45 270 : SideIntegralVariablePostprocessor::computeFaceInfoIntegral(const FaceInfo * const fi) 46 : { 47 270 : return MetaPhysicL::raw_value((*_field_variable)(makeCDFace(*fi), determineState())); 48 : } 49 : 50 : Real 51 1241993 : SideIntegralVariablePostprocessor::computeQpIntegral() 52 : { 53 1241993 : return _u[_qp]; 54 : } 55 : 56 : bool 57 2700 : SideIntegralVariablePostprocessor::hasFaceSide(const FaceInfo & fi, const bool fi_elem_side) const 58 : { 59 2700 : return _field_variable->hasFaceSide(fi, fi_elem_side); 60 : }