https://mooseframework.inl.gov
Loading...
Searching...
No Matches
GrainBoundaryVelocity.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
13
16{
18 params.addClassDescription("Compute the velocity of grain boundaries.");
19 params.addParam<Real>("eta_bottom", 0.20, "start point on range of eta we are interested in.");
20 params.addParam<Real>("eta_top", 0.80, "end point on range of eta we are interested in.");
22 "v", "var_name_base", "op_num", "Array of coupled variables");
23 return params;
24}
25
27 : AuxKernel(parameters),
28 _eta_bottom(getParam<Real>("eta_bottom")),
29 _eta_top(getParam<Real>("eta_top")),
30 _op_num(coupledComponents("v")),
31 _eta(coupledValues("v")),
32 _deta_dt(coupledDots("v")),
33 _grad_eta(coupledGradients("v"))
34{
35}
36
37Real
39{
40 _value = 0.0;
41 _new_val = 0.0;
42 for (unsigned int i = 0; i < _op_num; ++i)
43 {
44 // To make sure we are getting data from the range that we want
45 if ((*_eta[i])[_qp] > _eta_bottom && (*_eta[i])[_qp] < _eta_top)
46 _new_val = 1.0 / (*_grad_eta[i])[_qp].norm() * (*_deta_dt[i])[_qp];
47 // our calculation
48 if (_new_val > _value)
50 }
51
52 return _value;
53}
registerMooseObject("PhaseFieldApp", GrainBoundaryVelocity)
static InputParameters validParams()
static InputParameters validParams()
const std::vector< const VariableValue * > _eta
virtual Real computeValue() override
const std::vector< const VariableValue * > _deta_dt
GrainBoundaryVelocity(const InputParameters &parameters)
const std::vector< const VariableGradient * > _grad_eta
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 addRequiredCoupledVarWithAutoBuild(const std::string &name, const std::string &base_name, const std::string &num_name, const std::string &doc_string)