Skip to content

Commit

Permalink
Correctly handle user-set gap_geometry_type closes idaholab#9578
Browse files Browse the repository at this point in the history
  • Loading branch information
bwspenc authored and liuusu committed Oct 4, 2017
1 parent bff023b commit b01226f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 48 deletions.
2 changes: 1 addition & 1 deletion modules/heat_conduction/include/bcs/GapHeatTransfer.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class GapHeatTransfer : public IntegratedBC
public:
GapHeatTransfer(const InputParameters & parameters);

virtual void computeResidual() override;
virtual void initialSetup() override;

protected:
virtual Real computeQpResidual() override;
Expand Down
2 changes: 1 addition & 1 deletion modules/heat_conduction/include/materials/GapConductance.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class GapConductance : public Material
Real & r2,
Real & radius);

virtual void computeProperties() override;
virtual void initialSetup() override;

protected:
virtual void computeQpProperties() override;
Expand Down
2 changes: 2 additions & 0 deletions modules/heat_conduction/src/actions/ThermalContactBCsAction.C
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "MooseApp.h"
#include "Conversion.h"
#include "AddVariableAction.h"
#include "GapConductance.h"

template <>
InputParameters
Expand Down Expand Up @@ -45,6 +46,7 @@ validParams<ThermalContactBCsAction>()
"save_in", "The Auxiliary Variable to (optionally) save the boundary flux in");
params.addParam<bool>(
"quadrature", false, "Whether or not to use quadrature point based gap heat transfer");
params += GapConductance::actionParameters();

return params;
}
Expand Down
12 changes: 3 additions & 9 deletions modules/heat_conduction/src/bcs/GapHeatTransfer.C
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,10 @@ GapHeatTransfer::GapHeatTransfer(const InputParameters & parameters)
}

void
GapHeatTransfer::computeResidual()
GapHeatTransfer::initialSetup()
{
if (!_gap_geometry_params_set)
{
_gap_geometry_params_set = true;
GapConductance::setGapGeometryParameters(
_pars, _assembly.coordSystem(), _gap_geometry_type, _p1, _p2);
}

IntegratedBC::computeResidual();
GapConductance::setGapGeometryParameters(
_pars, _assembly.coordSystem(), _gap_geometry_type, _p1, _p2);
}

Real
Expand Down
43 changes: 6 additions & 37 deletions modules/heat_conduction/src/materials/GapConductance.C
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,6 @@ validParams<GapConductance>()
"then required.");
params.addParam<BoundaryName>("paired_boundary", "The boundary to be penetrated");

// Deprecated parameter
MooseEnum coord_types("default XYZ");
params.addDeprecatedParam<MooseEnum>(
"coord_type",
coord_types,
"Gap calculation type (default or XYZ).",
"The functionality of this parameter is replaced by 'gap_geometry_type'.");

params.addParam<Real>("stefan_boltzmann", 5.669e-8, "The Stefan-Boltzmann constant");

params.addParam<bool>("use_displaced_mesh",
Expand Down Expand Up @@ -168,6 +160,12 @@ GapConductance::GapConductance(const InputParameters & parameters)
}
}

void
GapConductance::initialSetup()
{
setGapGeometryParameters(_pars, _coord_sys, _gap_geometry_type, _p1, _p2);
}

void
GapConductance::setGapGeometryParameters(const InputParameters & params,
const Moose::CoordinateSystemType coord_sys,
Expand All @@ -179,23 +177,6 @@ GapConductance::setGapGeometryParameters(const InputParameters & params,
{
gap_geometry_type =
GapConductance::GAP_GEOMETRY(int(params.get<MooseEnum>("gap_geometry_type")));
if (params.isParamSetByUser("coord_type"))
::mooseError("Deprecated parameter 'coord_type' cannot be used together with "
"'gap_geometry_type' in GapConductance");
}
else if (params.isParamSetByUser("coord_type"))
{
if (params.get<MooseEnum>("coord_type") == "XYZ")
gap_geometry_type = GapConductance::PLATE;
else
{
if (coord_sys == Moose::COORD_XYZ)
gap_geometry_type = GapConductance::PLATE;
else if (coord_sys == Moose::COORD_RZ)
gap_geometry_type = GapConductance::CYLINDER;
else if (coord_sys == Moose::COORD_RSPHERICAL)
gap_geometry_type = GapConductance::SPHERE;
}
}
else
{
Expand Down Expand Up @@ -257,18 +238,6 @@ GapConductance::setGapGeometryParameters(const InputParameters & params,
}
}

void
GapConductance::computeProperties()
{
if (!_gap_geometry_params_set)
{
_gap_geometry_params_set = true;
setGapGeometryParameters(_pars, _coord_sys, _gap_geometry_type, _p1, _p2);
}

Material::computeProperties();
}

void
GapConductance::computeQpProperties()
{
Expand Down

0 comments on commit b01226f

Please sign in to comment.