https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
AntitrappingCurrent Class Reference

This calculates a modified coupled time derivative that multiplies the time derivative of a coupled variable by a function of the variables and interface normal. More...

#include <AntitrappingCurrent.h>

Inheritance diagram for AntitrappingCurrent:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 AntitrappingCurrent (const InputParameters &parameters)
 
virtual void initialSetup ()
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialPropertyByName (const std::string &name)
 
void validateDerivativeMaterialPropertyBase (const std::string &base)
 
const MaterialPropertyName derivativePropertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName derivativePropertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName derivativePropertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName derivativePropertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

virtual Real computeQpResidual ()
 
virtual Real computeQpJacobian ()
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar)
 

Protected Attributes

const VariableGradient_grad_v
 
const MaterialProperty< Real > & _F
 The function multiplied by the coupled time derivative. More...
 
const MaterialProperty< Real > & _dFdu
 function derivative w.r.t. the kernel variable More...
 
std::vector< const MaterialProperty< Real > * > _dFdarg
 function derivatives w.r.t. coupled variables More...
 

Detailed Description

This calculates a modified coupled time derivative that multiplies the time derivative of a coupled variable by a function of the variables and interface normal.

Definition at line 18 of file AntitrappingCurrent.h.

Constructor & Destructor Documentation

◆ AntitrappingCurrent()

AntitrappingCurrent::AntitrappingCurrent ( const InputParameters parameters)

Definition at line 23 of file AntitrappingCurrent.C.

24  : CoupledSusceptibilityTimeDerivative(parameters), _grad_v(coupledGradient("v"))
25 {
26 }
const VariableGradient & _grad_v
CoupledSusceptibilityTimeDerivative(const InputParameters &parameters)

Member Function Documentation

◆ computeQpJacobian()

Real AntitrappingCurrent::computeQpJacobian ( )
protectedvirtual

Reimplemented from CoupledSusceptibilityTimeDerivative.

Definition at line 39 of file AntitrappingCurrent.C.

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 }
static constexpr Real TOLERANCE
const VariableGradient & _grad_v
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const MaterialProperty< Real > & _dFdu
function derivative w.r.t. the kernel variable
auto norm_sq(const T &a) -> decltype(std::norm(a))

◆ computeQpOffDiagJacobian()

Real AntitrappingCurrent::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Reimplemented from CoupledSusceptibilityTimeDerivative.

Definition at line 50 of file AntitrappingCurrent.C.

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 }
static constexpr Real TOLERANCE
std::vector< const MaterialProperty< Real > * > _dFdarg
function derivatives w.r.t. coupled variables
const VariableGradient & _grad_v
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
auto norm_sq(const T &a) -> decltype(std::norm(a))
const MaterialProperty< Real > & _F
The function multiplied by the coupled time derivative.

◆ computeQpResidual()

Real AntitrappingCurrent::computeQpResidual ( )
protectedvirtual

Reimplemented from CoupledSusceptibilityTimeDerivative.

Definition at line 29 of file AntitrappingCurrent.C.

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 }
static constexpr Real TOLERANCE
const VariableGradient & _grad_v
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
auto norm_sq(const T &a) -> decltype(std::norm(a))
const MaterialProperty< Real > & _F
The function multiplied by the coupled time derivative.

◆ initialSetup()

void CoupledSusceptibilityTimeDerivative::initialSetup ( )
virtualinherited

Definition at line 38 of file CoupledSusceptibilityTimeDerivative.C.

39 {
40  validateNonlinearCoupling<Real>("f_name");
41 }

◆ validParams()

InputParameters AntitrappingCurrent::validParams ( )
static

Definition at line 15 of file AntitrappingCurrent.C.

16 {
18  params.addClassDescription(
19  "Kernel that provides antitrapping current at the interface for alloy solidification");
20  return params;
21 }
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _dFdarg

std::vector<const MaterialProperty<Real> *> CoupledSusceptibilityTimeDerivative::_dFdarg
protectedinherited

◆ _dFdu

const MaterialProperty<Real>& CoupledSusceptibilityTimeDerivative::_dFdu
protectedinherited

function derivative w.r.t. the kernel variable

Definition at line 39 of file CoupledSusceptibilityTimeDerivative.h.

Referenced by computeQpJacobian(), and CoupledSusceptibilityTimeDerivative::computeQpJacobian().

◆ _F

const MaterialProperty<Real>& CoupledSusceptibilityTimeDerivative::_F
protectedinherited

◆ _grad_v

const VariableGradient& AntitrappingCurrent::_grad_v
protected

The documentation for this class was generated from the following files: