www.mooseframework.org
FluxBasedStrainIncrement.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
8 #include "libmesh/quadrature.h"
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<Material>();
15  params.addClassDescription("Compute strain increment based on flux");
16  params.addRequiredCoupledVar("xflux", "x or 0-direction component of flux");
17  params.addCoupledVar("yflux", "y or 1-direction component of flux");
18  params.addCoupledVar("zflux", "z or 2-direction component of flux");
19  params.addCoupledVar("gb", "Grain boundary order parameter");
20  params.addRequiredParam<MaterialPropertyName>("property_name",
21  "Name of diffusive strain increment property");
22  return params;
23 }
24 
25 FluxBasedStrainIncrement::FluxBasedStrainIncrement(const InputParameters & parameters)
26  : DerivativeMaterialInterface<Material>(parameters),
27  _grad_jx(&coupledGradient("xflux")),
28  _has_yflux(isCoupled("yflux")),
29  _has_zflux(isCoupled("zflux")),
30  _grad_jy(_has_yflux ? &coupledGradient("yflux") : NULL),
31  _grad_jz(_has_zflux ? &coupledGradient("zflux") : NULL),
32  _gb(isCoupled("gb") ? coupledValue("gb") : _zero),
33  _strain_increment(
34  declareProperty<RankTwoTensor>(getParam<MaterialPropertyName>("property_name")))
35 {
36 }
37 
38 void
40 {
41  _strain_increment[_qp].zero();
42 }
43 
44 void
46 {
48 
49  _strain_increment[_qp] = -0.5 * (_flux_grad_tensor + _flux_grad_tensor.transpose());
50  _strain_increment[_qp] *= (1.0 - _gb[_qp]) * _dt;
51 }
52 
53 void
55 {
56  _flux_grad_tensor.zero();
57 
58  _flux_grad_tensor.fillRow(0, (*_grad_jx)[_qp]);
59 
60  if (_has_yflux)
61  _flux_grad_tensor.fillRow(1, (*_grad_jy)[_qp]);
62 
63  if (_has_zflux)
64  _flux_grad_tensor.fillRow(2, (*_grad_jz)[_qp]);
65 }
const VariableGradient * _grad_jx
const VariableGradient * _grad_jz
MaterialProperty< RankTwoTensor > & _strain_increment
const VariableGradient * _grad_jy
FluxBasedStrainIncrement(const InputParameters &parameters)
InputParameters validParams< FluxBasedStrainIncrement >()