www.mooseframework.org
ComputeSurfaceTensionKKS.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 
11 #include "RankTwoTensor.h"
12 
13 registerMooseObject("TensorMechanicsApp", ComputeSurfaceTensionKKS);
14 
15 template <>
16 InputParameters
18 {
19  InputParameters params = validParams<Material>();
20  params.addClassDescription(
21  "Surface tension of an interface defined by the gradient of an order parameter");
22  params.addCoupledVar("v",
23  "Order parameter that defines the interface, assumed to vary from 0 to 1.");
24  params.addParam<MaterialPropertyName>("kappa_name", "kappa_op", "Gradient energy coefficient");
25  params.addParam<MaterialPropertyName>("g", "g", "Barrier Function Material that provides g(eta)");
26  params.addRequiredParam<Real>("w", "Double well height parameter");
27  params.addParam<MaterialPropertyName>("planar_stress_name",
28  "extra_stress",
29  "Material property name for the interfacial planar stress");
30  return params;
31 }
32 
33 ComputeSurfaceTensionKKS::ComputeSurfaceTensionKKS(const InputParameters & parameters)
34  : Material(parameters),
35  _v(coupledValue("v")),
36  _grad_v(coupledGradient("v")),
37  _kappa(getMaterialProperty<Real>("kappa_name")),
38  _g(getMaterialProperty<Real>("g")),
39  _w(getParam<Real>("w")),
40  _planar_stress(
41  declareProperty<RankTwoTensor>(getParam<MaterialPropertyName>("planar_stress_name")))
42 {
43 }
44 
45 void
47 {
48  auto & S = _planar_stress[_qp];
49  S.zero();
50 
51  // compute norm square of the order parameter gradient
52  const Real grad_norm_sq = _grad_v[_qp].norm_sq();
53 
54  const Real nx = _grad_v[_qp](0);
55  const Real ny = _grad_v[_qp](1);
56  const Real nz = _grad_v[_qp](2);
57  Real fsum = _w * _g[_qp] + 0.5 * _kappa[_qp] * grad_norm_sq;
58 
59  S(0, 0) += fsum - _kappa[_qp] * nx * nx;
60  S(0, 1) += -_kappa[_qp] * nx * ny;
61  S(1, 1) += fsum - _kappa[_qp] * ny * ny;
62  S(0, 2) += -_kappa[_qp] * nx * nz;
63  S(1, 2) += -_kappa[_qp] * ny * nz;
64  S(2, 2) += fsum - _kappa[_qp] * nz * nz;
65 
66  // fill in symmetrically
67  S(1, 0) = S(0, 1);
68  S(2, 0) = S(0, 2);
69  S(2, 1) = S(1, 2);
70 }
Real _w
double well height parameter
virtual void computeQpProperties() override
registerMooseObject("TensorMechanicsApp", ComputeSurfaceTensionKKS)
MaterialProperty< RankTwoTensor > & _planar_stress
const MaterialProperty< Real > & _kappa
Material property for gradient energy coefficient.
ComputeSurfaceTensionKKS(const InputParameters &parameters)
const MaterialProperty< Real > & _g
Material property for barrier function.
InputParameters validParams< ComputeSurfaceTensionKKS >()
const VariableGradient & _grad_v
Gradient of order parameter.