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