- field_imagThe imaginary component of the electric field.C++ Type:std::vector<VariableName> Unit:(no unit assumed) Controllable:No Description:The imaginary component of the electric field. 
- field_realThe real component of the electric field.C++ Type:std::vector<VariableName> Unit:(no unit assumed) Controllable:No Description:The real component of the electric field. 
- variableThe name of the variable that this residual object operates onC++ Type:NonlinearVariableName Unit:(no unit assumed) Controllable:No Description:The name of the variable that this residual object operates on 
ADConductionCurrent
Calculates the current source term in the Helmholtz wave equation using the conduction formulation of the current.
Overview
The ADConductionCurrent object implements a conduction current source term to the electric field Helmholtz wave equation. The term is defined as:
where
- , 
- is the permeability of the medium, 
- is the angular frequency of the wave propagation, 
- is the conductivity of the medium, and 
- is the electric field. 
Example Input File Syntax
[Kernels<<<{"href": "../../syntax/Kernels/index.html"}>>>]
  [conduction_real]
    type = ADConductionCurrent<<<{"description": "Calculates the current source term in the Helmholtz wave equation using the conduction formulation of the current.", "href": "ADConductionCurrent.html"}>>>
    variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = E_real
    field_imag<<<{"description": "The imaginary component of the electric field."}>>> = E_imag
    field_real<<<{"description": "The real component of the electric field."}>>> = E_real
    conductivity_real<<<{"description": "The real component of the material conductivity."}>>> = cond_real
    conductivity_imag<<<{"description": "The imaginary component of the material conductivity."}>>> = cond_imag
    ang_freq_real<<<{"description": "The real component of the angular drive frequency."}>>> = k_real
    ang_freq_imag<<<{"description": "The imaginary component of the angular drive frequency."}>>> = k_imag
    permeability_real<<<{"description": "The real component of the material permeability."}>>> = mu_real
    permeability_imag<<<{"description": "The imaginary component of the material permeability."}>>> = mu_imag
    component<<<{"description": "Component of field (real or imaginary)."}>>> = real
  []
