www.mooseframework.org
ThermalMaterialBaseBPD.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
10 #include "ThermalMaterialBaseBPD.h"
11 #include "MooseVariable.h"
12 #include "Function.h"
13 #include "Assembly.h"
14 
15 #include "libmesh/quadrature.h"
16 
17 template <>
18 InputParameters
20 {
21  InputParameters params = validParams<PeridynamicsMaterialBase>();
22  params.addClassDescription("Base class for bond-based peridynamic thermal models");
23 
24  params.addRequiredCoupledVar("temperature", "Nonlinear variable name for the temperature");
25  params.addRequiredParam<MaterialPropertyName>("thermal_conductivity",
26  "Name of material defining thermal conductivity");
27 
28  return params;
29 }
30 
31 ThermalMaterialBaseBPD::ThermalMaterialBaseBPD(const InputParameters & parameters)
32  : PeridynamicsMaterialBase(parameters),
33  _temp_var(getVar("temperature", 0)),
34  _temp(2),
35  _bond_heat_flow(declareProperty<Real>("bond_heat_flow")),
36  _bond_dQdT(declareProperty<Real>("bond_dQdT")),
37  _thermal_conductivity(getMaterialProperty<Real>("thermal_conductivity"))
38 {
39 }
40 
41 void
43 {
44  setupMeshRelatedData(); // function from base class
45 
46  Real ave_thermal_conductivity = 0.0;
47  for (unsigned int qp = 0; qp < _qrule->n_points(); ++qp)
48  ave_thermal_conductivity += _thermal_conductivity[qp] * _JxW[qp] * _coord[qp];
49  ave_thermal_conductivity /= _assembly.elemVolume();
50 
51  // nodal temperature
52  _temp[0] = _temp_var->getNodalValue(*_current_elem->node_ptr(0));
53  _temp[1] = _temp_var->getNodalValue(*_current_elem->node_ptr(1));
54 
55  // compute peridynamic micro-conductivity: _Kij
56  computePeridynamicsParams(ave_thermal_conductivity);
57 
58  for (_qp = 0; _qp < _nnodes; ++_qp)
59  {
60  // residual term
61  _bond_heat_flow[_qp] =
62  _Kij * (_temp[1] - _temp[0]) / _origin_length * _node_vol[0] * _node_vol[1];
63 
64  // derivative of the residual term
65  _bond_dQdT[_qp] = -_Kij / _origin_length * _node_vol[0] * _node_vol[1];
66  }
67 }
PeridynamicsMaterialBase::_origin_length
Real _origin_length
Definition: PeridynamicsMaterialBase.h:43
ThermalMaterialBaseBPD::_Kij
Real _Kij
Micro-conductivity.
Definition: ThermalMaterialBaseBPD.h:51
PeridynamicsMaterialBase::_nnodes
const unsigned int _nnodes
Definition: PeridynamicsMaterialBase.h:37
ThermalMaterialBaseBPD::_thermal_conductivity
const MaterialProperty< Real > & _thermal_conductivity
Thermal conductivity.
Definition: ThermalMaterialBaseBPD.h:48
ThermalMaterialBaseBPD.h
PeridynamicsMaterialBase::setupMeshRelatedData
void setupMeshRelatedData()
Function to setup mesh related data to be used in this class.
Definition: PeridynamicsMaterialBase.C:34
ThermalMaterialBaseBPD::_temp
std::vector< Real > _temp
Definition: ThermalMaterialBaseBPD.h:39
ThermalMaterialBaseBPD::_bond_heat_flow
MaterialProperty< Real > & _bond_heat_flow
Material properties to be stored.
Definition: ThermalMaterialBaseBPD.h:43
validParams< ThermalMaterialBaseBPD >
InputParameters validParams< ThermalMaterialBaseBPD >()
Definition: ThermalMaterialBaseBPD.C:19
PeridynamicsMaterialBase::_node_vol
std::vector< Real > _node_vol
Definition: PeridynamicsMaterialBase.h:39
PeridynamicsMaterialBase
Base class for peridynamics material models.
Definition: PeridynamicsMaterialBase.h:23
ThermalMaterialBaseBPD::computePeridynamicsParams
virtual void computePeridynamicsParams(const Real ave_thermal_conductivity)=0
Function to compute micro-conductivity.
ThermalMaterialBaseBPD::_bond_dQdT
MaterialProperty< Real > & _bond_dQdT
Definition: ThermalMaterialBaseBPD.h:44
ThermalMaterialBaseBPD::_temp_var
MooseVariable * _temp_var
Temperature variable and values.
Definition: ThermalMaterialBaseBPD.h:38
ThermalMaterialBaseBPD::ThermalMaterialBaseBPD
ThermalMaterialBaseBPD(const InputParameters &parameters)
Definition: ThermalMaterialBaseBPD.C:31
ThermalMaterialBaseBPD::computeProperties
virtual void computeProperties() override
Definition: ThermalMaterialBaseBPD.C:42
validParams< PeridynamicsMaterialBase >
InputParameters validParams< PeridynamicsMaterialBase >()
Definition: PeridynamicsMaterialBase.C:14