https://mooseframework.inl.gov
Loading...
Searching...
No Matches
FormLoss1PhaseBase.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 "FormLoss1PhaseBase.h"
12#include "FlowChannel1Phase.h"
13
16{
18 params.addRequiredParam<std::string>("flow_channel",
19 "Flow channel where form loss will be applied");
20 params.addClassDescription("Base class for prescribing a form loss over a 1-phase flow channel");
21
22 return params;
23}
24
26 : Component(params), _flow_channel_name(getParam<std::string>("flow_channel"))
27{
28}
29
30void
32{
34
35 if (hasComponentByName<FlowChannel1Phase>(_flow_channel_name))
36 {
37 const FlowChannel1Phase & fch = getComponentByName<FlowChannel1Phase>(_flow_channel_name);
39 }
40}
41
42void
44{
45 checkComponentOfTypeExistsByName<FlowChannel1Phase>(_flow_channel_name);
46}
47
48void
50{
51 {
52 const std::string class_name = "ADOneD3EqnMomentumFormLoss";
53 InputParameters params = _factory.getValidParams(class_name);
54 params.set<NonlinearVariableName>("variable") = FlowModelSinglePhase::RHOUA;
55 params.set<std::vector<SubdomainName>>("block") = _flow_channel_subdomains;
56 params.set<std::vector<VariableName>>("A") = {FlowModel::AREA};
57 params.set<MaterialPropertyName>("rho") = FlowModelSinglePhase::DENSITY;
58 params.set<MaterialPropertyName>("vel") = FlowModelSinglePhase::VELOCITY;
60 class_name, genName(name(), FlowModelSinglePhase::RHOUA, "form_loss"), params);
61 }
62}
Base class for THM components.
Definition Component.h:32
virtual void init()
Initializes the component.
Definition Component.h:405
virtual const std::vector< SubdomainName > & getSubdomainNames() const
Gets the subdomain names for this component.
Definition Component.C:345
THMProblem & getTHMProblem() const
Gets the THM problem.
Definition Component.C:135
Factory & _factory
The Factory associated with the MooseApp.
Definition Component.h:497
static InputParameters validParams()
Definition Component.C:18
virtual void addKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
InputParameters getValidParams(const std::string &name) const
Single-component, single-phase flow channel.
static const std::string DENSITY
static const std::string VELOCITY
static const std::string RHOUA
static const std::string AREA
Definition FlowModel.h:102
virtual void addMooseObjects() override
const std::string & _flow_channel_name
Name of the flow channel component.
std::vector< SubdomainName > _flow_channel_subdomains
Subdomains corresponding to the connected flow channel.
virtual void init() override
Initializes the component.
static InputParameters validParams()
FormLoss1PhaseBase(const InputParameters &params)
virtual void check() const override
Check the component integrity.
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
const std::string & name() const
std::string genName(const std::string &prefix, unsigned int id, const std::string &suffix="") const
Build a name from a prefix, number and possible suffix.