https://mooseframework.inl.gov
SCMBlockedMassFlowRateAux.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 #include "SCM.h"
12 
14 
17 {
19  params.addClassDescription("Computes inlet mass flow rate BCs, from specified mass flux and "
20  "cross-sectional area and applies blocked inlet conditions");
21  params.addRequiredCoupledVar("area", "Cross sectional area [m^2]");
22  params.addRequiredParam<PostprocessorName>(
23  "unblocked_mass_flux", "Specified mass flux for unblocked subchannels [kg/s-m^2]");
24  params.addRequiredParam<PostprocessorName>(
25  "blocked_mass_flux", "Specified mass flux for blocked subchannels [kg/s-m^2]]");
26  params.addRequiredParam<std::vector<unsigned int>>("index_blockage",
27  "index of subchannels affected by blockage");
28  return params;
29 }
30 
32  : AuxKernel(parameters),
33  _subchannel_mesh(SCM::getConstMesh<SubChannelMesh>(_mesh)),
34  _unblocked_mass_flux(getPostprocessorValue("unblocked_mass_flux")),
35  _blocked_mass_flux(getPostprocessorValue("blocked_mass_flux")),
36  _area(coupledValue("area")),
37  _index_blockage(getParam<std::vector<unsigned int>>("index_blockage"))
38 {
39 }
40 
41 Real
43 {
45 
46  for (const auto & index : _index_blockage)
47  {
48  if (i == index)
49  return _blocked_mass_flux * _area[_qp];
50  }
51 
52  return _unblocked_mass_flux * _area[_qp];
53 }
virtual unsigned int getSubchannelIndexFromPoint(const Point &p) const =0
Return a subchannel index for a given physical point p
virtual Real computeValue() override
const PostprocessorValue & _blocked_mass_flux
Specified mass flux of blocked channels.
registerMooseObject("SubChannelApp", SCMBlockedMassFlowRateAux)
const Node *const & _current_node
const SubChannelMesh & _subchannel_mesh
Computes mass flow rate from specified uniform mass flux and cross-sectional area and applies inlet b...
void addRequiredParam(const std::string &name, const std::string &doc_string)
const VariableValue & _area
Cross-sectional area.
const T & getConstMesh(const MooseMesh &mesh)
function to cast const mesh
Definition: SCM.h:21
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
const std::vector< unsigned int > _index_blockage
index of subchannels affected by blockage
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
SCMBlockedMassFlowRateAux(const InputParameters &parameters)
const PostprocessorValue & _unblocked_mass_flux
Specified mass flux of unblocked channels.
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
Base class for subchannel meshes.
static InputParameters validParams()
void ErrorVector unsigned int
Definition: SCM.h:16