https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
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
29Real
30GeneralizedCircumference::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
39RealVectorValue
40GeneralizedCircumference::gradient(Real /*t*/, const Point & /*p*/) const
41{
42 mooseError(name(), ": ", __PRETTY_FUNCTION__, " is not implemented.");
43}
const Real p
registerMooseObject("ThermalHydraulicsApp", GeneralizedCircumference)
static InputParameters validParams()
virtual RealGradient gradient(Real t, const Point &p) const
virtual Real value(Real t, const Point &p) const
The generalized circumference, sigma_w, is defined such that the.
GeneralizedCircumference(const InputParameters &parameters)
virtual RealVectorValue gradient(Real t, const Point &p) const
static InputParameters validParams()
virtual Real value(Real t, const Point &p) const
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
const std::string & name() const
void mooseError(Args &&... args) const
const Real pi