forked from idaholab/moose
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add electrical contact analytical function test object (idaholab#31)
- Loading branch information
1 parent
0851e51
commit 53e6e38
Showing
2 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
modules/electromagnetics/test/include/functions/ElectricalContactTestFunc.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#pragma once | ||
|
||
#include "Function.h" | ||
|
||
/** | ||
* Analytical solution function to test the ElectrostaticContactCondition | ||
* interface kernel. Constants are taken from the materials (graphite and | ||
* stainless steel) used within the test. Defaults are taken at 300 K. | ||
*/ | ||
class ElectricalContactTestFunc : public Function | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
|
||
ElectricalContactTestFunc(const InputParameters & parameters); | ||
|
||
virtual Real value(Real t, const Point & p) const override; | ||
|
||
protected: | ||
|
||
/// Electrical conductivity property for graphite | ||
const Real & _electrical_conductivity_graphite; | ||
|
||
/// Electrical conductivity property for stainless steel | ||
const Real & _electrical_conductivity_stainless_steel; | ||
|
||
/// Geometric mean of the hardness of graphite and stainless steel | ||
const Real & _mean_hardness; | ||
|
||
/// User-supplied mechanical pressure | ||
const Real & _mechanical_pressure; | ||
|
||
/// Contact conductance property for the tested interface | ||
const Real & _electrical_contact_conductance; | ||
|
||
/** | ||
* MooseEnum to determine which part of the analytic solution | ||
* needs to be enabled (Stainless Steel vs. Graphite) | ||
*/ | ||
const MooseEnum & _domain; | ||
}; |
78 changes: 78 additions & 0 deletions
78
modules/electromagnetics/test/src/functions/ElectricalContactTestFunc.C
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#include "ElectricalContactTestFunc.h" | ||
|
||
registerMooseObject("ElkApp", ElectricalContactTestFunc); | ||
|
||
InputParameters | ||
ElectricalContactTestFunc::validParams() | ||
{ | ||
InputParameters params = Function::validParams(); | ||
params.addClassDescription(""); | ||
params.addParam<Real>("mechanical_pressure", | ||
3000., | ||
"Mechanical pressure uniformly applied at the contact surface area " | ||
"(Pressure = Force / Surface Area)."); | ||
params.addParam<Real>( | ||
"mean_hardness", 2.4797e9, "Geometric mean of the hardness of graphite and stainless steel."); | ||
params.addParam<Real>( | ||
"graphite_conductivity", 73069.2, "Conductivity in graphite (default at 300 K)."); | ||
params.addParam<Real>("stainless_steel_conductivity", | ||
1.41867e6, | ||
"Conductivity in stainless steel (default at 300 K)."); | ||
params.addParam<Real>("contact_conductance", | ||
75524., | ||
"Electrical contact conductance at the interface (default is at 300 K with " | ||
"3 kN/m^2 applied pressure)."); | ||
MooseEnum domain("stainless_steel graphite"); | ||
params.addParam<MooseEnum>("domain", domain, "Material domain / block of interest."); | ||
return params; | ||
} | ||
|
||
ElectricalContactTestFunc::ElectricalContactTestFunc(const InputParameters & parameters) | ||
: Function(parameters), | ||
_electrical_conductivity_graphite(getParam<Real>("graphite_conductivity")), | ||
_electrical_conductivity_stainless_steel(getParam<Real>("stainless_steel_conductivity")), | ||
_mean_hardness(getParam<Real>("mean_hardness")), | ||
_mechanical_pressure(getParam<Real>("mechanical_pressure")), | ||
_electrical_contact_conductance(getParam<Real>("contact_conductance")), | ||
_domain(getParam<MooseEnum>("domain")) | ||
{ | ||
} | ||
|
||
Real | ||
ElectricalContactTestFunc::value(Real /*t*/, const Point & p) const | ||
{ | ||
Real denominator = _electrical_contact_conductance * _electrical_conductivity_stainless_steel + | ||
_electrical_conductivity_graphite * _electrical_conductivity_stainless_steel + | ||
_electrical_conductivity_graphite * _electrical_contact_conductance; | ||
|
||
Real graphite_coefficient = | ||
-_electrical_contact_conductance * _electrical_conductivity_stainless_steel / denominator; | ||
|
||
Real stainless_steel_coefficient = | ||
-_electrical_contact_conductance * _electrical_conductivity_graphite / denominator; | ||
|
||
Real graphite_func = graphite_coefficient * (p(0) - 2); | ||
|
||
Real stainless_steel_func = stainless_steel_coefficient * p(0) + 1; | ||
|
||
/// Enum-to-enum comparisons are a bit more lightweight, so create another | ||
/// enum with the possible choices. | ||
enum DomainEnum | ||
{ | ||
STAINLESS_STEEL, | ||
GRAPHITE | ||
}; | ||
|
||
if (_domain == STAINLESS_STEEL) | ||
{ | ||
return stainless_steel_func; | ||
} | ||
else if (_domain == GRAPHITE) | ||
{ | ||
return graphite_func; | ||
} | ||
else | ||
{ | ||
mooseError(_name + ": Error in selecting proper domain in ElectricalContactTestFunc."); | ||
} | ||
} |