Skip to content
Permalink
Browse files

Merge pull request #13130 from bwspenc/gapcon_const

Add GapConductanceConstant and associated Action changes
  • Loading branch information...
permcody committed Apr 2, 2019
2 parents b1bea6b + d50627b commit 4e13dc3854b4e1941621123ef963f971e41b7eec
@@ -0,0 +1,18 @@
# GapConductanceConstant

## Description
The `GapConductanceConstant` material provides a user-specified, constant
gap condance that is used in thermal contact enforcement. This material
model is typically not directly specified by the user, but is created using
the `ThermalContactAction`, the details of which are documented in the
[ThermalContact](/ThermalContact/index.md) system documentation page.

!syntax description /Materials/GapConductance

!syntax parameters /Materials/GapConductance

!syntax inputs /Materials/GapConductance

!syntax children /Materials/GapConductance

!bibtex bibliography
@@ -0,0 +1,34 @@
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html

#ifndef GAPCONDUCTANCECONSTANT_H
#define GAPCONDUCTANCECONSTANT_H

#include "Material.h"

class GapConductanceConstant : public Material
{
public:
GapConductanceConstant(const InputParameters & parameters);

static InputParameters actionParameters();

virtual void computeQpProperties() override;

protected:
const Real & _prescribed_gap_conductance;
const std::string _appended_property_name;
MaterialProperty<Real> & _gap_conductance;
MaterialProperty<Real> & _gap_conductance_dT;
};

template <>
InputParameters validParams<GapConductanceConstant>();

#endif // GAPCONDUCTANCECONSTANT_H
@@ -13,6 +13,7 @@
#include "FEProblem.h"
#include "libmesh/string_to_enum.h"
#include "GapConductance.h"
#include "GapConductanceConstant.h"
#include "NonlinearSystem.h"

registerMooseAction("HeatConductionApp", ThermalContactAction, "add_aux_kernel");
@@ -83,6 +84,7 @@ validParams<ThermalContactAction>()
"Variable to be used in gap_conductivity_function in place of time");

params += GapConductance::actionParameters();
params += GapConductanceConstant::actionParameters();

return params;
}
@@ -241,32 +243,55 @@ ThermalContactAction::addMaterials()
if (getParam<std::string>("type") != "GapHeatTransfer")
return;

const std::string object_type = "GapConductance";

InputParameters params = _factory.getValidParams(object_type);
params.applyParameters(parameters(), {"variable"});

params.set<std::vector<VariableName>>("variable") = {getParam<NonlinearVariableName>("variable")};
params.set<std::vector<BoundaryName>>("boundary") = {getParam<BoundaryName>("slave")};

if (_quadrature)
if (parameters().isParamSetByUser("gap_conductance"))
{
params.set<BoundaryName>("paired_boundary") = getParam<BoundaryName>("master");
if (parameters().isParamSetByUser("gap_conductivity") ||
parameters().isParamSetByUser("gap_conductivity_function"))
mooseError(
"Cannot specify both gap_conductance and gap_conductivity or gap_conductivity_function");

const std::string object_type = "GapConductanceConstant";
InputParameters params = _factory.getValidParams(object_type);
params.applyParameters(parameters());
params.set<std::vector<BoundaryName>>("boundary") = {getParam<BoundaryName>("slave")};
_problem->addMaterial(object_type, name() + "_" + "gap_value", params);

if (_quadrature)
{
params.set<std::vector<BoundaryName>>("boundary") = {getParam<BoundaryName>("master")};
_problem->addMaterial(object_type, name() + "_" + "gap_value_master", params);
}
}
else
{
params.set<std::vector<VariableName>>("gap_temp") = {_gap_value_name};
params.set<std::vector<VariableName>>("gap_distance") = {"penetration"};
}
const std::string object_type = "GapConductance";

_problem->addMaterial(object_type, name() + "_" + "gap_value", params);
InputParameters params = _factory.getValidParams(object_type);
params.applyParameters(parameters(), {"variable"});

if (_quadrature)
{
params.set<BoundaryName>("paired_boundary") = getParam<BoundaryName>("slave");
params.set<std::vector<BoundaryName>>("boundary") = {getParam<BoundaryName>("master")};
params.set<std::vector<VariableName>>("variable") = {
getParam<NonlinearVariableName>("variable")};
params.set<std::vector<BoundaryName>>("boundary") = {getParam<BoundaryName>("slave")};

if (_quadrature)
{
params.set<BoundaryName>("paired_boundary") = getParam<BoundaryName>("master");
}
else
{
params.set<std::vector<VariableName>>("gap_temp") = {_gap_value_name};
params.set<std::vector<VariableName>>("gap_distance") = {"penetration"};
}

_problem->addMaterial(object_type, name() + "_" + "gap_value", params);

if (_quadrature)
{
params.set<BoundaryName>("paired_boundary") = getParam<BoundaryName>("slave");
params.set<std::vector<BoundaryName>>("boundary") = {getParam<BoundaryName>("master")};

_problem->addMaterial(object_type, name() + "_" + "gap_value_master", params);
_problem->addMaterial(object_type, name() + "_" + "gap_value_master", params);
}
}
}

