- eps_rel_imagRelative permittivity, imaginary component.
C++ Type:MaterialPropertyName
Unit:(no unit assumed)
Controllable:No
Description:Relative permittivity, imaginary component.
- eps_rel_realRelative permittivity, real component.
C++ Type:MaterialPropertyName
Unit:(no unit assumed)
Controllable:No
Description:Relative permittivity, real component.
- k_realWave number, real component.
C++ Type:MaterialPropertyName
Unit:(no unit assumed)
Controllable:No
Description:Wave number, real component.
- mu_rel_imagRelative permeability, imaginary component.
C++ Type:MaterialPropertyName
Unit:(no unit assumed)
Controllable:No
Description:Relative permeability, imaginary component.
- mu_rel_realRelative permeability, real component.
C++ Type:MaterialPropertyName
Unit:(no unit assumed)
Controllable:No
Description:Relative permeability, real component.
WaveEquationCoefficient
Material for use as coefficient (where a is a scalar coefficient) in standard-form Helmholtz wave equation applications with derivatives calculated using automatic differentiation.
Overview
This object provides a ready-to-use coefficient for the electric field Helmholtz wave equation problem, specifically a coefficient material property of the form
where
is the complex wave number ( where is the wavelength),
is the complex relative electric permittivity, and
is the complex relative magnetic permeability.
Note that all of these parameters (real and imaginary parts) can be provided by the user as material properties.
Example Input File Syntax
[Materials<<<{"href": "../../syntax/Materials/index.html"}>>>]
[wave_equation_coefficient]
type = WaveEquationCoefficient<<<{"description": "Material for use as coefficient $a k^2 \\mu_r \\epsilon_r$ (where a is a scalar coefficient) in standard-form Helmholtz wave equation applications with derivatives calculated using automatic differentiation.", "href": "WaveEquationCoefficient.html"}>>>
k_real<<<{"description": "Wave number, real component."}>>> = k_real_mat
k_imag<<<{"description": "Wave number, imaginary component."}>>> = k_imag_mat
eps_rel_real<<<{"description": "Relative permittivity, real component."}>>> = 1
eps_rel_imag<<<{"description": "Relative permittivity, imaginary component."}>>> = 0
mu_rel_real<<<{"description": "Relative permeability, real component."}>>> = 1
mu_rel_imag<<<{"description": "Relative permeability, imaginary component."}>>> = 0
[]
[]
(modules/electromagnetics/test/tests/kernels/scalar_complex_helmholtz/scalar_complex_helmholtz.i)Input Parameters
- blockThe list of blocks (ids or names) that this object will be applied
C++ Type:std::vector<SubdomainName>
Controllable:No
Description:The list of blocks (ids or names) that this object will be applied
- boundaryThe list of boundaries (ids or names) from the mesh where this object applies
C++ Type:std::vector<BoundaryName>
Controllable:No
Description:The list of boundaries (ids or names) from the mesh where this object applies
- coef1Real-valued function coefficient.
Default:1
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:Real-valued function coefficient.
- computeTrueWhen false, MOOSE will not call compute methods on this material. The user must call computeProperties() after retrieving the MaterialBase via MaterialBasePropertyInterface::getMaterialBase(). Non-computed MaterialBases are not sorted for dependencies.
Default:True
C++ Type:bool
Controllable:No
Description:When false, MOOSE will not call compute methods on this material. The user must call computeProperties() after retrieving the MaterialBase via MaterialBasePropertyInterface::getMaterialBase(). Non-computed MaterialBases are not sorted for dependencies.
- constant_onNONEWhen ELEMENT, MOOSE will only call computeQpProperties() for the 0th quadrature point, and then copy that value to the other qps.When SUBDOMAIN, MOOSE will only call computeQpProperties() for the 0th quadrature point, and then copy that value to the other qps. Evaluations on element qps will be skipped
Default:NONE
C++ Type:MooseEnum
Options:NONE, ELEMENT, SUBDOMAIN
Controllable:No
Description:When ELEMENT, MOOSE will only call computeQpProperties() for the 0th quadrature point, and then copy that value to the other qps.When SUBDOMAIN, MOOSE will only call computeQpProperties() for the 0th quadrature point, and then copy that value to the other qps. Evaluations on element qps will be skipped
- declare_suffixAn optional suffix parameter that can be appended to any declared properties. The suffix will be prepended with a '_' character.
C++ Type:MaterialPropertyName
Unit:(no unit assumed)
Controllable:No
Description:An optional suffix parameter that can be appended to any declared properties. The suffix will be prepended with a '_' character.
- k_imag0Wave number, imaginary component.
Default:0
C++ Type:MaterialPropertyName
Unit:(no unit assumed)
Controllable:No
Description:Wave number, imaginary component.
- prop_name_imaginarywave_equation_coefficient_imaginaryUser-specified material property name for the imaginary component.
Default:wave_equation_coefficient_imaginary
C++ Type:MaterialPropertyName
Unit:(no unit assumed)
Controllable:No
Description:User-specified material property name for the imaginary component.
- prop_name_realwave_equation_coefficient_realUser-specified material property name for the real component.
Default:wave_equation_coefficient_real
C++ Type:MaterialPropertyName
Unit:(no unit assumed)
Controllable:No
Description:User-specified material property name for the real component.
Optional Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:Yes
Description:Set the enabled status of the MooseObject.
- implicitTrueDetermines whether this object is calculated using an implicit or explicit form
Default:True
C++ Type:bool
Controllable:No
Description:Determines whether this object is calculated using an implicit or explicit form
- seed0The seed for the master random number generator
Default:0
C++ Type:unsigned int
Controllable:No
Description:The seed for the master random number generator
- use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Advanced Parameters
- output_propertiesList of material properties, from this material, to output (outputs must also be defined to an output type)
C++ Type:std::vector<std::string>
Controllable:No
Description:List of material properties, from this material, to output (outputs must also be defined to an output type)
- outputsnone Vector of output names where you would like to restrict the output of variables(s) associated with this object
Default:none
C++ Type:std::vector<OutputName>
Controllable:No
Description:Vector of output names where you would like to restrict the output of variables(s) associated with this object
Outputs Parameters
- prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
C++ Type:MaterialPropertyName
Unit:(no unit assumed)
Controllable:No
Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
- use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Default:False
C++ Type:bool
Controllable:No
Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Material Property Retrieval Parameters
Input Files
- (modules/electromagnetics/test/tests/kernels/vector_helmholtz/vector_conduction_current.i)
- (modules/electromagnetics/test/tests/auxkernels/heating/aux_microwave_heating.i)
- (modules/electromagnetics/test/tests/benchmarks/evanescent_wave/evanescent_wave_with_ADMaterials.i)
- (modules/electromagnetics/test/tests/auxkernels/heating/aux_current_source_heating.i)
- (modules/combined/test/tests/electromagnetic_joule_heating/aux_microwave_heating.i)
- (modules/electromagnetics/test/tests/auxkernels/azimuthal_Faradays_law/scalar_azim_magnetic_time_deriv.i)
- (modules/electromagnetics/test/tests/kernels/vector_helmholtz/microwave_heating.i)
- (modules/electromagnetics/test/tests/kernels/scalar_complex_helmholtz/scalar_complex_helmholtz.i)
- (modules/electromagnetics/test/tests/auxkernels/azimuthal_Faradays_law/error_azim_magnetic_time_deriv.i)
- (modules/combined/test/tests/electromagnetic_joule_heating/microwave_heating.i)
- (modules/electromagnetics/test/tests/auxkernels/azimuthal_Faradays_law/vector_azim_magnetic_time_deriv.i)
- (modules/electromagnetics/test/tests/kernels/vector_helmholtz/vector_ADmaterial_wave_reaction.i)
(modules/electromagnetics/test/tests/kernels/scalar_complex_helmholtz/scalar_complex_helmholtz.i)
# problem: -(cu')' - k^2 * u = -F , 0 < x < L, u: R -> C
# u(x=0) = g0 , u(x=L) = gL
# k = a + jb
# a = a(x) = 2 * (1 + x/L)
# b = b(x) = (1 + x/L)
# c = d + jh
# d = d(x) = 12 * (1 + x/L)^2
# h = h(x) = 4 * (1 + x/L)^2
# L = 10
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
xmin = 0
xmax = 10
nx = 100
[]
[]
[Variables]
[u_real]
order = FIRST
family = LAGRANGE
[]
[u_imag]
order = FIRST
family = LAGRANGE
[]
[]
[Functions]
[k_real]
type = ParsedFunction
expression = '2*(1 + x/10)'
[]
[k_imag]
type = ParsedFunction
expression = '(1 + x/10)'
[]
[d_func]
type = ParsedFunction
expression = '12 * (1 + x/10)^2'
[]
[h_func]
type = ParsedFunction
expression = '4 * (1 + x/10)^2'
[]
[negative_h_func]
type = ParsedFunction
expression = '-4 * (1 + x/10)^2'
[]
[RHS_real]
type = MMSTestFunc
L = 10
g0_real = 1
g0_imag = -1
gL_real = 0
gL_imag = 0
component = real
[]
[RHS_imag]
type = MMSTestFunc
L = 10
g0_real = 1
g0_imag = -1
gL_real = 0
gL_imag = 0
component = imaginary
[]
[]
[Materials]
[k_real_mat]
type = ADGenericFunctionMaterial
prop_names = k_real_mat
prop_values = k_real
[]
[k_imag_mat]
type = ADGenericFunctionMaterial
prop_names = k_imag_mat
prop_values = k_imag
[]
[wave_equation_coefficient]
type = WaveEquationCoefficient
k_real = k_real_mat
k_imag = k_imag_mat
eps_rel_real = 1
eps_rel_imag = 0
mu_rel_real = 1
mu_rel_imag = 0
[]
[negative_wave_equation_coefficient_imaginary]
type = ADParsedMaterial
property_name = negative_wave_equation_coefficient_imaginary
material_property_names = wave_equation_coefficient_imaginary
expression = '-1 * wave_equation_coefficient_imaginary'
[]
[]
[Kernels]
[laplacian_real]
type = FunctionDiffusion
function = d_func
variable = u_real
[]
[coupledLaplacian_real]
type = FunctionDiffusion
function = negative_h_func
v = u_imag
variable = u_real
[]
[coeffField_real]
type = ADMatReaction
reaction_rate = wave_equation_coefficient_real
variable = u_real
[]
[coupledField_real]
type = ADMatCoupledForce
v = u_imag
mat_prop_coef = negative_wave_equation_coefficient_imaginary
variable = u_real
[]
[bodyForce_real]
type = BodyForce
function = RHS_real
variable = u_real
[]
[laplacian_imag]
type = FunctionDiffusion
function = d_func
variable = u_imag
[]
[coupledLaplacian_imag]
type = FunctionDiffusion
function = h_func
v = u_real
variable = u_imag
[]
[coeffField_imag]
type = ADMatReaction
reaction_rate = wave_equation_coefficient_real
variable = u_imag
[]
[coupledField_imag]
type = ADMatCoupledForce
v = u_real
mat_prop_coef = wave_equation_coefficient_imaginary
variable = u_imag
[]
[bodyForce_imag]
type = BodyForce
function = RHS_imag
variable = u_imag
[]
[]
[BCs]
[left_real]
type = DirichletBC
value = 1
boundary = left
variable = u_real
[]
[left_imag]
type = DirichletBC
value = -1
boundary = left
variable = u_imag
[]
[right_real]
type = DirichletBC
value = 0
boundary = right
variable = u_real
[]
[right_imag]
type = DirichletBC
value = 0
boundary = right
variable = u_imag
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
exodus = true
[]
(modules/electromagnetics/test/tests/kernels/vector_helmholtz/vector_conduction_current.i)
# Test for ADConductionCurrent
# Manufactured solution: field_real = y^2 * x_hat - x^2 * y_hat
# E_imag = y^2 * x_hat - x^2 * y_hat
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
xmin = -1
ymin = -1
elem_type = QUAD9
[]
[]
[Functions]
#The exact solution for both the real and imag. component
[exact]
type = ParsedVectorFunction
expression_x = 'y*y'
expression_y = '-x*x'
[]
#The forcing terms for the real and imag. component
[source_real]
type = ParsedVectorFunction
symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
symbol_values = 'omega mu epsilon sigma omega mu epsilon sigma'
expression_x = '-epsilon_i*mu_i*omega_i^2*y^2 - 2*epsilon_i*mu_i*omega_i*omega_r*y^2 + epsilon_i*mu_i*omega_r^2*y^2 - epsilon_i*mu_r*omega_i^2*y^2 + 2*epsilon_i*mu_r*omega_i*omega_r*y^2 + epsilon_i*mu_r*omega_r^2*y^2 - epsilon_r*mu_i*omega_i^2*y^2 + 2*epsilon_r*mu_i*omega_i*omega_r*y^2 + epsilon_r*mu_i*omega_r^2*y^2 + epsilon_r*mu_r*omega_i^2*y^2 + 2*epsilon_r*mu_r*omega_i*omega_r*y^2 - epsilon_r*mu_r*omega_r^2*y^2 + mu_i*omega_i*sigma_i*y^2 + mu_i*omega_i*sigma_r*y^2 + mu_i*omega_r*sigma_i*y^2 - mu_i*omega_r*sigma_r*y^2 + mu_r*omega_i*sigma_i*y^2 - mu_r*omega_i*sigma_r*y^2 - mu_r*omega_r*sigma_i*y^2 - mu_r*omega_r*sigma_r*y^2 - 2'
expression_y = 'epsilon_i*mu_i*omega_i^2*x^2 + 2*epsilon_i*mu_i*omega_i*omega_r*x^2 - epsilon_i*mu_i*omega_r^2*x^2 + epsilon_i*mu_r*omega_i^2*x^2 - 2*epsilon_i*mu_r*omega_i*omega_r*x^2 - epsilon_i*mu_r*omega_r^2*x^2 + epsilon_r*mu_i*omega_i^2*x^2 - 2*epsilon_r*mu_i*omega_i*omega_r*x^2 - epsilon_r*mu_i*omega_r^2*x^2 - epsilon_r*mu_r*omega_i^2*x^2 - 2*epsilon_r*mu_r*omega_i*omega_r*x^2 + epsilon_r*mu_r*omega_r^2*x^2 - mu_i*omega_i*sigma_i*x^2 - mu_i*omega_i*sigma_r*x^2 - mu_i*omega_r*sigma_i*x^2 + mu_i*omega_r*sigma_r*x^2 - mu_r*omega_i*sigma_i*x^2 + mu_r*omega_i*sigma_r*x^2 + mu_r*omega_r*sigma_i*x^2 + mu_r*omega_r*sigma_r*x^2 + 2'
[]
[source_imag]
type = ParsedVectorFunction
symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
symbol_values = 'omega mu epsilon sigma omega mu epsilon sigma'
expression_x = '-epsilon_i*mu_i*omega_i^2*y^2 + 2*epsilon_i*mu_i*omega_i*omega_r*y^2 + epsilon_i*mu_i*omega_r^2*y^2 + epsilon_i*mu_r*omega_i^2*y^2 + 2*epsilon_i*mu_r*omega_i*omega_r*y^2 - epsilon_i*mu_r*omega_r^2*y^2 + epsilon_r*mu_i*omega_i^2*y^2 + 2*epsilon_r*mu_i*omega_i*omega_r*y^2 - epsilon_r*mu_i*omega_r^2*y^2 + epsilon_r*mu_r*omega_i^2*y^2 - 2*epsilon_r*mu_r*omega_i*omega_r*y^2 - epsilon_r*mu_r*omega_r^2*y^2 + mu_i*omega_i*sigma_i*y^2 - mu_i*omega_i*sigma_r*y^2 - mu_i*omega_r*sigma_i*y^2 - mu_i*omega_r*sigma_r*y^2 - mu_r*omega_i*sigma_i*y^2 - mu_r*omega_i*sigma_r*y^2 - mu_r*omega_r*sigma_i*y^2 + mu_r*omega_r*sigma_r*y^2 - 2'
expression_y = 'epsilon_i*mu_i*omega_i^2*x^2 - 2*epsilon_i*mu_i*omega_i*omega_r*x^2 - epsilon_i*mu_i*omega_r^2*x^2 - epsilon_i*mu_r*omega_i^2*x^2 - 2*epsilon_i*mu_r*omega_i*omega_r*x^2 + epsilon_i*mu_r*omega_r^2*x^2 - epsilon_r*mu_i*omega_i^2*x^2 - 2*epsilon_r*mu_i*omega_i*omega_r*x^2 + epsilon_r*mu_i*omega_r^2*x^2 - epsilon_r*mu_r*omega_i^2*x^2 + 2*epsilon_r*mu_r*omega_i*omega_r*x^2 + epsilon_r*mu_r*omega_r^2*x^2 - mu_i*omega_i*sigma_i*x^2 + mu_i*omega_i*sigma_r*x^2 + mu_i*omega_r*sigma_i*x^2 + mu_i*omega_r*sigma_r*x^2 + mu_r*omega_i*sigma_i*x^2 + mu_r*omega_i*sigma_r*x^2 + mu_r*omega_r*sigma_i*x^2 - mu_r*omega_r*sigma_r*x^2 + 2'
[]
#Material Coefficients
[omega]
type = ParsedFunction
expression = '2.0'
[]
[mu]
type = ParsedFunction
expression = '1.0'
[]
[epsilon]
type = ParsedFunction
expression = '3.0'
[]
[sigma]
type = ParsedFunction
expression = '4.0'
[]
[]
[Materials]
[WaveCoeff]
type = WaveEquationCoefficient
eps_rel_imag = eps_imag
eps_rel_real = eps_real
k_real = k_real
k_imag = k_imag
mu_rel_imag = mu_imag
mu_rel_real = mu_real
[]
[eps_real]
type = ADGenericFunctionMaterial
prop_names = eps_real
prop_values = epsilon
[]
[eps_imag]
type = ADGenericFunctionMaterial
prop_names = eps_imag
prop_values = epsilon
[]
[mu_real]
type = ADGenericFunctionMaterial
prop_names = mu_real
prop_values = mu
[]
[mu_imag]
type = ADGenericFunctionMaterial
prop_names = mu_imag
prop_values = mu
[]
[k_real]
type = ADGenericFunctionMaterial
prop_names = k_real
prop_values = omega
[]
[k_imag]
type = ADGenericFunctionMaterial
prop_names = k_imag
prop_values = omega
[]
[cond_real]
type = ADGenericFunctionMaterial
prop_names = cond_real
prop_values = sigma
[]
[cond_imag]
type = ADGenericFunctionMaterial
prop_names = cond_imag
prop_values = sigma
[]
[]
[Variables]
[E_real]
family = NEDELEC_ONE
order = FIRST
[]
[E_imag]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[curl_curl_real]
type = CurlCurlField
variable = E_real
[]
[coeff_real]
type = ADMatWaveReaction
variable = E_real
field_real = E_real
field_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = real
[]
[conduction_real]
type = ADConductionCurrent
variable = E_real
field_imag = E_imag
field_real = E_real
conductivity_real = cond_real
conductivity_imag = cond_imag
ang_freq_real = k_real
ang_freq_imag = k_imag
permeability_real = mu_real
permeability_imag = mu_imag
component = real
[]
[body_force_real]
type = VectorBodyForce
variable = E_real
function = source_real
[]
[curl_curl_imag]
type = CurlCurlField
variable = E_imag
[]
[coeff_imag]
type = ADMatWaveReaction
variable = E_imag
field_real = E_real
field_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = imaginary
[]
[conduction_imag]
type = ADConductionCurrent
variable = E_imag
field_imag = E_imag
field_real = E_real
conductivity_real = cond_real
conductivity_imag = cond_imag
ang_freq_real = k_real
ang_freq_imag = k_imag
permeability_real = mu_real
permeability_imag = mu_imag
component = imaginary
[]
[body_force_imag]
type = VectorBodyForce
variable = E_imag
function = source_imag
[]
[]
[BCs]
[sides_real]
type = VectorCurlPenaltyDirichletBC
variable = E_real
function_x = 'y*y'
function_y = '-x*x'
penalty = 1e8
boundary = 'left right top bottom'
[]
[sides_imag]
type = VectorCurlPenaltyDirichletBC
variable = E_imag
function_x = 'y*y'
function_y = '-x*x'
penalty = 1e8
boundary = 'left right top bottom'
[]
[]
[Postprocessors]
[error_real]
type = ElementVectorL2Error
variable = E_real
function = exact
[]
[error_imag]
type = ElementVectorL2Error
variable = E_imag
function = exact
[]
[h]
type = AverageElementSize
[]
[h_squared]
type = ParsedPostprocessor
pp_names = 'h'
expression = 'h * h'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Outputs]
exodus = true
csv = true
[]
(modules/electromagnetics/test/tests/auxkernels/heating/aux_microwave_heating.i)
# Test for EMJouleHeatingHeatGeneratedAux
# Manufactured solution: E_real = cos(pi*y) * x_hat - cos(pi*x) * y_hat
# E_imag = sin(pi*y) * x_hat - sin(pi*x) * y_hat
# n = x^2*y^2
# heating = '0.5*sigma_r*(sin(x*pi)^2 + sin(y*pi)^2 + cos(x*pi)^2 + cos(y*pi)^2)'
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
xmin = -1
ymin = -1
elem_type = QUAD9
[]
[]
[Functions]
#The exact solution for the heated species and electric field real and imag. component
[exact_real]
type = ParsedVectorFunction
expression_x = 'cos(pi*y)'
expression_y = '-cos(pi*x)'
[]
[exact_imag]
type = ParsedVectorFunction
expression_x = 'sin(pi*y)'
expression_y = '-sin(pi*x)'
[]
[exact_n]
type = ParsedFunction
expression = 'x^2*y^2'
[]
#The forcing terms for the heated species and electric field real and imag. component
[source_real]
type = ParsedVectorFunction
symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
symbol_values = 'omega mu epsilon sigma omega mu epsilon sigma'
expression_x = '-epsilon_i*mu_i*omega_i^2*cos(pi*y) - 2*epsilon_i*mu_i*omega_i*omega_r*sin(pi*y) + epsilon_i*mu_i*omega_r^2*cos(pi*y) - epsilon_i*mu_r*omega_i^2*sin(pi*y) + 2*epsilon_i*mu_r*omega_i*omega_r*cos(pi*y) + epsilon_i*mu_r*omega_r^2*sin(pi*y) - epsilon_r*mu_i*omega_i^2*sin(pi*y) + 2*epsilon_r*mu_i*omega_i*omega_r*cos(pi*y) + epsilon_r*mu_i*omega_r^2*sin(pi*y) + epsilon_r*mu_r*omega_i^2*cos(pi*y) + 2*epsilon_r*mu_r*omega_i*omega_r*sin(pi*y) - epsilon_r*mu_r*omega_r^2*cos(pi*y) + mu_i*omega_i*sigma_i*cos(pi*y) + mu_i*omega_i*sigma_r*sin(pi*y) + mu_i*omega_r*sigma_i*sin(pi*y) - mu_i*omega_r*sigma_r*cos(pi*y) + mu_r*omega_i*sigma_i*sin(pi*y) - mu_r*omega_i*sigma_r*cos(pi*y) - mu_r*omega_r*sigma_i*cos(pi*y) - mu_r*omega_r*sigma_r*sin(pi*y) + pi^2*cos(pi*y)'
expression_y = 'epsilon_i*mu_i*omega_i^2*cos(pi*x) + 2*epsilon_i*mu_i*omega_i*omega_r*sin(pi*x) - epsilon_i*mu_i*omega_r^2*cos(pi*x) + epsilon_i*mu_r*omega_i^2*sin(pi*x) - 2*epsilon_i*mu_r*omega_i*omega_r*cos(pi*x) - epsilon_i*mu_r*omega_r^2*sin(pi*x) + epsilon_r*mu_i*omega_i^2*sin(pi*x) - 2*epsilon_r*mu_i*omega_i*omega_r*cos(pi*x) - epsilon_r*mu_i*omega_r^2*sin(pi*x) - epsilon_r*mu_r*omega_i^2*cos(pi*x) - 2*epsilon_r*mu_r*omega_i*omega_r*sin(pi*x) + epsilon_r*mu_r*omega_r^2*cos(pi*x) - mu_i*omega_i*sigma_i*cos(pi*x) - mu_i*omega_i*sigma_r*sin(pi*x) - mu_i*omega_r*sigma_i*sin(pi*x) + mu_i*omega_r*sigma_r*cos(pi*x) - mu_r*omega_i*sigma_i*sin(pi*x) + mu_r*omega_i*sigma_r*cos(pi*x) + mu_r*omega_r*sigma_i*cos(pi*x) + mu_r*omega_r*sigma_r*sin(pi*x) - pi^2*cos(pi*x)'
[]
[source_imag]
type = ParsedVectorFunction
symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
symbol_values = 'omega mu epsilon sigma omega mu epsilon sigma'
expression_x = '-epsilon_i*mu_i*omega_i^2*sin(pi*y) + 2*epsilon_i*mu_i*omega_i*omega_r*cos(pi*y) + epsilon_i*mu_i*omega_r^2*sin(pi*y) + epsilon_i*mu_r*omega_i^2*cos(pi*y) + 2*epsilon_i*mu_r*omega_i*omega_r*sin(pi*y) - epsilon_i*mu_r*omega_r^2*cos(pi*y) + epsilon_r*mu_i*omega_i^2*cos(pi*y) + 2*epsilon_r*mu_i*omega_i*omega_r*sin(pi*y) - epsilon_r*mu_i*omega_r^2*cos(pi*y) + epsilon_r*mu_r*omega_i^2*sin(pi*y) - 2*epsilon_r*mu_r*omega_i*omega_r*cos(pi*y) - epsilon_r*mu_r*omega_r^2*sin(pi*y) + mu_i*omega_i*sigma_i*sin(pi*y) - mu_i*omega_i*sigma_r*cos(pi*y) - mu_i*omega_r*sigma_i*cos(pi*y) - mu_i*omega_r*sigma_r*sin(pi*y) - mu_r*omega_i*sigma_i*cos(pi*y) - mu_r*omega_i*sigma_r*sin(pi*y) - mu_r*omega_r*sigma_i*sin(pi*y) + mu_r*omega_r*sigma_r*cos(pi*y) + pi^2*sin(pi*y)'
expression_y = 'epsilon_i*mu_i*omega_i^2*sin(pi*x) - 2*epsilon_i*mu_i*omega_i*omega_r*cos(pi*x) - epsilon_i*mu_i*omega_r^2*sin(pi*x) - epsilon_i*mu_r*omega_i^2*cos(pi*x) - 2*epsilon_i*mu_r*omega_i*omega_r*sin(pi*x) + epsilon_i*mu_r*omega_r^2*cos(pi*x) - epsilon_r*mu_i*omega_i^2*cos(pi*x) - 2*epsilon_r*mu_i*omega_i*omega_r*sin(pi*x) + epsilon_r*mu_i*omega_r^2*cos(pi*x) - epsilon_r*mu_r*omega_i^2*sin(pi*x) + 2*epsilon_r*mu_r*omega_i*omega_r*cos(pi*x) + epsilon_r*mu_r*omega_r^2*sin(pi*x) - mu_i*omega_i*sigma_i*sin(pi*x) + mu_i*omega_i*sigma_r*cos(pi*x) + mu_i*omega_r*sigma_i*cos(pi*x) + mu_i*omega_r*sigma_r*sin(pi*x) + mu_r*omega_i*sigma_i*cos(pi*x) + mu_r*omega_i*sigma_r*sin(pi*x) + mu_r*omega_r*sigma_i*sin(pi*x) - mu_r*omega_r*sigma_r*cos(pi*x) - pi^2*sin(pi*x)'
[]
[source_n]
type = ParsedFunction
symbol_names = 'sigma_r'
symbol_values = 'sigma'
expression = '-2*x^2 - 2*y^2 - 0.5*sigma_r*(sin(x*pi)^2 + sin(y*pi)^2 + cos(x*pi)^2 + cos(y*pi)^2)'
[]
[heating_func]
type = ParsedFunction
symbol_names = 'sigma_r'
symbol_values = 'sigma'
expression = '0.5*sigma_r*(sin(x*pi)^2 + sin(y*pi)^2 + cos(x*pi)^2 + cos(y*pi)^2)'
[]
#Material Coefficients
[omega]
type = ParsedFunction
expression = '2.0'
[]
[mu]
type = ParsedFunction
expression = '1.0'
[]
[epsilon]
type = ParsedFunction
expression = '3.0'
[]
[sigma]
type = ParsedFunction
expression = '4.0'
#expression = 'x^2*y^2'
[]
[]
[Materials]
[WaveCoeff]
type = WaveEquationCoefficient
eps_rel_imag = eps_imag
eps_rel_real = eps_real
k_real = k_real
k_imag = k_imag
mu_rel_imag = mu_imag
mu_rel_real = mu_real
[]
[eps_real]
type = ADGenericFunctionMaterial
prop_names = eps_real
prop_values = epsilon
[]
[eps_imag]
type = ADGenericFunctionMaterial
prop_names = eps_imag
prop_values = epsilon
[]
[mu_real]
type = ADGenericFunctionMaterial
prop_names = mu_real
prop_values = mu
[]
[mu_imag]
type = ADGenericFunctionMaterial
prop_names = mu_imag
prop_values = mu
[]
[k_real]
type = ADGenericFunctionMaterial
prop_names = k_real
prop_values = omega
[]
[k_imag]
type = ADGenericFunctionMaterial
prop_names = k_imag
prop_values = omega
[]
[cond_real]
type = ADGenericFunctionMaterial
prop_names = cond_real
prop_values = sigma
[]
[cond_imag]
type = ADGenericFunctionMaterial
prop_names = cond_imag
prop_values = sigma
[]
[]
[Variables]
[n]
family = LAGRANGE
order = FIRST
[]
[E_real]
family = NEDELEC_ONE
order = FIRST
[]
[E_imag]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[curl_curl_real]
type = CurlCurlField
variable = E_real
[]
[coeff_real]
type = ADMatWaveReaction
variable = E_real
field_real = E_real
field_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = real
[]
[conduction_real]
type = ADConductionCurrent
variable = E_real
field_imag = E_imag
field_real = E_real
conductivity_real = cond_real
conductivity_imag = cond_imag
ang_freq_real = k_real
ang_freq_imag = k_imag
permeability_real = mu_real
permeability_imag = mu_imag
component = real
[]
[body_force_real]
type = VectorBodyForce
variable = E_real
function = source_real
[]
[curl_curl_imag]
type = CurlCurlField
variable = E_imag
[]
[coeff_imag]
type = ADMatWaveReaction
variable = E_imag
field_real = E_real
field_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = imaginary
[]
[conduction_imag]
type = ADConductionCurrent
variable = E_imag
field_imag = E_imag
field_real = E_real
conductivity_real = cond_real
conductivity_imag = cond_imag
ang_freq_real = k_real
ang_freq_imag = k_imag
permeability_real = mu_real
permeability_imag = mu_imag
component = imaginary
[]
[body_force_imag]
type = VectorBodyForce
variable = E_imag
function = source_imag
[]
[n_diffusion]
type = Diffusion
variable = n
[]
[microwave_heating]
type = EMJouleHeatingSource
variable = n
E_imag = E_imag
E_real = E_real
conductivity = cond_real
[]
[body_force_n]
type = BodyForce
variable = n
function = source_n
[]
[]
[AuxVariables]
[heating_term]
family = MONOMIAL
order = FIRST
[]
[]
[AuxKernels]
[aux_microwave_heating]
type = EMJouleHeatingHeatGeneratedAux
variable = heating_term
E_imag = E_imag
E_real = E_real
conductivity = cond_real
[]
[]
[BCs]
[sides_real]
type = VectorCurlPenaltyDirichletBC
variable = E_real
function = exact_real
penalty = 1e8
boundary = 'left right top bottom'
[]
[sides_imag]
type = VectorCurlPenaltyDirichletBC
variable = E_imag
function = exact_imag
penalty = 1e8
boundary = 'left right top bottom'
[]
[sides_n]
type = FunctorDirichletBC
variable = n
boundary = 'left right top bottom'
functor = exact_n
preset = false
[]
[]
[Postprocessors]
[error_real]
type = ElementVectorL2Error
variable = E_real
function = exact_real
[]
[error_imag]
type = ElementVectorL2Error
variable = E_imag
function = exact_imag
[]
[error_n]
type = ElementL2Error
variable = n
function = exact_n
[]
[error_aux_heating]
type = ElementL2Error
variable = heating_term
function = heating_func
[]
[h]
type = AverageElementSize
[]
[h_squared]
type = ParsedPostprocessor
pp_names = 'h'
expression = 'h * h'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
csv = true
[]
(modules/electromagnetics/test/tests/benchmarks/evanescent_wave/evanescent_wave_with_ADMaterials.i)
# This test is exactly the same as 'evanescent_wave/evanescent_wave.i'
# except it uses ADMatWaveReaction and WaveEquationCoefficient instead of VectorFunctionReaction
[Mesh]
[fmg]
type = FileMeshGenerator
file = waveguide_discontinuous.msh
[]
[]
[Functions]
[omegaMu]
type = ParsedFunction
expression = '2*pi*20e9*4*pi*1e-7'
[]
[beta]
type = ParsedFunction
expression = '2*pi*20e9/3e8'
[]
[curr_real]
type = ParsedVectorFunction
expression_y = 1.0
[]
[curr_imag] # defaults to '0.0 0.0 0.0'
type = ParsedVectorFunction
[]
[eps_real_func]
type = ParsedFunction
expression = '1'
[]
[mu_real_func]
type = ParsedFunction
expression = '(1 / 3e8)^2'
[]
[k_real_func]
type = ParsedFunction
expression = '2*pi*20e9'
[]
[]
[Materials]
[WaveCoeff]
type = WaveEquationCoefficient
eps_rel_imag = 0
eps_rel_real = eps_real
k_real = k_real
mu_rel_imag = 0
mu_rel_real = mu_real
[]
[eps_real]
type = ADGenericFunctionMaterial
prop_names = eps_real
prop_values = eps_real_func
[]
[mu_real]
type = ADGenericFunctionMaterial
prop_names = mu_real
prop_values = mu_real_func
[]
[k_real]
type = ADGenericFunctionMaterial
prop_names = k_real
prop_values = k_real_func
[]
[]
[Variables]
[E_real]
family = NEDELEC_ONE
order = FIRST
[]
[E_imag]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[curlCurl_real]
type = CurlCurlField
variable = E_real
[]
[coeff_real]
type = ADMatWaveReaction
variable = E_real
field_real = E_real
field_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = real
[]
[source_real]
type = VectorCurrentSource
variable = E_real
component = real
source_real = curr_real
source_imag = curr_imag
function_coefficient = omegaMu
block = source
[]
[curlCurl_imag]
type = CurlCurlField
variable = E_imag
[]
[coeff_imag]
type = ADMatWaveReaction
variable = E_imag
field_real = E_real
field_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = imaginary
[]
[source_imaginary]
type = VectorCurrentSource
variable = E_imag
component = imaginary
source_real = curr_real
source_imag = curr_imag
function_coefficient = omegaMu
block = source
[]
[]
[BCs]
[absorbing_left_real]
type = VectorEMRobinBC
variable = E_real
component = real
beta = beta
coupled_field = E_imag
mode = absorbing
boundary = 'port'
[]
[absorbing_right_real]
type = VectorEMRobinBC
variable = E_real
component = real
beta = beta
coupled_field = E_imag
mode = absorbing
boundary = 'exit'
[]
[absorbing_left_imag]
type = VectorEMRobinBC
variable = E_imag
component = imaginary
beta = beta
coupled_field = E_real
mode = absorbing
boundary = 'port'
[]
[absorbing_right_imag]
type = VectorEMRobinBC
variable = E_imag
component = imaginary
beta = beta
coupled_field = E_real
mode = absorbing
boundary = 'exit'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Outputs]
exodus = true
file_base = 'evanescent_wave_out'
print_linear_residuals = true
[]
[Debug]
show_var_residual_norms = true
[]
(modules/electromagnetics/test/tests/auxkernels/heating/aux_current_source_heating.i)
# Test for SourceCurrentHeating
# Manufactured solution: E_real = cos(pi*y) * x_hat - cos(pi*x) * y_hat
# E_imag = sin(pi*y) * x_hat - sin(pi*x) * y_hat
# heating = 'sin(x*pi)*cos(x*pi) + sin(y*pi)*cos(y*pi)'
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
xmin = -1
ymin = -1
elem_type = QUAD9
[]
[]
[Functions]
#The exact solution for the heated species and electric field real and imag. component
[exact_real]
type = ParsedVectorFunction
expression_x = 'cos(pi*y)'
expression_y = '-cos(pi*x)'
[]
[exact_imag]
type = ParsedVectorFunction
expression_x = 'sin(pi*y)'
expression_y = '-sin(pi*x)'
[]
#The forcing terms for the heated species and electric field real and imag. component
[source_real]
type = ParsedVectorFunction
expression_x = '-2*cos(pi*y) + pi^2*cos(pi*y)'
expression_y = '-pi^2*cos(pi*x) + 2*cos(pi*x)'
[]
[source_imag]
type = ParsedVectorFunction
expression_x = 'pi^2*sin(pi*y)'
expression_y = '-pi^2*sin(pi*x)'
[]
[current_real]
type = ParsedVectorFunction
expression_x = 'sin(pi*y)'
expression_y = '-sin(pi*x)'
[]
[current_imag]
type = ParsedVectorFunction
expression_x = 'cos(pi*y)'
expression_y = '-cos(pi*x)'
[]
[heating_func]
type = ParsedFunction
expression = '1.0*sin(x*pi)*cos(x*pi) + 1.0*sin(y*pi)*cos(y*pi)'
[]
[]
[Materials]
[WaveCoeff]
type = WaveEquationCoefficient
eps_rel_real = 1.0
eps_rel_imag = 0.0
k_real = 1.0
k_imag = 0.0
mu_rel_real = 1.0
mu_rel_imag = 0.0
[]
[]
[Variables]
[E_real]
family = NEDELEC_ONE
order = FIRST
[]
[E_imag]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[curl_curl_real]
type = CurlCurlField
variable = E_real
[]
[coeff_real]
type = ADMatWaveReaction
variable = E_real
field_real = E_real
field_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = real
[]
[current_real]
type = VectorCurrentSource
variable = E_real
source_real = current_real
source_imag = current_imag
component = real
[]
[body_force_real]
type = VectorBodyForce
variable = E_real
function = source_real
[]
[curl_curl_imag]
type = CurlCurlField
variable = E_imag
[]
[coeff_imag]
type = ADMatWaveReaction
variable = E_imag
field_real = E_real
field_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = imaginary
[]
[current_imag]
type = VectorCurrentSource
variable = E_imag
source_real = current_real
source_imag = current_imag
component = imaginary
[]
[body_force_imag]
type = VectorBodyForce
variable = E_imag
function = source_imag
[]
[]
[AuxVariables]
[current_heating_term]
family = MONOMIAL
order = FIRST
[]
[]
[AuxKernels]
[aux_current_heating]
type = SourceCurrentHeating
variable = current_heating_term
E_real = E_real
E_imag = E_imag
source_real = current_real
source_imag = current_imag
[]
[]
[BCs]
[sides_real]
type = VectorCurlPenaltyDirichletBC
variable = E_real
function = exact_real
penalty = 1e8
boundary = 'left right top bottom'
[]
[sides_imag]
type = VectorCurlPenaltyDirichletBC
variable = E_imag
function = exact_imag
penalty = 1e8
boundary = 'left right top bottom'
[]
[]
[Postprocessors]
[error_real]
type = ElementVectorL2Error
variable = E_real
function = exact_real
[]
[error_imag]
type = ElementVectorL2Error
variable = E_imag
function = exact_imag
[]
[error_aux_heating]
type = ElementL2Error
variable = current_heating_term
function = heating_func
[]
[h]
type = AverageElementSize
[]
[h_squared]
type = ParsedPostprocessor
pp_names = 'h'
expression = 'h * h'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
csv = true
[]
(modules/combined/test/tests/electromagnetic_joule_heating/aux_microwave_heating.i)
# Test for JouleHeatingHeatGeneratedAux
# Manufactured solution: E_real = cos(pi*y) * x_hat - cos(pi*x) * y_hat
# E_imag = sin(pi*y) * x_hat - sin(pi*x) * y_hat
# n = x^2*y^2
# heating = '0.5*sigma_r*(sin(x*pi)^2 + sin(y*pi)^2 + cos(x*pi)^2 + cos(y*pi)^2)'
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
xmin = -1
ymin = -1
elem_type = QUAD9
[]
[]
[Functions]
#The exact solution for the heated species and electric field real and imag. component
[exact_real]
type = ParsedVectorFunction
expression_x = 'cos(pi*y)'
expression_y = '-cos(pi*x)'
[]
[exact_imag]
type = ParsedVectorFunction
expression_x = 'sin(pi*y)'
expression_y = '-sin(pi*x)'
[]
[exact_n]
type = ParsedFunction
expression = 'x^2*y^2'
[]
#The forcing terms for the heated species and electric field real and imag. component
[source_real]
type = ParsedVectorFunction
symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
symbol_values = 'omega mu epsilon sigma omega mu epsilon sigma'
expression_x = '-epsilon_i*mu_i*omega_i^2*cos(pi*y) - 2*epsilon_i*mu_i*omega_i*omega_r*sin(pi*y) + epsilon_i*mu_i*omega_r^2*cos(pi*y) - epsilon_i*mu_r*omega_i^2*sin(pi*y) + 2*epsilon_i*mu_r*omega_i*omega_r*cos(pi*y) + epsilon_i*mu_r*omega_r^2*sin(pi*y) - epsilon_r*mu_i*omega_i^2*sin(pi*y) + 2*epsilon_r*mu_i*omega_i*omega_r*cos(pi*y) + epsilon_r*mu_i*omega_r^2*sin(pi*y) + epsilon_r*mu_r*omega_i^2*cos(pi*y) + 2*epsilon_r*mu_r*omega_i*omega_r*sin(pi*y) - epsilon_r*mu_r*omega_r^2*cos(pi*y) + mu_i*omega_i*sigma_i*cos(pi*y) + mu_i*omega_i*sigma_r*sin(pi*y) + mu_i*omega_r*sigma_i*sin(pi*y) - mu_i*omega_r*sigma_r*cos(pi*y) + mu_r*omega_i*sigma_i*sin(pi*y) - mu_r*omega_i*sigma_r*cos(pi*y) - mu_r*omega_r*sigma_i*cos(pi*y) - mu_r*omega_r*sigma_r*sin(pi*y) + pi^2*cos(pi*y)'
expression_y = 'epsilon_i*mu_i*omega_i^2*cos(pi*x) + 2*epsilon_i*mu_i*omega_i*omega_r*sin(pi*x) - epsilon_i*mu_i*omega_r^2*cos(pi*x) + epsilon_i*mu_r*omega_i^2*sin(pi*x) - 2*epsilon_i*mu_r*omega_i*omega_r*cos(pi*x) - epsilon_i*mu_r*omega_r^2*sin(pi*x) + epsilon_r*mu_i*omega_i^2*sin(pi*x) - 2*epsilon_r*mu_i*omega_i*omega_r*cos(pi*x) - epsilon_r*mu_i*omega_r^2*sin(pi*x) - epsilon_r*mu_r*omega_i^2*cos(pi*x) - 2*epsilon_r*mu_r*omega_i*omega_r*sin(pi*x) + epsilon_r*mu_r*omega_r^2*cos(pi*x) - mu_i*omega_i*sigma_i*cos(pi*x) - mu_i*omega_i*sigma_r*sin(pi*x) - mu_i*omega_r*sigma_i*sin(pi*x) + mu_i*omega_r*sigma_r*cos(pi*x) - mu_r*omega_i*sigma_i*sin(pi*x) + mu_r*omega_i*sigma_r*cos(pi*x) + mu_r*omega_r*sigma_i*cos(pi*x) + mu_r*omega_r*sigma_r*sin(pi*x) - pi^2*cos(pi*x)'
[]
[source_imag]
type = ParsedVectorFunction
symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
symbol_values = 'omega mu epsilon sigma omega mu epsilon sigma'
expression_x = '-epsilon_i*mu_i*omega_i^2*sin(pi*y) + 2*epsilon_i*mu_i*omega_i*omega_r*cos(pi*y) + epsilon_i*mu_i*omega_r^2*sin(pi*y) + epsilon_i*mu_r*omega_i^2*cos(pi*y) + 2*epsilon_i*mu_r*omega_i*omega_r*sin(pi*y) - epsilon_i*mu_r*omega_r^2*cos(pi*y) + epsilon_r*mu_i*omega_i^2*cos(pi*y) + 2*epsilon_r*mu_i*omega_i*omega_r*sin(pi*y) - epsilon_r*mu_i*omega_r^2*cos(pi*y) + epsilon_r*mu_r*omega_i^2*sin(pi*y) - 2*epsilon_r*mu_r*omega_i*omega_r*cos(pi*y) - epsilon_r*mu_r*omega_r^2*sin(pi*y) + mu_i*omega_i*sigma_i*sin(pi*y) - mu_i*omega_i*sigma_r*cos(pi*y) - mu_i*omega_r*sigma_i*cos(pi*y) - mu_i*omega_r*sigma_r*sin(pi*y) - mu_r*omega_i*sigma_i*cos(pi*y) - mu_r*omega_i*sigma_r*sin(pi*y) - mu_r*omega_r*sigma_i*sin(pi*y) + mu_r*omega_r*sigma_r*cos(pi*y) + pi^2*sin(pi*y)'
expression_y = 'epsilon_i*mu_i*omega_i^2*sin(pi*x) - 2*epsilon_i*mu_i*omega_i*omega_r*cos(pi*x) - epsilon_i*mu_i*omega_r^2*sin(pi*x) - epsilon_i*mu_r*omega_i^2*cos(pi*x) - 2*epsilon_i*mu_r*omega_i*omega_r*sin(pi*x) + epsilon_i*mu_r*omega_r^2*cos(pi*x) - epsilon_r*mu_i*omega_i^2*cos(pi*x) - 2*epsilon_r*mu_i*omega_i*omega_r*sin(pi*x) + epsilon_r*mu_i*omega_r^2*cos(pi*x) - epsilon_r*mu_r*omega_i^2*sin(pi*x) + 2*epsilon_r*mu_r*omega_i*omega_r*cos(pi*x) + epsilon_r*mu_r*omega_r^2*sin(pi*x) - mu_i*omega_i*sigma_i*sin(pi*x) + mu_i*omega_i*sigma_r*cos(pi*x) + mu_i*omega_r*sigma_i*cos(pi*x) + mu_i*omega_r*sigma_r*sin(pi*x) + mu_r*omega_i*sigma_i*cos(pi*x) + mu_r*omega_i*sigma_r*sin(pi*x) + mu_r*omega_r*sigma_i*sin(pi*x) - mu_r*omega_r*sigma_r*cos(pi*x) - pi^2*sin(pi*x)'
[]
[source_n]
type = ParsedFunction
symbol_names = 'sigma_r'
symbol_values = 'sigma'
expression = '-2*x^2 - 2*y^2 - 0.5*sigma_r*(sin(x*pi)^2 + sin(y*pi)^2 + cos(x*pi)^2 + cos(y*pi)^2)'
[]
[heating_func]
type = ParsedFunction
symbol_names = 'sigma_r'
symbol_values = 'sigma'
expression = '0.5*sigma_r*(sin(x*pi)^2 + sin(y*pi)^2 + cos(x*pi)^2 + cos(y*pi)^2)'
[]
#Material Coefficients
[omega]
type = ParsedFunction
expression = '2.0'
[]
[mu]
type = ParsedFunction
expression = '1.0'
[]
[epsilon]
type = ParsedFunction
expression = '3.0'
[]
[sigma]
type = ParsedFunction
expression = '4.0'
#expression = 'x^2*y^2'
[]
[]
[Materials]
[WaveCoeff]
type = WaveEquationCoefficient
eps_rel_imag = eps_imag
eps_rel_real = eps_real
k_real = k_real
k_imag = k_imag
mu_rel_imag = mu_imag
mu_rel_real = mu_real
[]
[eps_real]
type = ADGenericFunctionMaterial
prop_names = eps_real
prop_values = epsilon
[]
[eps_imag]
type = ADGenericFunctionMaterial
prop_names = eps_imag
prop_values = epsilon
[]
[mu_real]
type = ADGenericFunctionMaterial
prop_names = mu_real
prop_values = mu
[]
[mu_imag]
type = ADGenericFunctionMaterial
prop_names = mu_imag
prop_values = mu
[]
[k_real]
type = ADGenericFunctionMaterial
prop_names = k_real
prop_values = omega
[]
[k_imag]
type = ADGenericFunctionMaterial
prop_names = k_imag
prop_values = omega
[]
[cond_real]
type = ADGenericFunctionMaterial
prop_names = cond_real
prop_values = sigma
[]
[cond_imag]
type = ADGenericFunctionMaterial
prop_names = cond_imag
prop_values = sigma
[]
[ElectromagneticMaterial]
type = ElectromagneticHeatingMaterial
electric_field = E_real
complex_electric_field = E_imag
electric_field_heating_name = electric_field_heating
electrical_conductivity = cond_real
formulation = FREQUENCY
solver = ELECTROMAGNETIC
[]
[]
[Variables]
[n]
family = LAGRANGE
order = FIRST
[]
[E_real]
family = NEDELEC_ONE
order = FIRST
[]
[E_imag]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[curl_curl_real]
type = CurlCurlField
variable = E_real
[]
[coeff_real]
type = ADMatWaveReaction
variable = E_real
field_real = E_real
field_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = real
[]
[conduction_real]
type = ADConductionCurrent
variable = E_real
field_imag = E_imag
field_real = E_real
conductivity_real = cond_real
conductivity_imag = cond_imag
ang_freq_real = k_real
ang_freq_imag = k_imag
permeability_real = mu_real
permeability_imag = mu_imag
component = real
[]
[body_force_real]
type = VectorBodyForce
variable = E_real
function = source_real
[]
[curl_curl_imag]
type = CurlCurlField
variable = E_imag
[]
[coeff_imag]
type = ADMatWaveReaction
variable = E_imag
field_real = E_real
field_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = imaginary
[]
[conduction_imag]
type = ADConductionCurrent
variable = E_imag
field_imag = E_imag
field_real = E_real
conductivity_real = cond_real
conductivity_imag = cond_imag
ang_freq_real = k_real
ang_freq_imag = k_imag
permeability_real = mu_real
permeability_imag = mu_imag
component = imaginary
[]
[body_force_imag]
type = VectorBodyForce
variable = E_imag
function = source_imag
[]
[n_diffusion]
type = Diffusion
variable = n
[]
[microwave_heating]
type = ADJouleHeatingSource
variable = n
heating_term = 'electric_field_heating'
[]
[body_force_n]
type = BodyForce
variable = n
function = source_n
[]
[]
[AuxVariables]
[heating_term]
family = MONOMIAL
order = FIRST
[]
[]
[AuxKernels]
[aux_microwave_heating]
type = JouleHeatingHeatGeneratedAux
variable = heating_term
heating_term = 'electric_field_heating'
[]
[]
[BCs]
[sides_real]
type = VectorCurlPenaltyDirichletBC
variable = E_real
function = exact_real
penalty = 1e8
boundary = 'left right top bottom'
[]
[sides_imag]
type = VectorCurlPenaltyDirichletBC
variable = E_imag
function = exact_imag
penalty = 1e8
boundary = 'left right top bottom'
[]
[sides_n]
type = FunctorDirichletBC
variable = n
boundary = 'left right top bottom'
functor = exact_n
preset = false
[]
[]
[Postprocessors]
[error_real]
type = ElementVectorL2Error
variable = E_real
function = exact_real
[]
[error_imag]
type = ElementVectorL2Error
variable = E_imag
function = exact_imag
[]
[error_n]
type = ElementL2Error
variable = n
function = exact_n
[]
[error_aux_heating]
type = ElementL2Error
variable = heating_term
function = heating_func
[]
[h]
type = AverageElementSize
[]
[h_squared]
type = ParsedPostprocessor
pp_names = 'h'
expression = 'h * h'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
csv = true
[]
(modules/electromagnetics/test/tests/auxkernels/azimuthal_Faradays_law/scalar_azim_magnetic_time_deriv.i)
# Test for AzimuthMagneticTimeDerivRZ with scalar inputs
# Manufactured solution: E_real = y^2 * x_hat - x^2 * y_hat
# E_imag = y^2 * x_hat - x^2 * y_hat
# dB_theta_real / dt = -(2*y + 2*x)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
xmax = 1
xmin = 0
ymax = 1
ymin = -1
elem_type = QUAD9
[]
coord_type = RZ
rz_coord_axis = Y
[]
[Functions]
#The exact solution for the heated species and electric field real and imag. component
[exact_real]
type = ParsedVectorFunction
expression_x = 'y^2'
expression_y = '-x^2'
[]
[exact_imag]
type = ParsedVectorFunction
expression_x = 'y^2'
expression_y = '-x^2'
[]
#The forcing terms for the heated species and electric field real and imag. component
[source_real]
type = ParsedVectorFunction
expression_x = '-y^2 - cos(pi*y) - 2'
expression_y = 'x^2 + cos(pi*x) + 4 + 2*y/x'
[]
[source_imag]
type = ParsedVectorFunction
expression_x = '-y^2 + sin(pi*y) - 2'
expression_y = 'x^2 - sin(pi*x) + 4 + 2*y/x'
[]
[current_real]
type = ParsedVectorFunction
expression_x = 'sin(pi*y)'
expression_y = '-sin(pi*x)'
[]
[current_imag]
type = ParsedVectorFunction
expression_x = 'cos(pi*y)'
expression_y = '-cos(pi*x)'
[]
[azim_dB_dt_func]
type = ParsedFunction
expression = '-(2*y + 2*x)'
[]
[]
[Materials]
[WaveCoeff]
type = WaveEquationCoefficient
eps_rel_real = 1.0
eps_rel_imag = 0.0
k_real = 1.0
k_imag = 0.0
mu_rel_real = 1.0
mu_rel_imag = 0.0
[]
[]
[Variables]
[E_real]
family = NEDELEC_ONE
order = FIRST
[]
[E_imag]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[curl_curl_real]
type = CurlCurlField
variable = E_real
[]
[coeff_real]
type = ADMatWaveReaction
variable = E_real
field_real = E_real
field_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = real
[]
[current_real]
type = VectorCurrentSource
variable = E_real
source_real = current_real
source_imag = current_imag
component = real
[]
[body_force_real]
type = VectorBodyForce
variable = E_real
function = source_real
[]
[curl_curl_imag]
type = CurlCurlField
variable = E_imag
[]
[coeff_imag]
type = ADMatWaveReaction
variable = E_imag
field_real = E_real
field_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = imaginary
[]
[current_imag]
type = VectorCurrentSource
variable = E_imag
source_real = current_real
source_imag = current_imag
component = imaginary
[]
[body_force_imag]
type = VectorBodyForce
variable = E_imag
function = source_imag
[]
[]
[AuxVariables]
[aux_E_real_x]
family = MONOMIAL
order = FIRST
[]
[aux_E_real_y]
family = MONOMIAL
order = FIRST
[]
[azim_dB_dt_term_scalar]
family = MONOMIAL
order = FIRST
[]
[]
[AuxKernels]
[aux_E_real_x]
type = VectorVariableComponentAux
variable = aux_E_real_x
vector_variable = E_real
component = X
[]
[aux_E_real_y]
type = VectorVariableComponentAux
variable = aux_E_real_y
vector_variable = E_real
component = Y
[]
[aux_azim_dB_dt_scalar]
type = AzimuthMagneticTimeDerivRZ
Efield_X = aux_E_real_x
Efield_Y = aux_E_real_y
variable = azim_dB_dt_term_scalar
[]
[]
[BCs]
[sides_real]
type = VectorCurlPenaltyDirichletBC
variable = E_real
function = exact_real
penalty = 1e8
boundary = 'left right top bottom'
[]
[sides_imag]
type = VectorCurlPenaltyDirichletBC
variable = E_imag
function = exact_imag
penalty = 1e8
boundary = 'left right top bottom'
[]
[]
[Postprocessors]
[error_real]
type = ElementVectorL2Error
variable = E_real
function = exact_real
[]
[error_imag]
type = ElementVectorL2Error
variable = E_imag
function = exact_imag
[]
[error_azim_dB_dt_scalar]
type = ElementL2Error
variable = azim_dB_dt_term_scalar
function = azim_dB_dt_func
[]
[h]
type = AverageElementSize
[]
[h_squared]
type = ParsedPostprocessor
pp_names = 'h'
expression = 'h * h'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-16
[]
[Outputs]
exodus = true
csv = true
[]
(modules/electromagnetics/test/tests/kernels/vector_helmholtz/microwave_heating.i)
# Test for EMJouleHeatingSource
# Manufactured solution: E_real = cos(pi*y) * x_hat - cos(pi*x) * y_hat
# E_imag = sin(pi*y) * x_hat - sin(pi*x) * y_hat
# n = x^2*y^2
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
xmin = -1
ymin = -1
elem_type = QUAD9
[]
[]
[Functions]
#The exact solution for the heated species and electric field real and imag. component
[exact_real]
type = ParsedVectorFunction
expression_x = 'cos(pi*y)'
expression_y = '-cos(pi*x)'
[]
[exact_imag]
type = ParsedVectorFunction
expression_x = 'sin(pi*y)'
expression_y = '-sin(pi*x)'
[]
[exact_n]
type = ParsedFunction
expression = 'x^2*y^2'
[]
#The forcing terms for the heated species and electric field real and imag. component
[source_real]
type = ParsedVectorFunction
symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
symbol_values = 'omega mu epsilon sigma omega mu epsilon sigma'
expression_x = '-epsilon_i*mu_i*omega_i^2*cos(pi*y) - 2*epsilon_i*mu_i*omega_i*omega_r*sin(pi*y) + epsilon_i*mu_i*omega_r^2*cos(pi*y) - epsilon_i*mu_r*omega_i^2*sin(pi*y) + 2*epsilon_i*mu_r*omega_i*omega_r*cos(pi*y) + epsilon_i*mu_r*omega_r^2*sin(pi*y) - epsilon_r*mu_i*omega_i^2*sin(pi*y) + 2*epsilon_r*mu_i*omega_i*omega_r*cos(pi*y) + epsilon_r*mu_i*omega_r^2*sin(pi*y) + epsilon_r*mu_r*omega_i^2*cos(pi*y) + 2*epsilon_r*mu_r*omega_i*omega_r*sin(pi*y) - epsilon_r*mu_r*omega_r^2*cos(pi*y) + mu_i*omega_i*sigma_i*cos(pi*y) + mu_i*omega_i*sigma_r*sin(pi*y) + mu_i*omega_r*sigma_i*sin(pi*y) - mu_i*omega_r*sigma_r*cos(pi*y) + mu_r*omega_i*sigma_i*sin(pi*y) - mu_r*omega_i*sigma_r*cos(pi*y) - mu_r*omega_r*sigma_i*cos(pi*y) - mu_r*omega_r*sigma_r*sin(pi*y) + pi^2*cos(pi*y)'
expression_y = 'epsilon_i*mu_i*omega_i^2*cos(pi*x) + 2*epsilon_i*mu_i*omega_i*omega_r*sin(pi*x) - epsilon_i*mu_i*omega_r^2*cos(pi*x) + epsilon_i*mu_r*omega_i^2*sin(pi*x) - 2*epsilon_i*mu_r*omega_i*omega_r*cos(pi*x) - epsilon_i*mu_r*omega_r^2*sin(pi*x) + epsilon_r*mu_i*omega_i^2*sin(pi*x) - 2*epsilon_r*mu_i*omega_i*omega_r*cos(pi*x) - epsilon_r*mu_i*omega_r^2*sin(pi*x) - epsilon_r*mu_r*omega_i^2*cos(pi*x) - 2*epsilon_r*mu_r*omega_i*omega_r*sin(pi*x) + epsilon_r*mu_r*omega_r^2*cos(pi*x) - mu_i*omega_i*sigma_i*cos(pi*x) - mu_i*omega_i*sigma_r*sin(pi*x) - mu_i*omega_r*sigma_i*sin(pi*x) + mu_i*omega_r*sigma_r*cos(pi*x) - mu_r*omega_i*sigma_i*sin(pi*x) + mu_r*omega_i*sigma_r*cos(pi*x) + mu_r*omega_r*sigma_i*cos(pi*x) + mu_r*omega_r*sigma_r*sin(pi*x) - pi^2*cos(pi*x)'
[]
[source_imag]
type = ParsedVectorFunction
symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
symbol_values = 'omega mu epsilon sigma omega mu epsilon sigma'
expression_x = '-epsilon_i*mu_i*omega_i^2*sin(pi*y) + 2*epsilon_i*mu_i*omega_i*omega_r*cos(pi*y) + epsilon_i*mu_i*omega_r^2*sin(pi*y) + epsilon_i*mu_r*omega_i^2*cos(pi*y) + 2*epsilon_i*mu_r*omega_i*omega_r*sin(pi*y) - epsilon_i*mu_r*omega_r^2*cos(pi*y) + epsilon_r*mu_i*omega_i^2*cos(pi*y) + 2*epsilon_r*mu_i*omega_i*omega_r*sin(pi*y) - epsilon_r*mu_i*omega_r^2*cos(pi*y) + epsilon_r*mu_r*omega_i^2*sin(pi*y) - 2*epsilon_r*mu_r*omega_i*omega_r*cos(pi*y) - epsilon_r*mu_r*omega_r^2*sin(pi*y) + mu_i*omega_i*sigma_i*sin(pi*y) - mu_i*omega_i*sigma_r*cos(pi*y) - mu_i*omega_r*sigma_i*cos(pi*y) - mu_i*omega_r*sigma_r*sin(pi*y) - mu_r*omega_i*sigma_i*cos(pi*y) - mu_r*omega_i*sigma_r*sin(pi*y) - mu_r*omega_r*sigma_i*sin(pi*y) + mu_r*omega_r*sigma_r*cos(pi*y) + pi^2*sin(pi*y)'
expression_y = 'epsilon_i*mu_i*omega_i^2*sin(pi*x) - 2*epsilon_i*mu_i*omega_i*omega_r*cos(pi*x) - epsilon_i*mu_i*omega_r^2*sin(pi*x) - epsilon_i*mu_r*omega_i^2*cos(pi*x) - 2*epsilon_i*mu_r*omega_i*omega_r*sin(pi*x) + epsilon_i*mu_r*omega_r^2*cos(pi*x) - epsilon_r*mu_i*omega_i^2*cos(pi*x) - 2*epsilon_r*mu_i*omega_i*omega_r*sin(pi*x) + epsilon_r*mu_i*omega_r^2*cos(pi*x) - epsilon_r*mu_r*omega_i^2*sin(pi*x) + 2*epsilon_r*mu_r*omega_i*omega_r*cos(pi*x) + epsilon_r*mu_r*omega_r^2*sin(pi*x) - mu_i*omega_i*sigma_i*sin(pi*x) + mu_i*omega_i*sigma_r*cos(pi*x) + mu_i*omega_r*sigma_i*cos(pi*x) + mu_i*omega_r*sigma_r*sin(pi*x) + mu_r*omega_i*sigma_i*cos(pi*x) + mu_r*omega_i*sigma_r*sin(pi*x) + mu_r*omega_r*sigma_i*sin(pi*x) - mu_r*omega_r*sigma_r*cos(pi*x) - pi^2*sin(pi*x)'
[]
[source_n]
type = ParsedFunction
symbol_names = 'sigma_r'
symbol_values = 'sigma'
expression = '-2*x^2 - 2*y^2 - 0.5*sigma_r*(sin(x*pi)^2 + sin(y*pi)^2 + cos(x*pi)^2 + cos(y*pi)^2)'
[]
#Material Coefficients
[omega]
type = ParsedFunction
expression = '2.0'
[]
[mu]
type = ParsedFunction
expression = '1.0'
[]
[epsilon]
type = ParsedFunction
expression = '3.0'
[]
[sigma]
type = ParsedFunction
expression = '4.0'
#expression = 'x^2*y^2'
[]
[]
[Materials]
[WaveCoeff]
type = WaveEquationCoefficient
eps_rel_imag = eps_imag
eps_rel_real = eps_real
k_real = k_real
k_imag = k_imag
mu_rel_imag = mu_imag
mu_rel_real = mu_real
[]
[eps_real]
type = ADGenericFunctionMaterial
prop_names = eps_real
prop_values = epsilon
[]
[eps_imag]
type = ADGenericFunctionMaterial
prop_names = eps_imag
prop_values = epsilon
[]
[mu_real]
type = ADGenericFunctionMaterial
prop_names = mu_real
prop_values = mu
[]
[mu_imag]
type = ADGenericFunctionMaterial
prop_names = mu_imag
prop_values = mu
[]
[k_real]
type = ADGenericFunctionMaterial
prop_names = k_real
prop_values = omega
[]
[k_imag]
type = ADGenericFunctionMaterial
prop_names = k_imag
prop_values = omega
[]
[cond_real]
type = ADGenericFunctionMaterial
prop_names = cond_real
prop_values = sigma
[]
[cond_imag]
type = ADGenericFunctionMaterial
prop_names = cond_imag
prop_values = sigma
[]
[]
[Variables]
[n]
family = LAGRANGE
order = FIRST
[]
[E_real]
family = NEDELEC_ONE
order = FIRST
[]
[E_imag]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[curl_curl_real]
type = CurlCurlField
variable = E_real
[]
[coeff_real]
type = ADMatWaveReaction
variable = E_real
field_real = E_real
field_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = real
[]
[conduction_real]
type = ADConductionCurrent
variable = E_real
field_imag = E_imag
field_real = E_real
conductivity_real = cond_real
conductivity_imag = cond_imag
ang_freq_real = k_real
ang_freq_imag = k_imag
permeability_real = mu_real
permeability_imag = mu_imag
component = real
[]
[body_force_real]
type = VectorBodyForce
variable = E_real
function = source_real
[]
[curl_curl_imag]
type = CurlCurlField
variable = E_imag
[]
[coeff_imag]
type = ADMatWaveReaction
variable = E_imag
field_real = E_real
field_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = imaginary
[]
[conduction_imag]
type = ADConductionCurrent
variable = E_imag
field_imag = E_imag
field_real = E_real
conductivity_real = cond_real
conductivity_imag = cond_imag
ang_freq_real = k_real
ang_freq_imag = k_imag
permeability_real = mu_real
permeability_imag = mu_imag
component = imaginary
[]
[body_force_imag]
type = VectorBodyForce
variable = E_imag
function = source_imag
[]
[n_diffusion]
type = Diffusion
variable = n
[]
[microwave_heating]
type = EMJouleHeatingSource
variable = n
E_imag = E_imag
E_real = E_real
conductivity = cond_real
[]
[body_force_n]
type = BodyForce
variable = n
function = source_n
[]
[]
[BCs]
[sides_real]
type = VectorCurlPenaltyDirichletBC
variable = E_real
function = exact_real
penalty = 1e8
boundary = 'left right top bottom'
[]
[sides_imag]
type = VectorCurlPenaltyDirichletBC
variable = E_imag
function = exact_imag
penalty = 1e8
boundary = 'left right top bottom'
[]
[sides_n]
type = FunctorDirichletBC
variable = n
boundary = 'left right top bottom'
functor = exact_n
preset = false
[]
[]
[Postprocessors]
[error_real]
type = ElementVectorL2Error
variable = E_real
function = exact_real
[]
[error_imag]
type = ElementVectorL2Error
variable = E_imag
function = exact_imag
[]
[error_n]
type = ElementL2Error
variable = n
function = exact_n
[]
[h]
type = AverageElementSize
[]
[h_squared]
type = ParsedPostprocessor
pp_names = 'h'
expression = 'h * h'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
csv = true
[]
(modules/electromagnetics/test/tests/kernels/scalar_complex_helmholtz/scalar_complex_helmholtz.i)
# problem: -(cu')' - k^2 * u = -F , 0 < x < L, u: R -> C
# u(x=0) = g0 , u(x=L) = gL
# k = a + jb
# a = a(x) = 2 * (1 + x/L)
# b = b(x) = (1 + x/L)
# c = d + jh
# d = d(x) = 12 * (1 + x/L)^2
# h = h(x) = 4 * (1 + x/L)^2
# L = 10
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
xmin = 0
xmax = 10
nx = 100
[]
[]
[Variables]
[u_real]
order = FIRST
family = LAGRANGE
[]
[u_imag]
order = FIRST
family = LAGRANGE
[]
[]
[Functions]
[k_real]
type = ParsedFunction
expression = '2*(1 + x/10)'
[]
[k_imag]
type = ParsedFunction
expression = '(1 + x/10)'
[]
[d_func]
type = ParsedFunction
expression = '12 * (1 + x/10)^2'
[]
[h_func]
type = ParsedFunction
expression = '4 * (1 + x/10)^2'
[]
[negative_h_func]
type = ParsedFunction
expression = '-4 * (1 + x/10)^2'
[]
[RHS_real]
type = MMSTestFunc
L = 10
g0_real = 1
g0_imag = -1
gL_real = 0
gL_imag = 0
component = real
[]
[RHS_imag]
type = MMSTestFunc
L = 10
g0_real = 1
g0_imag = -1
gL_real = 0
gL_imag = 0
component = imaginary
[]
[]
[Materials]
[k_real_mat]
type = ADGenericFunctionMaterial
prop_names = k_real_mat
prop_values = k_real
[]
[k_imag_mat]
type = ADGenericFunctionMaterial
prop_names = k_imag_mat
prop_values = k_imag
[]
[wave_equation_coefficient]
type = WaveEquationCoefficient
k_real = k_real_mat
k_imag = k_imag_mat
eps_rel_real = 1
eps_rel_imag = 0
mu_rel_real = 1
mu_rel_imag = 0
[]
[negative_wave_equation_coefficient_imaginary]
type = ADParsedMaterial
property_name = negative_wave_equation_coefficient_imaginary
material_property_names = wave_equation_coefficient_imaginary
expression = '-1 * wave_equation_coefficient_imaginary'
[]
[]
[Kernels]
[laplacian_real]
type = FunctionDiffusion
function = d_func
variable = u_real
[]
[coupledLaplacian_real]
type = FunctionDiffusion
function = negative_h_func
v = u_imag
variable = u_real
[]
[coeffField_real]
type = ADMatReaction
reaction_rate = wave_equation_coefficient_real
variable = u_real
[]
[coupledField_real]
type = ADMatCoupledForce
v = u_imag
mat_prop_coef = negative_wave_equation_coefficient_imaginary
variable = u_real
[]
[bodyForce_real]
type = BodyForce
function = RHS_real
variable = u_real
[]
[laplacian_imag]
type = FunctionDiffusion
function = d_func
variable = u_imag
[]
[coupledLaplacian_imag]
type = FunctionDiffusion
function = h_func
v = u_real
variable = u_imag
[]
[coeffField_imag]
type = ADMatReaction
reaction_rate = wave_equation_coefficient_real
variable = u_imag
[]
[coupledField_imag]
type = ADMatCoupledForce
v = u_real
mat_prop_coef = wave_equation_coefficient_imaginary
variable = u_imag
[]
[bodyForce_imag]
type = BodyForce
function = RHS_imag
variable = u_imag
[]
[]
[BCs]
[left_real]
type = DirichletBC
value = 1
boundary = left
variable = u_real
[]
[left_imag]
type = DirichletBC
value = -1
boundary = left
variable = u_imag
[]
[right_real]
type = DirichletBC
value = 0
boundary = right
variable = u_real
[]
[right_imag]
type = DirichletBC
value = 0
boundary = right
variable = u_imag
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
exodus = true
[]
(modules/electromagnetics/test/tests/auxkernels/azimuthal_Faradays_law/error_azim_magnetic_time_deriv.i)
# Test for AzimuthMagneticTimeDerivRZ with scalar inputs
# Manufactured solution: E_real = y^2 * x_hat - x^2 * y_hat
# E_imag = y^2 * x_hat - x^2 * y_hat
# dB_theta_real / dt = -(2*y + 2*x)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmax = 1
xmin = 0
ymax = 1
ymin = -1
elem_type = QUAD9
[]
coord_type = RZ
rz_coord_axis = Y
[]
[Functions]
#The exact solution for the heated species and electric field real and imag. component
[exact_real]
type = ParsedVectorFunction
expression_x = 'y^2'
expression_y = '-x^2'
[]
[exact_imag]
type = ParsedVectorFunction
expression_x = 'y^2'
expression_y = '-x^2'
[]
#The forcing terms for the heated species and electric field real and imag. component
[source_real]
type = ParsedVectorFunction
expression_x = '-y^2 - cos(pi*y) - 2'
expression_y = 'x^2 + cos(pi*x) + 4 + 2*y/x'
[]
[source_imag]
type = ParsedVectorFunction
expression_x = '-y^2 + sin(pi*y) - 2'
expression_y = 'x^2 - sin(pi*x) + 4 + 2*y/x'
[]
[current_real]
type = ParsedVectorFunction
expression_x = 'sin(pi*y)'
expression_y = '-sin(pi*x)'
[]
[current_imag]
type = ParsedVectorFunction
expression_x = 'cos(pi*y)'
expression_y = '-cos(pi*x)'
[]
[azim_dB_dt_func]
type = ParsedFunction
expression = '-(2*y + 2*x)'
[]
[]
[Materials]
[WaveCoeff]
type = WaveEquationCoefficient
eps_rel_real = 1.0
eps_rel_imag = 0.0
k_real = 1.0
k_imag = 0.0
mu_rel_real = 1.0
mu_rel_imag = 0.0
[]
[]
[Variables]
[E_real]
family = NEDELEC_ONE
order = FIRST
[]
[E_imag]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[curl_curl_real]
type = CurlCurlField
variable = E_real
[]
[coeff_real]
type = ADMatWaveReaction
variable = E_real
field_real = E_real
field_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = real
[]
[current_real]
type = VectorCurrentSource
variable = E_real
source_real = current_real
source_imag = current_imag
component = real
[]
[body_force_real]
type = VectorBodyForce
variable = E_real
function = source_real
[]
[curl_curl_imag]
type = CurlCurlField
variable = E_imag
[]
[coeff_imag]
type = ADMatWaveReaction
variable = E_imag
field_real = E_real
field_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = imaginary
[]
[current_imag]
type = VectorCurrentSource
variable = E_imag
source_real = current_real
source_imag = current_imag
component = imaginary
[]
[body_force_imag]
type = VectorBodyForce
variable = E_imag
function = source_imag
[]
[]
[AuxVariables]
[aux_E_real_x]
family = MONOMIAL
order = FIRST
[]
[aux_E_real_y]
family = MONOMIAL
order = FIRST
[]
[azim_dB_dt_term]
family = MONOMIAL
order = FIRST
[]
[]
[AuxKernels]
[aux_E_real_x]
type = VectorVariableComponentAux
variable = aux_E_real_x
vector_variable = E_real
component = X
[]
[aux_E_real_y]
type = VectorVariableComponentAux
variable = aux_E_real_y
vector_variable = E_real
component = Y
[]
[aux_azim_dB_dt]
type = AzimuthMagneticTimeDerivRZ
# Efield = E_real
# Efield_X = aux_E_real_x
# Efield_Y = aux_E_real_y
variable = azim_dB_dt_term
[]
[]
[BCs]
[sides_real]
type = VectorCurlPenaltyDirichletBC
variable = E_real
function = exact_real
penalty = 1e8
boundary = 'left right top bottom'
[]
[sides_imag]
type = VectorCurlPenaltyDirichletBC
variable = E_imag
function = exact_imag
penalty = 1e8
boundary = 'left right top bottom'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-16
[]
[Outputs]
exodus = true
csv = true
[]
(modules/combined/test/tests/electromagnetic_joule_heating/microwave_heating.i)
# Test for ADJouleHeatingSource
#
# This test utilizes the method of manufactured solutions, such that
# all terms of the PDE's and all supplied parameter are are non-zero.
# The exact PDE's are the following:
#
# curl(curl(E)) - mu*omega^2*epsilon*E + j*mu*omega*sigma*E = F_E_supplied
# div(-grad(n)) - 0.5*Re(sigma*E * E^*) = F_n_supplied
#
# Where:
# - E is the electric field
# - mu is the permeability
# - omega is the angular frequency of the system
# - epsilon is the permittivity
# - j is the sqrt(-1)
# - sigma is the electric conductivity
# - F_E_supplied is the forcing term of the electric field MMS
# - n is the energy density of a species
# (this is analogous to the electron energy density in plasma physics)
# - E^* is the complex conjugate of the electric field
# - F_n_supplied is the forcing term of the energy density MMS
#
# All boundary conditions in this test are Dirichlet BCs. The manufactured
# solutions are as follow:
#
# Manufactured solution: E_real = cos(pi*y) * x_hat - cos(pi*x) * y_hat
# E_imag = sin(pi*y) * x_hat - sin(pi*x) * y_hat
# n = x^2*y^2
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
xmin = -1
ymin = -1
elem_type = QUAD9
[]
[]
[Functions]
#The exact solution for the heated species and electric field real and imag. component
[exact_real]
type = ParsedVectorFunction
expression_x = 'cos(pi*y)'
expression_y = '-cos(pi*x)'
[]
[exact_imag]
type = ParsedVectorFunction
expression_x = 'sin(pi*y)'
expression_y = '-sin(pi*x)'
[]
[exact_n]
type = ParsedFunction
expression = 'x^2*y^2'
[]
#The forcing terms for the heated species and electric field real and imag. component
[source_real]
type = ParsedVectorFunction
symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
symbol_values = 'omega mu epsilon sigma omega mu epsilon sigma'
expression_x = '-epsilon_i*mu_i*omega_i^2*cos(pi*y) - 2*epsilon_i*mu_i*omega_i*omega_r*sin(pi*y) + epsilon_i*mu_i*omega_r^2*cos(pi*y) - epsilon_i*mu_r*omega_i^2*sin(pi*y) + 2*epsilon_i*mu_r*omega_i*omega_r*cos(pi*y) + epsilon_i*mu_r*omega_r^2*sin(pi*y) - epsilon_r*mu_i*omega_i^2*sin(pi*y) + 2*epsilon_r*mu_i*omega_i*omega_r*cos(pi*y) + epsilon_r*mu_i*omega_r^2*sin(pi*y) + epsilon_r*mu_r*omega_i^2*cos(pi*y) + 2*epsilon_r*mu_r*omega_i*omega_r*sin(pi*y) - epsilon_r*mu_r*omega_r^2*cos(pi*y) + mu_i*omega_i*sigma_i*cos(pi*y) + mu_i*omega_i*sigma_r*sin(pi*y) + mu_i*omega_r*sigma_i*sin(pi*y) - mu_i*omega_r*sigma_r*cos(pi*y) + mu_r*omega_i*sigma_i*sin(pi*y) - mu_r*omega_i*sigma_r*cos(pi*y) - mu_r*omega_r*sigma_i*cos(pi*y) - mu_r*omega_r*sigma_r*sin(pi*y) + pi^2*cos(pi*y)'
expression_y = 'epsilon_i*mu_i*omega_i^2*cos(pi*x) + 2*epsilon_i*mu_i*omega_i*omega_r*sin(pi*x) - epsilon_i*mu_i*omega_r^2*cos(pi*x) + epsilon_i*mu_r*omega_i^2*sin(pi*x) - 2*epsilon_i*mu_r*omega_i*omega_r*cos(pi*x) - epsilon_i*mu_r*omega_r^2*sin(pi*x) + epsilon_r*mu_i*omega_i^2*sin(pi*x) - 2*epsilon_r*mu_i*omega_i*omega_r*cos(pi*x) - epsilon_r*mu_i*omega_r^2*sin(pi*x) - epsilon_r*mu_r*omega_i^2*cos(pi*x) - 2*epsilon_r*mu_r*omega_i*omega_r*sin(pi*x) + epsilon_r*mu_r*omega_r^2*cos(pi*x) - mu_i*omega_i*sigma_i*cos(pi*x) - mu_i*omega_i*sigma_r*sin(pi*x) - mu_i*omega_r*sigma_i*sin(pi*x) + mu_i*omega_r*sigma_r*cos(pi*x) - mu_r*omega_i*sigma_i*sin(pi*x) + mu_r*omega_i*sigma_r*cos(pi*x) + mu_r*omega_r*sigma_i*cos(pi*x) + mu_r*omega_r*sigma_r*sin(pi*x) - pi^2*cos(pi*x)'
[]
[source_imag]
type = ParsedVectorFunction
symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
symbol_values = 'omega mu epsilon sigma omega mu epsilon sigma'
expression_x = '-epsilon_i*mu_i*omega_i^2*sin(pi*y) + 2*epsilon_i*mu_i*omega_i*omega_r*cos(pi*y) + epsilon_i*mu_i*omega_r^2*sin(pi*y) + epsilon_i*mu_r*omega_i^2*cos(pi*y) + 2*epsilon_i*mu_r*omega_i*omega_r*sin(pi*y) - epsilon_i*mu_r*omega_r^2*cos(pi*y) + epsilon_r*mu_i*omega_i^2*cos(pi*y) + 2*epsilon_r*mu_i*omega_i*omega_r*sin(pi*y) - epsilon_r*mu_i*omega_r^2*cos(pi*y) + epsilon_r*mu_r*omega_i^2*sin(pi*y) - 2*epsilon_r*mu_r*omega_i*omega_r*cos(pi*y) - epsilon_r*mu_r*omega_r^2*sin(pi*y) + mu_i*omega_i*sigma_i*sin(pi*y) - mu_i*omega_i*sigma_r*cos(pi*y) - mu_i*omega_r*sigma_i*cos(pi*y) - mu_i*omega_r*sigma_r*sin(pi*y) - mu_r*omega_i*sigma_i*cos(pi*y) - mu_r*omega_i*sigma_r*sin(pi*y) - mu_r*omega_r*sigma_i*sin(pi*y) + mu_r*omega_r*sigma_r*cos(pi*y) + pi^2*sin(pi*y)'
expression_y = 'epsilon_i*mu_i*omega_i^2*sin(pi*x) - 2*epsilon_i*mu_i*omega_i*omega_r*cos(pi*x) - epsilon_i*mu_i*omega_r^2*sin(pi*x) - epsilon_i*mu_r*omega_i^2*cos(pi*x) - 2*epsilon_i*mu_r*omega_i*omega_r*sin(pi*x) + epsilon_i*mu_r*omega_r^2*cos(pi*x) - epsilon_r*mu_i*omega_i^2*cos(pi*x) - 2*epsilon_r*mu_i*omega_i*omega_r*sin(pi*x) + epsilon_r*mu_i*omega_r^2*cos(pi*x) - epsilon_r*mu_r*omega_i^2*sin(pi*x) + 2*epsilon_r*mu_r*omega_i*omega_r*cos(pi*x) + epsilon_r*mu_r*omega_r^2*sin(pi*x) - mu_i*omega_i*sigma_i*sin(pi*x) + mu_i*omega_i*sigma_r*cos(pi*x) + mu_i*omega_r*sigma_i*cos(pi*x) + mu_i*omega_r*sigma_r*sin(pi*x) + mu_r*omega_i*sigma_i*cos(pi*x) + mu_r*omega_i*sigma_r*sin(pi*x) + mu_r*omega_r*sigma_i*sin(pi*x) - mu_r*omega_r*sigma_r*cos(pi*x) - pi^2*sin(pi*x)'
[]
[source_n]
type = ParsedFunction
symbol_names = 'sigma_r'
symbol_values = 'sigma'
expression = '-2*x^2 - 2*y^2 - 0.5*sigma_r*(sin(x*pi)^2 + sin(y*pi)^2 + cos(x*pi)^2 + cos(y*pi)^2)'
[]
#Material Coefficients
[omega]
type = ParsedFunction
expression = '2.0'
[]
[mu]
type = ParsedFunction
expression = '1.0'
[]
[epsilon]
type = ParsedFunction
expression = '3.0'
[]
[sigma]
type = ParsedFunction
expression = '4.0'
#expression = 'x^2*y^2'
[]
[]
[Materials]
[WaveCoeff]
type = WaveEquationCoefficient
eps_rel_imag = eps_imag
eps_rel_real = eps_real
k_real = k_real
k_imag = k_imag
mu_rel_imag = mu_imag
mu_rel_real = mu_real
[]
[eps_real]
type = ADGenericFunctionMaterial
prop_names = eps_real
prop_values = epsilon
[]
[eps_imag]
type = ADGenericFunctionMaterial
prop_names = eps_imag
prop_values = epsilon
[]
[mu_real]
type = ADGenericFunctionMaterial
prop_names = mu_real
prop_values = mu
[]
[mu_imag]
type = ADGenericFunctionMaterial
prop_names = mu_imag
prop_values = mu
[]
[k_real]
type = ADGenericFunctionMaterial
prop_names = k_real
prop_values = omega
[]
[k_imag]
type = ADGenericFunctionMaterial
prop_names = k_imag
prop_values = omega
[]
[cond_real]
type = ADGenericFunctionMaterial
prop_names = cond_real
prop_values = sigma
[]
[cond_imag]
type = ADGenericFunctionMaterial
prop_names = cond_imag
prop_values = sigma
[]
[ElectromagneticMaterial]
type = ElectromagneticHeatingMaterial
electric_field = E_real
complex_electric_field = E_imag
electric_field_heating_name = electric_field_heating
electrical_conductivity = cond_real
formulation = FREQUENCY
solver = ELECTROMAGNETIC
[]
[]
[Variables]
[n]
family = LAGRANGE
order = FIRST
[]
[E_real]
family = NEDELEC_ONE
order = FIRST
[]
[E_imag]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[curl_curl_real]
type = CurlCurlField
variable = E_real
[]
[coeff_real]
type = ADMatWaveReaction
variable = E_real
field_real = E_real
field_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = real
[]
[conduction_real]
type = ADConductionCurrent
variable = E_real
field_imag = E_imag
field_real = E_real
conductivity_real = cond_real
conductivity_imag = cond_imag
ang_freq_real = k_real
ang_freq_imag = k_imag
permeability_real = mu_real
permeability_imag = mu_imag
component = real
[]
[body_force_real]
type = VectorBodyForce
variable = E_real
function = source_real
[]
[curl_curl_imag]
type = CurlCurlField
variable = E_imag
[]
[coeff_imag]
type = ADMatWaveReaction
variable = E_imag
field_real = E_real
field_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = imaginary
[]
[conduction_imag]
type = ADConductionCurrent
variable = E_imag
field_imag = E_imag
field_real = E_real
conductivity_real = cond_real
conductivity_imag = cond_imag
ang_freq_real = k_real
ang_freq_imag = k_imag
permeability_real = mu_real
permeability_imag = mu_imag
component = imaginary
[]
[body_force_imag]
type = VectorBodyForce
variable = E_imag
function = source_imag
[]
[n_diffusion]
type = Diffusion
variable = n
[]
[microwave_heating]
type = ADJouleHeatingSource
variable = n
heating_term = 'electric_field_heating'
[]
[body_force_n]
type = BodyForce
variable = n
function = source_n
[]
[]
[BCs]
[sides_real]
type = VectorCurlPenaltyDirichletBC
variable = E_real
function = exact_real
penalty = 1e8
boundary = 'left right top bottom'
[]
[sides_imag]
type = VectorCurlPenaltyDirichletBC
variable = E_imag
function = exact_imag
penalty = 1e8
boundary = 'left right top bottom'
[]
[sides_n]
type = FunctorDirichletBC
variable = n
boundary = 'left right top bottom'
functor = exact_n
preset = false
[]
[]
[Postprocessors]
[error_real]
type = ElementVectorL2Error
variable = E_real
function = exact_real
[]
[error_imag]
type = ElementVectorL2Error
variable = E_imag
function = exact_imag
[]
[error_n]
type = ElementL2Error
variable = n
function = exact_n
[]
[h]
type = AverageElementSize
[]
[h_squared]
type = ParsedPostprocessor
pp_names = 'h'
expression = 'h * h'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
csv = true
[]
(modules/electromagnetics/test/tests/auxkernels/azimuthal_Faradays_law/vector_azim_magnetic_time_deriv.i)
# Test for AzimuthMagneticTimeDerivRZ with a vector input
# Manufactured solution: E_real = y^2 * x_hat - x^2 * y_hat
# E_imag = y^2 * x_hat - x^2 * y_hat
# dB_theta_real / dt = -(2*y + 2*x)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
xmax = 1
xmin = 0
ymax = 1
ymin = -1
elem_type = QUAD9
[]
coord_type = RZ
rz_coord_axis = Y
[]
[Functions]
#The exact solution for the heated species and electric field real and imag. component
[exact_real]
type = ParsedVectorFunction
expression_x = 'y^2'
expression_y = '-x^2'
[]
[exact_imag]
type = ParsedVectorFunction
expression_x = 'y^2'
expression_y = '-x^2'
[]
#The forcing terms for the heated species and electric field real and imag. component
[source_real]
type = ParsedVectorFunction
expression_x = '-y^2 - cos(pi*y) - 2'
expression_y = 'x^2 + cos(pi*x) + 4 + 2*y/x'
[]
[source_imag]
type = ParsedVectorFunction
expression_x = '-y^2 + sin(pi*y) - 2'
expression_y = 'x^2 - sin(pi*x) + 4 + 2*y/x'
[]
[current_real]
type = ParsedVectorFunction
expression_x = 'sin(pi*y)'
expression_y = '-sin(pi*x)'
[]
[current_imag]
type = ParsedVectorFunction
expression_x = 'cos(pi*y)'
expression_y = '-cos(pi*x)'
[]
[azim_dB_dt_func]
type = ParsedFunction
expression = '-(2*y + 2*x)'
[]
[]
[Materials]
[WaveCoeff]
type = WaveEquationCoefficient
eps_rel_real = 1.0
eps_rel_imag = 0.0
k_real = 1.0
k_imag = 0.0
mu_rel_real = 1.0
mu_rel_imag = 0.0
[]
[]
[Variables]
[E_real]
family = NEDELEC_ONE
order = FIRST
[]
[E_imag]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[curl_curl_real]
type = CurlCurlField
variable = E_real
[]
[coeff_real]
type = ADMatWaveReaction
variable = E_real
field_real = E_real
field_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = real
[]
[current_real]
type = VectorCurrentSource
variable = E_real
source_real = current_real
source_imag = current_imag
component = real
[]
[body_force_real]
type = VectorBodyForce
variable = E_real
function = source_real
[]
[curl_curl_imag]
type = CurlCurlField
variable = E_imag
[]
[coeff_imag]
type = ADMatWaveReaction
variable = E_imag
field_real = E_real
field_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = imaginary
[]
[current_imag]
type = VectorCurrentSource
variable = E_imag
source_real = current_real
source_imag = current_imag
component = imaginary
[]
[body_force_imag]
type = VectorBodyForce
variable = E_imag
function = source_imag
[]
[]
[AuxVariables]
[azim_dB_dt_term_vector]
family = MONOMIAL
order = FIRST
[]
[]
[AuxKernels]
[aux_azim_dB_dt_vector]
type = AzimuthMagneticTimeDerivRZ
Efield = E_real
variable = azim_dB_dt_term_vector
[]
[]
[BCs]
[sides_real]
type = VectorCurlPenaltyDirichletBC
variable = E_real
function = exact_real
penalty = 1e8
boundary = 'left right top bottom'
[]
[sides_imag]
type = VectorCurlPenaltyDirichletBC
variable = E_imag
function = exact_imag
penalty = 1e8
boundary = 'left right top bottom'
[]
[]
[Postprocessors]
[error_real]
type = ElementVectorL2Error
variable = E_real
function = exact_real
[]
[error_imag]
type = ElementVectorL2Error
variable = E_imag
function = exact_imag
[]
[error_azim_dB_dt_vector]
type = ElementL2Error
variable = azim_dB_dt_term_vector
function = azim_dB_dt_func
[]
[h]
type = AverageElementSize
[]
[h_squared]
type = ParsedPostprocessor
pp_names = 'h'
expression = 'h * h'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-16
[]
[Outputs]
exodus = true
csv = true
[]
(modules/electromagnetics/test/tests/kernels/vector_helmholtz/vector_ADmaterial_wave_reaction.i)
# Test for ADMatWaveReaction
# Manufactured solution: E_real = y^2 * x_hat - x^2 * y_hat
# E_imag = y^2 * x_hat - x^2 * y_hat
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
xmin = -1
ymin = -1
elem_type = QUAD9
[]
[]
[Functions]
#The exact solution for both the real and imag. component
[exact]
type = ParsedVectorFunction
expression_x = 'y*y'
expression_y = '-x*x'
[]
#The forcing terms for the real and imag. component
[source_real]
type = ParsedVectorFunction
symbol_names = 'omega_r mu_r epsilon_r omega_i mu_i epsilon_i'
symbol_values = 'omega mu epsilon omega mu epsilon'
expression_x = '-epsilon_i*mu_i*omega_i^2*y^2 - 2*epsilon_i*mu_i*omega_i*omega_r*y^2 + epsilon_i*mu_i*omega_r^2*y^2 - epsilon_i*mu_r*omega_i^2*y^2 + 2*epsilon_i*mu_r*omega_i*omega_r*y^2 + epsilon_i*mu_r*omega_r^2*y^2 - epsilon_r*mu_i*omega_i^2*y^2 + 2*epsilon_r*mu_i*omega_i*omega_r*y^2 + epsilon_r*mu_i*omega_r^2*y^2 + epsilon_r*mu_r*omega_i^2*y^2 + 2*epsilon_r*mu_r*omega_i*omega_r*y^2 - epsilon_r*mu_r*omega_r^2*y^2 - 2'
expression_y = 'epsilon_i*mu_i*omega_i^2*x^2 + 2*epsilon_i*mu_i*omega_i*omega_r*x^2 - epsilon_i*mu_i*omega_r^2*x^2 + epsilon_i*mu_r*omega_i^2*x^2 - 2*epsilon_i*mu_r*omega_i*omega_r*x^2 - epsilon_i*mu_r*omega_r^2*x^2 + epsilon_r*mu_i*omega_i^2*x^2 - 2*epsilon_r*mu_i*omega_i*omega_r*x^2 - epsilon_r*mu_i*omega_r^2*x^2 - epsilon_r*mu_r*omega_i^2*x^2 - 2*epsilon_r*mu_r*omega_i*omega_r*x^2 + epsilon_r*mu_r*omega_r^2*x^2 + 2'
[]
[source_imag]
type = ParsedVectorFunction
symbol_names = 'omega_r mu_r epsilon_r omega_i mu_i epsilon_i'
symbol_values = 'omega mu epsilon omega mu epsilon'
expression_x = '-epsilon_i*mu_i*omega_i^2*y^2 + 2*epsilon_i*mu_i*omega_i*omega_r*y^2 + epsilon_i*mu_i*omega_r^2*y^2 + epsilon_i*mu_r*omega_i^2*y^2 + 2*epsilon_i*mu_r*omega_i*omega_r*y^2 - epsilon_i*mu_r*omega_r^2*y^2 + epsilon_r*mu_i*omega_i^2*y^2 + 2*epsilon_r*mu_i*omega_i*omega_r*y^2 - epsilon_r*mu_i*omega_r^2*y^2 + epsilon_r*mu_r*omega_i^2*y^2 - 2*epsilon_r*mu_r*omega_i*omega_r*y^2 - epsilon_r*mu_r*omega_r^2*y^2 - 2'
expression_y = 'epsilon_i*mu_i*omega_i^2*x^2 - 2*epsilon_i*mu_i*omega_i*omega_r*x^2 - epsilon_i*mu_i*omega_r^2*x^2 - epsilon_i*mu_r*omega_i^2*x^2 - 2*epsilon_i*mu_r*omega_i*omega_r*x^2 + epsilon_i*mu_r*omega_r^2*x^2 - epsilon_r*mu_i*omega_i^2*x^2 - 2*epsilon_r*mu_i*omega_i*omega_r*x^2 + epsilon_r*mu_i*omega_r^2*x^2 - epsilon_r*mu_r*omega_i^2*x^2 + 2*epsilon_r*mu_r*omega_i*omega_r*x^2 + epsilon_r*mu_r*omega_r^2*x^2 + 2'
[]
#Material Coefficients
[omega]
type = ParsedFunction
expression = '2.0'
[]
[mu]
type = ParsedFunction
expression = '1.0'
[]
[epsilon]
type = ParsedFunction
expression = '3.0'
[]
[]
[Materials]
[WaveCoeff]
type = WaveEquationCoefficient
eps_rel_imag = eps_imag
eps_rel_real = eps_real
k_real = k_real
k_imag = k_imag
mu_rel_imag = mu_imag
mu_rel_real = mu_real
[]
[eps_real]
type = ADGenericFunctionMaterial
prop_names = eps_real
prop_values = epsilon
[]
[eps_imag]
type = ADGenericFunctionMaterial
prop_names = eps_imag
prop_values = epsilon
[]
[mu_real]
type = ADGenericFunctionMaterial
prop_names = mu_real
prop_values = mu
[]
[mu_imag]
type = ADGenericFunctionMaterial
prop_names = mu_imag
prop_values = mu
[]
[k_real]
type = ADGenericFunctionMaterial
prop_names = k_real
prop_values = omega
[]
[k_imag]
type = ADGenericFunctionMaterial
prop_names = k_imag
prop_values = omega
[]
[]
[Variables]
[E_real]
family = NEDELEC_ONE
order = FIRST
[]
[E_imag]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[curl_curl_real]
type = CurlCurlField
variable = E_real
[]
[coeff_real]
type = ADMatWaveReaction
variable = E_real
field_real = E_real
field_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = real
[]
[body_force_real]
type = VectorBodyForce
variable = E_real
function = source_real
[]
[curl_curl_imag]
type = CurlCurlField
variable = E_imag
[]
[coeff_imag]
type = ADMatWaveReaction
variable = E_imag
field_real = E_real
field_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = imaginary
[]
[body_force_imag]
type = VectorBodyForce
variable = E_imag
function = source_imag
[]
[]
[BCs]
[sides_real]
type = VectorCurlPenaltyDirichletBC
variable = E_real
function_x = 'y*y'
function_y = '-x*x'
penalty = 1e8
boundary = 'left right top bottom'
[]
[sides_imag]
type = VectorCurlPenaltyDirichletBC
variable = E_imag
function_x = 'y*y'
function_y = '-x*x'
penalty = 1e8
boundary = 'left right top bottom'
[]
[]
[Postprocessors]
[error_real]
type = ElementVectorL2Error
variable = E_real
function = exact
[]
[error_imag]
type = ElementVectorL2Error
variable = E_imag
function = exact
[]
[h]
type = AverageElementSize
[]
[h_squared]
type = ParsedPostprocessor
pp_names = 'h'
expression = 'h * h'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Outputs]
exodus = true
csv = true
[]