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