https://mooseframework.inl.gov
Loading...
Searching...
No Matches
AntitrappingCurrent.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 "AntitrappingCurrent.h"
11
13
16{
19 "Kernel that provides antitrapping current at the interface for alloy solidification");
20 return params;
21}
22
24 : CoupledSusceptibilityTimeDerivative(parameters), _grad_v(coupledGradient("v"))
25{
26}
27
28Real
30{
31 const Real norm_sq = _grad_v[_qp].norm_sq();
32 if (norm_sq < libMesh::TOLERANCE)
33 return 0.0;
34
35 return _F[_qp] * _v_dot[_qp] * _grad_v[_qp] * _grad_test[_i][_qp] / std::sqrt(norm_sq);
36}
37
38Real
40{
41 const Real norm_sq = _grad_v[_qp].norm_sq();
42 if (norm_sq < libMesh::TOLERANCE)
43 return 0.0;
44
45 return _dFdu[_qp] * _v_dot[_qp] * _grad_v[_qp] * _grad_test[_i][_qp] * _phi[_j][_qp] /
46 std::sqrt(norm_sq);
47}
48
49Real
51{
52 const Real norm_sq = _grad_v[_qp].norm_sq();
53 if (norm_sq < libMesh::TOLERANCE)
54 return 0.0;
55
56 // get the coupled variable jvar is referring to
57 const unsigned int cvar = mapJvarToCvar(jvar);
58
59 if (jvar == _v_var)
60 return (_F[_qp] * _dv_dot[_qp] * _grad_v[_qp] * _grad_test[_i][_qp] * _phi[_j][_qp] +
61 _F[_qp] * _v_dot[_qp] * _grad_test[_i][_qp] * _grad_phi[_j][_qp] -
62 _F[_qp] * _v_dot[_qp] * _grad_v[_qp] * _grad_test[_i][_qp] * _grad_v[_qp] *
63 _grad_phi[_j][_qp] / norm_sq +
64 _v_dot[_qp] * _grad_v[_qp] * _grad_test[_i][_qp] * _phi[_j][_qp] *
65 (*_dFdarg[cvar])[_qp]) /
66 std::sqrt(norm_sq);
67
68 return _v_dot[_qp] * _grad_v[_qp] * _grad_test[_i][_qp] * _phi[_j][_qp] * (*_dFdarg[cvar])[_qp] /
69 std::sqrt(norm_sq);
70}
registerMooseObject("PhaseFieldApp", AntitrappingCurrent)
This calculates a modified coupled time derivative that multiplies the time derivative of a coupled v...
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
static InputParameters validParams()
virtual Real computeQpJacobian()
const VariableGradient & _grad_v
AntitrappingCurrent(const InputParameters &parameters)
virtual Real computeQpResidual()
This calculates a modified coupled time derivative that multiplies the time derivative of a coupled v...
std::vector< const MaterialProperty< Real > * > _dFdarg
function derivatives w.r.t. coupled variables
const MaterialProperty< Real > & _F
The function multiplied by the coupled time derivative.
const MaterialProperty< Real > & _dFdu
function derivative w.r.t. the kernel variable
void addClassDescription(const std::string &doc_string)
static constexpr Real TOLERANCE