https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
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}
Base class for flow junctions.
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
JunctionWithLossesBase(const InputParameters &parameters)
static InputParameters validParams()
bool isParamValid(const std::string &name) const