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 "GeneralizedCircumference.h" 11 : 12 : registerMooseObject("ThermalHydraulicsApp", GeneralizedCircumference); 13 : 14 : InputParameters 15 702 : GeneralizedCircumference::validParams() 16 : { 17 702 : InputParameters params = Function::validParams(); 18 1404 : params.addRequiredParam<FunctionName>("area_function", "function to compute the cross section"); 19 702 : params.addClassDescription("Computes a generalized circumference from a function " 20 : "providing the area."); 21 702 : return params; 22 0 : } 23 : 24 382 : GeneralizedCircumference::GeneralizedCircumference(const InputParameters & parameters) 25 382 : : Function(parameters), FunctionInterface(this), _area_func(getFunction("area_function")) 26 : { 27 382 : } 28 : 29 : Real 30 33760 : GeneralizedCircumference::value(Real t, const Point & p) const 31 : { 32 33760 : RealVectorValue gradA = _area_func.gradient(t, p); 33 33760 : Real dAdx2 = gradA(0) * gradA(0); 34 : 35 : // Here, we assume a flow channel with circular cross section. 36 33760 : return std::sqrt(4. * libMesh::pi * _area_func.value(t, p) + dAdx2); 37 : } 38 : 39 : RealVectorValue 40 0 : GeneralizedCircumference::gradient(Real /*t*/, const Point & /*p*/) const 41 : { 42 0 : mooseError(name(), ": ", __PRETTY_FUNCTION__, " is not implemented."); 43 : }