@@ -0,0 +1,54 @@
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html

#include "GapConductanceConstant.h"

registerMooseObject("HeatConductionApp", GapConductanceConstant);

template <>
InputParameters
validParams<GapConductanceConstant>()
{
InputParameters params = validParams<Material>();
params += GapConductanceConstant::actionParameters();
// We can't just make it required in the first place because then it would always
// be required in the Action, even if this model isn't used.
params.makeParamRequired<Real>("gap_conductance");
params.addClassDescription("Material to compute a constant, prescribed gap conductance");

return params;
}

InputParameters
GapConductanceConstant::actionParameters()
{
InputParameters params = emptyInputParameters();
params.addParam<std::string>(
"appended_property_name", "", "Name appended to material properties to make them unique");
params.addParam<Real>("gap_conductance", 0.0, "Gap conductance");
return params;
}

GapConductanceConstant::GapConductanceConstant(const InputParameters & params)
: Material(params),
_prescribed_gap_conductance(getParam<Real>("gap_conductance")),
_appended_property_name(getParam<std::string>("appended_property_name")),
_gap_conductance(declareProperty<Real>("gap_conductance" + _appended_property_name)),
_gap_conductance_dT(declareProperty<Real>("gap_conductance" + _appended_property_name + "_dT"))
{
if (!params.isParamSetByUser("gap_conductance"))
mooseError("gap_conductance must be specified");
}

void
GapConductanceConstant::computeQpProperties()
{
_gap_conductance[_qp] = _prescribed_gap_conductance;
_gap_conductance_dT[_qp] = 0.0;
}
@@ -0,0 +1,73 @@
[Mesh]
type = FileMesh
file = meshed_gap.e
dim = 2
[]

[Variables]
[./temp]
block = '1 3'
initial_condition = 1.0
[../]
[]

[Kernels]
[./hc]
type = HeatConduction
variable = temp
block = '1 3'
[../]
[]

[BCs]
[./left]
type = DirichletBC
variable = temp
boundary = 1
value = 1
[../]
[./right]
type = DirichletBC
variable = temp
boundary = 4
value = 2
[../]
[]

[ThermalContact]
[./gap_conductance]
type = GapHeatTransfer
variable = temp
master = 2
slave = 3
gap_conductance = 2.5
[../]
[]

[Materials]
[./hcm]
type = HeatConductionMaterial
block = '1 3'
temp = temp
thermal_conductivity = 1
[../]
[]

[Problem]
type = FEProblem
kernel_coverage_check = false
material_coverage_check = false
[]

[Executioner]
type = Steady
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]

[Outputs]
[./out]
type = Exodus
[../]
[]
@@ -9,6 +9,28 @@
across a meshed gap in a 2D plane geometry."
[../]

[./constant_conductance]
type = 'Exodiff'
input = 'meshed_gap_thermal_contact_constant_conductance.i'
exodiff = 'meshed_gap_thermal_contact_constant_conductance_out.e'
issues = '#13061'
design = 'syntax/ThermalContact/index.md source/materials/GapConductanceConstant.md'
requirement = "The ThermalContact system shall correctly enforce heat transfer
across a meshed gap in a 2D plane geometry using a prescribed constant conductance."
[../]

[./constant_conductance_quadrature]
prereq = constant_conductance
type = 'Exodiff'
input = 'meshed_gap_thermal_contact_constant_conductance.i'
cli_args = 'ThermalContact/gap_conductance/quadrature=true Outputs/file_base=meshed_gap_thermal_contact_constant_conductance_quadrature_out'
exodiff = 'meshed_gap_thermal_contact_constant_conductance_quadrature_out.e'
issues = '#13061'
design = 'syntax/ThermalContact/index.md source/materials/GapConductanceConstant.md'
requirement = "The ThermalContact system shall correctly enforce heat transfer
across a meshed gap in a 2D plane geometry using a prescribed constant conductance with the quadrature option"
[../]

[./annulus]
type = 'Exodiff'
input = 'meshed_annulus_thermal_contact.i'

0 comments on commit 4e13dc3

Please sign in to comment.
You can’t perform that action at this time.