https://mooseframework.inl.gov
ElectricalContactTestFunc.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 
12 registerMooseObject("ElectromagneticsTestApp", ElectricalContactTestFunc);
13 
16 {
18  params.addClassDescription(
19  "Function used in ElectrostaticContactCondition analytic solution testing.");
20  params.addRangeCheckedParam<Real>(
21  "mechanical_pressure",
22  3000.,
23  "mechanical_pressure>0",
24  "Mechanical pressure uniformly applied at the contact surface area "
25  "(Pressure = Force / Surface Area).");
26  params.addRangeCheckedParam<Real>(
27  "mean_hardness",
28  2.4797e9,
29  "mean_hardness>0",
30  "Geometric mean of the hardness of graphite and stainless steel.");
31  params.addRangeCheckedParam<Real>("graphite_conductivity",
32  73069.2,
33  "graphite_conductivity>0",
34  "Conductivity in graphite (default at 300 K).");
35  params.addRangeCheckedParam<Real>("stainless_steel_conductivity",
36  1.41867e6,
37  "stainless_steel_conductivity>0",
38  "Conductivity in stainless steel (default at 300 K).");
39  params.addRangeCheckedParam<Real>(
40  "contact_conductance",
41  75524.,
42  "contact_conductance >0",
43  "Electrical contact conductance at the interface (default is at 300 K with "
44  "3 kN/m^2 applied pressure).");
45  MooseEnum domain("stainless_steel graphite");
46  params.addParam<MooseEnum>(
47  "domain", domain, "Material domain / block of interest (stainless_steel, graphite).");
48  params.addParam<bool>("three_block", false, "Is this a three block test case? Default = false.");
49  MooseEnum side("left right");
50  params.addParam<MooseEnum>("three_block_side",
51  side,
52  "If a three block test case, side / block of interest (left, right).");
53  return params;
54 }
55 
57  : Function(parameters),
58  _electrical_conductivity_graphite(getParam<Real>("graphite_conductivity")),
59  _electrical_conductivity_stainless_steel(getParam<Real>("stainless_steel_conductivity")),
60  _mean_hardness(getParam<Real>("mean_hardness")),
61  _mechanical_pressure(getParam<Real>("mechanical_pressure")),
62  _electrical_contact_conductance(getParam<Real>("contact_conductance")),
63  _domain(getParam<MooseEnum>("domain")),
64  _is_three_block(getParam<bool>("three_block")),
65  _side(getParam<MooseEnum>("three_block_side"))
66 {
67 }
68 
69 Real
70 ElectricalContactTestFunc::value(Real t, const Point & p) const
71 {
72  if (_is_three_block)
73  {
74  return threeBlockFunction(t, p);
75  }
76  else
77  {
78  return twoBlockFunction(t, p);
79  }
80 }
81 
82 Real
83 ElectricalContactTestFunc::twoBlockFunction(Real /*t*/, const Point & p) const
84 {
88 
89  Real graphite_coefficient =
91 
92  Real stainless_steel_coefficient =
94 
95  Real graphite_func = graphite_coefficient * (p(0) - 2);
96 
97  Real stainless_steel_func = stainless_steel_coefficient * p(0) + 1;
98 
99  if (_domain == STAINLESS_STEEL)
100  {
101  return stainless_steel_func;
102  }
103  else if (_domain == GRAPHITE)
104  {
105  return graphite_func;
106  }
107  else
108  {
109  mooseError(_name + ": Error in selecting proper domain in ElectricalContactTestFunc.");
110  }
111 }
112 
113 Real
114 ElectricalContactTestFunc::threeBlockFunction(Real /*t*/, const Point & p) const
115 {
116  Real denominator =
120 
121  Real graphite_coefficient =
123 
124  Real graphite_constant =
128  denominator;
129 
130  Real stainless_steel_coefficient =
132 
133  Real graphite_func = graphite_coefficient * p(0) + graphite_constant;
134 
135  Real stainless_steel_func_left = stainless_steel_coefficient * p(0) + 1;
136 
137  Real stainless_steel_func_right = stainless_steel_coefficient * (p(0) - 3);
138 
143  enum SideEnum
144  {
145  LEFT,
146  RIGHT
147  };
148 
149  if (_domain == STAINLESS_STEEL && _side == LEFT)
150  {
151  return stainless_steel_func_left;
152  }
153  else if (_domain == STAINLESS_STEEL && _side == RIGHT)
154  {
155  return stainless_steel_func_right;
156  }
157  else if (_domain == GRAPHITE)
158  {
159  return graphite_func;
160  }
161  else
162  {
163  mooseError(_name + ": Error in selecting proper domain in ElectricalContactTestFunc.");
164  }
165 }
const MooseEnum & _side
MooseEnum to determine which stainless steel region needs to be enabled in the three block analytic s...
static InputParameters validParams()
virtual Real value(Real t, const Point &p) const override
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
ElectricalContactTestFunc(const InputParameters &parameters)
Analytical solution function to test the ElectrostaticContactCondition interface kernel.
const MooseEnum & _domain
MooseEnum to determine which part of the analytic solution needs to be enabled (Stainless Steel vs...
const Real & _electrical_conductivity_graphite
Electrical conductivity property for graphite.
const Real & _electrical_conductivity_stainless_steel
Electrical conductivity property for stainless steel.
const std::string _name
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
registerMooseObject("ElectromagneticsTestApp", ElectricalContactTestFunc)
void mooseError(Args &&... args) const
const bool & _is_three_block
Boolean to determine if test function is being used in three block test case.
void addClassDescription(const std::string &doc_string)
void addRangeCheckedParam(const std::string &name, const T &value, const std::string &parsed_function, const std::string &doc_string)
const Real & _electrical_contact_conductance
Contact conductance property for the tested interface.
static InputParameters validParams()
Real threeBlockFunction(Real t, const Point &p) const
Function used to calculate three block test case analytic solution.
Real twoBlockFunction(Real t, const Point &p) const
Function used to calculate two block test case analytic solution.