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