https://mooseframework.inl.gov
JunctionWithLossesBase.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 "JunctionWithLossesBase.h"
11 
14 {
16  params.addRequiredParam<std::vector<Real>>("K", "Form loss coefficients [-]");
17  // use same values in K for K_reverse if not provided
18  params.addParam<std::vector<Real>>("K_reverse", "Reverse form loss coefficients [-]");
19  params.addRequiredParam<Real>("A_ref", "Junction Reference area [m^2]");
20 
21  return params;
22 }
23 
25  : FlowJunction(parameters),
26  _k_coeffs(getParam<std::vector<Real>>("K")),
27  _kr_coeffs(isParamValid("K_reverse") ? getParam<std::vector<Real>>("K_reverse")
28  : getParam<std::vector<Real>>("K")),
29  _ref_area(getParam<Real>("A_ref"))
30 {
31  checkSizeEqualsNumberOfConnections<Real>("K");
32  if (isParamValid("K_reverse"))
33  checkSizeEqualsNumberOfConnections<Real>("K_reverse");
34 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
bool isParamValid(const std::string &name) const
Base class for flow junctions.
Definition: FlowJunction.h:17
static InputParameters validParams()
Definition: FlowJunction.C:14
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
JunctionWithLossesBase(const InputParameters &parameters)
static InputParameters validParams()