- 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 on
C++ Type:NonlinearVariableName
Unit:(no unit assumed)
Controllable:No
Description:The name of the variable that this residual object operates on
ADMatWaveReaction
Calculates the current source term in the Helmholtz wave equation using the dielectric formulation of the current.
Overview
The ADMatWaveReaction object implements a displacement current source term to the electric field Helmholtz wave equation. The term is defined as:
where
is the angular frequency of the wave propagation,
is the permeability of the medium,
is the permittivity of the medium, and
is the electric field.
Note that is provided via the Materials block, using the WaveEquationCoefficient object.
Example Input File Syntax
[Kernels<<<{"href": "../../syntax/Kernels/index.html"}>>>]
[coeff_real]
type = ADMatWaveReaction<<<{"description": "Calculates the current source term in the Helmholtz wave equation using the dielectric formulation of the current.", "href": "ADMatWaveReaction.html"}>>>
variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = E_real
field_real<<<{"description": "The real component of the electric field."}>>> = E_real
field_imag<<<{"description": "The imaginary component of the electric field."}>>> = E_imag
wave_coef_real<<<{"description": "The real component of the coefficient for the Helmholtz wave equation."}>>> = wave_equation_coefficient_real
wave_coef_imag<<<{"description": "The imaginary component of the coefficient for the Helmholtz wave equation."}>>> = wave_equation_coefficient_imaginary
component<<<{"description": "Component of field (real or imaginary)."}>>> = real
[]
[]
(modules/electromagnetics/test/tests/kernels/vector_helmholtz/vector_ADmaterial_wave_reaction.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
- componentComponent of field (real or imaginary).
C++ Type:MooseEnum
Options:real, imaginary
Controllable:No
Description:Component of field (real or imaginary).
- displacementsThe displacements
C++ 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)
- wave_coef_imagwave_equation_coefficient_imaginaryThe imaginary component of the coefficient for the Helmholtz wave equation.
Default:wave_equation_coefficient_imaginary
C++ Type:MaterialPropertyName
Unit:(no unit assumed)
Controllable:No
Description:The imaginary component of the coefficient for the Helmholtz wave equation.
- wave_coef_realwave_equation_coefficient_realThe real component of the coefficient for the Helmholtz wave equation.
Default:wave_equation_coefficient_real
C++ Type:MaterialPropertyName
Unit:(no unit assumed)
Controllable:No
Description:The real component of the coefficient for the Helmholtz wave equation.
Optional Parameters
- absolute_value_vector_tagsThe tags for the vectors this residual object should fill with the absolute value of the residual contribution
C++ 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 fill
C++ 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 fill
C++ 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 fill
Default: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 fill
Default: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 form
Default: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.)
- 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
- 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/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/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
[]
(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/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
[]