[]Input Parameters
- ang_freq_imag0The imaginary component of the angular drive frequency.Default:0 C++ Type:MaterialPropertyName Unit:(no unit assumed) Controllable:No Description:The imaginary component of the angular drive frequency. 
- ang_freq_realang_freqThe real component of the angular drive frequency.Default:ang_freq C++ Type:MaterialPropertyName Unit:(no unit assumed) Controllable:No Description:The real component of the angular drive frequency. 
- blockThe list of blocks (ids or names) that this object will be appliedC++ Type:std::vector<SubdomainName> Controllable:No Description:The list of blocks (ids or names) that this object will be applied 
- componentComponent of field (real or imaginary).C++ Type:MooseEnum Options:real, imaginary Controllable:No Description:Component of field (real or imaginary). 
- conductivity_imag0The imaginary component of the material conductivity.Default:0 C++ Type:MaterialPropertyName Unit:(no unit assumed) Controllable:No Description:The imaginary component of the material conductivity. 
- conductivity_real1The real component of the material conductivity.Default:1 C++ Type:MaterialPropertyName Unit:(no unit assumed) Controllable:No Description:The real component of the material conductivity. 
- displacementsThe displacementsC++ Type:std::vector<VariableName> Unit:(no unit assumed) Controllable:No Description:The displacements 
- matrix_onlyFalseWhether this object is only doing assembly to matrices (no vectors)Default:False C++ Type:bool Controllable:No Description:Whether this object is only doing assembly to matrices (no vectors) 
- permeability_imag0The imaginary component of the material permeability.Default:0 C++ Type:MaterialPropertyName Unit:(no unit assumed) Controllable:No Description:The imaginary component of the material permeability. 
- permeability_realmu_vacuumThe real component of the material permeability.Default:mu_vacuum C++ Type:MaterialPropertyName Unit:(no unit assumed) Controllable:No Description:The real component of the material permeability. 
Optional Parameters
- absolute_value_vector_tagsThe tags for the vectors this residual object should fill with the absolute value of the residual contributionC++ Type:std::vector<TagName> Controllable:No Description:The tags for the vectors this residual object should fill with the absolute value of the residual contribution 
- extra_matrix_tagsThe extra tags for the matrices this Kernel should fillC++ Type:std::vector<TagName> Controllable:No Description:The extra tags for the matrices this Kernel should fill 
- extra_vector_tagsThe extra tags for the vectors this Kernel should fillC++ Type:std::vector<TagName> Controllable:No Description:The extra tags for the vectors this Kernel should fill 
- matrix_tagssystemThe tag for the matrices this Kernel should fillDefault:system C++ Type:MultiMooseEnum Options:nontime, system Controllable:No Description:The tag for the matrices this Kernel should fill 
- vector_tagsnontimeThe tag for the vectors this Kernel should fillDefault:nontime C++ Type:MultiMooseEnum Options:nontime, time Controllable:No Description:The tag for the vectors this Kernel should fill 
Contribution To Tagged Field Data 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. 
- diag_save_inThe name of auxiliary variables to save this Kernel's diagonal Jacobian contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)C++ Type:std::vector<AuxVariableName> Unit:(no unit assumed) Controllable:No Description:The name of auxiliary variables to save this Kernel's diagonal Jacobian contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.) 
- 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 formDefault:True C++ Type:bool Controllable:No Description:Determines whether this object is calculated using an implicit or explicit form 
- save_inThe name of auxiliary variables to save this Kernel's residual contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)C++ Type:std::vector<AuxVariableName> Unit:(no unit assumed) Controllable:No Description:The name of auxiliary variables to save this Kernel's residual contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.) 
- search_methodnearest_node_connected_sidesChoice of search algorithm. All options begin by finding the nearest node in the primary boundary to a query point in the secondary boundary. In the default nearest_node_connected_sides algorithm, primary boundary elements are searched iff that nearest node is one of their nodes. This is fast to determine via a pregenerated node-to-elem map and is robust on conforming meshes. In the optional all_proximate_sides algorithm, primary boundary elements are searched iff they touch that nearest node, even if they are not topologically connected to it. This is more CPU-intensive but is necessary for robustness on any boundary surfaces which has disconnections (such as Flex IGA meshes) or non-conformity (such as hanging nodes in adaptively h-refined meshes).Default:nearest_node_connected_sides C++ Type:MooseEnum Options:nearest_node_connected_sides, all_proximate_sides Controllable:No Description:Choice of search algorithm. All options begin by finding the nearest node in the primary boundary to a query point in the secondary boundary. In the default nearest_node_connected_sides algorithm, primary boundary elements are searched iff that nearest node is one of their nodes. This is fast to determine via a pregenerated node-to-elem map and is robust on conforming meshes. In the optional all_proximate_sides algorithm, primary boundary elements are searched iff they touch that nearest node, even if they are not topologically connected to it. This is more CPU-intensive but is necessary for robustness on any boundary surfaces which has disconnections (such as Flex IGA meshes) or non-conformity (such as hanging nodes in adaptively h-refined meshes). 
- seed0The seed for the master random number generatorDefault: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
- 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/microwave_heating.i)
- (modules/combined/test/tests/electromagnetic_joule_heating/microwave_heating.i)
- (modules/combined/test/tests/electromagnetic_joule_heating/aux_microwave_heating.i)
- (modules/electromagnetics/test/tests/kernels/vector_helmholtz/vector_conduction_current.i)
- (modules/combined/test/tests/electromagnetic_joule_heating/fusing_current_through_copper_wire.i)
- (modules/electromagnetics/test/tests/auxkernels/heating/aux_microwave_heating.i)
(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/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/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/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/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/combined/test/tests/electromagnetic_joule_heating/fusing_current_through_copper_wire.i)
# This test is a simpified coupled case between the electromagnetic and
# heat transfer modules. While the file microwave_heating.i is a test
# utilizing the method of manufactured solutions, where both real and
# complex components of the electromagnetic properties are provided
# (such that no term is zeroed out), this test involves only the
# real components of the electromagnetic properties. In particular,
# this test supplies the fusing current to a copper wire and simulations
# the spatial and temporal heating profile until the wire reaches its
# melting point. The PDE's of this test file are as follows:
#
#   curl(curl(A)) + j*mu*omega*(sigma*A) = J
#   mag(E) = mag(-j*omega*A) + mag(J/sigma)
#   rho*C*dT/dt - div(k*grad(T)) = Q
#   Q = 0.5*sigma*mag(E)^2
#
# Where:
#   - A is the magnetic vector potential
#   - j is the sqrt(-1)
#   - mu is the permeability of free space
#   - omega is the angular frequency of the system
#   - sigma is the electric conductivity of the wire
#   - J is the supplied DC current
#   - E is the electric field
#   - rho is the density of copper
#   - C is the heat capacity of copper
#   - T is the temperature
#   - k is the thermal conductivity of the wire
#   - Q is the Joule heating
#
# The BCs are as follows:
#
#   curl(n) x curl(A) = 0,  where n is the normal vector
#   q * n = h (T - T_infty), where q is the heat flux,
#                            h is the convective heat transfer coefficient,
#                            and T_infty is the far-field temperature.
[Mesh]
  # Mesh of the copper wire
  [fmg]
    type = FileMeshGenerator
    file = copper_wire.msh
  []
