https://mooseframework.inl.gov
AzimuthMagneticTimeDerivRZ.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 
12 registerMooseObject("ElectromagneticsApp", AzimuthMagneticTimeDerivRZ);
13 
16 {
18  params.addClassDescription(
19  "Computes the time derivative of the azimuthal component "
20  "of the magnetic field assuming cylindrical electric field. The electric field can "
21  "be supplied as a vector or scalar components.");
22  params.addCoupledVar("Efield", "The electric field vector");
23  params.addCoupledVar("Efield_X", "The x-component of the electric field");
24  params.addCoupledVar("Efield_Y", "The y-component of the electric field");
25  return params;
26 }
27 
29  : AuxKernel(parameters),
30  _is_efield_vector(isCoupled("Efield")),
31  _is_efield_scalar(isCoupled("Efield_X") && isCoupled("Efield_Y")),
32  _efield_curl(_is_efield_vector ? coupledCurl("Efield") : _vector_curl_zero),
33  _efield_x_grad(_is_efield_scalar ? coupledGradient("Efield_X") : _grad_zero),
34  _efield_y_grad(_is_efield_scalar ? coupledGradient("Efield_Y") : _grad_zero)
35 {
37  {
38  mooseError("Both a vector and scalar components of the electric field were provided! Please "
39  "only choose one.");
40  }
41 
43  {
44  mooseError("Neither a vector nor two scalar components of the electric field were provided! "
45  "Please check the input parameters.");
46  }
47 }
48 
49 Real
51 {
53  {
54  /* NOTE: The curl for a axisymmetric cylindrical vector is equal and opposite to
55  * the curl for 2D cartesian vector, such that:
56  * curl u_z = - curl u_theta
57  * For Faraday's law of induction, this means we use the positive Cartesian curl,
58  * in place of the negative axisymmetric cylindrical curl.
59  */
60  return _efield_curl[_qp](2);
61  }
62  else
63  {
64  return -(_efield_x_grad[_qp](1) - _efield_y_grad[_qp](0));
65  }
66 }
AzimuthMagneticTimeDerivRZ(const InputParameters &parameters)
Computes the time derivative of the azimuthal component of the magnetic field assuming cylindrical el...
virtual Real computeValue() override
const bool _is_efield_scalar
True if both the x- & y- component of the electric field were provided.
void addCoupledVar(const std::string &name, const std::string &doc_string)
registerMooseObject("ElectromagneticsApp", AzimuthMagneticTimeDerivRZ)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const VectorVariableCurl & _efield_curl
Curl of the electric field vector.
void mooseError(Args &&... args) const
const bool _is_efield_vector
True if the vector of the electric field was provided.
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
const VariableGradient & _efield_y_grad
Gradient of the y-component of the electric field.
static InputParameters validParams()
const VariableGradient & _efield_x_grad
Gradient of the x-component of the electric field.