https://mooseframework.inl.gov
GeneralizedCircumference.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 
11 
12 registerMooseObject("ThermalHydraulicsApp", GeneralizedCircumference);
13 
16 {
18  params.addRequiredParam<FunctionName>("area_function", "function to compute the cross section");
19  params.addClassDescription("Computes a generalized circumference from a function "
20  "providing the area.");
21  return params;
22 }
23 
25  : Function(parameters), FunctionInterface(this), _area_func(getFunction("area_function"))
26 {
27 }
28 
29 Real
30 GeneralizedCircumference::value(Real t, const Point & p) const
31 {
32  RealVectorValue gradA = _area_func.gradient(t, p);
33  Real dAdx2 = gradA(0) * gradA(0);
34 
35  // Here, we assume a flow channel with circular cross section.
36  return std::sqrt(4. * libMesh::pi * _area_func.value(t, p) + dAdx2);
37 }
38 
40 GeneralizedCircumference::gradient(Real /*t*/, const Point & /*p*/) const
41 {
42  mooseError(name(), ": ", __PRETTY_FUNCTION__, " is not implemented.");
43 }
virtual RealVectorValue gradient(Real t, const Point &p) const
static InputParameters validParams()
The generalized circumference, sigma_w, is defined such that the.
virtual const std::string & name() const
void addRequiredParam(const std::string &name, const std::string &doc_string)
GeneralizedCircumference(const InputParameters &parameters)
registerMooseObject("ThermalHydraulicsApp", GeneralizedCircumference)
virtual Real value(Real t, const Point &p) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual RealGradient gradient(Real t, const Point &p) const
void mooseError(Args &&... args) const
void addClassDescription(const std::string &doc_string)
virtual Real value(Real t, const Point &p) const
static InputParameters validParams()
const Real pi