[]
[Variables]
  # The real and complex components of the magnetic vector
  # potential in the frequency domain
  [A_real]
    family = NEDELEC_ONE
    order = FIRST
  []
  [A_imag]
    family = NEDELEC_ONE
    order = FIRST
  []
  # The temperature of the air in the copper wire
  [T]
    initial_condition = 293.0 #in K
  []
[]
[Kernels]
  ### Physics to determine the magnetic vector potential propagation ###
  # The propagation of the real component
  [curl_curl_real]
    type = CurlCurlField
    variable = A_real
  []
  # Current induced by the electrical conductivity
  # of the copper wire
  [conduction_real]
    type = ADConductionCurrent
    variable = A_real
    field_imag =  A_imag
    field_real =  A_real
    conductivity_real = electrical_conductivity
    conductivity_imag = 0.0
    ang_freq_real = omega_real
    ang_freq_imag = 0.0
    permeability_real = mu_real
    permeability_imag = 0.0
    component = real
  []
  # Current supplied to the wire
  [source_real]
    type = VectorBodyForce
    variable = A_real
    function = mu_curr_real
  []
  # The propagation of the complex component
  [curl_curl_imag]
    type = CurlCurlField
    variable = A_imag
  []
  # Current induced by the electrical conductivity
  # of the copper wire
  [conduction_imag]
    type = ADConductionCurrent
    variable = A_imag
    field_imag =  A_imag
    field_real =  A_real
    conductivity_real = electrical_conductivity
    conductivity_imag = 0.0
    ang_freq_real = omega_real
    ang_freq_imag = 0.0
    permeability_real = mu_real
    permeability_imag = 0.0
    component = imaginary
  []
  ### Physics to determine the heat transfer ###
  # Heat transfer in the copper wire
  [HeatTdot_in_copper]
    type = ADHeatConductionTimeDerivative
    variable = T
    specific_heat = specific_heat_copper
    density_name = density_copper
  []
  [HeatDiff_in_copper]
    type = ADHeatConduction
    variable = T
    thermal_conductivity = thermal_conductivity_copper
  []
  # Heating due the total current
  [HeatSrc]
    type = ADJouleHeatingSource
    variable = T
    heating_term = 'electric_field_heating'
  []
[]
[AuxVariables]
  # Decomposing the magnetic vector potential
  # for the electric field calculations
  [A_x_real]
    family = MONOMIAL
    order = FIRST
  []
  [A_y_real]
    family = MONOMIAL
    order = FIRST
  []
  [A_x_imag]
    family = MONOMIAL
    order = FIRST
  []
  [A_y_imag]
    family = MONOMIAL
    order = FIRST
  []
  # The electrical conductivity for the electric
  # field calculations
  [elec_cond]
    family = MONOMIAL
    order = FIRST
  []
  # The electric field profile determined from
  # the magnetic vector potential
  [E_real]
    family = NEDELEC_ONE
    order = FIRST
  []
  [E_imag]
    family = NEDELEC_ONE
    order = FIRST
  []
