https://mooseframework.inl.gov
ElbowPipe1Phase.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 
10 #include "ElbowPipe1Phase.h"
11 #include "THMMesh.h"
12 
13 registerMooseObject("ThermalHydraulicsApp", ElbowPipe1Phase);
14 
17 {
19  params.addRequiredParam<Real>("radius", "Radius of the pipe [m]");
20  params.addRequiredParam<Real>("start_angle", "Angle at which the pipe starts [degrees]");
21  params.addRequiredParam<Real>("end_angle", "Angle at which the pipe ends [degrees]");
22 
23  // Suppress length. Also need to set it to something, because it is required in the parent class
24  params.set<std::vector<Real>>("length") = {0.0};
25  params.suppressParameter<std::vector<Real>>("length");
26 
27  params.addClassDescription("Bent pipe for 1-phase flow");
28 
29  return params;
30 }
31 
33  : FlowChannel1Phase(params),
34  _radius(getParam<Real>("radius")),
35  _start_angle(getParam<Real>("start_angle")),
36  _end_angle(getParam<Real>("end_angle"))
37 {
39  _end_angle += 360.;
41  if (_central_angle > 360)
42  logError("The difference between the angle parameters 'end_angle' and 'start_angle' (",
44  ") is greater than 360 degrees");
45 
46  _length = 2 * M_PI * _radius * (_central_angle / 360.);
47  _lengths[0] = _length;
48 }
49 
50 void
52 {
53  Real arc_length = 2 * M_PI * _radius * (_central_angle / 360.);
54  for (unsigned int i = 0; i < _node_locations.size(); i++)
55  {
56  // distance from the origin (to account for elements of different sizes)
57  Point dist(_node_locations[i], 0., 0.);
58  Real x_pos = dist.norm();
59  Real alpha = (_start_angle + (_central_angle * x_pos / arc_length)) * M_PI / 180.;
61  addNode(p);
62  }
63 }
Real _start_angle
Start angle [degrees].
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sin(_arg) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tan
Bent pipe for 1-phase flow.
T & set(const std::string &name, bool quiet_mode=false)
std::vector< Real > _lengths
Length of each axial section.
Real _central_angle
central angle
Node * addNode(const Point &pt)
Definition: Component.C:213
void addRequiredParam(const std::string &name, const std::string &doc_string)
static InputParameters validParams()
void suppressParameter(const std::string &name)
void logError(Args &&... args) const
Logs an error.
Definition: Component.h:215
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template cos(_arg) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(cos
Single-component, single-phase flow channel.
virtual void buildMeshNodes() override
Real _radius
Radius of the pipe [m].
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real _end_angle
End angle [degrees].
static const std::string alpha
Definition: NS.h:134
static InputParameters validParams()
ElbowPipe1Phase(const InputParameters &params)
void addClassDescription(const std::string &doc_string)
std::vector< Real > _node_locations
Node locations along the main axis.
registerMooseObject("ThermalHydraulicsApp", ElbowPipe1Phase)