https://mooseframework.inl.gov
ThermalSensitivity.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 
10 #include "ThermalSensitivity.h"
11 
12 registerMooseObject("HeatTransferApp", ThermalSensitivity);
13 
16 {
18  params.addClassDescription("Computes cost sensitivity needed for multimaterial SIMP method.");
19  params.addRequiredCoupledVar("design_density", "Design density variable name.");
20  params.addRequiredCoupledVar("temperature", "temperature");
21  params.addRequiredParam<MaterialPropertyName>("thermal_conductivity",
22  "DerivativeParsedMaterial for cost of materials.");
23  return params;
24 }
25 
28  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
29  _sensitivity(declareProperty<Real>(_base_name + "thermal_sensitivity")),
30  _design_density(coupledValue("design_density")),
31  _design_density_name(coupledName("design_density", 0)),
32  _grad_temperature(coupledGradient("temperature")),
33  _thermal_conductivity(
34  getMaterialPropertyByName<Real>(getParam<MaterialPropertyName>("thermal_conductivity"))),
35  _dTdp(getMaterialPropertyDerivativeByName<Real>(
36  getParam<MaterialPropertyName>("thermal_conductivity"), _design_density_name))
37 {
38 }
39 
40 void
42 {
43  const Real thermal_compliance =
45  _sensitivity[_qp] = -_dTdp[_qp] * thermal_compliance / _thermal_conductivity[_qp];
46 }
Computes heat conduction compliance derivative with respect to a variable contained in a parsed mater...
registerMooseObject("HeatTransferApp", ThermalSensitivity)
const MaterialProperty< Real > & _dTdp
Derivative with respect to pseudo-density obtained via derivative parsed material.
void addRequiredParam(const std::string &name, const std::string &doc_string)
static InputParameters validParams()
virtual void computeQpProperties() override
const MaterialProperty< Real > & _thermal_conductivity
Thermal conductivity material.
const VariableGradient & _grad_temperature
Temperature gradient vector.
ThermalSensitivity(const InputParameters &parameters)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
MaterialProperty< Real > & _sensitivity
Sensitivity material generated by this object.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)