Skip to content

Commit

Permalink
Add electrical contact analytical function test object (idaholab#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
cticenhour committed Apr 18, 2021
1 parent 578db88 commit b4eac4b
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 0 deletions.
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;
};
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.");
}
}

0 comments on commit b4eac4b

Please sign in to comment.