23 "First order Robin-style Absorbing/Port BC for scalar variables, assuming plane waves.");
28 params.
addParam<FunctionName>(
"func_real", 1.0,
"Function coefficient, real component.");
29 params.
addParam<FunctionName>(
"func_imag", 0.0,
"Function coefficient, imaginary component.");
30 params.
addParam<FunctionName>(
"profile_func_real", 1.0,
"Function coefficient, real component.");
32 "profile_func_imag", 0.0,
"Function coefficient, imaginary component.");
33 params.
addParam<
Real>(
"coeff_real", 1.0,
"Constant coefficient, real component.");
34 params.
addParam<
Real>(
"coeff_imag", 0.0,
"Constant coefficient, real component.");
40 "Mode of operation for EMRobinBC. Can be set to 'absorbing' or 'port' " 41 "(default: 'port').");
47 _field_real(adCoupledValue(
"field_real")),
48 _field_imag(adCoupledValue(
"field_imaginary")),
49 _component(getParam<
MooseEnum>(
"component")),
50 _func_real(getFunction(
"func_real")),
51 _func_imag(getFunction(
"func_imag")),
52 _profile_func_real(getFunction(
"profile_func_real")),
53 _profile_func_imag(getFunction(
"profile_func_imag")),
54 _coeff_real(getParam<
Real>(
"coeff_real")),
55 _coeff_imag(getParam<
Real>(
"coeff_imag")),
62 if (
_mode ==
EM::ABSORBING && (profile_func_real_was_set || profile_func_imag_was_set))
66 ", mode was set to Absorbing, while an incoming profile function (used for Port BCs) was " 67 "defined. Either remove the profile function parameters, or set your BC to Port mode!");
79 std::complex<double> common =
EM::j * coeff * func;
83 std::complex<double> rhs = 0.0;
87 rhs = 2.0 * common * profile_func * std::exp(common *
_q_point[
_qp](0));
93 ADReal diff_real = rhs.real() - lhs_real;
94 ADReal diff_imag = rhs.imag() - lhs_imag;
const Function & _func_imag
Imaginary component of the function coefficient representing the wavenumber.
static const std::string component
const ADVariableValue & _field_real
Real component of the electric field.
const Function & _profile_func_real
Real component of the incoming wave function amplitude.
const MooseEnum _mode
Enum for selection of boundary condition mode: absorbing or port (Default = port) ...
const MooseEnum _sign
Scalar value representing the sign of the term in the weak form.
DualNumber< Real, DNDerivativeType, true > ADReal
static InputParameters validParams()
EMRobinBC(const InputParameters ¶meters)
const MooseArray< Point > & _q_point
Case when the boundary is configured to absorb impinging electromagnetic radiation.
static InputParameters validParams()
const Real _coeff_real
Real component of the constant coefficient representing the wavenumber.
const Function & _profile_func_imag
Imaginary component of the incoming wave function amplitude.
Case when the boundary is configured to both absorb impinging electromagnetic radiation and launch an...
Represents the boundary condition for a first order Robin-style Absorbing/Port boundary for scalar va...
const ADVariableValue & _field_imag
Imaginary component of the electric field.
registerMooseObject("ElectromagneticsApp", EMRobinBC)
virtual ADReal computeQpResidual() override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const ADTemplateVariableTestValue< T > & _test
const Real _coeff_imag
Imaginary component of the constant coefficient representing the wavenumber.
void mooseError(Args &&... args) const
const MooseEnum _component
Enum for selection of real or imaginary component of the field wave.
const InputParameters & parameters() const
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
const Function & _func_real
Real component of the function coefficient representing the wavenumber.
virtual Real value(Real t, const Point &p) const