Advanced Multi-Physics (AMP)
On-Line Documentation
SubchannelFourEqNonlinearOperator.h
Go to the documentation of this file.
1
2#ifndef included_AMP_SubchannelFourEqNonlinearOperator
3#define included_AMP_SubchannelFourEqNonlinearOperator
4
5#include "AMP/operators/Operator.h"
6#include "AMP/operators/subchannel/SubchannelOperatorParameters.h"
7
8
9namespace AMP::Operator {
10
17{
18public:
19 typedef std::unique_ptr<AMP::Mesh::MeshElement> ElementPtr;
20
22 explicit SubchannelFourEqNonlinearOperator( std::shared_ptr<const OperatorParameters> params );
23
26
28 std::string type() const override { return "SubchannelFourEqNonlinearOperator"; }
29
37
38 void reset( std::shared_ptr<const OperatorParameters> params ) override;
39
40 std::shared_ptr<AMP::LinearAlgebra::Variable> getInputVariable() const override
41 {
42 return d_inpVariable;
43 }
44
45 std::shared_ptr<AMP::LinearAlgebra::Variable> getOutputVariable() const override
46 {
47 return d_outVariable;
48 }
49
50 std::shared_ptr<AMP::LinearAlgebra::VectorSelector> selectOutputVector() const override;
51
52 std::shared_ptr<AMP::LinearAlgebra::VectorSelector> selectInputVector() const override;
53
58
60 std::shared_ptr<SubchannelPhysicsModel> getSubchannelPhysicsModel()
61 {
63 }
64
66 double getInletTemperature() { return d_Tin; }
67
69 double getOutletPressure() { return d_Pout; }
70
72 auto getParams() { return d_params; }
73
75 void getLateralFaces( std::shared_ptr<AMP::Mesh::Mesh>,
76 std::map<AMP::Mesh::Point, ElementPtr> &,
77 std::map<AMP::Mesh::Point, ElementPtr> & );
78
80 std::map<AMP::Mesh::Point, double> getGapWidths( std::shared_ptr<AMP::Mesh::Mesh>,
81 const std::vector<double> &,
82 const std::vector<double> &,
83 const std::vector<double> & );
84
86
87 void fillSubchannelGrid( std::shared_ptr<AMP::Mesh::Mesh> ); // function to fill the subchannel
88 // data for all processors
89
90 int getSubchannelIndex( double x,
91 double y ); // function to give unique index for each subchannel
92
93protected:
95 std::shared_ptr<OperatorParameters>
97
98 std::shared_ptr<const SubchannelOperatorParameters> d_params;
99
100 std::shared_ptr<SubchannelPhysicsModel> d_subchannelPhysicsModel;
101
102private:
104
105 std::shared_ptr<AMP::LinearAlgebra::Variable> d_inpVariable;
106 std::shared_ptr<AMP::LinearAlgebra::Variable> d_outVariable;
107 std::shared_ptr<AMP::LinearAlgebra::Vector> d_cladTemperature;
108
109 bool d_forceNoConduction; // option to force conduction terms to zero; used for testing
110 bool d_forceNoTurbulence; // option to force turbulence terms to zero; used for testing
111 bool d_forceNoHeatSource; // option to force heat source terms to zero; used for testing
112 bool
113 d_forceNoFriction; // option to force friction and form loss terms to zero; used for testing
114
115 double d_Pout; // exit pressure [Pa]
116 double d_Tin; // inlet temperature [K]
117 double d_mass; // inlet global mass flow rate [kg/s]
118 double d_win; // inlet lateral mass flow rate [kg/s]
119 double d_gamma; // fission heating coefficient
120 double d_theta; // channel angle [rad]
121 double d_turbulenceCoef; // proportionality constant relating turbulent momentum to turbulent
122 // energy transport
123 double d_reynolds; // reynolds number
124 double d_prandtl; // prandtl number
125 double d_KG; // lateral form loss coefficient
126
127 std::string d_frictionModel; // friction model
128 double d_friction; // friction factor
129 double d_roughness; // surface roughness [m]
130
131 std::vector<double> d_channelDiam; // Channel hydraulic diameter using the wetted perimeter
132 std::vector<double> d_channelArea; // Channel flow area
133 std::vector<double> d_rodDiameter; // Average rod diameter for each subchannel
134 std::vector<double> d_rodFraction; // Fraction of a rod in each subchannel
135 std::vector<double> d_channelMass; // Mass flow rate for each subchannel [kg/s]
136
137 size_t d_NGrid; // number of grid spacers
138 std::vector<double> d_zMinGrid; // z min positions of each grid spacer
139 std::vector<double> d_zMaxGrid; // z max positions of each grid spacer
140 std::vector<double> d_lossGrid; // loss coefficients for each grid spacer
141
142 std::string d_source; // heat source type
143 std::string d_heatShape; // heat shape used if heat source type is "totalHeatGeneration"
144 double d_Q; // (sum of rod powers)/4 for each subchannel
145 std::vector<double> d_QFraction; // fraction of max rod power in each subchannel
146
147 std::vector<double> d_x, d_y, d_z;
148 std::vector<bool> d_ownSubChannel; // does this processor own this subchannel (multiple
149 // processors may own a subchannel)?
150 std::vector<std::vector<ElementPtr>> d_subchannelElem; // List of elements in each subchannel
151 std::vector<std::vector<ElementPtr>>
152 d_subchannelFace; // List of z-face elements in each subchannel
153 size_t d_numSubchannels; // number of subchannels
154
155 double Volume( double, double ); // evaluates specific volume
156 double Temperature( double, double ); // evaluates temperature
157 double ThermalConductivity( double, double ); // evaluates thermal conductivity
158 double DynamicViscosity( double, double ); // evaluates dynamic viscosity
159 double Enthalpy( double, double ); // evaluates specific enthalpy
160
163 const std::map<AMP::Mesh::Point, ElementPtr> & );
164};
165
166
167} // namespace AMP::Operator
168
169#endif
std::shared_ptr< Vector > shared_ptr
Shorthand for shared pointer to Vector.
Definition Vector.h:60
std::shared_ptr< const Vector > const_shared_ptr
Definition Vector.h:65
std::shared_ptr< AMP::Operator::Operator > shared_ptr
Definition Operator.h:29
std::map< AMP::Mesh::Point, double > getGapWidths(std::shared_ptr< AMP::Mesh::Mesh >, const std::vector< double > &, const std::vector< double > &, const std::vector< double > &)
Makes map of gap widths to their xy positions.
SubchannelFourEqNonlinearOperator(std::shared_ptr< const OperatorParameters > params)
Constructor.
std::shared_ptr< const SubchannelOperatorParameters > d_params
void apply(AMP::LinearAlgebra::Vector::const_shared_ptr u, AMP::LinearAlgebra::Vector::shared_ptr f) override
std::shared_ptr< SubchannelPhysicsModel > getSubchannelPhysicsModel()
Get the element physics model.
void setVector(AMP::LinearAlgebra::Vector::shared_ptr frozenVec)
std::shared_ptr< AMP::LinearAlgebra::Variable > getInputVariable() const override
Return the input variable.
std::shared_ptr< AMP::LinearAlgebra::Variable > getOutputVariable() const override
Return the output variable.
std::shared_ptr< AMP::LinearAlgebra::Variable > d_outVariable
ElementPtr getAxiallyAdjacentLateralFace(const AMP::Mesh::MeshElement *, const AMP::Mesh::MeshElement &, const std::map< AMP::Mesh::Point, ElementPtr > &)
std::shared_ptr< OperatorParameters > getJacobianParameters(AMP::LinearAlgebra::Vector::const_shared_ptr u) override
Gets parameters from nonlinear operator for use in linear operator.
std::shared_ptr< SubchannelPhysicsModel > d_subchannelPhysicsModel
std::shared_ptr< AMP::LinearAlgebra::VectorSelector > selectOutputVector() const override
Return the selector for output vectors.
void fillSubchannelGrid(std::shared_ptr< AMP::Mesh::Mesh >)
void getAxialFaces(const AMP::Mesh::MeshElement &, ElementPtr &, ElementPtr &)
std::shared_ptr< AMP::LinearAlgebra::Variable > d_inpVariable
std::shared_ptr< AMP::LinearAlgebra::VectorSelector > selectInputVector() const override
Return the selector for input vectors.
void reset(std::shared_ptr< const OperatorParameters > params) override
void getLateralFaces(std::shared_ptr< AMP::Mesh::Mesh >, std::map< AMP::Mesh::Point, ElementPtr > &, std::map< AMP::Mesh::Point, ElementPtr > &)
Makes map of lateral gaps to their centroids.
std::shared_ptr< AMP::LinearAlgebra::Vector > d_cladTemperature
std::string type() const override
Return the name of the operator.



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:41.
Comments on this page