- 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
CurlCurlField
Weak form term corresponding to .
Overview
The CurlCurlField object implements the following PDE term for vector variables:
where
is a constant coefficient (default = 1.0), and
is the solution field vector variable.
Example Input File Syntax
[Kernels<<<{"href": "../../syntax/Kernels/index.html"}>>>]
[curl_curl]
type = CurlCurlField<<<{"description": "Weak form term corresponding to $\\nabla \\times (a \\nabla \\times \\vec{E})$.", "href": "CurlCurlField.html"}>>>
variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = u
[]
[]
(modules/electromagnetics/test/tests/kernels/vector_helmholtz/vector_kernels.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
- coeff1Weak form coefficient (default = 1.0).
Default:1
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:Weak form coefficient (default = 1.0).
- 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)
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_current_source.i)
- (modules/electromagnetics/test/tests/kernels/vector_helmholtz/vector_conduction_current.i)
- (modules/combined/test/tests/electromagnetic_joule_heating/microwave_heating.i)
- (modules/electromagnetics/test/tests/interfacekernels/electromagnetic_interfaces/combined_default.i)
- (modules/electromagnetics/test/tests/interfacekernels/electromagnetic_interfaces/combined_props.i)
- (modules/electromagnetics/test/tests/benchmarks/evanescent_wave/evanescent_wave.i)
- (modules/combined/test/tests/electromagnetic_joule_heating/fusing_current_through_copper_wire.i)
- (modules/electromagnetics/test/tests/auxkernels/azimuthal_Faradays_law/scalar_azim_magnetic_time_deriv.i)
- (modules/electromagnetics/test/tests/benchmarks/evanescent_wave/evanescent_wave_with_ADMaterials.i)
- (modules/electromagnetics/test/tests/interfacekernels/electromagnetic_interfaces/parallel.i)
- (modules/electromagnetics/test/tests/bcs/vector_robin_bc/portbc_waves.i)
- (modules/electromagnetics/test/tests/kernels/vector_helmholtz/vector_kernels.i)
- (modules/electromagnetics/test/tests/auxkernels/azimuthal_Faradays_law/error_azim_magnetic_time_deriv.i)
- (modules/electromagnetics/test/tests/kernels/vector_helmholtz/ad_vector_kernels.i)
- (modules/electromagnetics/test/tests/auxkernels/heating/aux_current_source_heating.i)
- (modules/electromagnetics/test/tests/auxkernels/heating/aux_microwave_heating.i)
- (modules/electromagnetics/test/tests/benchmarks/dipole_antenna/dipole_transient.i)
- (modules/electromagnetics/test/tests/benchmarks/dipole_antenna/dipole.i)
- (modules/combined/test/tests/electromagnetic_joule_heating/aux_microwave_heating.i)
- (modules/electromagnetics/test/tests/auxkernels/azimuthal_Faradays_law/vector_azim_magnetic_time_deriv.i)
- (modules/electromagnetics/test/tests/auxkernels/current_density/em_current_density.i)
- (modules/electromagnetics/test/tests/interfacekernels/electromagnetic_interfaces/perpendicular.i)
- (modules/electromagnetics/test/tests/auxkernels/current_density/error_test.i)
- (modules/electromagnetics/test/tests/kernels/vector_helmholtz/microwave_heating.i)
- (modules/electromagnetics/test/tests/kernels/vector_helmholtz/vector_ADmaterial_wave_reaction.i)
(modules/electromagnetics/test/tests/kernels/vector_helmholtz/vector_kernels.i)
# Test for EM module vector kernels CurlCurlField and VectorFunctionReaction
# Manufactured solution: u = y * x_hat - x * y_hat
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmin = -1
ymin = -1
elem_type = QUAD9
[]
[]
[Variables]
[u]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[curl_curl]
type = CurlCurlField
variable = u
[]
[coeff]
type = VectorFunctionReaction
variable = u
[]
[rhs]
type = VectorBodyForce
variable = u
function_x = 'y'
function_y = '-x'
[]
[]
[BCs]
[sides]
type = VectorCurlPenaltyDirichletBC
variable = u
function_x = 'y'
function_y = '-x'
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'
[]
[Outputs]
exodus = true
[]
(modules/electromagnetics/test/tests/kernels/vector_helmholtz/vector_current_source.i)
# Test for VectorCurrentSource
# Manufactured solution: u_real = y^2 * x_hat - x^2 * y_hat
# u_imag = y^2 * x_hat - x^2 * y_hat
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmin = -1
ymin = -1
elem_type = QUAD9
[]
[]
[Functions]
[source_real]
type = ParsedVectorFunction
expression_x = 'y*y - 2'
expression_y = '2 - x*x'
[]
[source_imag]
type = ParsedVectorFunction
expression_x = '2 - y*y'
expression_y = 'x*x - 2'
[]
[]
[Variables]
[u_real]
family = NEDELEC_ONE
order = FIRST
[]
[u_imag]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[curl_curl_real]
type = CurlCurlField
variable = u_real
[]
[coeff_real]
type = VectorFunctionReaction
variable = u_real
[]
[current_real]
type = VectorCurrentSource
variable = u_real
function_coefficient = -1.0
source_real = source_real
source_imag = source_imag
component = real
[]
[curl_curl_imag]
type = CurlCurlField
variable = u_imag
[]
[coeff_imag]
type = VectorFunctionReaction
variable = u_imag
[]
[current_imag]
type = VectorCurrentSource
variable = u_imag
function_coefficient = -1.0
source_real = source_real
source_imag = source_imag
component = imaginary
[]
[]
[BCs]
[sides_real]
type = VectorCurlPenaltyDirichletBC
variable = u_real
function_x = 'y*y'
function_y = '-x*x'
penalty = 1e8
boundary = 'left right top bottom'
[]
[sides_imag]
type = VectorCurlPenaltyDirichletBC
variable = u_imag
function_x = 'y*y'
function_y = '-x*x'
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'
[]
[Outputs]
exodus = true
[]
(modules/electromagnetics/test/tests/kernels/vector_helmholtz/vector_conduction_current.i)
# Test for ADConductionCurrent
# Manufactured solution: field_real = y^2 * x_hat - x^2 * y_hat
# E_imag = y^2 * x_hat - x^2 * y_hat
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
xmin = -1
ymin = -1
elem_type = QUAD9
[]
[]
[Functions]
#The exact solution for both the real and imag. component
[exact]
type = ParsedVectorFunction
expression_x = 'y*y'
expression_y = '-x*x'
[]
#The forcing terms for the real and imag. component
[source_real]
type = ParsedVectorFunction
symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
symbol_values = 'omega mu epsilon sigma omega mu epsilon sigma'
expression_x = '-epsilon_i*mu_i*omega_i^2*y^2 - 2*epsilon_i*mu_i*omega_i*omega_r*y^2 + epsilon_i*mu_i*omega_r^2*y^2 - epsilon_i*mu_r*omega_i^2*y^2 + 2*epsilon_i*mu_r*omega_i*omega_r*y^2 + epsilon_i*mu_r*omega_r^2*y^2 - epsilon_r*mu_i*omega_i^2*y^2 + 2*epsilon_r*mu_i*omega_i*omega_r*y^2 + epsilon_r*mu_i*omega_r^2*y^2 + epsilon_r*mu_r*omega_i^2*y^2 + 2*epsilon_r*mu_r*omega_i*omega_r*y^2 - epsilon_r*mu_r*omega_r^2*y^2 + mu_i*omega_i*sigma_i*y^2 + mu_i*omega_i*sigma_r*y^2 + mu_i*omega_r*sigma_i*y^2 - mu_i*omega_r*sigma_r*y^2 + mu_r*omega_i*sigma_i*y^2 - mu_r*omega_i*sigma_r*y^2 - mu_r*omega_r*sigma_i*y^2 - mu_r*omega_r*sigma_r*y^2 - 2'
expression_y = 'epsilon_i*mu_i*omega_i^2*x^2 + 2*epsilon_i*mu_i*omega_i*omega_r*x^2 - epsilon_i*mu_i*omega_r^2*x^2 + epsilon_i*mu_r*omega_i^2*x^2 - 2*epsilon_i*mu_r*omega_i*omega_r*x^2 - epsilon_i*mu_r*omega_r^2*x^2 + epsilon_r*mu_i*omega_i^2*x^2 - 2*epsilon_r*mu_i*omega_i*omega_r*x^2 - epsilon_r*mu_i*omega_r^2*x^2 - epsilon_r*mu_r*omega_i^2*x^2 - 2*epsilon_r*mu_r*omega_i*omega_r*x^2 + epsilon_r*mu_r*omega_r^2*x^2 - mu_i*omega_i*sigma_i*x^2 - mu_i*omega_i*sigma_r*x^2 - mu_i*omega_r*sigma_i*x^2 + mu_i*omega_r*sigma_r*x^2 - mu_r*omega_i*sigma_i*x^2 + mu_r*omega_i*sigma_r*x^2 + mu_r*omega_r*sigma_i*x^2 + mu_r*omega_r*sigma_r*x^2 + 2'
[]
[source_imag]
type = ParsedVectorFunction
symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
symbol_values = 'omega mu epsilon sigma omega mu epsilon sigma'
expression_x = '-epsilon_i*mu_i*omega_i^2*y^2 + 2*epsilon_i*mu_i*omega_i*omega_r*y^2 + epsilon_i*mu_i*omega_r^2*y^2 + epsilon_i*mu_r*omega_i^2*y^2 + 2*epsilon_i*mu_r*omega_i*omega_r*y^2 - epsilon_i*mu_r*omega_r^2*y^2 + epsilon_r*mu_i*omega_i^2*y^2 + 2*epsilon_r*mu_i*omega_i*omega_r*y^2 - epsilon_r*mu_i*omega_r^2*y^2 + epsilon_r*mu_r*omega_i^2*y^2 - 2*epsilon_r*mu_r*omega_i*omega_r*y^2 - epsilon_r*mu_r*omega_r^2*y^2 + mu_i*omega_i*sigma_i*y^2 - mu_i*omega_i*sigma_r*y^2 - mu_i*omega_r*sigma_i*y^2 - mu_i*omega_r*sigma_r*y^2 - mu_r*omega_i*sigma_i*y^2 - mu_r*omega_i*sigma_r*y^2 - mu_r*omega_r*sigma_i*y^2 + mu_r*omega_r*sigma_r*y^2 - 2'
expression_y = 'epsilon_i*mu_i*omega_i^2*x^2 - 2*epsilon_i*mu_i*omega_i*omega_r*x^2 - epsilon_i*mu_i*omega_r^2*x^2 - epsilon_i*mu_r*omega_i^2*x^2 - 2*epsilon_i*mu_r*omega_i*omega_r*x^2 + epsilon_i*mu_r*omega_r^2*x^2 - epsilon_r*mu_i*omega_i^2*x^2 - 2*epsilon_r*mu_i*omega_i*omega_r*x^2 + epsilon_r*mu_i*omega_r^2*x^2 - epsilon_r*mu_r*omega_i^2*x^2 + 2*epsilon_r*mu_r*omega_i*omega_r*x^2 + epsilon_r*mu_r*omega_r^2*x^2 - mu_i*omega_i*sigma_i*x^2 + mu_i*omega_i*sigma_r*x^2 + mu_i*omega_r*sigma_i*x^2 + mu_i*omega_r*sigma_r*x^2 + mu_r*omega_i*sigma_i*x^2 + mu_r*omega_i*sigma_r*x^2 + mu_r*omega_r*sigma_i*x^2 - mu_r*omega_r*sigma_r*x^2 + 2'
[]
#Material Coefficients
[omega]
type = ParsedFunction
expression = '2.0'
[]
[mu]
type = ParsedFunction
expression = '1.0'
[]
[epsilon]
type = ParsedFunction
expression = '3.0'
[]
[sigma]
type = ParsedFunction
expression = '4.0'
[]
[]
[Materials]
[WaveCoeff]
type = WaveEquationCoefficient
eps_rel_imag = eps_imag
eps_rel_real = eps_real
k_real = k_real
k_imag = k_imag
mu_rel_imag = mu_imag
mu_rel_real = mu_real
[]
[eps_real]
type = ADGenericFunctionMaterial
prop_names = eps_real
prop_values = epsilon
[]
[eps_imag]
type = ADGenericFunctionMaterial
prop_names = eps_imag
prop_values = epsilon
[]
[mu_real]
type = ADGenericFunctionMaterial
prop_names = mu_real
prop_values = mu
[]
[mu_imag]
type = ADGenericFunctionMaterial
prop_names = mu_imag
prop_values = mu
[]
[k_real]
type = ADGenericFunctionMaterial
prop_names = k_real
prop_values = omega
[]
[k_imag]
type = ADGenericFunctionMaterial
prop_names = k_imag
prop_values = omega
[]
[cond_real]
type = ADGenericFunctionMaterial
prop_names = cond_real
prop_values = sigma
[]
[cond_imag]
type = ADGenericFunctionMaterial
prop_names = cond_imag
prop_values = sigma
[]
[]
[Variables]
[E_real]
family = NEDELEC_ONE
order = FIRST
[]
[E_imag]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[curl_curl_real]
type = CurlCurlField
variable = E_real
[]
[coeff_real]
type = ADMatWaveReaction
variable = E_real
field_real = E_real
field_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = real
[]
[conduction_real]
type = ADConductionCurrent
variable = E_real
field_imag = E_imag
field_real = E_real
conductivity_real = cond_real
conductivity_imag = cond_imag
ang_freq_real = k_real
ang_freq_imag = k_imag
permeability_real = mu_real
permeability_imag = mu_imag
component = real
[]
[body_force_real]
type = VectorBodyForce
variable = E_real
function = source_real
[]
[curl_curl_imag]
type = CurlCurlField
variable = E_imag
[]
[coeff_imag]
type = ADMatWaveReaction
variable = E_imag
field_real = E_real
field_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = imaginary
[]
[conduction_imag]
type = ADConductionCurrent
variable = E_imag
field_imag = E_imag
field_real = E_real
conductivity_real = cond_real
conductivity_imag = cond_imag
ang_freq_real = k_real
ang_freq_imag = k_imag
permeability_real = mu_real
permeability_imag = mu_imag
component = imaginary
[]
[body_force_imag]
type = VectorBodyForce
variable = E_imag
function = source_imag
[]
[]
[BCs]
[sides_real]
type = VectorCurlPenaltyDirichletBC
variable = E_real
function_x = 'y*y'
function_y = '-x*x'
penalty = 1e8
boundary = 'left right top bottom'
[]
[sides_imag]
type = VectorCurlPenaltyDirichletBC
variable = E_imag
function_x = 'y*y'
function_y = '-x*x'
penalty = 1e8
boundary = 'left right top bottom'
[]
[]
[Postprocessors]
[error_real]
type = ElementVectorL2Error
variable = E_real
function = exact
[]
[error_imag]
type = ElementVectorL2Error
variable = E_imag
function = exact
[]
[h]
type = AverageElementSize
[]
[h_squared]
type = ParsedPostprocessor
pp_names = 'h'
expression = 'h * h'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Outputs]
exodus = true
csv = true
[]
(modules/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/interfacekernels/electromagnetic_interfaces/combined_default.i)
# Verification Test of PerpendicularElectricFieldInterface and
# ParallelElectricFieldInterface with default materials
#
# Imposes u_perpendicular = v_perpendicular and u_parallel = v_parallel
# on each interface (equivalent to saying u = v for default parameters)
# between subdomain 0 and 1
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 10
ny = 10
nz = 10
xmax = 2
ymax = 2
zmax = 2
elem_type = HEX20
[]
[subdomain1]
type = SubdomainBoundingBoxGenerator
bottom_left = '0 0 0'
top_right = '1 1 1'
block_id = 1
input = gmg
[]
[break_boundary]
type = BreakBoundaryOnSubdomainGenerator
input = subdomain1
[]
[interface]
type = SideSetsBetweenSubdomainsGenerator
input = break_boundary
primary_block = '0'
paired_block = '1'
new_boundary = 'primary0_interface'
[]
[]
[Variables]
[u]
order = FIRST
family = NEDELEC_ONE
block = 0
[]
[v]
order = FIRST
family = NEDELEC_ONE
block = 1
[]
[]
[Kernels]
[curl_u]
type = CurlCurlField
variable = u
block = 0
[]
[coeff_u]
type = VectorFunctionReaction
variable = u
block = 0
[]
[ffn_u]
type = VectorBodyForce
variable = u
block = 0
function_x = 1
function_y = 1
function_z = 1
[]
[curl_v]
type = CurlCurlField
variable = v
block = 1
[]
[coeff_v]
type = VectorFunctionReaction
variable = v
block = 1
[]
[]
[InterfaceKernels]
[perpendicular]
type = PerpendicularElectricFieldInterface
variable = u
neighbor_var = v
boundary = primary0_interface
[]
[parallel]
type = ParallelElectricFieldInterface
variable = u
neighbor_var = v
boundary = primary0_interface
[]
[]
[BCs]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Outputs]
exodus = true
print_linear_residuals = true
[]
(modules/electromagnetics/test/tests/interfacekernels/electromagnetic_interfaces/combined_props.i)
# Verification Test of PerpendicularElectricFieldInterface and
# ParallelElectricFieldInterface with user-defined materials
# and interface free charge
#
# Imposes epsilon_0 * u_perpendicular - epsilon_1 * v_perpendicular = free_charge
# and u_parallel = v_parallel on each interface between subdomain
# blocks 0 and 1
#
# epsilon_0 = 1.0
# epsilon_1 = 10.0
# free_charge = 1.0
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 10
ny = 10
nz = 10
xmax = 2
ymax = 2
zmax = 2
elem_type = HEX20
[]
[subdomain1]
type = SubdomainBoundingBoxGenerator
bottom_left = '0 0 0'
top_right = '1 1 1'
block_id = 1
input = gmg
[]
[break_boundary]
type = BreakBoundaryOnSubdomainGenerator
input = subdomain1
[]
[interface]
type = SideSetsBetweenSubdomainsGenerator
input = break_boundary
primary_block = '0'
paired_block = '1'
new_boundary = 'primary0_interface'
[]
[]
[Variables]
[u]
order = FIRST
family = NEDELEC_ONE
block = 0
[]
[v]
order = FIRST
family = NEDELEC_ONE
block = 1
[]
[]
[Kernels]
[curl_u]
type = CurlCurlField
variable = u
block = 0
[]
[coeff_u]
type = VectorFunctionReaction
variable = u
block = 0
[]
[ffn_u]
type = VectorBodyForce
variable = u
block = 0
function_x = 1
function_y = 1
function_z = 1
[]
[curl_v]
type = CurlCurlField
variable = v
block = 1
[]
[coeff_v]
type = VectorFunctionReaction
variable = v
block = 1
[]
[]
[InterfaceKernels]
[perpendicular]
type = PerpendicularElectricFieldInterface
variable = u
neighbor_var = v
boundary = primary0_interface
primary_epsilon = 1.0
secondary_epsilon = 10.0
free_charge = 1.0
[]
[parallel]
type = ParallelElectricFieldInterface
variable = u
neighbor_var = v
boundary = primary0_interface
[]
[]
[BCs]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Outputs]
exodus = true
print_linear_residuals = true
[]
(modules/electromagnetics/test/tests/benchmarks/evanescent_wave/evanescent_wave.i)
# Evanescent wave decay benchmark
# frequency = 20 GHz
# eps_R = 1.0
# mu_R = 1.0
[Mesh]
[fmg]
type = FileMeshGenerator
file = waveguide_discontinuous.msh
[]
[]
[Functions]
[waveNumberSquared]
type = ParsedFunction
expression = '(2*pi*20e9/3e8)^2'
[]
[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
[]
[]
[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 = VectorFunctionReaction
variable = E_real
function = waveNumberSquared
sign = negative
[]
[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 = VectorFunctionReaction
variable = E_imag
function = waveNumberSquared
sign = negative
[]
[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
print_linear_residuals = true
[]
[Debug]
show_var_residual_norms = 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/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/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/interfacekernels/electromagnetic_interfaces/parallel.i)
# Verification Test of ParallelElectricFieldInterface
# with default materials
#
# Imposes u_parallel = v_parallel on each interface
# between subdomain 0 and 1
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 10
ny = 10
nz = 10
xmax = 2
ymax = 2
zmax = 2
elem_type = HEX20
[]
[subdomain1]
type = SubdomainBoundingBoxGenerator
bottom_left = '0 0 0'
top_right = '1 1 1'
block_id = 1
input = gmg
[]
[break_boundary]
type = BreakBoundaryOnSubdomainGenerator
input = subdomain1
[]
[interface]
type = SideSetsBetweenSubdomainsGenerator
input = break_boundary
primary_block = '0'
paired_block = '1'
new_boundary = 'primary0_interface'
[]
[]
[Variables]
[u]
order = FIRST
family = NEDELEC_ONE
block = 0
[]
[v]
order = FIRST
family = NEDELEC_ONE
block = 1
[]
[]
[Kernels]
[curl_u]
type = CurlCurlField
variable = u
block = 0
[]
[coeff_u]
type = VectorFunctionReaction
variable = u
block = 0
[]
[ffn_u]
type = VectorBodyForce
variable = u
block = 0
function_x = 1
function_y = 1
function_z = 1
[]
[curl_v]
type = CurlCurlField
variable = v
block = 1
[]
[coeff_v]
type = VectorFunctionReaction
variable = v
block = 1
[]
[]
[InterfaceKernels]
[parallel]
type = ParallelElectricFieldInterface
variable = u
neighbor_var = v
boundary = primary0_interface
[]
[]
[BCs]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Outputs]
exodus = true
print_linear_residuals = true
[]
(modules/electromagnetics/test/tests/bcs/vector_robin_bc/portbc_waves.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmin = -1
ymin = -1
elem_type = QUAD9
[]
uniform_refine = 1
[]
[Functions]
[mms_real] # Manufactured solution, real component
type = ParsedVectorFunction
expression_x = 'cos(pi*x)*sin(pi*y)'
expression_y = '-cos(pi*x)*sin(pi*y)'
curl_z = 'pi*sin(pi*x)*sin(pi*y) - pi*cos(pi*x)*cos(pi*y)'
[]
[mms_imaginary] # Manufactured solution, imaginary component
type = ParsedVectorFunction
expression_x = 'cos(pi*x + pi/2)*sin(pi*y)'
expression_y = '-cos(pi*x + pi/2)*sin(pi*x)'
curl_z = 'pi*sin(pi*x)*cos(pi*y) + pi*sin(pi*y)*cos(pi*x)'
[]
[]
[Variables]
[u_real]
family = NEDELEC_ONE
order = FIRST
[]
[u_imaginary]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[curl_curl_real]
type = CurlCurlField
variable = u_real
[]
[coeff_real]
type = VectorFunctionReaction
variable = u_real
[]
[rhs_real]
type = VectorBodyForce
variable = u_real
function_x = 'pi*pi*sin(pi*x)*cos(pi*y) + sin(pi*y)*cos(pi*x) + pi*pi*sin(pi*y)*cos(pi*x)'
function_y = '-pi*pi*sin(pi*x)*cos(pi*y) - pi*pi*sin(pi*y)*cos(pi*x) - sin(pi*y)*cos(pi*x)'
[]
[curl_curl_imaginary]
type = CurlCurlField
variable = u_imaginary
[]
[coeff_imaginary]
type = VectorFunctionReaction
variable = u_imaginary
[]
[rhs_imaginary]
type = VectorBodyForce
variable = u_imaginary
function_x = '-pi*pi*sin(pi*x)*sin(pi*y) - sin(pi*x)*sin(pi*y) + pi*pi*cos(pi*x)*cos(pi*y)'
function_y = 'sin(pi*x)*sin(pi*y) + pi*pi*sin(pi*x)*sin(pi*y) - pi*pi*cos(pi*x)*cos(pi*y)'
[]
[]
[BCs]
[sides_real]
type = VectorEMRobinBC
variable = u_real
component = real
coupled_field = u_imaginary
imag_incoming = mms_imaginary
real_incoming = mms_real
boundary = 'left right top bottom'
[]
[sides_imaginary]
type = VectorEMRobinBC
variable = u_imaginary
component = imaginary
coupled_field = u_real
imag_incoming = mms_imaginary
real_incoming = mms_real
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'
[]
[Outputs]
exodus = true
[]
(modules/electromagnetics/test/tests/kernels/vector_helmholtz/vector_kernels.i)
# Test for EM module vector kernels CurlCurlField and VectorFunctionReaction
# Manufactured solution: u = y * x_hat - x * y_hat
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmin = -1
ymin = -1
elem_type = QUAD9
[]
[]
[Variables]
[u]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[curl_curl]
type = CurlCurlField
variable = u
[]
[coeff]
type = VectorFunctionReaction
variable = u
[]
[rhs]
type = VectorBodyForce
variable = u
function_x = 'y'
function_y = '-x'
[]
[]
[BCs]
[sides]
type = VectorCurlPenaltyDirichletBC
variable = u
function_x = 'y'
function_y = '-x'
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'
[]
[Outputs]
exodus = true
[]
(modules/electromagnetics/test/tests/auxkernels/azimuthal_Faradays_law/error_azim_magnetic_time_deriv.i)
# Test for AzimuthMagneticTimeDerivRZ with scalar inputs
# Manufactured solution: E_real = y^2 * x_hat - x^2 * y_hat
# E_imag = y^2 * x_hat - x^2 * y_hat
# dB_theta_real / dt = -(2*y + 2*x)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmax = 1
xmin = 0
ymax = 1
ymin = -1
elem_type = QUAD9
[]
coord_type = RZ
rz_coord_axis = Y
[]
[Functions]
#The exact solution for the heated species and electric field real and imag. component
[exact_real]
type = ParsedVectorFunction
expression_x = 'y^2'
expression_y = '-x^2'
[]
[exact_imag]
type = ParsedVectorFunction
expression_x = 'y^2'
expression_y = '-x^2'
[]
#The forcing terms for the heated species and electric field real and imag. component
[source_real]
type = ParsedVectorFunction
expression_x = '-y^2 - cos(pi*y) - 2'
expression_y = 'x^2 + cos(pi*x) + 4 + 2*y/x'
[]
[source_imag]
type = ParsedVectorFunction
expression_x = '-y^2 + sin(pi*y) - 2'
expression_y = 'x^2 - sin(pi*x) + 4 + 2*y/x'
[]
[current_real]
type = ParsedVectorFunction
expression_x = 'sin(pi*y)'
expression_y = '-sin(pi*x)'
[]
[current_imag]
type = ParsedVectorFunction
expression_x = 'cos(pi*y)'
expression_y = '-cos(pi*x)'
[]
[azim_dB_dt_func]
type = ParsedFunction
expression = '-(2*y + 2*x)'
[]
[]
[Materials]
[WaveCoeff]
type = WaveEquationCoefficient
eps_rel_real = 1.0
eps_rel_imag = 0.0
k_real = 1.0
k_imag = 0.0
mu_rel_real = 1.0
mu_rel_imag = 0.0
[]
[]
[Variables]
[E_real]
family = NEDELEC_ONE
order = FIRST
[]
[E_imag]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[curl_curl_real]
type = CurlCurlField
variable = E_real
[]
[coeff_real]
type = ADMatWaveReaction
variable = E_real
field_real = E_real
field_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = real
[]
[current_real]
type = VectorCurrentSource
variable = E_real
source_real = current_real
source_imag = current_imag
component = real
[]
[body_force_real]
type = VectorBodyForce
variable = E_real
function = source_real
[]
[curl_curl_imag]
type = CurlCurlField
variable = E_imag
[]
[coeff_imag]
type = ADMatWaveReaction
variable = E_imag
field_real = E_real
field_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = imaginary
[]
[current_imag]
type = VectorCurrentSource
variable = E_imag
source_real = current_real
source_imag = current_imag
component = imaginary
[]
[body_force_imag]
type = VectorBodyForce
variable = E_imag
function = source_imag
[]
[]
[AuxVariables]
[aux_E_real_x]
family = MONOMIAL
order = FIRST
[]
[aux_E_real_y]
family = MONOMIAL
order = FIRST
[]
[azim_dB_dt_term]
family = MONOMIAL
order = FIRST
[]
[]
[AuxKernels]
[aux_E_real_x]
type = VectorVariableComponentAux
variable = aux_E_real_x
vector_variable = E_real
component = X
[]
[aux_E_real_y]
type = VectorVariableComponentAux
variable = aux_E_real_y
vector_variable = E_real
component = Y
[]
[aux_azim_dB_dt]
type = AzimuthMagneticTimeDerivRZ
# Efield = E_real
# Efield_X = aux_E_real_x
# Efield_Y = aux_E_real_y
variable = azim_dB_dt_term
[]
[]
[BCs]
[sides_real]
type = VectorCurlPenaltyDirichletBC
variable = E_real
function = exact_real
penalty = 1e8
boundary = 'left right top bottom'
[]
[sides_imag]
type = VectorCurlPenaltyDirichletBC
variable = E_imag
function = exact_imag
penalty = 1e8
boundary = 'left right top bottom'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-16
[]
[Outputs]
exodus = true
csv = true
[]
(modules/electromagnetics/test/tests/kernels/vector_helmholtz/ad_vector_kernels.i)
# Test for EM module vector kernels ADCurlCurlField and VectorFunctionReaction
# Manufactured solution: u = y * x_hat - x * y_hat
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmin = -1
ymin = -1
elem_type = QUAD9
[]
[]
[Variables]
[u]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[curl_curl]
type = ADCurlCurlField
variable = u
[]
[coeff]
type = VectorFunctionReaction
variable = u
[]
[rhs]
type = VectorBodyForce
variable = u
function_x = 'y'
function_y = '-x'
[]
[]
[BCs]
[sides]
type = VectorCurlPenaltyDirichletBC
variable = u
function_x = 'y'
function_y = '-x'
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'
[]
[Outputs]
exodus = 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/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/dipole_antenna/dipole_transient.i)
# Verification Benchmark - Half-wave Dipole Antenna (Frequency Domain)
# Resonant Frequency = 1 GHz
# Wave Propagation Medium: Vacuum
[Mesh]
[fmg]
type = FileMeshGenerator
file = dipole_antenna_1G.msh
[]
[]
[Variables]
[E_real]
order = FIRST
family = NEDELEC_ONE
[]
[E_imag]
order = FIRST
family = NEDELEC_ONE
[]
[]
[Kernels]
[curl_curl_real]
type = CurlCurlField
variable = E_real
[]
[time_derivative_real]
type = VectorSecondTimeDerivative
variable = E_real
coefficient = '1/(3e8 * 3e8)' # 1/c^2 = mu_0 * eps_0
[]
[curl_curl_imag]
type = CurlCurlField
variable = E_imag
[]
[time_derivative_imag]
type = VectorSecondTimeDerivative
variable = E_imag
coefficient = '1/(3e8 * 3e8)' # 1/c^2 = mu_0 * eps_0
[]
[]
[BCs]
[antenna_real] # Impose exact solution of electric field onto antenna surface.
type = VectorCurlPenaltyDirichletBC # Replace with proper antenna surface current condition.
penalty = 1e5
function_y = 'cos(2*pi*1e9*t)'
boundary = antenna
variable = E_real
[]
[antenna_imag]
type = VectorCurlPenaltyDirichletBC
penalty = 1e5
function_y = 'sin(2*pi*1e9*t)'
boundary = antenna
variable = E_imag
[]
[radiation_condition_real] # First order absorbing boundary condition
type = VectorTransientAbsorbingBC
variable = E_real
coupled_field = E_imag
boundary = boundary
component = real
[]
[radiation_condition_imag]
type = VectorTransientAbsorbingBC
variable = E_imag
coupled_field = E_real
boundary = boundary
component = imaginary
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
num_steps = 150
dt = 0.5e-10
[TimeIntegrator]
type = NewmarkBeta
[]
[]
[Outputs]
exodus = true
perf_graph = true
[]
(modules/electromagnetics/test/tests/benchmarks/dipole_antenna/dipole.i)
# Verification Benchmark - Half-wave Dipole Antenna (Frequency Domain)
# Resonant Frequency = 1 GHz
# Wave Propagation Medium: Vacuum
[Mesh]
[file_mesh]
type = FileMeshGenerator
file = dipole_antenna_1G.msh
[]
[refine]
type = RefineBlockGenerator
input = file_mesh
block = 'vacuum'
refinement = 2
[]
[]
[Variables]
[E_real]
order = FIRST
family = NEDELEC_ONE
[]
[E_imag]
order = FIRST
family = NEDELEC_ONE
[]
[]
[Functions]
[WaveNumberSquared]
type = ParsedFunction
expression = '(2*pi*1e9/3e8)*(2*pi*1e9/3e8)'
[]
[]
[Kernels]
[curl_curl_real]
type = CurlCurlField
variable = E_real
[]
[coeff_real]
type = VectorFunctionReaction
variable = E_real
function = WaveNumberSquared
sign = negative
[]
[curl_curl_imag]
type = CurlCurlField
variable = E_imag
[]
[coeff_imag]
type = VectorFunctionReaction
variable = E_imag
function = WaveNumberSquared
sign = negative
[]
[]
[BCs]
[antenna_real] # Impose exact solution of electric field onto antenna surface.
type = VectorCurlPenaltyDirichletBC # Replace with proper antenna surface current condition.
penalty = 1e5
function_y = '1'
boundary = antenna
variable = E_real
[]
[antenna_imag]
type = VectorCurlPenaltyDirichletBC
penalty = 1e5
function_y = '1'
boundary = antenna
variable = E_imag
[]
[radiation_condition_real]
type = VectorEMRobinBC
variable = E_real
coupled_field = E_imag
boundary = boundary
component = real
mode = absorbing
beta = 20.9439510239 # wave number at 1 GHz
[]
[radiation_condition_imag]
type = VectorEMRobinBC
variable = E_imag
coupled_field = E_real
boundary = boundary
component = imaginary
mode = absorbing
beta = 20.9439510239 # wave number at 1 GHz
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Outputs]
exodus = true
perf_graph = 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/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/auxkernels/current_density/em_current_density.i)
# This test is a modification of the vector_helmholtz.vector_kernels test
# to verify functionality of the current density auxkernel for the case of
# a vector field variable in electromagnetic mode.
# Manufactured solution: u = y * x_hat - x * y_hat
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmin = -1
ymin = -1
elem_type = QUAD9
[]
[]
[Variables]
[u]
family = NEDELEC_ONE
order = FIRST
[]
[]
[AuxVariables]
[J]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[curl_curl]
type = CurlCurlField
variable = u
[]
[coeff]
type = VectorFunctionReaction
variable = u
[]
[rhs]
type = VectorBodyForce
variable = u
function_x = 'y'
function_y = '-x'
[]
[]
[BCs]
[sides]
type = VectorCurlPenaltyDirichletBC
variable = u
function_x = 'y'
function_y = '-x'
penalty = 1e8
boundary = 'left right top bottom'
[]
[]
[AuxKernels]
[current_density]
type = ADCurrentDensity
variable = J
electrostatic = false
electric_field = u
[]
[]
[Materials] # THIS MATERIAL IS ONLY USED TO TEST THE CURRENT DENSITY CALCULATION
[conductivity] # Electrical conductivity for graphite at 293.15 K in S/m
type = ADGenericConstantMaterial # perpendicular to basal plane
prop_names = 'electrical_conductivity' # Citation: H. Pierson, "Handbook of carbon, graphite,
prop_values = 3.33e2 # diamond, and fullerenes: properties, processing,
[] # and applications," p. 61, William Andrew, 1993.
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Outputs]
exodus = true
[]
(modules/electromagnetics/test/tests/interfacekernels/electromagnetic_interfaces/perpendicular.i)
# Verification Test of PerpendicularElectricFieldInterface
# with default materials
#
# Imposes u_perpendicular = v_perpendicular on each interface
# between subdomain 0 and 1
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 10
ny = 10
nz = 10
xmax = 2
ymax = 2
zmax = 2
elem_type = HEX20
[]
[subdomain1]
type = SubdomainBoundingBoxGenerator
bottom_left = '0 0 0'
top_right = '1 1 1'
block_id = 1
input = gmg
[]
[break_boundary]
type = BreakBoundaryOnSubdomainGenerator
input = subdomain1
[]
[interface]
type = SideSetsBetweenSubdomainsGenerator
input = break_boundary
primary_block = '0'
paired_block = '1'
new_boundary = 'primary0_interface'
[]
[]
[Variables]
[u]
order = FIRST
family = NEDELEC_ONE
block = 0
[]
[v]
order = FIRST
family = NEDELEC_ONE
block = 1
[]
[]
[Kernels]
[curl_u]
type = CurlCurlField
variable = u
block = 0
[]
[coeff_u]
type = VectorFunctionReaction
variable = u
block = 0
[]
[ffn_u]
type = VectorBodyForce
variable = u
block = 0
function_x = 1
function_y = 1
function_z = 1
[]
[curl_v]
type = CurlCurlField
variable = v
block = 1
[]
[coeff_v]
type = VectorFunctionReaction
variable = v
block = 1
[]
[]
[InterfaceKernels]
[perpendicular]
type = PerpendicularElectricFieldInterface
variable = u
neighbor_var = v
boundary = primary0_interface
[]
[]
[BCs]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Outputs]
exodus = true
print_linear_residuals = true
[]
(modules/electromagnetics/test/tests/auxkernels/current_density/error_test.i)
# This input file is used to test error conditions for the CurrentDensity
# auxkernel. As written, this will fail (missing a coupled variable in that
# auxkernel)
[Mesh]
[box]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
elem_type = TRI6
[]
[]
[Variables]
[potential]
family = LAGRANGE
order = FIRST
[]
[electric_field]
family = NEDELEC_ONE
order = FIRST
[]
[]
[AuxVariables]
[J]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[poisson]
type = Diffusion
variable = potential
[]
[EM_curl_curl]
type = CurlCurlField
variable = electric_field
[]
[]
[BCs]
# natural BCs for both (all variables = 0)
[]
[AuxKernels]
[current_density]
type = ADCurrentDensity
variable = J
[]
[]
[Materials]
[conductivity]
type = ADGenericConstantMaterial
prop_names = 'electrical_conductivity'
prop_values = 3.33e2 # electrical conductivity for graphite at 293.15 K
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Outputs]
exodus = true
print_linear_converged_reason = false
print_nonlinear_converged_reason = false
[]
(modules/electromagnetics/test/tests/kernels/vector_helmholtz/microwave_heating.i)
# Test for EMJouleHeatingSource
# Manufactured solution: E_real = cos(pi*y) * x_hat - cos(pi*x) * y_hat
# E_imag = sin(pi*y) * x_hat - sin(pi*x) * y_hat
# n = x^2*y^2
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
xmin = -1
ymin = -1
elem_type = QUAD9
[]
[]
[Functions]
#The exact solution for the heated species and electric field real and imag. component
[exact_real]
type = ParsedVectorFunction
expression_x = 'cos(pi*y)'
expression_y = '-cos(pi*x)'
[]
[exact_imag]
type = ParsedVectorFunction
expression_x = 'sin(pi*y)'
expression_y = '-sin(pi*x)'
[]
[exact_n]
type = ParsedFunction
expression = 'x^2*y^2'
[]
#The forcing terms for the heated species and electric field real and imag. component
[source_real]
type = ParsedVectorFunction
symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
symbol_values = 'omega mu epsilon sigma omega mu epsilon sigma'
expression_x = '-epsilon_i*mu_i*omega_i^2*cos(pi*y) - 2*epsilon_i*mu_i*omega_i*omega_r*sin(pi*y) + epsilon_i*mu_i*omega_r^2*cos(pi*y) - epsilon_i*mu_r*omega_i^2*sin(pi*y) + 2*epsilon_i*mu_r*omega_i*omega_r*cos(pi*y) + epsilon_i*mu_r*omega_r^2*sin(pi*y) - epsilon_r*mu_i*omega_i^2*sin(pi*y) + 2*epsilon_r*mu_i*omega_i*omega_r*cos(pi*y) + epsilon_r*mu_i*omega_r^2*sin(pi*y) + epsilon_r*mu_r*omega_i^2*cos(pi*y) + 2*epsilon_r*mu_r*omega_i*omega_r*sin(pi*y) - epsilon_r*mu_r*omega_r^2*cos(pi*y) + mu_i*omega_i*sigma_i*cos(pi*y) + mu_i*omega_i*sigma_r*sin(pi*y) + mu_i*omega_r*sigma_i*sin(pi*y) - mu_i*omega_r*sigma_r*cos(pi*y) + mu_r*omega_i*sigma_i*sin(pi*y) - mu_r*omega_i*sigma_r*cos(pi*y) - mu_r*omega_r*sigma_i*cos(pi*y) - mu_r*omega_r*sigma_r*sin(pi*y) + pi^2*cos(pi*y)'
expression_y = 'epsilon_i*mu_i*omega_i^2*cos(pi*x) + 2*epsilon_i*mu_i*omega_i*omega_r*sin(pi*x) - epsilon_i*mu_i*omega_r^2*cos(pi*x) + epsilon_i*mu_r*omega_i^2*sin(pi*x) - 2*epsilon_i*mu_r*omega_i*omega_r*cos(pi*x) - epsilon_i*mu_r*omega_r^2*sin(pi*x) + epsilon_r*mu_i*omega_i^2*sin(pi*x) - 2*epsilon_r*mu_i*omega_i*omega_r*cos(pi*x) - epsilon_r*mu_i*omega_r^2*sin(pi*x) - epsilon_r*mu_r*omega_i^2*cos(pi*x) - 2*epsilon_r*mu_r*omega_i*omega_r*sin(pi*x) + epsilon_r*mu_r*omega_r^2*cos(pi*x) - mu_i*omega_i*sigma_i*cos(pi*x) - mu_i*omega_i*sigma_r*sin(pi*x) - mu_i*omega_r*sigma_i*sin(pi*x) + mu_i*omega_r*sigma_r*cos(pi*x) - mu_r*omega_i*sigma_i*sin(pi*x) + mu_r*omega_i*sigma_r*cos(pi*x) + mu_r*omega_r*sigma_i*cos(pi*x) + mu_r*omega_r*sigma_r*sin(pi*x) - pi^2*cos(pi*x)'
[]
[source_imag]
type = ParsedVectorFunction
symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
symbol_values = 'omega mu epsilon sigma omega mu epsilon sigma'
expression_x = '-epsilon_i*mu_i*omega_i^2*sin(pi*y) + 2*epsilon_i*mu_i*omega_i*omega_r*cos(pi*y) + epsilon_i*mu_i*omega_r^2*sin(pi*y) + epsilon_i*mu_r*omega_i^2*cos(pi*y) + 2*epsilon_i*mu_r*omega_i*omega_r*sin(pi*y) - epsilon_i*mu_r*omega_r^2*cos(pi*y) + epsilon_r*mu_i*omega_i^2*cos(pi*y) + 2*epsilon_r*mu_i*omega_i*omega_r*sin(pi*y) - epsilon_r*mu_i*omega_r^2*cos(pi*y) + epsilon_r*mu_r*omega_i^2*sin(pi*y) - 2*epsilon_r*mu_r*omega_i*omega_r*cos(pi*y) - epsilon_r*mu_r*omega_r^2*sin(pi*y) + mu_i*omega_i*sigma_i*sin(pi*y) - mu_i*omega_i*sigma_r*cos(pi*y) - mu_i*omega_r*sigma_i*cos(pi*y) - mu_i*omega_r*sigma_r*sin(pi*y) - mu_r*omega_i*sigma_i*cos(pi*y) - mu_r*omega_i*sigma_r*sin(pi*y) - mu_r*omega_r*sigma_i*sin(pi*y) + mu_r*omega_r*sigma_r*cos(pi*y) + pi^2*sin(pi*y)'
expression_y = 'epsilon_i*mu_i*omega_i^2*sin(pi*x) - 2*epsilon_i*mu_i*omega_i*omega_r*cos(pi*x) - epsilon_i*mu_i*omega_r^2*sin(pi*x) - epsilon_i*mu_r*omega_i^2*cos(pi*x) - 2*epsilon_i*mu_r*omega_i*omega_r*sin(pi*x) + epsilon_i*mu_r*omega_r^2*cos(pi*x) - epsilon_r*mu_i*omega_i^2*cos(pi*x) - 2*epsilon_r*mu_i*omega_i*omega_r*sin(pi*x) + epsilon_r*mu_i*omega_r^2*cos(pi*x) - epsilon_r*mu_r*omega_i^2*sin(pi*x) + 2*epsilon_r*mu_r*omega_i*omega_r*cos(pi*x) + epsilon_r*mu_r*omega_r^2*sin(pi*x) - mu_i*omega_i*sigma_i*sin(pi*x) + mu_i*omega_i*sigma_r*cos(pi*x) + mu_i*omega_r*sigma_i*cos(pi*x) + mu_i*omega_r*sigma_r*sin(pi*x) + mu_r*omega_i*sigma_i*cos(pi*x) + mu_r*omega_i*sigma_r*sin(pi*x) + mu_r*omega_r*sigma_i*sin(pi*x) - mu_r*omega_r*sigma_r*cos(pi*x) - pi^2*sin(pi*x)'
[]
[source_n]
type = ParsedFunction
symbol_names = 'sigma_r'
symbol_values = 'sigma'
expression = '-2*x^2 - 2*y^2 - 0.5*sigma_r*(sin(x*pi)^2 + sin(y*pi)^2 + cos(x*pi)^2 + cos(y*pi)^2)'
[]
#Material Coefficients
[omega]
type = ParsedFunction
expression = '2.0'
[]
[mu]
type = ParsedFunction
expression = '1.0'
[]
[epsilon]
type = ParsedFunction
expression = '3.0'
[]
[sigma]
type = ParsedFunction
expression = '4.0'
#expression = 'x^2*y^2'
[]
[]
[Materials]
[WaveCoeff]
type = WaveEquationCoefficient
eps_rel_imag = eps_imag
eps_rel_real = eps_real
k_real = k_real
k_imag = k_imag
mu_rel_imag = mu_imag
mu_rel_real = mu_real
[]
[eps_real]
type = ADGenericFunctionMaterial
prop_names = eps_real
prop_values = epsilon
[]
[eps_imag]
type = ADGenericFunctionMaterial
prop_names = eps_imag
prop_values = epsilon
[]
[mu_real]
type = ADGenericFunctionMaterial
prop_names = mu_real
prop_values = mu
[]
[mu_imag]
type = ADGenericFunctionMaterial
prop_names = mu_imag
prop_values = mu
[]
[k_real]
type = ADGenericFunctionMaterial
prop_names = k_real
prop_values = omega
[]
[k_imag]
type = ADGenericFunctionMaterial
prop_names = k_imag
prop_values = omega
[]
[cond_real]
type = ADGenericFunctionMaterial
prop_names = cond_real
prop_values = sigma
[]
[cond_imag]
type = ADGenericFunctionMaterial
prop_names = cond_imag
prop_values = sigma
[]
[]
[Variables]
[n]
family = LAGRANGE
order = FIRST
[]
[E_real]
family = NEDELEC_ONE
order = FIRST
[]
[E_imag]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[curl_curl_real]
type = CurlCurlField
variable = E_real
[]
[coeff_real]
type = ADMatWaveReaction
variable = E_real
field_real = E_real
field_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = real
[]
[conduction_real]
type = ADConductionCurrent
variable = E_real
field_imag = E_imag
field_real = E_real
conductivity_real = cond_real
conductivity_imag = cond_imag
ang_freq_real = k_real
ang_freq_imag = k_imag
permeability_real = mu_real
permeability_imag = mu_imag
component = real
[]
[body_force_real]
type = VectorBodyForce
variable = E_real
function = source_real
[]
[curl_curl_imag]
type = CurlCurlField
variable = E_imag
[]
[coeff_imag]
type = ADMatWaveReaction
variable = E_imag
field_real = E_real
field_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = imaginary
[]
[conduction_imag]
type = ADConductionCurrent
variable = E_imag
field_imag = E_imag
field_real = E_real
conductivity_real = cond_real
conductivity_imag = cond_imag
ang_freq_real = k_real
ang_freq_imag = k_imag
permeability_real = mu_real
permeability_imag = mu_imag
component = imaginary
[]
[body_force_imag]
type = VectorBodyForce
variable = E_imag
function = source_imag
[]
[n_diffusion]
type = Diffusion
variable = n
[]
[microwave_heating]
type = EMJouleHeatingSource
variable = n
E_imag = E_imag
E_real = E_real
conductivity = cond_real
[]
[body_force_n]
type = BodyForce
variable = n
function = source_n
[]
[]
[BCs]
[sides_real]
type = VectorCurlPenaltyDirichletBC
variable = E_real
function = exact_real
penalty = 1e8
boundary = 'left right top bottom'
[]
[sides_imag]
type = VectorCurlPenaltyDirichletBC
variable = E_imag
function = exact_imag
penalty = 1e8
boundary = 'left right top bottom'
[]
[sides_n]
type = FunctorDirichletBC
variable = n
boundary = 'left right top bottom'
functor = exact_n
preset = false
[]
[]
[Postprocessors]
[error_real]
type = ElementVectorL2Error
variable = E_real
function = exact_real
[]
[error_imag]
type = ElementVectorL2Error
variable = E_imag
function = exact_imag
[]
[error_n]
type = ElementL2Error
variable = n
function = exact_n
[]
[h]
type = AverageElementSize
[]
[h_squared]
type = ParsedPostprocessor
pp_names = 'h'
expression = 'h * h'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
csv = true
[]
(modules/electromagnetics/test/tests/kernels/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
[]