[]
[AuxKernels]
  # Decomposing the magnetic vector potential
  # for the electric field calculations
  [A_x_real]
    type = VectorVariableComponentAux
    variable = A_x_real
    vector_variable = A_real
    component = X
  []
  [A_y_real]
    type = VectorVariableComponentAux
    variable = A_y_real
    vector_variable = A_real
    component = Y
  []
  [A_x_imag]
    type = VectorVariableComponentAux
    variable = A_x_imag
    vector_variable = A_imag
    component = X
  []
  [A_y_imag]
    type = VectorVariableComponentAux
    variable = A_y_imag
    vector_variable = A_imag
    component = Y
  []
  # The electrical conductivity for the electric
  # field calculations
  [cond]
    type = ADMaterialRealAux
    property = electrical_conductivity
    variable = elec_cond
    execute_on = 'INITIAL LINEAR TIMESTEP_END'
  []
  # The magnitude of electric field profile determined
  # from the magnetic vector potential using:
  # abs(E) = abs(-j*omega*A) + abs(supplied current / elec_cond)
  # NOTE: The reason for calculating the magnitude of the electric
  #       field is the heating term is defined as:
  #       Q = 1/2 abs(E)^2 for frequency domain field formulations
  [E_real]
    type = ParsedVectorAux
    coupled_variables = 'A_x_imag A_y_imag elec_cond'
    expression_x = 'abs(2*3.14*60*A_x_imag) + abs(60e6/elec_cond)'
    expression_y = 'abs(2*3.14*60*A_y_imag)'
    variable = E_real
  []
  [E_imag]
    type = ParsedVectorAux
    coupled_variables = 'A_x_real A_y_real'
    expression_x = 'abs(-2*3.14*60*A_x_real)'
    expression_y = 'abs(-2*3.14*60*A_y_real)'
    variable = E_imag
  []
[]
[Functions]
  # The supplied current density to the wire
  # where only the real x-component is considered
  [curr_real_x]
    type = ParsedFunction
    expression = '60e6' # Units in A/m^2, equivalent to 1178 A in a 5mm diameter wire
  []
  # Permeability of free space
  [mu_real_func]
    type = ParsedFunction
    expression = '4*pi*1e-7' # Units in N/A^2
  []
  # The angular drive frequency of the system
  [omega_real_func]
    type = ParsedFunction
    expression = '2*pi*60' # Units in rad/s
  []
  # The angular frequency time permeability of free space
  [omegaMu]
    type = ParsedFunction
    symbol_names = 'omega mu'
    symbol_values = 'omega_real_func mu_real_func'
    expression = 'omega*mu'
  []
  # The supplied current density time permeability of free space
  [mu_curr_real]
    type = ParsedVectorFunction
    symbol_names = 'current_mag mu'
    symbol_values = 'curr_real_x mu_real_func'
    expression_x = 'mu * current_mag'
  []
[]
[BCs]
  ### Temperature boundary conditions ###
  # Convective heat flux BC with copper wire
  # exposed to air
  [surface]
    type = ADConvectiveHeatFluxBC
    variable = T
    boundary = walls
    T_infinity = 293
    heat_transfer_coefficient = 10
  []
  ### Magnetic vector potential boundary conditions ###
  # No defined boundary conditions represents
  # zero curl conditions at the boundaries, such that:
  # A x n = 0
[]
[Materials]
  [k]
    type = ADGenericConstantMaterial
    prop_names = 'thermal_conductivity_copper'
    prop_values = '397.48' #in W/(m K)
  []
  [cp]
    type = ADGenericConstantMaterial
    prop_names = 'specific_heat_copper'
    prop_values = '385.0' #in J/(kg K)
  []
  [rho]
    type = ADGenericConstantMaterial
    prop_names = 'density_copper'
    prop_values = '8920.0' #in kg/(m^3)
  []
  # Electrical conductivity (copper is default material)
  [sigma]
    type = ADElectricalConductivity
    temperature = T
    block = copper
  []
  # Material that supplies the correct Joule heating formulation
  [ElectromagneticMaterial]
    type = ElectromagneticHeatingMaterial
    electric_field = E_real
    complex_electric_field = E_imag
    electric_field_heating_name = electric_field_heating
    electrical_conductivity = electrical_conductivity
    formulation = FREQUENCY
    solver = ELECTROMAGNETIC
    block = copper
  []
  # Coefficient for wave propagation
  [mu_real]
    type = ADGenericFunctionMaterial
    prop_names = mu_real
    prop_values = mu_real_func
  []
  [omega_real]
    type = ADGenericFunctionMaterial
    prop_names = omega_real
    prop_values = omega_real_func
  []
[]
[Preconditioning]
  [SMP]
    type = SMP
    full = true
  []
[]
[Executioner]
  type = Transient
  scheme = bdf2
  solve_type = NEWTON
  line_search = NONE
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'lu'
  dt = 1.0
  # NOTE: Change 'end_time' to 10s to accurately simulate the fusing current
  # end_time = 10
  end_time = 5
  automatic_scaling = true
[]
[Outputs]
  exodus = true
  perf_graph = 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
[]