https://mooseframework.inl.gov
Loading...
Searching...
No Matches
LayeredFlowAreaChange.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
13
16{
18 params += LayeredBase::validParams();
19 params.addRequiredCoupledVar("displacements",
20 "Displacements, size must match problem dimension.");
21
22 // this layered object should not be used on the displaced mesh
23 // because it measures deviation from the undisplaced mesh
24 params.suppressParameter<bool>("use_displaced_mesh");
25 params.set<bool>("use_displaced_mesh") = false;
26 params.suppressParameter<std::vector<SubdomainName>>("block");
27
29 "This layered user object computes the change in cross sectional area "
30 "of a flow channel from the displacement variables. Note: the convention is"
31 "that reduction in flow area is negative. For this to be satisfied, normals must"
32 "point INTO the flow channel.");
33 return params;
34}
35
38 LayeredBase(parameters),
39 _dim(_mesh.dimension())
40{
41 if (coupledComponents("displacements") != _dim)
42 paramError("displacements",
43 "The number of displacement components must be equal to the mesh displacement.");
44
45 _disp.resize(_dim);
46 for (unsigned int j = 0; j < _dim; ++j)
47 _disp[j] = &coupledValue("displacements", j);
48}
49
50void
56
57void
59{
60 unsigned int layer = getLayer(_current_elem->vertex_average());
62 : _layer_bounds[layer + 1] - _layer_bounds[layer];
63 Real integral_value = computeIntegral() / height;
64
65 setLayerValue(layer, getLayerValue(layer) + integral_value);
66}
67
68Real
70{
71 Real sum = 0;
72 for (_qp = 0; _qp < _qrule->n_points(); _qp++)
73 sum += _JxW[_qp] * _coord[_qp] * computeQpIntegral();
74
75 return sum;
76}
77
78Real
80{
81 RealVectorValue displacements;
82 for (unsigned int j = 0; j < _dim; ++j)
83 displacements(j) = (*_disp[j])[_qp];
84 return -_normals[_qp] * displacements;
85}
86
87void
92
93void
const std::vector< double > y
registerMooseObject("ThermalHydraulicsApp", LayeredFlowAreaChange)
void suppressParameter(const std::string &name)
void addRequiredCoupledVar(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)
virtual void threadJoin(const UserObject &y)
unsigned int _num_layers
virtual Real getLayerValue(unsigned int layer) const
bool _interval_based
Real _direction_max
virtual unsigned int getLayer(const Point &p) const
void setLayerValue(unsigned int layer, Real value)
static InputParameters validParams()
Real _direction_min
std::vector< Real > _layer_bounds
virtual void finalize()
virtual void initialize()
This layered user object computes the change in cross sectional area of a flow channel.
LayeredFlowAreaChange(const InputParameters &parameters)
virtual void finalize() override
unsigned int _dim
the problem dimension
virtual Real computeIntegral() override
static InputParameters validParams()
virtual void initialize() override
virtual Real computeQpIntegral() override
virtual void threadJoin(const UserObject &y) override
virtual void execute() override
std::vector< const VariableValue * > _disp
the displacement vectors
static InputParameters validParams()