- curl_x0x-component of curl of function.
Default:0
C++ Type:std::string
Controllable:No
Description:x-component of curl of function.
- curl_y0y-component of curl of function.
Default:0
C++ Type:std::string
Controllable:No
Description:y-component of curl of function.
- curl_z0z-component of curl of function.
Default:0
C++ Type:std::string
Controllable:No
Description:z-component of curl of function.
- div0divergence of function.
Default:0
C++ Type:std::string
Controllable:No
Description:divergence of function.
- expression_x0x-component of function.
Default:0
C++ Type:std::string
Controllable:No
Description:x-component of function.
- expression_y0y-component of function.
Default:0
C++ Type:std::string
Controllable:No
Description:y-component of function.
- expression_z0z-component of function.
Default:0
C++ Type:std::string
Controllable:No
Description:z-component of function.
- symbol_namesSymbols (excluding t,x,y,z) that are bound to the values provided by the corresponding items in the vals vector.
C++ Type:std::vector<std::string>
Controllable:No
Description:Symbols (excluding t,x,y,z) that are bound to the values provided by the corresponding items in the vals vector.
- symbol_valuesConstant numeric values, postprocessor names, function names, and scalar variables corresponding to the symbols in symbol_names.
C++ Type:std::vector<std::string>
Controllable:No
Description:Constant numeric values, postprocessor names, function names, and scalar variables corresponding to the symbols in symbol_names.
ParsedVectorFunction
Returns a vector function based on string descriptions for each component.
The ParsedVectorFunction
is a vectorized version of the ParsedFunction. The vector components, the curl and the divergence of the function may be specified. The inputs for the components of the vector, the curl and the divergence of the function follow the same rules as outlined for the ParsedFunction.
Example input syntax
In this example, a ParsedVectorFunction
is used to define a curl boundary condition. Both x,y component and the z-curl are set for this function.
[Functions<<<{"href": "../../syntax/Functions/index.html"}>>>]
# Simple "clockwise rotating" field in XY plane. curl(u) = (0, 0, -2)
[./field]
type = ParsedVectorFunction<<<{"description": "Returns a vector function based on string descriptions for each component.", "href": "MooseParsedVectorFunction.html"}>>>
expression_x<<<{"description": "x-component of function."}>>> = 'y'
expression_y<<<{"description": "y-component of function."}>>> = '-x'
curl_z<<<{"description": "z-component of curl of function."}>>> = '-2'
[../]
[./ffn_x]
type = ParsedFunction<<<{"description": "Function created by parsing a string", "href": "MooseParsedFunction.html"}>>>
expression<<<{"description": "The user defined function."}>>> = 'y'
[../]
[./ffn_y]
type = ParsedFunction<<<{"description": "Function created by parsing a string", "href": "MooseParsedFunction.html"}>>>
expression<<<{"description": "The user defined function."}>>> = '-x'
[../]
[]
[BCs<<<{"href": "../../syntax/BCs/index.html"}>>>]
[./top]
type = VectorCurlBC
curl_value = field
variable = u
boundary = 'left right top bottom'
[../]
[]
(test/tests/functions/parsed/function_curl.i)Input Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:No
Description:Set the enabled status of the MooseObject.
Advanced Parameters
Input Files
- (modules/electromagnetics/test/tests/kernels/vector_helmholtz/vector_ADmaterial_wave_reaction.i)
- (modules/electromagnetics/test/tests/kernels/vector_helmholtz/vector_current_source.i)
- (modules/navier_stokes/test/tests/finite_element/ins/hdg/ip/lid-driven/matrix-testing.i)
- (test/tests/mfem/kernels/irrotational.i)
- (test/tests/dgkernels/passive-scalar-channel-flow/test.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/implicit-euler-basic-kt-primitive.i)
- (modules/electromagnetics/test/tests/kernels/vector_helmholtz/vector_conduction_current.i)
- (modules/navier_stokes/test/tests/finite_element/ins/coupled-force/gravity-through-coupled-force.i)
- (modules/combined/test/tests/electromagnetic_joule_heating/microwave_heating.i)
- (test/tests/mfem/ics/vector_ic.i)
- (modules/level_set/examples/circle/circle_16.i)
- (test/tests/transfers/multiapp_copy_transfer/vector-variable-transfer/parent_L2_LagrangeVec.i)
- (test/tests/kernels/vector_fe/coupled_electrostatics.i)
- (modules/level_set/test/tests/verification/1d_level_set_supg_mms/1d_level_set_supg_mms.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/varying-eps-hllc.i)
- (modules/electromagnetics/test/tests/benchmarks/evanescent_wave/evanescent_wave.i)
- (test/tests/kernels/vector_fe/ad_coupled_curl_product.i)
- (modules/combined/test/tests/electromagnetic_joule_heating/fusing_current_through_copper_wire.i)
- (test/tests/kernels/vector_fe/vector_kernel.i)
- (modules/electromagnetics/test/tests/auxkernels/azimuthal_Faradays_law/scalar_azim_magnetic_time_deriv.i)
- (test/tests/mfem/kernels/curlcurl.i)
- (modules/electromagnetics/test/tests/benchmarks/evanescent_wave/evanescent_wave_with_ADMaterials.i)
- (test/tests/functions/parsed/vector_function.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/rotated-2d-bkt-function-porosity.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/scalar_advection/mass-frac-advection.i)
- (modules/navier_stokes/test/tests/finite_element/ins/cg-dg-hybrid/channel-flow/channel-hybrid.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/hllc.i)
- (modules/level_set/test/tests/verification/1d_level_set_mms/level_set_mms.i)
- (test/tests/auxkernels/vector_function_aux/vector_function_aux.i)
- (modules/electromagnetics/test/tests/bcs/vector_robin_bc/portbc_waves.i)
- (modules/electromagnetics/test/tests/auxkernels/azimuthal_Faradays_law/error_azim_magnetic_time_deriv.i)
- (modules/level_set/examples/rotating_circle/circle_rotate.i)
- (modules/electromagnetics/test/tests/auxkernels/heating/aux_current_source_heating.i)
- (modules/geochemistry/test/tests/kinetics/bio_zoning_flow.i)
- (modules/electromagnetics/test/tests/auxkernels/heating/aux_microwave_heating.i)
- (modules/geochemistry/test/tests/kernels/advection_1.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/varying-eps-basic-kt-primitive.i)
- (test/tests/functions/linear_combination_function/lcf_vector.i)
- (modules/level_set/test/tests/kernels/advection/advection_mms.i)
- (modules/combined/test/tests/electromagnetic_joule_heating/aux_microwave_heating.i)
- (modules/navier_stokes/test/tests/finite_element/ins/hdg/ip/lid-driven/lid-driven-fsp.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/basic-primitive-pcnsfv-kt.i)
- (modules/navier_stokes/test/tests/finite_element/ins/coupled-force/gravity-through-coupled-force-action.i)
- (modules/level_set/examples/rotating_circle/circle_rotate_parent.i)
- (test/tests/mfem/kernels/graddiv.i)
- (test/tests/auxkernels/functor_elemental_gradient/functor_gradient.i)
- (test/tests/functions/parsed/function_curl.i)
- (modules/electromagnetics/test/tests/auxkernels/azimuthal_Faradays_law/vector_azim_magnetic_time_deriv.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/varying-eps-basic-kt-mixed.i)
- (modules/navier_stokes/test/tests/finite_element/ins/coupled-force/steady-function.i)
- (modules/navier_stokes/test/tests/finite_element/ins/coupled-force/steady-action-function.i)
- (test/tests/kernels/vector_dot_dot/vector_test.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/heated-channel/transient-porous-kt-primitive.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/rotated-2d-bkt-function-porosity-mixed.i)
- (test/tests/kernels/vector_fe/ad_vector_kernel.i)
- (modules/level_set/examples/rotating_circle/circle_rotate_supg.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/basic-conserved-pcnsfv-kt.i)
- (modules/electromagnetics/test/tests/kernels/vector_helmholtz/microwave_heating.i)
- (test/tests/ics/vector_function_ic/vector_function_ic.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/dc.i)
- (modules/level_set/test/tests/reinitialization/parent.i)
(test/tests/functions/parsed/function_curl.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmin = -1
ymin = -1
elem_type = QUAD9
[]
[Variables]
# u = (y, -x, 0)
[./u]
family = NEDELEC_ONE
order = FIRST
[../]
[]
[Functions]
# Simple "clockwise rotating" field in XY plane. curl(u) = (0, 0, -2)
[./field]
type = ParsedVectorFunction
expression_x = 'y'
expression_y = '-x'
curl_z = '-2'
[../]
[./ffn_x]
type = ParsedFunction
expression = 'y'
[../]
[./ffn_y]
type = ParsedFunction
expression = '-x'
[../]
[]
[Kernels]
[./diff]
type = VectorFEWave
variable = u
x_forcing_func = ffn_x
y_forcing_func = ffn_y
[../]
[]
[BCs]
[./top]
type = VectorCurlBC
curl_value = field
variable = u
boundary = 'left right top bottom'
[../]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = 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
[]
(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/navier_stokes/test/tests/finite_element/ins/hdg/ip/lid-driven/matrix-testing.i)
mu = 1
rho = 1
U = 1
n = 5
l = 1
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = ${l}
nx = ${n}
ny = ${n}
elem_type = TRI6
[]
[]
[Problem]
type = PrintMatricesNSProblem
extra_tag_matrices = 'mass jump combined grad_div'
pressure_mass_matrix = 'mass'
velocity_mass_matrix = 'mass'
augmented_lagrange_matrices = 'jump grad_div combined'
u = vel_x
v = vel_y
pressure = pressure
pressure_bar = pressure_bar
print = false
[]
[Variables]
[vel_x]
family = MONOMIAL
order = FIRST
[]
[vel_y]
family = MONOMIAL
order = FIRST
[]
[pressure]
family = MONOMIAL
order = CONSTANT
[]
[vel_bar_x]
family = SIDE_HIERARCHIC
order = FIRST
[]
[vel_bar_y]
family = SIDE_HIERARCHIC
order = FIRST
[]
[pressure_bar]
family = SIDE_HIERARCHIC
order = FIRST
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[HDGKernels]
[momentum_x_diffusion]
type = NavierStokesStressIPHDGKernel
variable = vel_x
face_variable = vel_bar_x
diffusivity = 'mu'
alpha = 6
pressure_variable = pressure
pressure_face_variable = pressure_bar
component = 0
[]
[momentum_y_diffusion]
type = NavierStokesStressIPHDGKernel
variable = vel_y
face_variable = vel_bar_y
diffusivity = 'mu'
alpha = 6
pressure_variable = pressure
pressure_face_variable = pressure_bar
component = 1
[]
[pressure_convection]
type = AdvectionIPHDGKernel
variable = pressure
face_variable = pressure_bar
velocity = 'velocity'
coeff = '${fparse -rho}'
self_advection = false
[]
[]
[Kernels]
[mean_zero_pressure]
type = ScalarLagrangeMultiplier
variable = pressure
lambda = lambda
[]
[mass_matrix_vel_x]
type = MassMatrix
variable = vel_x
matrix_tags = 'mass'
[]
[mass_matrix_vel_y]
type = MassMatrix
variable = vel_y
matrix_tags = 'mass'
[]
[mass_matrix_pressure]
type = MassMatrix
variable = pressure
matrix_tags = 'mass'
[]
[u_jump]
type = GradDiv
matrix_only = true
variable = vel_x
u = vel_x
v = vel_y
component = 0
vector_tags = ''
matrix_tags = 'grad_div combined'
[]
[v_jump]
type = GradDiv
matrix_only = true
variable = vel_y
u = vel_x
v = vel_y
component = 1
vector_tags = ''
matrix_tags = 'grad_div combined'
[]
[]
[ScalarKernels]
[mean_zero_pressure_lm]
type = AverageValueConstraint
variable = lambda
pp_name = pressure_integral
value = 0
[]
[]
[DGKernels]
[pb_mass]
type = MassMatrixDGKernel
variable = pressure_bar
matrix_tags = 'mass'
[]
[u_jump]
type = MassFluxPenalty
matrix_only = true
variable = vel_x
u = vel_x
v = vel_y
component = 0
vector_tags = ''
matrix_tags = 'jump combined'
[]
[v_jump]
type = MassFluxPenalty
matrix_only = true
variable = vel_y
u = vel_x
v = vel_y
component = 1
vector_tags = ''
matrix_tags = 'jump combined'
[]
[]
[BCs]
[momentum_x_diffusion_walls]
type = NavierStokesStressIPHDGDirichletBC
boundary = 'left bottom right'
variable = vel_x
face_variable = vel_bar_x
pressure_variable = pressure
pressure_face_variable = pressure_bar
alpha = 6
functor = '0'
diffusivity = 'mu'
component = 0
[]
[momentum_x_diffusion_top]
type = NavierStokesStressIPHDGDirichletBC
boundary = 'top'
variable = vel_x
face_variable = vel_bar_x
pressure_variable = pressure
pressure_face_variable = pressure_bar
alpha = 6
functor = '${U}'
diffusivity = 'mu'
component = 0
[]
[momentum_y_diffusion_all]
type = NavierStokesStressIPHDGDirichletBC
boundary = 'left bottom right top'
variable = vel_y
face_variable = vel_bar_y
pressure_variable = pressure
pressure_face_variable = pressure_bar
alpha = 6
functor = '0'
diffusivity = 'mu'
component = 1
[]
[mass_convection]
type = AdvectionIPHDGPrescribedFluxBC
face_variable = pressure_bar
variable = pressure
velocity = 'velocity'
coeff = '${fparse -rho}'
self_advection = false
boundary = 'left bottom top right'
prescribed_normal_flux = 0
[]
[pb_mass]
type = MassMatrixIntegratedBC
variable = pressure_bar
matrix_tags = 'mass'
boundary = 'left right bottom top'
[]
[u_jump_walls]
type = MassFluxPenaltyBC
matrix_only = true
variable = vel_x
u = vel_x
v = vel_y
component = 0
vector_tags = ''
matrix_tags = 'jump combined'
boundary = 'left right bottom'
dirichlet_value = 'walls'
[]
[v_jump_walls]
type = MassFluxPenaltyBC
matrix_only = true
variable = vel_y
u = vel_x
v = vel_y
component = 1
vector_tags = ''
matrix_tags = 'jump combined'
boundary = 'left right bottom'
dirichlet_value = 'walls'
[]
[u_jump_top]
type = MassFluxPenaltyBC
matrix_only = true
variable = vel_x
u = vel_x
v = vel_y
component = 0
vector_tags = ''
matrix_tags = 'jump combined'
boundary = 'top'
dirichlet_value = 'top'
[]
[v_jump_top]
type = MassFluxPenaltyBC
matrix_only = true
variable = vel_y
u = vel_x
v = vel_y
component = 1
vector_tags = ''
matrix_tags = 'jump combined'
boundary = 'top'
dirichlet_value = 'top'
[]
[]
[Functions]
[top]
type = ParsedVectorFunction
value_x = ${U}
value_y = 0
[]
[walls]
type = ParsedVectorFunction
value_x = 0
value_y = 0
[]
[]
[Materials]
[const]
type = ADGenericConstantMaterial
prop_names = 'rho mu'
prop_values = '${rho} ${mu}'
[]
[vel]
type = ADVectorFromComponentVariablesMaterial
vector_prop_name = 'velocity'
u = vel_x
v = vel_y
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-12
[]
[Outputs]
[out]
type = CSV
hide = 'pressure_integral lambda'
execute_on = 'timestep_end'
[]
[]
[Postprocessors]
[symmetric]
type = MatrixSymmetryCheck
execute_on = 'timestep_end'
[]
[pressure_integral]
type = ElementIntegralVariablePostprocessor
variable = pressure
execute_on = linear
[]
[fe_jump_and_upb_equiv]
type = MatrixEqualityCheck
mat1 = 'vel_pb_grad_div.mat'
mat2 = 'jump.mat'
[]
[fe_grad_div_and_up_equiv]
type = MatrixEqualityCheck
mat1 = 'vel_p_grad_div.mat'
mat2 = 'grad_div.mat'
[]
[fe_combined_and_upall_equiv]
type = MatrixEqualityCheck
mat1 = 'vel_all_p_grad_div.mat'
mat2 = 'combined.mat'
[]
[upb_grad_div_num_zero_eig]
type = MatrixEigenvalueCheck
mat = vel_pb_grad_div.mat
[]
[upb_div_grad_num_zero_eig]
type = MatrixEigenvalueCheck
mat = vel_pb_div_grad.mat
[]
[up_grad_div_num_zero_eig]
type = MatrixEigenvalueCheck
mat = vel_p_grad_div.mat
[]
[up_div_grad_num_zero_eig]
type = MatrixEigenvalueCheck
mat = vel_p_div_grad.mat
[]
[upall_grad_div_num_zero_eig]
type = MatrixEigenvalueCheck
mat = vel_all_p_grad_div.mat
[]
[upall_div_grad_num_zero_eig]
type = MatrixEigenvalueCheck
mat = vel_all_p_div_grad.mat
[]
[]
(test/tests/mfem/kernels/irrotational.i)
# 2D irrotational vortex with Nedelec elements of the first kind.
centre_x = -0.75
centre_y = 0.1
[Mesh]
type = MFEMMesh
file = ../mesh/vortex.msh
dim = 2
[]
[Problem]
type = MFEMProblem
[]
[FESpaces]
[H1FESpace]
type = MFEMScalarFESpace
fec_type = H1
fec_order = SEVENTH
[]
[HCurlFESpace]
type = MFEMVectorFESpace
fec_type = ND
fec_order = SEVENTH
[]
[]
[Variables]
[velocity_potential]
type = MFEMVariable
fespace = H1FESpace
[]
[]
[AuxVariables]
[velocity]
type = MFEMVariable
fespace = HCurlFESpace
[]
[]
[Functions]
[speed]
type = ParsedFunction
expression = '1 / sqrt((x-x0)^2 + (y-y0)^2)'
symbol_names = 'x0 y0'
symbol_values = '${centre_x} ${centre_y}'
[]
[theta]
type = ParsedFunction
expression = 'atan2(y-y0, x-x0)'
symbol_names = 'x0 y0'
symbol_values = '${centre_x} ${centre_y}'
[]
[exact_velocity]
type = ParsedVectorFunction
expression_x = '-v * sin(th)'
expression_y = 'v * cos(th)'
symbol_names = 'v th'
symbol_values = 'speed theta'
[]
[]
[BCs]
[potential_velocity_boundary]
type = MFEMScalarDirichletBC
variable = velocity_potential
boundary = '1'
coefficient = theta
[]
[]
[Kernels]
[laplacian]
type = MFEMDiffusionKernel
variable = velocity_potential
[]
[]
[AuxKernels]
[grad]
type = MFEMGradAux
variable = velocity
source = velocity_potential
execute_on = TIMESTEP_END
[]
[]
[Preconditioner]
[boomeramg]
type = MFEMHypreBoomerAMG
[]
[]
[Solver]
type = MFEMHypreGMRES
preconditioner = boomeramg
l_tol = 1e-16
l_max_its = 1000
[]
[Executioner]
type = MFEMSteady
device = cpu
[]
[Postprocessors]
[potential_error]
type = MFEML2Error
variable = velocity_potential
function = theta
execution_order_group = 1
[]
[velocity_error]
type = MFEMVectorL2Error
variable = velocity
function = exact_velocity
execution_order_group = 1
[]
[]
[Outputs]
[ParaViewDataCollection]
type = MFEMParaViewDataCollection
file_base = OutputData/Irrotational
vtk_format = ASCII
[]
[L2CSV]
type = CSV
file_base = OutputData/Irrotational
[]
[]
(test/tests/dgkernels/passive-scalar-channel-flow/test.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = -1
ymax = 1
nx = 20
ny = 4
[]
[]
[Variables]
[u]
family = MONOMIAL
[]
[]
[Kernels]
[convection]
type = ADConservativeAdvection
variable = u
velocity = 'velocity'
[]
[diffusion]
type = MatDiffusion
variable = u
diffusivity = 1
[]
[]
[DGKernels]
[convection]
type = ADDGAdvection
variable = u
velocity = 'velocity'
[]
[diffusion]
type = DGDiffusion
variable = u
sigma = 6
epsilon = -1
diff = 1
[]
[]
[Functions]
[v_inlet]
type = ParsedVectorFunction
expression_x = '1'
[]
[]
[BCs]
[u_walls]
type = DGFunctionDiffusionDirichletBC
boundary = 'bottom top'
variable = u
sigma = 6
epsilon = -1
function = '0'
diff = 1
[]
[u_in]
type = ADConservativeAdvectionBC
boundary = 'left'
variable = u
velocity_function = v_inlet
primal_dirichlet_value = 1
[]
[u_out]
type = ADConservativeAdvectionBC
boundary = 'right'
variable = u
velocity_mat_prop = 'velocity'
[]
[]
[Materials]
[vel]
type = ADVectorFromComponentVariablesMaterial
vector_prop_name = 'velocity'
u = 1
v = 0
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/implicit-euler-basic-kt-primitive.i)
p_initial=1.01e5
T=273.15
# u refers to the superficial velocity
u_in=1
user_limiter='upwind'
[GlobalParams]
fp = fp
two_term_boundary_expansion = true
limiter = ${user_limiter}
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 1
xmin = 0
xmax = 18
nx = 180
[]
[to_pt5]
input = cartesian
type = SubdomainBoundingBoxGenerator
bottom_left = '2 0 0'
top_right = '4 1 0'
block_id = 1
[]
[pt5]
input = to_pt5
type = SubdomainBoundingBoxGenerator
bottom_left = '4 0 0'
top_right = '6 1 0'
block_id = 2
[]
[to_pt25]
input = pt5
type = SubdomainBoundingBoxGenerator
bottom_left = '6 0 0'
top_right = '8 1 0'
block_id = 3
[]
[pt25]
input = to_pt25
type = SubdomainBoundingBoxGenerator
bottom_left = '8 0 0'
top_right = '10 1 0'
block_id = 4
[]
[to_pt5_again]
input = pt25
type = SubdomainBoundingBoxGenerator
bottom_left = '10 0 0'
top_right = '12 1 0'
block_id = 5
[]
[pt5_again]
input = to_pt5_again
type = SubdomainBoundingBoxGenerator
bottom_left = '12 0 0'
top_right = '14 1 0'
block_id = 6
[]
[to_one]
input = pt5_again
type = SubdomainBoundingBoxGenerator
bottom_left = '14 0 0'
top_right = '16 1 0'
block_id = 7
[]
[one]
input = to_one
type = SubdomainBoundingBoxGenerator
bottom_left = '16 0 0'
top_right = '18 1 0'
block_id = 8
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[pressure]
type = MooseVariableFVReal
initial_condition = ${p_initial}
[]
[sup_vel_x]
type = MooseVariableFVReal
initial_condition = 1e-15
scaling = 1e-2
[]
[T_fluid]
type = MooseVariableFVReal
initial_condition = ${T}
scaling = 1e-5
[]
[]
[AuxVariables]
[vel_x]
type = MooseVariableFVReal
[]
[sup_mom_x]
type = MooseVariableFVReal
[]
[rho]
type = MooseVariableFVReal
[]
[worst_courant]
type = MooseVariableFVReal
[]
[porosity]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[vel_x]
type = ADMaterialRealAux
variable = vel_x
property = vel_x
execute_on = 'timestep_end'
[]
[sup_mom_x]
type = ADMaterialRealAux
variable = sup_mom_x
property = superficial_rhou
execute_on = 'timestep_end'
[]
[rho]
type = ADMaterialRealAux
variable = rho
property = rho
execute_on = 'timestep_end'
[]
[worst_courant]
type = Courant
variable = worst_courant
u = sup_vel_x
execute_on = 'timestep_end'
[]
[porosity]
type = MaterialRealAux
variable = porosity
property = porosity
execute_on = 'timestep_end'
[]
[]
[FVKernels]
[mass_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rho_dt'
variable = pressure
[]
[mass_advection]
type = PCNSFVKT
variable = pressure
eqn = "mass"
[]
[momentum_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rhou_dt'
variable = sup_vel_x
[]
[momentum_advection]
type = PCNSFVKT
variable = sup_vel_x
eqn = "momentum"
momentum_component = 'x'
[]
[eps_grad]
type = PNSFVPGradEpsilon
variable = sup_vel_x
momentum_component = 'x'
epsilon_function = 'eps'
[]
[energy_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rho_et_dt'
variable = T_fluid
[]
[energy_advection]
type = PCNSFVKT
variable = T_fluid
eqn = "energy"
[]
[]
[FVBCs]
[rho_left]
type = PCNSFVStrongBC
boundary = 'left'
variable = pressure
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'mass'
[]
[rhou_left]
type = PCNSFVStrongBC
boundary = 'left'
variable = sup_vel_x
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'momentum'
momentum_component = 'x'
[]
[rho_et_left]
type = PCNSFVStrongBC
boundary = 'left'
variable = T_fluid
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'energy'
[]
[rho_right]
type = PCNSFVStrongBC
boundary = 'right'
variable = pressure
pressure = ${p_initial}
eqn = 'mass'
[]
[rhou_right]
type = PCNSFVStrongBC
boundary = 'right'
variable = sup_vel_x
pressure = ${p_initial}
eqn = 'momentum'
momentum_component = 'x'
[]
[rho_et_right]
type = PCNSFVStrongBC
boundary = 'right'
variable = T_fluid
pressure = ${p_initial}
eqn = 'energy'
[]
# Use these to help create more accurate cell centered gradients for cells adjacent to boundaries
[T_left]
type = FVDirichletBC
variable = T_fluid
value = ${T}
boundary = 'left'
[]
[sup_vel_left]
type = FVDirichletBC
variable = sup_vel_x
value = ${u_in}
boundary = 'left'
[]
[p_right]
type = FVDirichletBC
variable = pressure
value = ${p_initial}
boundary = 'right'
[]
[]
[Functions]
[ud_in]
type = ParsedVectorFunction
expression_x = '${u_in}'
[]
[eps]
type = ParsedFunction
expression = 'if(x < 2, 1,
if(x < 4, 1 - .5 / 2 * (x - 2),
if(x < 6, .5,
if(x < 8, .5 - .25 / 2 * (x - 6),
if(x < 10, .25,
if(x < 12, .25 + .25 / 2 * (x - 10),
if(x < 14, .5,
if(x < 16, .5 + .5 / 2 * (x - 14),
1))))))))'
[]
[]
[Materials]
[var_mat]
type = PorousPrimitiveVarMaterial
pressure = pressure
T_fluid = T_fluid
superficial_vel_x = sup_vel_x
fp = fp
porosity = porosity
[]
[porosity]
type = GenericFunctionMaterial
prop_names = 'porosity'
prop_values = 'eps'
[]
[]
[Executioner]
solve_type = NEWTON
line_search = 'bt'
type = Transient
nl_max_its = 20
[TimeStepper]
type = IterationAdaptiveDT
dt = 5e-5
optimal_iterations = 6
growth_factor = 1.2
[]
num_steps = 10000
end_time = 500
nl_abs_tol = 1e-8
[]
[Outputs]
[out]
type = Exodus
execute_on = 'final'
[]
checkpoint = true
[]
[Debug]
show_var_residual_norms = 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/navier_stokes/test/tests/finite_element/ins/coupled-force/gravity-through-coupled-force.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1.0
ymin = 0
ymax = 1.0
nx = 16
ny = 16
[]
[./corner_node]
type = ExtraNodesetGenerator
new_boundary = 'pinned_node'
nodes = '0'
input = gen
[../]
[]
[Variables]
[./velocity]
family = LAGRANGE_VEC
[../]
[./p]
[../]
[u]
family = LAGRANGE_VEC
[]
[]
[AuxVariables]
[gravity]
family = LAGRANGE_VEC
[]
[]
[ICs]
[velocity]
type = VectorConstantIC
x_value = 1e-15
y_value = 1e-15
variable = velocity
[]
[gravity]
type = VectorConstantIC
x_value = '0'
y_value = '-9.81'
variable = gravity
[]
[]
[Kernels]
inactive = 'momentum_coupled_forces_two_vars momentum_coupled_forces_two_funcs'
[./mass]
type = INSADMass
variable = p
[../]
[./mass_pspg]
type = INSADMassPSPG
variable = p
[../]
[./momentum_convection]
type = INSADMomentumAdvection
variable = velocity
[../]
[./momentum_viscous]
type = INSADMomentumViscous
variable = velocity
[../]
[./momentum_pressure]
type = INSADMomentumPressure
variable = velocity
pressure = p
integrate_p_by_parts = true
[../]
[momentum_coupled_forces_var_and_func]
type = INSADMomentumCoupledForce
variable = velocity
coupled_vector_var = u
vector_function = 'vector_gravity_func'
[]
[momentum_coupled_forces_two_vars]
type = INSADMomentumCoupledForce
variable = velocity
coupled_vector_var = 'u gravity'
[]
[momentum_coupled_forces_two_funcs]
type = INSADMomentumCoupledForce
variable = velocity
vector_function = 'vector_func vector_gravity_func'
[]
[./momentum_supg]
type = INSADMomentumSUPG
variable = velocity
velocity = velocity
[../]
[u_diff]
type = VectorDiffusion
variable = u
[]
[]
[BCs]
[./no_slip]
type = VectorFunctionDirichletBC
variable = velocity
boundary = 'bottom right left top'
[../]
[./pressure_pin]
type = DirichletBC
variable = p
boundary = 'pinned_node'
value = 0
[../]
[u_left]
type = VectorFunctionDirichletBC
variable = u
boundary = 'left'
function_x = 1
function_y = 1
[]
[u_right]
type = VectorFunctionDirichletBC
variable = u
boundary = 'right'
function_x = -1
function_y = -1
[]
[]
[Materials]
[./const]
type = ADGenericConstantMaterial
prop_names = 'rho mu'
prop_values = '1 1'
[../]
[ins_mat]
type = INSADTauMaterial
velocity = velocity
pressure = p
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -sub_pc_factor_levels -ksp_gmres_restart'
petsc_options_value = 'asm 6 200'
line_search = 'none'
nl_rel_tol = 1e-12
nl_max_its = 6
[]
[Outputs]
[out]
type = Exodus
hide = 'gravity'
[]
[]
[Functions]
[vector_func]
type = ParsedVectorFunction
expression_x = '-2*x + 1'
expression_y = '-2*x + 1'
[]
[vector_gravity_func]
type = ParsedVectorFunction
expression_x = '0'
expression_y = '-9.81'
[]
[]
(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
[]
(test/tests/mfem/ics/vector_ic.i)
[Mesh]
type = MFEMMesh
file = ../mesh/cylinder-hex-q2.gen
[]
[Problem]
type = MFEMProblem
solve = false
[]
[FESpaces]
[H1VectorFESpace]
type = MFEMVectorFESpace
fec_type = H1
fec_order = FIRST
[]
[HCurlFESpace]
type = MFEMVectorFESpace
fec_type = ND
fec_order = FIRST
[]
[HDivFESpace]
type = MFEMVectorFESpace
fec_type = RT
fec_order = CONSTANT
[]
[L2VectorFESpace]
type = MFEMVectorFESpace
fec_type = L2
fec_order = CONSTANT
[]
[]
[Variables]
[h1_vector]
type = MFEMVariable
fespace = H1VectorFESpace
[]
[nd_vector]
type = MFEMVariable
fespace = HCurlFESpace
[]
[rt_vector]
type = MFEMVariable
fespace = HDivFESpace
[]
[l2_vector]
type = MFEMVariable
fespace = L2VectorFESpace
[]
[]
[Functions]
[external_vector_field]
type = ParsedVectorFunction
expression_x = 'sin(kappa * y)'
expression_y = 'sin(kappa * z)'
expression_z = 'sin(kappa * x)'
symbol_names = kappa
symbol_values = 3.1415926535
[]
[]
[ICs]
[h1_vector_ic]
type = MFEMVectorIC
variable = h1_vector
coefficient = external_vector_field
[]
[l2_vector_ic]
type = MFEMVectorIC
variable = l2_vector
coefficient = external_vector_field
[]
[nd_vector_ic]
type = MFEMVectorIC
variable = nd_vector
coefficient = external_vector_field
[]
[rt_vector_ic]
type = MFEMVectorIC
variable = rt_vector
coefficient = external_vector_field
[]
[]
[Executioner]
type = MFEMSteady
device = cpu
[]
[Outputs]
[ParaViewDataCollection]
type = MFEMParaViewDataCollection
file_base = OutputData/VectorIC
vtk_format = ASCII
[]
[]
(modules/level_set/examples/circle/circle_16.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 16
ny = 16
[]
[Variables]
[./phi]
[../]
[]
[AuxVariables]
[./velocity]
family = LAGRANGE_VEC
[../]
[]
[ICs]
[./phi_ic]
type = FunctionIC
function = phi_exact
variable = phi
[../]
[./vel_ic]
type = VectorFunctionIC
variable = velocity
function = velocity_func
[]
[]
[Functions]
[./phi_exact]
type = LevelSetOlssonBubble
epsilon = 0.05
center = '0.5 0.5 0'
radius = 0.15
[../]
[./velocity_func]
type = ParsedVectorFunction
expression_x = '3'
expression_y = '3'
[../]
[]
[BCs]
[./Periodic]
[./all]
variable = phi
auto_direction = 'x y'
[../]
[../]
[]
[Kernels]
[./time]
type = TimeDerivative
variable = phi
[../]
[./advection]
type = LevelSetAdvection
velocity = velocity
variable = phi
[../]
[]
[Postprocessors]
[./cfl]
type = LevelSetCFLCondition
velocity = velocity
execute_on = 'initial'
[../]
[]
[Executioner]
type = Transient
solve_type = PJFNK
start_time = 0
end_time = 1
scheme = crank-nicolson
petsc_options_iname = '-pc_type -sub_pc_type'
petsc_options_value = 'asm ilu'
[./TimeStepper]
type = PostprocessorDT
postprocessor = cfl
scale = 0.8
[../]
[]
[Outputs]
csv = true
exodus = true
[]
(test/tests/transfers/multiapp_copy_transfer/vector-variable-transfer/parent_L2_LagrangeVec.i)
[Mesh]
type = GeneratedMesh
dim = 3
nx = 5
ny = 5
nz = 5
[]
[Problem]
solve = false
[]
[AuxVariables]
[sent_vector]
family = LAGRANGE_VEC
order = FIRST
[]
[]
[Functions]
[set_sent_vector]
type = ParsedVectorFunction
expression_x = '100*x*x'
expression_y = '100*y*y'
expression_z = '100*z*z'
[]
[]
[ICs]
# Set sent vector. We will check this in the subapp.
[set_sent_vector]
type = VectorFunctionIC
variable = sent_vector
function = set_sent_vector
[]
[]
[MultiApps]
[sub_app]
type = TransientMultiApp
positions = '0 0 0'
input_files = 'sub_L2_LagrangeVec.i'
execute_on = timestep_begin
[]
[]
[Transfers]
[push]
type = MultiAppCopyTransfer
to_multi_app = sub_app
source_variable = 'sent_vector'
variable = 'received_vector'
[]
[]
[Executioner]
type = Transient
dt = 1.0
start_time = 0.0
end_time = 1.0
[]
(test/tests/kernels/vector_fe/coupled_electrostatics.i)
# Test for DivField and GradField kernels and VectorDivPenaltyDirichletBC bcs.
# This test uses Raviart-Thomas elements to solve a model div-grad problem
# in H(div). The problem is simply a div-grad formulation, u = -grad(p), and
# div(u) = f, of the standard Poisson problem div(grad(p)) = -f.
# Manufactured solution: p = cos(k*x)*sin(k*y)*cos(k*z).
k = asin(1)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 6
ny = 6
nz = 6
xmax = 1
ymax = 1
zmax = 1
xmin = -1
ymin = -1
zmin = -1
elem_type = HEX27
[]
[]
[Variables]
[u]
family = RAVIART_THOMAS
order = FIRST
[]
[p]
family = MONOMIAL
order = CONSTANT
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[Functions]
[f]
type = ParsedVectorFunction
expression_x = ${k}*sin(${k}*x)*sin(${k}*y)*cos(${k}*z)
expression_y = -${k}*cos(${k}*x)*cos(${k}*y)*cos(${k}*z)
expression_z = ${k}*cos(${k}*x)*sin(${k}*y)*sin(${k}*z)
div = ${Mesh/gmg/dim}*${k}^2*cos(${k}*x)*sin(${k}*y)*cos(${k}*z)
[]
[]
[Kernels]
[coefficient]
type = VectorFunctionReaction
variable = u
sign = negative
[]
[gradient]
type = GradField
variable = u
coupled_scalar_variable = p
[]
[divergence]
type = DivField
variable = p
coupled_vector_variable = u
[]
[forcing]
type = BodyForce
variable = p
function = ${Functions/f/div}
[]
[mean_zero_p]
type = ScalarLagrangeMultiplier
variable = p
lambda = lambda
[]
[]
[ScalarKernels]
[constraint]
type = AverageValueConstraint
variable = lambda
pp_name = PP
value = 0.0
[]
[]
[BCs]
[sides]
type = VectorDivPenaltyDirichletBC
variable = u
function = f
penalty = 1e8
boundary = 'top bottom left right front back'
[]
[]
[Postprocessors]
active = PP
[PP]
type = ElementIntegralVariablePostprocessor
variable = p
execute_on = linear
[]
[L2Error]
type = ElementVectorL2Error
variable = u
function = f
[]
[HDivSemiError]
type = ElementHDivSemiError
variable = u
function = f
[]
[HDivError]
type = ElementHDivError
variable = u
function = f
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = LINEAR
petsc_options_iname = '-pc_type -ksp_rtol -ksp_norm_type'
petsc_options_value = ' jacobi 1e-12 preconditioned'
[]
[Outputs]
exodus = true
[]
(modules/level_set/test/tests/verification/1d_level_set_supg_mms/1d_level_set_supg_mms.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0
xmax = 32
nx = 64
[]
[Variables]
[./phi]
[../]
[]
[AuxVariables]
[./velocity]
family = LAGRANGE_VEC
[../]
[]
[ICs]
[./phi_ic]
function = phi_exact
variable = phi
type = FunctionIC
[../]
[./vel_ic]
type = VectorFunctionIC
variable = velocity
function = velocity_func
[]
[]
[Functions]
[./phi_exact]
type = ParsedFunction
expression = 'a*exp(1/(10*t))*sin(2*pi*x/b) + 1'
symbol_names = 'a b'
symbol_values = '1 8'
[../]
[./phi_mms]
type = ParsedFunction
expression = '-a*exp(1/(10*t))*sin(2*pi*x/b)/(10*t^2) + 2*pi*a*exp(1/(10*t))*cos(2*pi*x/b)/b'
symbol_names = 'a b'
symbol_values = '1 8'
[../]
[./velocity_func]
type = ParsedVectorFunction
expression_x = '1'
expression_y = '1'
[../]
[]
[Kernels]
[./time]
type = TimeDerivative
variable = phi
[../]
[./time_supg]
type = LevelSetTimeDerivativeSUPG
variable = phi
velocity = velocity
[../]
[./phi_advection]
type = LevelSetAdvection
variable = phi
velocity = velocity
[../]
[./phi_forcing]
type = BodyForce
variable = phi
function = phi_mms
[../]
[./phi_advection_supg]
type = LevelSetAdvectionSUPG
variable = phi
velocity = velocity
[../]
[./phi_forcing_supg]
type = LevelSetForcingFunctionSUPG
velocity = velocity
variable = phi
function = phi_mms
[../]
[]
[Postprocessors]
[./error]
type = ElementL2Error
function = phi_exact
variable = phi
[../]
[./h]
type = AverageElementSize
[../]
[./point]
type = PointValue
point = '0.1 0 0'
variable = phi
[../]
[]
[Executioner]
type = Transient
start_time = 1
dt = 0.01
end_time = 1.25
solve_type = PJFNK
petsc_options_iname = '-pc_type -sub_pc_type'
petsc_options_value = 'asm ilu'
scheme = bdf2
nl_rel_tol = 1e-12
[]
[Outputs]
time_step_interval = 10
execute_on = 'timestep_end'
csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/varying-eps-hllc.i)
[GlobalParams]
fp = fp
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 1
xmin = .1
xmax = .6
nx = 2
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[pressure]
type = MooseVariableFVReal
[]
[sup_mom_x]
type = MooseVariableFVReal
[]
[T_fluid]
type = MooseVariableFVReal
[]
[]
[ICs]
[pressure]
type = FunctionIC
variable = pressure
function = 'exact_p'
[]
[sup_mom_x]
type = FunctionIC
variable = sup_mom_x
function = 'exact_rho_ud'
[]
[T_fluid]
type = FunctionIC
variable = T_fluid
function = 'exact_T'
[]
[]
[FVKernels]
[mass_advection]
type = PCNSFVMassHLLC
variable = pressure
[]
[mass_fn]
type = FVBodyForce
variable = pressure
function = 'forcing_rho'
[]
[momentum_x_advection]
type = PCNSFVMomentumHLLC
variable = sup_mom_x
momentum_component = x
[]
[eps_grad]
type = PNSFVPGradEpsilon
variable = sup_mom_x
momentum_component = 'x'
epsilon_function = 'eps'
[]
[momentum_fn]
type = FVBodyForce
variable = sup_mom_x
function = 'forcing_rho_ud'
[]
[fluid_energy_advection]
type = PCNSFVFluidEnergyHLLC
variable = T_fluid
[]
[energy_fn]
type = FVBodyForce
variable = T_fluid
function = 'forcing_rho_et'
[]
[]
[FVBCs]
[mass_left]
variable = pressure
type = PCNSFVStrongBC
boundary = left
T_fluid = 'exact_T'
superficial_velocity = 'exact_superficial_velocity'
eqn = 'mass'
[]
[momentum_left]
variable = sup_mom_x
type = PCNSFVStrongBC
boundary = left
T_fluid = 'exact_T'
superficial_velocity = 'exact_superficial_velocity'
eqn = 'momentum'
momentum_component = 'x'
[]
[energy_left]
variable = T_fluid
type = PCNSFVStrongBC
boundary = left
T_fluid = 'exact_T'
superficial_velocity = 'exact_superficial_velocity'
eqn = 'energy'
[]
[mass_right]
variable = pressure
type = PCNSFVStrongBC
boundary = right
eqn = 'mass'
pressure = 'exact_p'
[]
[momentum_right]
variable = sup_mom_x
type = PCNSFVStrongBC
boundary = right
eqn = 'momentum'
momentum_component = 'x'
pressure = 'exact_p'
[]
[energy_right]
variable = T_fluid
type = PCNSFVStrongBC
boundary = right
eqn = 'energy'
pressure = 'exact_p'
[]
[]
[Materials]
[var_mat]
type = PorousMixedVarMaterial
pressure = pressure
superficial_rhou = sup_mom_x
T_fluid = T_fluid
porosity = porosity
[]
[porosity]
type = GenericFunctionMaterial
prop_names = 'porosity'
prop_values = 'eps'
[]
[]
[Functions]
[exact_rho]
type = ParsedFunction
expression = '3.48788261470924*cos(x)'
[]
[forcing_rho]
type = ParsedFunction
expression = '-3.83667087618017*sin(1.1*x)*cos(1.3*x) - 4.53424739912202*sin(1.3*x)*cos(1.1*x)'
[]
[exact_rho_ud]
type = ParsedFunction
expression = '3.48788261470924*cos(1.1*x)*cos(1.3*x)'
[]
[forcing_rho_ud]
type = ParsedFunction
expression = '(-(10.6975765229419*cos(1.5*x)/cos(x) - 0.697576522941849*cos(1.1*x)^2/cos(x)^2)*sin(x) + (10.6975765229419*sin(x)*cos(1.5*x)/cos(x)^2 - 1.3951530458837*sin(x)*cos(1.1*x)^2/cos(x)^3 + 1.53466835047207*sin(1.1*x)*cos(1.1*x)/cos(x)^2 - 16.0463647844128*sin(1.5*x)/cos(x))*cos(x))*cos(1.3*x) + 3.48788261470924*sin(x)*cos(1.1*x)^2*cos(1.3*x)/cos(x)^2 - 7.67334175236034*sin(1.1*x)*cos(1.1*x)*cos(1.3*x)/cos(x) - 4.53424739912202*sin(1.3*x)*cos(1.1*x)^2/cos(x)'
[]
[exact_rho_et]
type = ParsedFunction
expression = '26.7439413073546*cos(1.5*x)'
[]
[forcing_rho_et]
type = ParsedFunction
expression = '1.0*(3.48788261470924*(3.06706896551724*cos(1.5*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x) + 26.7439413073546*cos(1.5*x))*sin(x)*cos(1.1*x)*cos(1.3*x)/cos(x)^2 - 1.1*(3.48788261470924*(3.06706896551724*cos(1.5*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x) + 26.7439413073546*cos(1.5*x))*sin(1.1*x)*cos(1.3*x)/cos(x) - 1.3*(3.48788261470924*(3.06706896551724*cos(1.5*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x) + 26.7439413073546*cos(1.5*x))*sin(1.3*x)*cos(1.1*x)/cos(x) + 1.0*(-(10.6975765229419*cos(1.5*x)/cos(x) - 0.697576522941849*cos(1.1*x)^2/cos(x)^2)*sin(x) + (10.6975765229419*sin(x)*cos(1.5*x)/cos(x)^2 - 1.3951530458837*sin(x)*cos(1.1*x)^2/cos(x)^3 + 1.53466835047207*sin(1.1*x)*cos(1.1*x)/cos(x)^2 - 16.0463647844128*sin(1.5*x)/cos(x))*cos(x) - 40.1159119610319*sin(1.5*x))*cos(1.1*x)*cos(1.3*x)/cos(x)'
[]
[exact_T]
type = ParsedFunction
expression = '0.0106975765229418*cos(1.5*x)/cos(x) - 0.000697576522941848*cos(1.1*x)^2/cos(x)^2'
[]
[exact_eps_p]
type = ParsedFunction
expression = '3.48788261470924*(3.06706896551724*cos(1.5*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x)*cos(1.3*x)'
[]
[exact_p]
type = ParsedFunction
expression = '3.48788261470924*(3.06706896551724*cos(1.5*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x)'
[]
[exact_sup_vel_x]
type = ParsedFunction
expression = '1.0*cos(1.1*x)*cos(1.3*x)/cos(x)'
[]
[eps]
type = ParsedFunction
expression = 'cos(1.3*x)'
[]
[exact_superficial_velocity]
type = ParsedVectorFunction
expression_x = '1.0*cos(1.1*x)*cos(1.3*x)/cos(x)'
[]
[]
[Executioner]
solve_type = NEWTON
type = Steady
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_max_its = 50
line_search = bt
nl_rel_tol = 1e-12
nl_abs_tol = 1e-12
[]
[Outputs]
exodus = true
csv = true
[]
[Debug]
show_var_residual_norms = true
[]
[Postprocessors]
[h]
type = AverageElementSize
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2pressure]
type = ElementL2Error
variable = pressure
function = exact_p
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2sup_mom_x]
variable = sup_mom_x
function = exact_rho_ud
type = ElementL2Error
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2T_fluid]
variable = T_fluid
function = exact_T
type = ElementL2Error
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[]
(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
[]
(test/tests/kernels/vector_fe/ad_coupled_curl_product.i)
# This example couples the product of the curl of a variable vector
# and a supplied field into a diffusion problem of a Lagrange variable
# using automatic differentiation
[Mesh]
type = GeneratedMesh
dim = 3
nx = 5
ny = 5
nz = 5
xmin = -1
ymin = -1
zmin = -1
elem_type = HEX20
[]
[Variables]
[u]
[]
[v]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[coupled_curl_supplied_field_product]
type = ADCoupledCurlSuppliedFieldProduct
variable = u
vector = v
supplied_field_x = '0'
supplied_field_y = '0'
supplied_field_z = '1'
[]
[u_diff]
type = Diffusion
variable = u
[]
[u_body_force]
type = BodyForce
variable = u
function = u_body_force_ffn
[]
[diff]
type = ADVectorFEWave
variable = v
x_forcing_func = x_ffn
y_forcing_func = y_ffn
[]
[]
[BCs]
[v_bnd]
type = VectorCurlPenaltyDirichletBC
boundary = 'left right top bottom front back'
penalty = 1e10
function = v_sln
variable = v
[]
[u_bnd]
type = ADFunctionPenaltyDirichletBC
boundary = 'left right top bottom front back'
penalty = 1e10
function = u_sln
variable = u
[]
[]
[Functions]
[x_ffn]
type = ParsedFunction
expression = '(2*pi*pi + 1)*cos(pi*x)*sin(pi*y)'
[]
[y_ffn]
type = ParsedFunction
expression = '-(2*pi*pi + 1)*sin(pi*x)*cos(pi*y)'
[]
[u_body_force_ffn]
type = ParsedFunction
expression = '-2*pi*cos(pi*x)*cos(pi*y) + pi^2*cos(z*pi)'
[]
[u_sln]
type = ParsedFunction
expression = 'cos(z*pi)'
[]
[v_sln]
type = ParsedVectorFunction
expression_x = 'cos(pi*x)*sin(pi*y)'
expression_y = '-sin(pi*x)*cos(pi*y)'
curl_z = '-2*pi*cos(pi*x)*cos(pi*y)'
[]
[]
[Postprocessors]
[v_L2Error]
type = ElementVectorL2Error
variable = v
function = v_sln
[]
[HCurlSemiError]
type = ElementHCurlSemiError
variable = v
function = v_sln
[]
[HCurlError]
type = ElementHCurlError
variable = v
function = v_sln
[]
[u_L2Error]
type = ElementL2Error
variable = u
function = u_sln
[]
[]
[Preconditioning]
[pre]
type = SMP
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
petsc_options_iname = -pc_type
petsc_options_value = lu
[]
[Outputs]
exodus = true
csv = true
[]
(modules/combined/test/tests/electromagnetic_joule_heating/fusing_current_through_copper_wire.i)
# This test is a simpified coupled case between the electromagnetic and
# heat transfer modules. While the file microwave_heating.i is a test
# utilizing the method of manufactured solutions, where both real and
# complex components of the electromagnetic properties are provided
# (such that no term is zeroed out), this test involves only the
# real components of the electromagnetic properties. In particular,
# this test supplies the fusing current to a copper wire and simulations
# the spatial and temporal heating profile until the wire reaches its
# melting point. The PDE's of this test file are as follows:
#
# curl(curl(A)) + j*mu*omega*(sigma*A) = J
# mag(E) = mag(-j*omega*A) + mag(J/sigma)
# rho*C*dT/dt - div(k*grad(T)) = Q
# Q = 0.5*sigma*mag(E)^2
#
# Where:
# - A is the magnetic vector potential
# - j is the sqrt(-1)
# - mu is the permeability of free space
# - omega is the angular frequency of the system
# - sigma is the electric conductivity of the wire
# - J is the supplied DC current
# - E is the electric field
# - rho is the density of copper
# - C is the heat capacity of copper
# - T is the temperature
# - k is the thermal conductivity of the wire
# - Q is the Joule heating
#
# The BCs are as follows:
#
# curl(n) x curl(A) = 0, where n is the normal vector
# q * n = h (T - T_infty), where q is the heat flux,
# h is the convective heat transfer coefficient,
# and T_infty is the far-field temperature.
[Mesh]
# Mesh of the copper wire
[fmg]
type = FileMeshGenerator
file = copper_wire.msh
[]
[]
[Variables]
# The real and complex components of the magnetic vector
# potential in the frequency domain
[A_real]
family = NEDELEC_ONE
order = FIRST
[]
[A_imag]
family = NEDELEC_ONE
order = FIRST
[]
# The temperature of the air in the copper wire
[T]
initial_condition = 293.0 #in K
[]
[]
[Kernels]
### Physics to determine the magnetic vector potential propagation ###
# The propagation of the real component
[curl_curl_real]
type = CurlCurlField
variable = A_real
[]
# Current induced by the electrical conductivity
# of the copper wire
[conduction_real]
type = ADConductionCurrent
variable = A_real
field_imag = A_imag
field_real = A_real
conductivity_real = electrical_conductivity
conductivity_imag = 0.0
ang_freq_real = omega_real
ang_freq_imag = 0.0
permeability_real = mu_real
permeability_imag = 0.0
component = real
[]
# Current supplied to the wire
[source_real]
type = VectorBodyForce
variable = A_real
function = mu_curr_real
[]
# The propagation of the complex component
[curl_curl_imag]
type = CurlCurlField
variable = A_imag
[]
# Current induced by the electrical conductivity
# of the copper wire
[conduction_imag]
type = ADConductionCurrent
variable = A_imag
field_imag = A_imag
field_real = A_real
conductivity_real = electrical_conductivity
conductivity_imag = 0.0
ang_freq_real = omega_real
ang_freq_imag = 0.0
permeability_real = mu_real
permeability_imag = 0.0
component = imaginary
[]
### Physics to determine the heat transfer ###
# Heat transfer in the copper wire
[HeatTdot_in_copper]
type = ADHeatConductionTimeDerivative
variable = T
specific_heat = specific_heat_copper
density_name = density_copper
[]
[HeatDiff_in_copper]
type = ADHeatConduction
variable = T
thermal_conductivity = thermal_conductivity_copper
[]
# Heating due the total current
[HeatSrc]
type = ADJouleHeatingSource
variable = T
heating_term = 'electric_field_heating'
[]
[]
[AuxVariables]
# Decomposing the magnetic vector potential
# for the electric field calculations
[A_x_real]
family = MONOMIAL
order = FIRST
[]
[A_y_real]
family = MONOMIAL
order = FIRST
[]
[A_x_imag]
family = MONOMIAL
order = FIRST
[]
[A_y_imag]
family = MONOMIAL
order = FIRST
[]
# The electrical conductivity for the electric
# field calculations
[elec_cond]
family = MONOMIAL
order = FIRST
[]
# The electric field profile determined from
# the magnetic vector potential
[E_real]
family = NEDELEC_ONE
order = FIRST
[]
[E_imag]
family = NEDELEC_ONE
order = FIRST
[]
[]
[AuxKernels]
# Decomposing the magnetic vector potential
# for the electric field calculations
[A_x_real]
type = VectorVariableComponentAux
variable = A_x_real
vector_variable = A_real
component = X
[]
[A_y_real]
type = VectorVariableComponentAux
variable = A_y_real
vector_variable = A_real
component = Y
[]
[A_x_imag]
type = VectorVariableComponentAux
variable = A_x_imag
vector_variable = A_imag
component = X
[]
[A_y_imag]
type = VectorVariableComponentAux
variable = A_y_imag
vector_variable = A_imag
component = Y
[]
# The electrical conductivity for the electric
# field calculations
[cond]
type = ADMaterialRealAux
property = electrical_conductivity
variable = elec_cond
execute_on = 'INITIAL LINEAR TIMESTEP_END'
[]
# The magnitude of electric field profile determined
# from the magnetic vector potential using:
# abs(E) = abs(-j*omega*A) + abs(supplied current / elec_cond)
# NOTE: The reason for calculating the magnitude of the electric
# field is the heating term is defined as:
# Q = 1/2 abs(E)^2 for frequency domain field formulations
[E_real]
type = ParsedVectorAux
coupled_variables = 'A_x_imag A_y_imag elec_cond'
expression_x = 'abs(2*3.14*60*A_x_imag) + abs(60e6/elec_cond)'
expression_y = 'abs(2*3.14*60*A_y_imag)'
variable = E_real
[]
[E_imag]
type = ParsedVectorAux
coupled_variables = 'A_x_real A_y_real'
expression_x = 'abs(-2*3.14*60*A_x_real)'
expression_y = 'abs(-2*3.14*60*A_y_real)'
variable = E_imag
[]
[]
[Functions]
# The supplied current density to the wire
# where only the real x-component is considered
[curr_real_x]
type = ParsedFunction
expression = '60e6' # Units in A/m^2, equivalent to 1178 A in a 5mm diameter wire
[]
# Permeability of free space
[mu_real_func]
type = ParsedFunction
expression = '4*pi*1e-7' # Units in N/A^2
[]
# The angular drive frequency of the system
[omega_real_func]
type = ParsedFunction
expression = '2*pi*60' # Units in rad/s
[]
# The angular frequency time permeability of free space
[omegaMu]
type = ParsedFunction
symbol_names = 'omega mu'
symbol_values = 'omega_real_func mu_real_func'
expression = 'omega*mu'
[]
# The supplied current density time permeability of free space
[mu_curr_real]
type = ParsedVectorFunction
symbol_names = 'current_mag mu'
symbol_values = 'curr_real_x mu_real_func'
expression_x = 'mu * current_mag'
[]
[]
[BCs]
### Temperature boundary conditions ###
# Convective heat flux BC with copper wire
# exposed to air
[surface]
type = ADConvectiveHeatFluxBC
variable = T
boundary = walls
T_infinity = 293
heat_transfer_coefficient = 10
[]
### Magnetic vector potential boundary conditions ###
# No defined boundary conditions represents
# zero curl conditions at the boundaries, such that:
# A x n = 0
[]
[Materials]
[k]
type = ADGenericConstantMaterial
prop_names = 'thermal_conductivity_copper'
prop_values = '397.48' #in W/(m K)
[]
[cp]
type = ADGenericConstantMaterial
prop_names = 'specific_heat_copper'
prop_values = '385.0' #in J/(kg K)
[]
[rho]
type = ADGenericConstantMaterial
prop_names = 'density_copper'
prop_values = '8920.0' #in kg/(m^3)
[]
# Electrical conductivity (copper is default material)
[sigma]
type = ADElectricalConductivity
temperature = T
block = copper
[]
# Material that supplies the correct Joule heating formulation
[ElectromagneticMaterial]
type = ElectromagneticHeatingMaterial
electric_field = E_real
complex_electric_field = E_imag
electric_field_heating_name = electric_field_heating
electrical_conductivity = electrical_conductivity
formulation = FREQUENCY
solver = ELECTROMAGNETIC
block = copper
[]
# Coefficient for wave propagation
[mu_real]
type = ADGenericFunctionMaterial
prop_names = mu_real
prop_values = mu_real_func
[]
[omega_real]
type = ADGenericFunctionMaterial
prop_names = omega_real
prop_values = omega_real_func
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = NEWTON
line_search = NONE
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
dt = 1.0
# NOTE: Change 'end_time' to 10s to accurately simulate the fusing current
# end_time = 10
end_time = 5
automatic_scaling = true
[]
[Outputs]
exodus = true
perf_graph = true
[]
(test/tests/kernels/vector_fe/vector_kernel.i)
# This example reproduces the libmesh vector_fe example 3 results
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 20
xmin = -1
ymin = -1
elem_type = QUAD9
[]
[Variables]
[u]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[diff]
type = VectorFEWave
variable = u
x_forcing_func = x_ffn
y_forcing_func = y_ffn
[]
[]
[BCs]
[bnd]
type = VectorCurlPenaltyDirichletBC
boundary = 'left right top bottom'
penalty = 1e10
function = sln
variable = u
[]
[]
[Functions]
[x_ffn]
type = ParsedFunction
expression = '(2*pi*pi + 1)*cos(pi*x)*sin(pi*y)'
[]
[y_ffn]
type = ParsedFunction
expression = '-(2*pi*pi + 1)*sin(pi*x)*cos(pi*y)'
[]
[sln]
type = ParsedVectorFunction
expression_x = cos(pi*x)*sin(pi*y)
expression_y = -sin(pi*x)*cos(pi*y)
curl_z = -2*pi*cos(pi*x)*cos(pi*y)
[]
[]
[Postprocessors]
active = ''
[L2Error]
type = ElementVectorL2Error
variable = u
function = sln
[]
[HCurlSemiError]
type = ElementHCurlSemiError
variable = u
function = sln
[]
[HCurlError]
type = ElementHCurlError
variable = u
function = sln
[]
[]
[Preconditioning]
[pre]
type = SMP
[]
[]
[Executioner]
type = Steady
solve_type = LINEAR
petsc_options_iname = -pc_type
petsc_options_value = lu
[]
[Outputs]
exodus = 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
[]
(test/tests/mfem/kernels/curlcurl.i)
# Definite Maxwell problem solved with Nedelec elements of the first kind
# based on MFEM Example 3.
[Mesh]
type = MFEMMesh
file = ../mesh/small_fichera.mesh
dim = 3
[]
[Problem]
type = MFEMProblem
[]
[FESpaces]
[HCurlFESpace]
type = MFEMVectorFESpace
fec_type = ND
fec_order = FIRST
[]
[HDivFESpace]
type = MFEMVectorFESpace
fec_type = RT
fec_order = CONSTANT
[]
[]
[Variables]
[e_field]
type = MFEMVariable
fespace = HCurlFESpace
[]
[]
[AuxVariables]
[db_dt_field]
type = MFEMVariable
fespace = HDivFESpace
[]
[]
[AuxKernels]
[curl]
type = MFEMCurlAux
variable = db_dt_field
source = e_field
scale_factor = -1.0
execute_on = TIMESTEP_END
[]
[]
[Functions]
[exact_e_field]
type = ParsedVectorFunction
expression_x = 'sin(kappa * y)'
expression_y = 'sin(kappa * z)'
expression_z = 'sin(kappa * x)'
symbol_names = kappa
symbol_values = 3.1415926535
[]
[forcing_field]
type = ParsedVectorFunction
expression_x = '(1. + kappa * kappa) * sin(kappa * y)'
expression_y = '(1. + kappa * kappa) * sin(kappa * z)'
expression_z = '(1. + kappa * kappa) * sin(kappa * x)'
symbol_names = kappa
symbol_values = 3.1415926535
[]
[]
[BCs]
[tangential_E_bdr]
type = MFEMVectorTangentialDirichletBC
variable = e_field
vector_coefficient = exact_e_field
[]
[]
[Kernels]
[curlcurl]
type = MFEMCurlCurlKernel
variable = e_field
[]
[mass]
type = MFEMVectorFEMassKernel
variable = e_field
[]
[source]
type = MFEMVectorFEDomainLFKernel
variable = e_field
vector_coefficient = forcing_field
[]
[]
[Preconditioner]
[ams]
type = MFEMHypreAMS
fespace = HCurlFESpace
[]
[]
[Solver]
type = MFEMHypreGMRES
preconditioner = ams
l_tol = 1e-6
[]
[Executioner]
type = MFEMSteady
device = cpu
[]
[Outputs]
[ParaViewDataCollection]
type = MFEMParaViewDataCollection
file_base = OutputData/CurlCurl
vtk_format = ASCII
[]
[]
(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
[]
(test/tests/functions/parsed/vector_function.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
uniform_refine = 1
[]
[Variables]
[./u]
[../]
[]
[Functions]
[./conductivity]
type = ParsedVectorFunction
expression_y = 0.1
expression_x = 0.8
[../]
[]
[Kernels]
[./diff]
type = DiffTensorKernel
variable = u
conductivity = conductivity
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./bottom]
type = DirichletBC
variable = u
boundary = bottom
value = 1
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/rotated-2d-bkt-function-porosity.i)
p_initial=1.01e5
T=273.15
# u refers to the superficial velocity
u_in=1
user_limiter='upwind'
friction_coeff=10
[GlobalParams]
fp = fp
two_term_boundary_expansion = true
limiter = ${user_limiter}
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1
nx = 3
ymin = 0
ymax = 18
ny = 90
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[pressure]
type = MooseVariableFVReal
initial_condition = ${p_initial}
[]
[sup_vel_x]
type = MooseVariableFVReal
initial_condition = 1e-15
scaling = 1e-2
[]
[sup_vel_y]
type = MooseVariableFVReal
initial_condition = 1e-15
scaling = 1e-2
[]
[T_fluid]
type = MooseVariableFVReal
initial_condition = ${T}
scaling = 1e-5
[]
[]
[AuxVariables]
[vel_y]
type = MooseVariableFVReal
[]
[sup_mom_y]
type = MooseVariableFVReal
[]
[rho]
type = MooseVariableFVReal
[]
[eps]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[vel_y]
type = ADMaterialRealAux
variable = vel_y
property = vel_y
execute_on = 'timestep_end'
[]
[sup_mom_y]
type = ADMaterialRealAux
variable = sup_mom_y
property = superficial_rhov
execute_on = 'timestep_end'
[]
[rho]
type = ADMaterialRealAux
variable = rho
property = rho
execute_on = 'timestep_end'
[]
[eps]
type = MaterialRealAux
variable = eps
property = porosity
execute_on = 'timestep_end'
[]
[]
[FVKernels]
[mass_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rho_dt'
variable = pressure
[]
[mass_advection]
type = PCNSFVKT
variable = pressure
eqn = "mass"
[]
[momentum_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rhou_dt'
variable = sup_vel_x
[]
[momentum_advection]
type = PCNSFVKT
variable = sup_vel_x
eqn = "momentum"
momentum_component = 'x'
[]
[eps_grad]
type = PNSFVPGradEpsilon
variable = sup_vel_x
momentum_component = 'x'
epsilon_function = 'eps'
[]
[drag]
type = PCNSFVMomentumFriction
variable = sup_vel_x
momentum_component = 'x'
Darcy_name = 'cl'
momentum_name = superficial_rhou
[]
[momentum_time_y]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rhov_dt'
variable = sup_vel_y
[]
[momentum_advection_y]
type = PCNSFVKT
variable = sup_vel_y
eqn = "momentum"
momentum_component = 'y'
[]
[eps_grad_y]
type = PNSFVPGradEpsilon
variable = sup_vel_y
momentum_component = 'y'
epsilon_function = 'eps'
[]
[drag_y]
type = PCNSFVMomentumFriction
variable = sup_vel_y
momentum_component = 'y'
Darcy_name = 'cl'
momentum_name = superficial_rhov
[]
[energy_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rho_et_dt'
variable = T_fluid
[]
[energy_advection]
type = PCNSFVKT
variable = T_fluid
eqn = "energy"
[]
[]
[FVBCs]
[rho_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = pressure
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'mass'
[]
[rhou_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = sup_vel_x
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'momentum'
momentum_component = 'x'
[]
[rhov_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = sup_vel_y
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'momentum'
momentum_component = 'y'
[]
[rho_et_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = T_fluid
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'energy'
[]
[rho_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = pressure
pressure = ${p_initial}
eqn = 'mass'
[]
[rhou_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = sup_vel_x
pressure = ${p_initial}
eqn = 'momentum'
momentum_component = 'x'
[]
[rhov_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = sup_vel_y
pressure = ${p_initial}
eqn = 'momentum'
momentum_component = 'y'
[]
[rho_et_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = T_fluid
pressure = ${p_initial}
eqn = 'energy'
[]
[wall_pressure_x]
type = PCNSFVImplicitMomentumPressureBC
momentum_component = 'x'
boundary = 'left right'
variable = sup_vel_x
[]
[wall_pressure_y]
type = PCNSFVImplicitMomentumPressureBC
momentum_component = 'y'
boundary = 'left right'
variable = sup_vel_y
[]
# Use these to help create more accurate cell centered gradients for cells adjacent to boundaries
[T_bottom]
type = FVDirichletBC
variable = T_fluid
value = ${T}
boundary = 'bottom'
[]
[sup_vel_x_bottom_and_walls]
type = FVDirichletBC
variable = sup_vel_x
value = 0
boundary = 'bottom left right'
[]
[sup_vel_y_walls]
type = FVDirichletBC
variable = sup_vel_y
value = 0
boundary = 'left right'
[]
[sup_vel_y_bottom]
type = FVDirichletBC
variable = sup_vel_y
value = ${u_in}
boundary = 'bottom'
[]
[p_top]
type = FVDirichletBC
variable = pressure
value = ${p_initial}
boundary = 'top'
[]
[]
[Functions]
[ud_in]
type = ParsedVectorFunction
expression_x = '0'
expression_y = '${u_in}'
[]
[eps]
type = ParsedFunction
expression = 'if(y < 2.8, 1,
if(y < 3.2, 1 - .5 / .4 * (y - 2.8),
if(y < 6.8, .5,
if(y < 7.2, .5 - .25 / .4 * (y - 6.8),
if(y < 10.8, .25,
if(y < 11.2, .25 + .25 / .4 * (y - 10.8),
if(y < 14.8, .5,
if(y < 15.2, .5 + .5 / .4 * (y - 14.8),
1))))))))'
[]
[]
[Materials]
[var_mat]
type = PorousPrimitiveVarMaterial
pressure = pressure
T_fluid = T_fluid
superficial_vel_x = sup_vel_x
superficial_vel_y = sup_vel_y
fp = fp
porosity = porosity
[]
[porosity]
type = GenericFunctionMaterial
prop_names = 'porosity'
prop_values = 'eps'
[]
[ad_generic]
type = ADGenericConstantVectorMaterial
prop_names = 'cl'
prop_values = '${friction_coeff} ${friction_coeff} ${friction_coeff}'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
solve_type = NEWTON
line_search = 'bt'
type = Transient
nl_max_its = 20
[TimeStepper]
type = IterationAdaptiveDT
dt = 5e-5
optimal_iterations = 6
growth_factor = 1.2
[]
num_steps = 10000
end_time = 500
nl_abs_tol = 1e-7
petsc_options_iname = '-pc_type -pc_factor_mat_solver_type'
petsc_options_value = 'lu mumps'
[]
[Outputs]
[out]
type = Exodus
execute_on = 'final'
[]
checkpoint = true
[]
[Debug]
show_var_residual_norms = true
[]
(modules/navier_stokes/test/tests/finite_volume/cns/scalar_advection/mass-frac-advection.i)
rho_initial=1.29
p_initial=1.01e5
T=273.15
gamma=1.4
e_initial=${fparse p_initial / (gamma - 1) / rho_initial}
et_initial=${e_initial}
rho_et_initial=${fparse rho_initial * et_initial}
v_in=1
[GlobalParams]
fp = fp
# retain behavior at time of test creation
two_term_boundary_expansion = false
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1
nx = 2
ymin = 0
ymax = 10
ny = 20
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Variables]
[rho]
type = MooseVariableFVReal
initial_condition = ${rho_initial}
[]
[rho_u]
type = MooseVariableFVReal
initial_condition = 1e-15
[]
[rho_v]
type = MooseVariableFVReal
initial_condition = 1e-15
[]
[rho_et]
type = MooseVariableFVReal
initial_condition = ${rho_et_initial}
scaling = 1e-5
[]
[mass_frac]
type = MooseVariableFVReal
initial_condition = 1e-15
[]
[]
[AuxVariables]
[U_x]
type = MooseVariableFVReal
[]
[U_y]
type = MooseVariableFVReal
[]
[pressure]
type = MooseVariableFVReal
[]
[temperature]
type = MooseVariableFVReal
[]
[courant]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[U_x]
type = ADMaterialRealAux
variable = U_x
property = vel_x
execute_on = 'timestep_end'
[]
[U_y]
type = ADMaterialRealAux
variable = U_y
property = vel_y
execute_on = 'timestep_end'
[]
[pressure]
type = ADMaterialRealAux
variable = pressure
property = pressure
execute_on = 'timestep_end'
[]
[temperature]
type = ADMaterialRealAux
variable = temperature
property = T_fluid
execute_on = 'timestep_end'
[]
[courant]
type = Courant
variable = courant
u = U_x
v = U_y
[]
[]
[FVKernels]
[mass_time]
type = FVPorosityTimeDerivative
variable = rho
[]
[mass_advection]
type = PCNSFVKT
variable = rho
eqn = "mass"
[]
[momentum_time_x]
type = FVTimeKernel
variable = rho_u
[]
[momentum_advection_and_pressure_x]
type = PCNSFVKT
variable = rho_u
eqn = "momentum"
momentum_component = 'x'
[]
[momentum_time_y]
type = FVTimeKernel
variable = rho_v
[]
[momentum_advection_and_pressure_y]
type = PCNSFVKT
variable = rho_v
eqn = "momentum"
momentum_component = 'y'
[]
[energy_time]
type = FVPorosityTimeDerivative
variable = rho_et
[]
[energy_advection]
type = PCNSFVKT
variable = rho_et
eqn = "energy"
[]
[mass_frac_time]
type = PCNSFVDensityTimeDerivative
variable = mass_frac
rho = rho
[]
[mass_frac_advection]
type = PCNSFVKT
variable = mass_frac
eqn = "scalar"
[]
[]
[Functions]
[ud_in]
type = ParsedVectorFunction
expression_x = '0'
expression_y = '${v_in}'
[]
[]
[FVBCs]
[rho_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = rho
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'mass'
[]
[rho_u_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = rho_u
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'momentum'
momentum_component = 'x'
[]
[rho_v_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = rho_v
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'momentum'
momentum_component = 'y'
[]
[rho_et_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = rho_et
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'energy'
[]
[mass_frac_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = mass_frac
superficial_velocity = 'ud_in'
T_fluid = ${T}
scalar = 1
eqn = 'scalar'
[]
[rho_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = rho
pressure = ${p_initial}
eqn = 'mass'
[]
[rho_u_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = rho_u
pressure = ${p_initial}
eqn = 'momentum'
momentum_component = 'x'
[]
[rho_v_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = rho_v
pressure = ${p_initial}
eqn = 'momentum'
momentum_component = 'y'
[]
[rho_et_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = rho_et
pressure = ${p_initial}
eqn = 'energy'
[]
[mass_frac_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = mass_frac
pressure = ${p_initial}
eqn = 'scalar'
[]
[momentum_x_walls]
type = PCNSFVImplicitMomentumPressureBC
variable = rho_u
boundary = 'left right'
momentum_component = 'x'
[]
[momentum_y_walls]
type = PCNSFVImplicitMomentumPressureBC
variable = rho_v
boundary = 'left right'
momentum_component = 'y'
[]
[]
[Materials]
[var_mat]
type = PorousConservedVarMaterial
rho = rho
rho_et = rho_et
superficial_rhou = rho_u
superficial_rhov = rho_v
fp = fp
porosity = porosity
[]
[porosity]
type = GenericConstantMaterial
prop_names = 'porosity'
prop_values = '1'
[]
[]
[Executioner]
type = Transient
[TimeIntegrator]
type = ActuallyExplicitEuler
[]
steady_state_detection = true
steady_state_tolerance = 1e-12
abort_on_solve_fail = true
dt = 5e-4
num_steps = 25
[]
[Outputs]
[out]
type = Exodus
execute_on = 'initial timestep_end'
[]
[dof]
type = DOFMap
execute_on = 'initial'
[]
[]
[Debug]
show_var_residual_norms = true
[]
(modules/navier_stokes/test/tests/finite_element/ins/cg-dg-hybrid/channel-flow/channel-hybrid.i)
mu = 1.1
rho = 1.1
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = -1
ymax = 1
nx = 100
ny = 20
[]
[]
[Variables]
[u]
family = MONOMIAL
[]
[v]
family = MONOMIAL
[]
[pressure][]
[]
[Kernels]
[momentum_x_convection]
type = ADConservativeAdvection
variable = u
velocity = 'velocity'
advected_quantity = 'rhou'
[]
[momentum_x_diffusion]
type = MatDiffusion
variable = u
diffusivity = 'mu'
[]
[momentum_x_pressure]
type = PressureGradient
integrate_p_by_parts = false
variable = u
pressure = pressure
component = 0
[]
[momentum_y_convection]
type = ADConservativeAdvection
variable = v
velocity = 'velocity'
advected_quantity = 'rhov'
[]
[momentum_y_diffusion]
type = MatDiffusion
variable = v
diffusivity = 'mu'
[]
[momentum_y_pressure]
type = PressureGradient
integrate_p_by_parts = false
variable = v
pressure = pressure
component = 1
[]
[mass]
type = ADConservativeAdvection
variable = pressure
velocity = velocity
advected_quantity = -1
[]
[]
[DGKernels]
[momentum_x_convection]
type = ADDGAdvection
variable = u
velocity = 'velocity'
advected_quantity = 'rhou'
[]
[momentum_x_diffusion]
type = DGDiffusion
variable = u
sigma = 6
epsilon = -1
diff = 'mu'
[]
[momentum_y_convection]
type = ADDGAdvection
variable = v
velocity = 'velocity'
advected_quantity = 'rhov'
[]
[momentum_y_diffusion]
type = DGDiffusion
variable = v
sigma = 6
epsilon = -1
diff = 'mu'
[]
[]
[Functions]
[v_inlet]
type = ParsedVectorFunction
expression_x = '1'
[]
[]
[BCs]
[u_walls]
type = DGFunctionDiffusionDirichletBC
boundary = 'bottom top'
variable = u
sigma = 6
epsilon = -1
function = '0'
diff = 'mu'
[]
[v_walls]
type = DGFunctionDiffusionDirichletBC
boundary = 'bottom top'
variable = v
sigma = 6
epsilon = -1
function = '0'
diff = 'mu'
[]
[u_in]
type = ADConservativeAdvectionBC
boundary = 'left'
variable = u
velocity_function = v_inlet
primal_dirichlet_value = 1
primal_coefficient = 'rho'
[]
[v_in]
type = ADConservativeAdvectionBC
boundary = 'left'
variable = v
velocity_function = v_inlet
primal_dirichlet_value = 0
primal_coefficient = 'rho'
[]
[p_in]
type = ADConservativeAdvectionBC
boundary = 'left'
variable = pressure
velocity_function = v_inlet
advected_quantity = -1
[]
[u_out]
type = ADConservativeAdvectionBC
boundary = 'right'
variable = u
velocity_mat_prop = 'velocity'
advected_quantity = 'rhou'
[]
[v_out]
type = ADConservativeAdvectionBC
boundary = 'right'
variable = v
velocity_mat_prop = 'velocity'
advected_quantity = 'rhov'
[]
[p_out]
type = DirichletBC
variable = pressure
boundary = 'right'
value = 0
[]
[]
[Materials]
[const]
type = ADGenericConstantMaterial
prop_names = 'rho'
prop_values = '${rho}'
[]
[const_reg]
type = GenericConstantMaterial
prop_names = 'mu'
prop_values = '${mu}'
[]
[vel]
type = ADVectorFromComponentVariablesMaterial
vector_prop_name = 'velocity'
u = u
v = v
[]
[rhou]
type = ADParsedMaterial
property_name = 'rhou'
coupled_variables = 'u'
material_property_names = 'rho'
expression = 'rho*u'
[]
[rhov]
type = ADParsedMaterial
property_name = 'rhov'
coupled_variables = 'v'
material_property_names = 'rho'
expression = 'rho*v'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/hllc.i)
p_initial=1.01e5
T=273.15
# u refers to the superficial velocity
u_in=1
[GlobalParams]
fp = fp
two_term_boundary_expansion = true
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 1
xmin = 0
xmax = 18
nx = 180
[]
[to_pt5]
input = cartesian
type = SubdomainBoundingBoxGenerator
bottom_left = '2 0 0'
top_right = '4 1 0'
block_id = 1
[]
[pt5]
input = to_pt5
type = SubdomainBoundingBoxGenerator
bottom_left = '4 0 0'
top_right = '6 1 0'
block_id = 2
[]
[to_pt25]
input = pt5
type = SubdomainBoundingBoxGenerator
bottom_left = '6 0 0'
top_right = '8 1 0'
block_id = 3
[]
[pt25]
input = to_pt25
type = SubdomainBoundingBoxGenerator
bottom_left = '8 0 0'
top_right = '10 1 0'
block_id = 4
[]
[to_pt5_again]
input = pt25
type = SubdomainBoundingBoxGenerator
bottom_left = '10 0 0'
top_right = '12 1 0'
block_id = 5
[]
[pt5_again]
input = to_pt5_again
type = SubdomainBoundingBoxGenerator
bottom_left = '12 0 0'
top_right = '14 1 0'
block_id = 6
[]
[to_one]
input = pt5_again
type = SubdomainBoundingBoxGenerator
bottom_left = '14 0 0'
top_right = '16 1 0'
block_id = 7
[]
[one]
input = to_one
type = SubdomainBoundingBoxGenerator
bottom_left = '16 0 0'
top_right = '18 1 0'
block_id = 8
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[pressure]
type = MooseVariableFVReal
initial_condition = ${p_initial}
[]
[sup_vel_x]
type = MooseVariableFVReal
initial_condition = 1
scaling = 1e-2
[]
[T_fluid]
type = MooseVariableFVReal
initial_condition = ${T}
scaling = 1e-5
[]
[]
[AuxVariables]
[vel_x]
type = MooseVariableFVReal
[]
[sup_mom_x]
type = MooseVariableFVReal
[]
[rho]
type = MooseVariableFVReal
[]
[worst_courant]
type = MooseVariableFVReal
[]
[porosity]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[vel_x]
type = ADMaterialRealAux
variable = vel_x
property = vel_x
execute_on = 'timestep_end'
[]
[sup_mom_x]
type = ADMaterialRealAux
variable = sup_mom_x
property = superficial_rhou
execute_on = 'timestep_end'
[]
[rho]
type = ADMaterialRealAux
variable = rho
property = rho
execute_on = 'timestep_end'
[]
[worst_courant]
type = Courant
variable = worst_courant
u = sup_vel_x
execute_on = 'timestep_end'
[]
[porosity]
type = MaterialRealAux
variable = porosity
property = porosity
execute_on = 'timestep_end'
[]
[]
[FVKernels]
[mass_advection]
type = PCNSFVMassHLLC
variable = pressure
[]
[momentum_advection]
type = PCNSFVMomentumHLLC
variable = sup_vel_x
momentum_component = 'x'
[]
[eps_grad]
type = PNSFVPGradEpsilon
variable = sup_vel_x
momentum_component = 'x'
epsilon_function = 'eps'
[]
[energy_advection]
type = PCNSFVFluidEnergyHLLC
variable = T_fluid
[]
[]
[FVBCs]
[rho_left]
type = PCNSFVStrongBC
boundary = 'left'
variable = pressure
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'mass'
[]
[rhou_left]
type = PCNSFVStrongBC
boundary = 'left'
variable = sup_vel_x
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'momentum'
momentum_component = 'x'
[]
[rho_et_left]
type = PCNSFVStrongBC
boundary = 'left'
variable = T_fluid
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'energy'
[]
[rho_right]
type = PCNSFVStrongBC
boundary = 'right'
variable = pressure
pressure = ${p_initial}
eqn = 'mass'
[]
[rhou_right]
type = PCNSFVStrongBC
boundary = 'right'
variable = sup_vel_x
pressure = ${p_initial}
eqn = 'momentum'
momentum_component = 'x'
[]
[rho_et_right]
type = PCNSFVStrongBC
boundary = 'right'
variable = T_fluid
pressure = ${p_initial}
eqn = 'energy'
[]
# Use these to help create more accurate cell centered gradients for cells adjacent to boundaries
[T_left]
type = FVDirichletBC
variable = T_fluid
value = ${T}
boundary = 'left'
[]
[sup_vel_left]
type = FVDirichletBC
variable = sup_vel_x
value = ${u_in}
boundary = 'left'
[]
[p_right]
type = FVDirichletBC
variable = pressure
value = ${p_initial}
boundary = 'right'
[]
[]
[Functions]
[ud_in]
type = ParsedVectorFunction
expression_x = '${u_in}'
[]
[eps]
type = ParsedFunction
expression = 'if(x < 2, 1,
if(x < 4, 1 - .5 / 2 * (x - 2),
if(x < 6, .5,
if(x < 8, .5 - .25 / 2 * (x - 6),
if(x < 10, .25,
if(x < 12, .25 + .25 / 2 * (x - 10),
if(x < 14, .5,
if(x < 16, .5 + .5 / 2 * (x - 14),
1))))))))'
[]
[]
[Materials]
[var_mat]
type = PorousPrimitiveVarMaterial
pressure = pressure
T_fluid = T_fluid
superficial_vel_x = sup_vel_x
porosity = porosity
[]
[porosity]
type = GenericFunctionMaterial
prop_names = 'porosity'
prop_values = 'eps'
[]
[]
[Executioner]
solve_type = NEWTON
line_search = 'bt'
type = Steady
[]
[Outputs]
[out]
type = Exodus
execute_on = 'final'
[]
checkpoint = true
[]
[Debug]
show_var_residual_norms = true
[]
(modules/level_set/test/tests/verification/1d_level_set_mms/level_set_mms.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0
xmax = 32
nx = 64
uniform_refine = 0
[]
[Variables]
[./phi]
[../]
[]
[AuxVariables]
[./velocity]
family = LAGRANGE_VEC
[../]
[]
[ICs]
[./phi_ic]
function = phi_exact
variable = phi
type = FunctionIC
[../]
[./vel_ic]
type = VectorFunctionIC
variable = velocity
function = velocity_func
[]
[]
[Functions]
[./phi_exact]
type = ParsedFunction
expression = 'a*exp(1/(10*t))*sin(2*pi*x/b) + 1'
symbol_names = 'a b'
symbol_values = '1 8'
[../]
[./phi_mms]
type = ParsedFunction
expression = '-a*exp(1/(10*t))*sin(2*pi*x/b)/(10*t^2) + 2*pi*a*exp(1/(10*t))*cos(2*pi*x/b)/b'
symbol_names = 'a b'
symbol_values = '1 8'
[../]
[./velocity_func]
type = ParsedVectorFunction
expression_x = '1'
expression_y = '1'
[../]
[]
[Kernels]
[./phi_advection]
type = LevelSetAdvection
variable = phi
velocity = velocity
[../]
[./phi_time]
type = TimeDerivative
variable = phi
[../]
[./phi_forcing]
type = BodyForce
variable = phi
function = phi_mms
[../]
[]
[Postprocessors]
[./error]
type = ElementL2Error
function = phi_exact
variable = phi
[../]
[./h]
type = AverageElementSize
[../]
[./point]
type = PointValue
point = '0.1 0 0'
variable = phi
[../]
[]
[Executioner]
type = Transient
start_time = 1
dt = 0.01
end_time = 1.25
solve_type = PJFNK
petsc_options_iname = '-pc_type -sub_pc_type'
petsc_options_value = 'asm ilu'
scheme = bdf2
nl_rel_tol = 1e-12
[]
[Outputs]
time_step_interval = 10
execute_on = 'timestep_end'
csv = true
[]
(test/tests/auxkernels/vector_function_aux/vector_function_aux.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
[]
[AuxVariables]
[vec]
family = LAGRANGE_VEC
order = FIRST
[]
[]
[Variables]
[u][]
[]
[Functions]
[function]
type = ParsedVectorFunction
expression_x = t*x
expression_y = t*y
[]
[]
[AuxKernels]
[vec]
type = VectorFunctionAux
variable = vec
function = function
execute_on = 'INITIAL TIMESTEP_END'
[../]
[]
[Problem]
type = FEProblem
#solve = false
kernel_coverage_check = false
[]
[Executioner]
type = Transient
start_time = 0.0
num_steps = 5
dt = 1
[]
[Outputs]
exodus = 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/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/level_set/examples/rotating_circle/circle_rotate.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 32
ny = 32
uniform_refine = 2
[]
[AuxVariables]
[./velocity]
family = LAGRANGE_VEC
[../]
[]
[Variables]
[./phi]
[../]
[]
[Functions]
[./phi_exact]
type = LevelSetOlssonBubble
epsilon = 0.03
center = '0 0.5 0'
radius = 0.15
[../]
[./velocity_func]
type = ParsedVectorFunction
expression_x = '4*y'
expression_y = '-4*x'
[../]
[]
[ICs]
[./phi_ic]
type = FunctionIC
function = phi_exact
variable = phi
[../]
[./vel_ic]
type = VectorFunctionIC
variable = velocity
function = velocity_func
[]
[]
[Kernels]
[./time]
type = TimeDerivative
variable = phi
[../]
[./advection]
type = LevelSetAdvection
velocity = velocity
variable = phi
[../]
[]
[Postprocessors]
[./area]
type = LevelSetVolume
threshold = 0.5
variable = phi
location = outside
execute_on = 'initial timestep_end'
[../]
[./cfl]
type = LevelSetCFLCondition
velocity = velocity
execute_on = 'initial' #timestep_end'
[../]
[]
[Executioner]
type = Transient
solve_type = PJFNK
start_time = 0
end_time = 1.570796
scheme = crank-nicolson
petsc_options_iname = '-pc_type -sub_pc_type'
petsc_options_value = 'asm ilu'
[./TimeStepper]
type = PostprocessorDT
postprocessor = cfl
scale = 0.8
[../]
[]
[Outputs]
csv = true
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/geochemistry/test/tests/kinetics/bio_zoning_flow.i)
# groundwater velocity is 10m.yr^-1 divided by porosity of 0.3
# The following are the mole numbers of the species in the groundwater
# The numerical values can be obtained by running the geochemistry simulation with a very small timestep so no kinetics are active (use the transported_bulk_moles values)
eqm_H2O = 55.49986252429319
eqm_CH3COO = 1e-9
eqm_CH4 = 1e-9
eqm_HS = 1e-9
eqm_Ca = 1e-3
eqm_SO4 = 4e-5
eqm_Fe = 1.386143651587732e-05
# The following are scalings used in calculating the residual. Eg, because the concentration of CH3COO is so low, its residual is always tiny, so to get better accuracy it should be scaled
scale_H2O = ${fparse 1.0 / eqm_H2O}
scale_CH3COO = ${fparse 1.0 / eqm_CH3COO}
scale_CH4 = ${fparse 1.0 / eqm_CH4}
scale_HS = ${fparse 1.0 / eqm_HS}
scale_Ca = ${fparse 1.0 / eqm_Ca}
scale_SO4 = ${fparse 1.0 / eqm_SO4}
scale_Fe = ${fparse 1.0 / eqm_Fe}
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 500
xmin = 0
xmax = 200000
[]
[]
[UserObjects]
[nodal_void_volume_uo]
type = NodalVoidVolume
porosity = 1.0
execute_on = 'initial'
[]
[]
[Variables]
[conc_H2O]
initial_condition = ${eqm_H2O}
scaling = ${scale_H2O}
[]
[conc_CH3COO]
initial_condition = ${eqm_CH3COO}
scaling = ${scale_CH3COO}
[]
[conc_CH4]
initial_condition = ${eqm_CH4}
scaling = ${scale_CH4}
[]
[conc_HS]
initial_condition = ${eqm_HS}
scaling = ${scale_HS}
[]
[conc_Ca]
initial_condition = ${eqm_Ca}
scaling = ${scale_Ca}
[]
[conc_SO4]
initial_condition = ${eqm_SO4}
scaling = ${scale_SO4}
[]
[conc_Fe]
initial_condition = ${eqm_Fe}
scaling = ${scale_Fe}
[]
[]
[Kernels]
[dot_H2O]
type = GeochemistryTimeDerivative
variable = conc_H2O
save_in = rate_H2O_times_vv
[]
[dot_CH3COO]
type = GeochemistryTimeDerivative
variable = conc_CH3COO
save_in = rate_CH3COO_times_vv
[]
[dot_CH4]
type = GeochemistryTimeDerivative
variable = conc_CH4
save_in = rate_CH4_times_vv
[]
[dot_HS]
type = GeochemistryTimeDerivative
variable = conc_HS
save_in = rate_HS_times_vv
[]
[dot_Ca]
type = GeochemistryTimeDerivative
variable = conc_Ca
save_in = rate_Ca_times_vv
[]
[dot_SO4]
type = GeochemistryTimeDerivative
variable = conc_SO4
save_in = rate_SO4_times_vv
[]
[dot_Fe]
type = GeochemistryTimeDerivative
variable = conc_Fe
save_in = rate_Fe_times_vv
[]
[adv_H2O]
type = ConservativeAdvection
velocity = velocity
upwinding_type = full
variable = conc_H2O
[]
[adv_CH3COO]
type = ConservativeAdvection
velocity = velocity
upwinding_type = full
variable = conc_CH3COO
[]
[adv_CH4]
type = ConservativeAdvection
velocity = velocity
upwinding_type = full
variable = conc_CH4
[]
[adv_HS]
type = ConservativeAdvection
velocity = velocity
upwinding_type = full
variable = conc_HS
[]
[adv_Ca]
type = ConservativeAdvection
velocity = velocity
upwinding_type = full
variable = conc_Ca
[]
[adv_SO4]
type = ConservativeAdvection
velocity = velocity
upwinding_type = full
variable = conc_SO4
[]
[adv_Fe]
type = ConservativeAdvection
velocity = velocity
upwinding_type = full
variable = conc_Fe
[]
[]
[AuxVariables]
[velocity]
family = MONOMIAL_VEC
order = CONSTANT
[]
[nodal_void_volume]
[]
[rate_H2O_times_vv]
[]
[rate_CH3COO_times_vv]
[]
[rate_CH4_times_vv]
[]
[rate_HS_times_vv]
[]
[rate_Ca_times_vv]
[]
[rate_SO4_times_vv]
[]
[rate_Fe_times_vv]
[]
[rate_H2O]
[]
[rate_CH3COO]
[]
[rate_CH4]
[]
[rate_HS]
[]
[rate_Ca]
[]
[rate_SO4]
[]
[rate_Fe]
[]
[]
[AuxKernels]
[velocity]
type = VectorFunctionAux
function = vel_fcn
variable = velocity
[]
[nodal_void_volume_auxk]
type = NodalVoidVolumeAux
variable = nodal_void_volume
nodal_void_volume_uo = nodal_void_volume_uo
execute_on = 'initial timestep_end' # "initial" to ensure it is properly evaluated for the first timestep
[]
[rate_H2O_auxk]
type = ParsedAux
variable = rate_H2O
args = 'rate_H2O_times_vv nodal_void_volume'
function = 'rate_H2O_times_vv / nodal_void_volume'
[]
[rate_CH3COO]
type = ParsedAux
variable = rate_CH3COO
args = 'rate_CH3COO_times_vv nodal_void_volume'
function = 'rate_CH3COO_times_vv / nodal_void_volume'
[]
[rate_CH4]
type = ParsedAux
variable = rate_CH4
args = 'rate_CH4_times_vv nodal_void_volume'
function = 'rate_CH4_times_vv / nodal_void_volume'
[]
[rate_HS]
type = ParsedAux
variable = rate_HS
args = 'rate_HS_times_vv nodal_void_volume'
function = 'rate_HS_times_vv / nodal_void_volume'
[]
[rate_Ca]
type = ParsedAux
variable = rate_Ca
args = 'rate_Ca_times_vv nodal_void_volume'
function = 'rate_Ca_times_vv / nodal_void_volume'
[]
[rate_SO4]
type = ParsedAux
variable = rate_SO4
args = 'rate_SO4_times_vv nodal_void_volume'
function = 'rate_SO4_times_vv / nodal_void_volume'
[]
[rate_Fe]
type = ParsedAux
variable = rate_Fe
args = 'rate_Fe_times_vv nodal_void_volume'
function = 'rate_Fe_times_vv / nodal_void_volume'
[]
[]
[Functions]
[vel_fcn]
type = ParsedVectorFunction
expression_x = 33.333333
expression_y = 0
expression_z = 0
[]
[]
[BCs]
[inject_H2O]
type = DirichletBC
boundary = 'left right'
variable = conc_H2O
value = ${eqm_H2O}
[]
[inject_CH3COO]
type = DirichletBC
boundary = 'left right'
variable = conc_CH3COO
value = ${eqm_CH3COO}
[]
[inject_CH4]
type = DirichletBC
boundary = 'left right'
variable = conc_CH4
value = ${eqm_CH4}
[]
[inject_HS]
type = DirichletBC
boundary = 'left right'
variable = conc_HS
value = ${eqm_HS}
[]
[inject_Ca]
type = DirichletBC
boundary = 'left right'
variable = conc_Ca
value = ${eqm_Ca}
[]
[inject_SO4]
type = DirichletBC
boundary = 'left right'
variable = conc_SO4
value = ${eqm_SO4}
[]
[]
[Preconditioning]
[typically_efficient]
type = SMP
full = true
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = ' hypre boomeramg'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
[TimeStepper]
type = FunctionDT
function = 'min(0.1 * (t + 1), 100)'
[]
end_time = 20000
nl_abs_tol = 1E-5
[]
[Outputs]
csv = true
[]
[MultiApps]
[react]
type = TransientMultiApp
input_files = bio_zoning_conc.i
clone_parent_mesh = true
execute_on = 'timestep_end' # This is critical
[]
[]
[Transfers]
[changes_due_to_flow]
type = MultiAppCopyTransfer
to_multi_app = react
source_variable = 'rate_H2O rate_CH3COO rate_CH4 rate_HS rate_Ca rate_SO4 rate_Fe' # change in mole number at every node / dt
variable = 'rate_H2O_per_1l rate_CH3COO_per_1l rate_CH4_per_1l rate_HS_per_1l rate_Ca_per_1l rate_SO4_per_1l rate_Fe_per_1l' # change in moles at every node / dt
[]
[transported_moles_from_geochem]
type = MultiAppCopyTransfer
from_multi_app = react
source_variable = 'transported_H2O transported_CH3COO transported_CH4 transported_HS transported_Ca transported_SO4 transported_Fe'
variable = 'conc_H2O conc_CH3COO conc_CH4 conc_HS conc_Ca conc_SO4 conc_Fe'
[]
[]
(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/geochemistry/test/tests/kernels/advection_1.i)
# A step-like initial concentration is advected to the right using a constant velocity.
# Because of the Dirichlet BC on the left, the step-like concentration profile is maintained (up to the usual numerical diffusion)
# Because upwinding_type=full in the ConservativeAdvection Kernel, there are no overshoots and undershoots
# The total amount of "conc" should increase by dt * velocity every timestep, as recorded by the front_position Postprocessor
[Mesh]
type = GeneratedMesh
dim = 1
nx = 100
[]
[Variables]
[conc]
[]
[]
[ICs]
[conc]
type = FunctionIC
function = 'if(x<=0.25, 1, 0)'
variable = conc
[]
[]
[BCs]
[left]
type = DirichletBC
boundary = left
value = 1.0
variable = conc
[]
[]
[Kernels]
[dot]
type = GeochemistryTimeDerivative
variable = conc
[]
[adv]
type = ConservativeAdvection
velocity = velocity
upwinding_type = full
variable = conc
[]
[]
[AuxVariables]
[velocity]
family = MONOMIAL_VEC
order = CONSTANT
[]
[]
[AuxKernels]
[velocity]
type = VectorFunctionAux
function = vel_fcn
variable = velocity
[]
[]
[Functions]
[vel_fcn]
type = ParsedVectorFunction
expression_x = 1
expression_y = 0
expression_z = 0
[]
[]
[Executioner]
type = Transient
solve_type = Newton
dt = 0.01
end_time = 0.1
[]
[Postprocessors]
[front_position]
type = ElementIntegralVariablePostprocessor
variable = conc
[]
[]
[Outputs]
csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/varying-eps-basic-kt-primitive.i)
[GlobalParams]
fp = fp
limiter = 'central_difference'
two_term_boundary_expansion = true
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 1
xmin = .1
xmax = .6
nx = 2
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[pressure]
type = MooseVariableFVReal
[]
[sup_vel_x]
type = MooseVariableFVReal
[]
[T_fluid]
type = MooseVariableFVReal
[]
[]
[ICs]
[pressure]
type = FunctionIC
variable = pressure
function = 'exact_p'
[]
[sup_vel_x]
type = FunctionIC
variable = sup_vel_x
function = 'exact_sup_vel_x'
[]
[T_fluid]
type = FunctionIC
variable = T_fluid
function = 'exact_T'
[]
[]
[FVKernels]
[mass_advection]
type = PCNSFVKT
variable = pressure
eqn = "mass"
[]
[mass_fn]
type = FVBodyForce
variable = pressure
function = 'forcing_rho'
[]
[momentum_x_advection]
type = PCNSFVKT
variable = sup_vel_x
momentum_component = x
eqn = "momentum"
[]
[eps_grad]
type = PNSFVPGradEpsilon
variable = sup_vel_x
momentum_component = 'x'
epsilon_function = 'eps'
[]
[momentum_fn]
type = FVBodyForce
variable = sup_vel_x
function = 'forcing_rho_ud'
[]
[fluid_energy_advection]
type = PCNSFVKT
variable = T_fluid
eqn = "energy"
[]
[energy_fn]
type = FVBodyForce
variable = T_fluid
function = 'forcing_rho_et'
[]
[]
[FVBCs]
[mass_left]
variable = pressure
type = PCNSFVStrongBC
boundary = left
T_fluid = 'exact_T'
superficial_velocity = 'exact_superficial_velocity'
eqn = 'mass'
[]
[momentum_left]
variable = sup_vel_x
type = PCNSFVStrongBC
boundary = left
T_fluid = 'exact_T'
superficial_velocity = 'exact_superficial_velocity'
eqn = 'momentum'
momentum_component = 'x'
[]
[energy_left]
variable = T_fluid
type = PCNSFVStrongBC
boundary = left
T_fluid = 'exact_T'
superficial_velocity = 'exact_superficial_velocity'
eqn = 'energy'
[]
[mass_right]
variable = pressure
type = PCNSFVStrongBC
boundary = right
eqn = 'mass'
pressure = 'exact_p'
[]
[momentum_right]
variable = sup_vel_x
type = PCNSFVStrongBC
boundary = right
eqn = 'momentum'
momentum_component = 'x'
pressure = 'exact_p'
[]
[energy_right]
variable = T_fluid
type = PCNSFVStrongBC
boundary = right
eqn = 'energy'
pressure = 'exact_p'
[]
# help gradient reconstruction
[pressure_right]
type = FVFunctionDirichletBC
variable = pressure
function = exact_p
boundary = 'right'
[]
[sup_vel_x_left]
type = FVFunctionDirichletBC
variable = sup_vel_x
function = exact_sup_vel_x
boundary = 'left'
[]
[T_fluid_left]
type = FVFunctionDirichletBC
variable = T_fluid
function = exact_T
boundary = 'left'
[]
[]
[Materials]
[var_mat]
type = PorousPrimitiveVarMaterial
pressure = pressure
superficial_vel_x = sup_vel_x
T_fluid = T_fluid
porosity = porosity
[]
[porosity]
type = GenericFunctionMaterial
prop_names = 'porosity'
prop_values = 'eps'
[]
[]
[Functions]
[exact_rho]
type = ParsedFunction
expression = '3.48788261470924*cos(x)'
[]
[forcing_rho]
type = ParsedFunction
expression = '-3.83667087618017*sin(1.1*x)*cos(1.3*x) - 4.53424739912202*sin(1.3*x)*cos(1.1*x)'
[]
[exact_rho_ud]
type = ParsedFunction
expression = '3.48788261470924*cos(1.1*x)*cos(1.3*x)'
[]
[forcing_rho_ud]
type = ParsedFunction
expression = '(-(10.6975765229419*cos(1.5*x)/cos(x) - 0.697576522941849*cos(1.1*x)^2/cos(x)^2)*sin(x) + (10.6975765229419*sin(x)*cos(1.5*x)/cos(x)^2 - 1.3951530458837*sin(x)*cos(1.1*x)^2/cos(x)^3 + 1.53466835047207*sin(1.1*x)*cos(1.1*x)/cos(x)^2 - 16.0463647844128*sin(1.5*x)/cos(x))*cos(x))*cos(1.3*x) + 3.48788261470924*sin(x)*cos(1.1*x)^2*cos(1.3*x)/cos(x)^2 - 7.67334175236034*sin(1.1*x)*cos(1.1*x)*cos(1.3*x)/cos(x) - 4.53424739912202*sin(1.3*x)*cos(1.1*x)^2/cos(x)'
[]
[exact_rho_et]
type = ParsedFunction
expression = '26.7439413073546*cos(1.5*x)'
[]
[forcing_rho_et]
type = ParsedFunction
expression = '1.0*(3.48788261470924*(3.06706896551724*cos(1.5*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x) + 26.7439413073546*cos(1.5*x))*sin(x)*cos(1.1*x)*cos(1.3*x)/cos(x)^2 - 1.1*(3.48788261470924*(3.06706896551724*cos(1.5*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x) + 26.7439413073546*cos(1.5*x))*sin(1.1*x)*cos(1.3*x)/cos(x) - 1.3*(3.48788261470924*(3.06706896551724*cos(1.5*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x) + 26.7439413073546*cos(1.5*x))*sin(1.3*x)*cos(1.1*x)/cos(x) + 1.0*(-(10.6975765229419*cos(1.5*x)/cos(x) - 0.697576522941849*cos(1.1*x)^2/cos(x)^2)*sin(x) + (10.6975765229419*sin(x)*cos(1.5*x)/cos(x)^2 - 1.3951530458837*sin(x)*cos(1.1*x)^2/cos(x)^3 + 1.53466835047207*sin(1.1*x)*cos(1.1*x)/cos(x)^2 - 16.0463647844128*sin(1.5*x)/cos(x))*cos(x) - 40.1159119610319*sin(1.5*x))*cos(1.1*x)*cos(1.3*x)/cos(x)'
[]
[exact_T]
type = ParsedFunction
expression = '0.0106975765229418*cos(1.5*x)/cos(x) - 0.000697576522941848*cos(1.1*x)^2/cos(x)^2'
[]
[exact_eps_p]
type = ParsedFunction
expression = '3.48788261470924*(3.06706896551724*cos(1.5*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x)*cos(1.3*x)'
[]
[exact_p]
type = ParsedFunction
expression = '3.48788261470924*(3.06706896551724*cos(1.5*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x)'
[]
[exact_sup_vel_x]
type = ParsedFunction
expression = '1.0*cos(1.1*x)*cos(1.3*x)/cos(x)'
[]
[eps]
type = ParsedFunction
expression = 'cos(1.3*x)'
[]
[exact_superficial_velocity]
type = ParsedVectorFunction
expression_x = '1.0*cos(1.1*x)*cos(1.3*x)/cos(x)'
[]
[]
[Executioner]
solve_type = NEWTON
type = Transient
num_steps = 1
dtmin = 1
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_max_its = 50
line_search = bt
nl_rel_tol = 1e-12
nl_abs_tol = 1e-12
[]
[Outputs]
exodus = true
csv = true
[]
[Debug]
show_var_residual_norms = true
[]
[Postprocessors]
[h]
type = AverageElementSize
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2pressure]
type = ElementL2Error
variable = pressure
function = exact_p
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2sup_vel_x]
variable = sup_vel_x
function = exact_sup_vel_x
type = ElementL2Error
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2T_fluid]
variable = T_fluid
function = exact_T
type = ElementL2Error
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[]
(test/tests/functions/linear_combination_function/lcf_vector.i)
# use the vectorValue of a LinearCombinationFunction
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
uniform_refine = 1
[]
[Variables]
[./u]
[../]
[]
[Functions]
[./conductivity_1]
type = ParsedVectorFunction
expression_y = '0.1+x'
expression_x = '0.5*(1+x*y)'
[../]
[./conductivity_2]
type = ParsedVectorFunction
expression_y = '0.1+2*x'
expression_x = '0.2+x*y'
[../]
[./conductivity]
type = LinearCombinationFunction # yields value_y=0.1, value_x=0.8
functions = 'conductivity_1 conductivity_2'
w = '2 -1'
[../]
[]
[Kernels]
[./diff]
type = DiffTensorKernel
variable = u
conductivity = conductivity
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./bottom]
type = DirichletBC
variable = u
boundary = bottom
value = 1
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
(modules/level_set/test/tests/kernels/advection/advection_mms.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0
xmax = 12
nx = 48
[]
[Adaptivity]
steps = 5
marker = marker
[./Markers]
[./marker]
type = UniformMarker
mark = REFINE
[../]
[../]
[]
[Variables]
[./phi]
[../]
[]
[AuxVariables]
[./velocity]
family = LAGRANGE_VEC
[../]
[]
[ICs]
[./vel_ic]
type = VectorFunctionIC
variable = velocity
function = velocity_func
[]
[]
[BCs]
[./left]
type = FunctionDirichletBC
boundary = 'left'
function = phi_exact
variable = phi
[../]
[]
[Functions]
[./phi_exact]
type = ParsedFunction
expression = 'a*sin(pi*x/b)*cos(pi*x)'
symbol_names = 'a b'
symbol_values = '2 12'
[../]
[./phi_mms]
type = ParsedFunction
expression = '-2*pi*a*sin(pi*x)*sin(pi*x/b) + 2*pi*a*cos(pi*x)*cos(pi*x/b)/b'
symbol_names = 'a b'
symbol_values = '2 12'
[../]
[./velocity_func]
type = ParsedVectorFunction
expression_x = '2'
expression_y = '2'
[../]
[]
[Kernels]
[./phi_advection]
type = LevelSetAdvection
variable = phi
velocity = velocity
[../]
[./phi_forcing]
type = BodyForce
variable = phi
function = phi_mms
[../]
[]
[Postprocessors]
[./error]
type = ElementL2Error
function = phi_exact
variable = phi
[../]
[./h]
type = AverageElementSize
[../]
[]
[VectorPostprocessors]
active = ''
[./results]
type = LineValueSampler
variable = phi
start_point = '0 0 0'
end_point = '12 0 0'
num_points = 500
sort_by = x
[../]
[]
[Executioner]
type = Steady
nl_rel_tol = 1e-10
solve_type = NEWTON
# A steady-state pure advection problem is numerically challenging,
# it has a zero diagonal in the Jabocian matrix. The following solver
# settings seem to reliably solve this problem.
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
[]
[Outputs]
execute_on = 'TIMESTEP_END'
csv = true
[]
(modules/combined/test/tests/electromagnetic_joule_heating/aux_microwave_heating.i)
# Test for JouleHeatingHeatGeneratedAux
# Manufactured solution: E_real = cos(pi*y) * x_hat - cos(pi*x) * y_hat
# E_imag = sin(pi*y) * x_hat - sin(pi*x) * y_hat
# n = x^2*y^2
# heating = '0.5*sigma_r*(sin(x*pi)^2 + sin(y*pi)^2 + cos(x*pi)^2 + cos(y*pi)^2)'
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
xmin = -1
ymin = -1
elem_type = QUAD9
[]
[]
[Functions]
#The exact solution for the heated species and electric field real and imag. component
[exact_real]
type = ParsedVectorFunction
expression_x = 'cos(pi*y)'
expression_y = '-cos(pi*x)'
[]
[exact_imag]
type = ParsedVectorFunction
expression_x = 'sin(pi*y)'
expression_y = '-sin(pi*x)'
[]
[exact_n]
type = ParsedFunction
expression = 'x^2*y^2'
[]
#The forcing terms for the heated species and electric field real and imag. component
[source_real]
type = ParsedVectorFunction
symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
symbol_values = 'omega mu epsilon sigma omega mu epsilon sigma'
expression_x = '-epsilon_i*mu_i*omega_i^2*cos(pi*y) - 2*epsilon_i*mu_i*omega_i*omega_r*sin(pi*y) + epsilon_i*mu_i*omega_r^2*cos(pi*y) - epsilon_i*mu_r*omega_i^2*sin(pi*y) + 2*epsilon_i*mu_r*omega_i*omega_r*cos(pi*y) + epsilon_i*mu_r*omega_r^2*sin(pi*y) - epsilon_r*mu_i*omega_i^2*sin(pi*y) + 2*epsilon_r*mu_i*omega_i*omega_r*cos(pi*y) + epsilon_r*mu_i*omega_r^2*sin(pi*y) + epsilon_r*mu_r*omega_i^2*cos(pi*y) + 2*epsilon_r*mu_r*omega_i*omega_r*sin(pi*y) - epsilon_r*mu_r*omega_r^2*cos(pi*y) + mu_i*omega_i*sigma_i*cos(pi*y) + mu_i*omega_i*sigma_r*sin(pi*y) + mu_i*omega_r*sigma_i*sin(pi*y) - mu_i*omega_r*sigma_r*cos(pi*y) + mu_r*omega_i*sigma_i*sin(pi*y) - mu_r*omega_i*sigma_r*cos(pi*y) - mu_r*omega_r*sigma_i*cos(pi*y) - mu_r*omega_r*sigma_r*sin(pi*y) + pi^2*cos(pi*y)'
expression_y = 'epsilon_i*mu_i*omega_i^2*cos(pi*x) + 2*epsilon_i*mu_i*omega_i*omega_r*sin(pi*x) - epsilon_i*mu_i*omega_r^2*cos(pi*x) + epsilon_i*mu_r*omega_i^2*sin(pi*x) - 2*epsilon_i*mu_r*omega_i*omega_r*cos(pi*x) - epsilon_i*mu_r*omega_r^2*sin(pi*x) + epsilon_r*mu_i*omega_i^2*sin(pi*x) - 2*epsilon_r*mu_i*omega_i*omega_r*cos(pi*x) - epsilon_r*mu_i*omega_r^2*sin(pi*x) - epsilon_r*mu_r*omega_i^2*cos(pi*x) - 2*epsilon_r*mu_r*omega_i*omega_r*sin(pi*x) + epsilon_r*mu_r*omega_r^2*cos(pi*x) - mu_i*omega_i*sigma_i*cos(pi*x) - mu_i*omega_i*sigma_r*sin(pi*x) - mu_i*omega_r*sigma_i*sin(pi*x) + mu_i*omega_r*sigma_r*cos(pi*x) - mu_r*omega_i*sigma_i*sin(pi*x) + mu_r*omega_i*sigma_r*cos(pi*x) + mu_r*omega_r*sigma_i*cos(pi*x) + mu_r*omega_r*sigma_r*sin(pi*x) - pi^2*cos(pi*x)'
[]
[source_imag]
type = ParsedVectorFunction
symbol_names = 'omega_r mu_r epsilon_r sigma_r omega_i mu_i epsilon_i sigma_i'
symbol_values = 'omega mu epsilon sigma omega mu epsilon sigma'
expression_x = '-epsilon_i*mu_i*omega_i^2*sin(pi*y) + 2*epsilon_i*mu_i*omega_i*omega_r*cos(pi*y) + epsilon_i*mu_i*omega_r^2*sin(pi*y) + epsilon_i*mu_r*omega_i^2*cos(pi*y) + 2*epsilon_i*mu_r*omega_i*omega_r*sin(pi*y) - epsilon_i*mu_r*omega_r^2*cos(pi*y) + epsilon_r*mu_i*omega_i^2*cos(pi*y) + 2*epsilon_r*mu_i*omega_i*omega_r*sin(pi*y) - epsilon_r*mu_i*omega_r^2*cos(pi*y) + epsilon_r*mu_r*omega_i^2*sin(pi*y) - 2*epsilon_r*mu_r*omega_i*omega_r*cos(pi*y) - epsilon_r*mu_r*omega_r^2*sin(pi*y) + mu_i*omega_i*sigma_i*sin(pi*y) - mu_i*omega_i*sigma_r*cos(pi*y) - mu_i*omega_r*sigma_i*cos(pi*y) - mu_i*omega_r*sigma_r*sin(pi*y) - mu_r*omega_i*sigma_i*cos(pi*y) - mu_r*omega_i*sigma_r*sin(pi*y) - mu_r*omega_r*sigma_i*sin(pi*y) + mu_r*omega_r*sigma_r*cos(pi*y) + pi^2*sin(pi*y)'
expression_y = 'epsilon_i*mu_i*omega_i^2*sin(pi*x) - 2*epsilon_i*mu_i*omega_i*omega_r*cos(pi*x) - epsilon_i*mu_i*omega_r^2*sin(pi*x) - epsilon_i*mu_r*omega_i^2*cos(pi*x) - 2*epsilon_i*mu_r*omega_i*omega_r*sin(pi*x) + epsilon_i*mu_r*omega_r^2*cos(pi*x) - epsilon_r*mu_i*omega_i^2*cos(pi*x) - 2*epsilon_r*mu_i*omega_i*omega_r*sin(pi*x) + epsilon_r*mu_i*omega_r^2*cos(pi*x) - epsilon_r*mu_r*omega_i^2*sin(pi*x) + 2*epsilon_r*mu_r*omega_i*omega_r*cos(pi*x) + epsilon_r*mu_r*omega_r^2*sin(pi*x) - mu_i*omega_i*sigma_i*sin(pi*x) + mu_i*omega_i*sigma_r*cos(pi*x) + mu_i*omega_r*sigma_i*cos(pi*x) + mu_i*omega_r*sigma_r*sin(pi*x) + mu_r*omega_i*sigma_i*cos(pi*x) + mu_r*omega_i*sigma_r*sin(pi*x) + mu_r*omega_r*sigma_i*sin(pi*x) - mu_r*omega_r*sigma_r*cos(pi*x) - pi^2*sin(pi*x)'
[]
[source_n]
type = ParsedFunction
symbol_names = 'sigma_r'
symbol_values = 'sigma'
expression = '-2*x^2 - 2*y^2 - 0.5*sigma_r*(sin(x*pi)^2 + sin(y*pi)^2 + cos(x*pi)^2 + cos(y*pi)^2)'
[]
[heating_func]
type = ParsedFunction
symbol_names = 'sigma_r'
symbol_values = 'sigma'
expression = '0.5*sigma_r*(sin(x*pi)^2 + sin(y*pi)^2 + cos(x*pi)^2 + cos(y*pi)^2)'
[]
#Material Coefficients
[omega]
type = ParsedFunction
expression = '2.0'
[]
[mu]
type = ParsedFunction
expression = '1.0'
[]
[epsilon]
type = ParsedFunction
expression = '3.0'
[]
[sigma]
type = ParsedFunction
expression = '4.0'
#expression = 'x^2*y^2'
[]
[]
[Materials]
[WaveCoeff]
type = WaveEquationCoefficient
eps_rel_imag = eps_imag
eps_rel_real = eps_real
k_real = k_real
k_imag = k_imag
mu_rel_imag = mu_imag
mu_rel_real = mu_real
[]
[eps_real]
type = ADGenericFunctionMaterial
prop_names = eps_real
prop_values = epsilon
[]
[eps_imag]
type = ADGenericFunctionMaterial
prop_names = eps_imag
prop_values = epsilon
[]
[mu_real]
type = ADGenericFunctionMaterial
prop_names = mu_real
prop_values = mu
[]
[mu_imag]
type = ADGenericFunctionMaterial
prop_names = mu_imag
prop_values = mu
[]
[k_real]
type = ADGenericFunctionMaterial
prop_names = k_real
prop_values = omega
[]
[k_imag]
type = ADGenericFunctionMaterial
prop_names = k_imag
prop_values = omega
[]
[cond_real]
type = ADGenericFunctionMaterial
prop_names = cond_real
prop_values = sigma
[]
[cond_imag]
type = ADGenericFunctionMaterial
prop_names = cond_imag
prop_values = sigma
[]
[ElectromagneticMaterial]
type = ElectromagneticHeatingMaterial
electric_field = E_real
complex_electric_field = E_imag
electric_field_heating_name = electric_field_heating
electrical_conductivity = cond_real
formulation = FREQUENCY
solver = ELECTROMAGNETIC
[]
[]
[Variables]
[n]
family = LAGRANGE
order = FIRST
[]
[E_real]
family = NEDELEC_ONE
order = FIRST
[]
[E_imag]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[curl_curl_real]
type = CurlCurlField
variable = E_real
[]
[coeff_real]
type = ADMatWaveReaction
variable = E_real
field_real = E_real
field_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = real
[]
[conduction_real]
type = ADConductionCurrent
variable = E_real
field_imag = E_imag
field_real = E_real
conductivity_real = cond_real
conductivity_imag = cond_imag
ang_freq_real = k_real
ang_freq_imag = k_imag
permeability_real = mu_real
permeability_imag = mu_imag
component = real
[]
[body_force_real]
type = VectorBodyForce
variable = E_real
function = source_real
[]
[curl_curl_imag]
type = CurlCurlField
variable = E_imag
[]
[coeff_imag]
type = ADMatWaveReaction
variable = E_imag
field_real = E_real
field_imag = E_imag
wave_coef_real = wave_equation_coefficient_real
wave_coef_imag = wave_equation_coefficient_imaginary
component = imaginary
[]
[conduction_imag]
type = ADConductionCurrent
variable = E_imag
field_imag = E_imag
field_real = E_real
conductivity_real = cond_real
conductivity_imag = cond_imag
ang_freq_real = k_real
ang_freq_imag = k_imag
permeability_real = mu_real
permeability_imag = mu_imag
component = imaginary
[]
[body_force_imag]
type = VectorBodyForce
variable = E_imag
function = source_imag
[]
[n_diffusion]
type = Diffusion
variable = n
[]
[microwave_heating]
type = ADJouleHeatingSource
variable = n
heating_term = 'electric_field_heating'
[]
[body_force_n]
type = BodyForce
variable = n
function = source_n
[]
[]
[AuxVariables]
[heating_term]
family = MONOMIAL
order = FIRST
[]
[]
[AuxKernels]
[aux_microwave_heating]
type = JouleHeatingHeatGeneratedAux
variable = heating_term
heating_term = 'electric_field_heating'
[]
[]
[BCs]
[sides_real]
type = VectorCurlPenaltyDirichletBC
variable = E_real
function = exact_real
penalty = 1e8
boundary = 'left right top bottom'
[]
[sides_imag]
type = VectorCurlPenaltyDirichletBC
variable = E_imag
function = exact_imag
penalty = 1e8
boundary = 'left right top bottom'
[]
[sides_n]
type = FunctorDirichletBC
variable = n
boundary = 'left right top bottom'
functor = exact_n
preset = false
[]
[]
[Postprocessors]
[error_real]
type = ElementVectorL2Error
variable = E_real
function = exact_real
[]
[error_imag]
type = ElementVectorL2Error
variable = E_imag
function = exact_imag
[]
[error_n]
type = ElementL2Error
variable = n
function = exact_n
[]
[error_aux_heating]
type = ElementL2Error
variable = heating_term
function = heating_func
[]
[h]
type = AverageElementSize
[]
[h_squared]
type = ParsedPostprocessor
pp_names = 'h'
expression = 'h * h'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
csv = true
[]
(modules/navier_stokes/test/tests/finite_element/ins/hdg/ip/lid-driven/lid-driven-fsp.i)
mu = 1
rho = 1
l = 1
U = 1e3
n = 200
gamma = 1e5
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = ${l}
nx = ${n}
ny = ${n}
elem_type = TRI6
[]
[]
[Problem]
type = NavierStokesProblem
extra_tag_matrices = 'mass'
mass_matrix = 'mass'
use_pressure_mass_matrix = true
[]
[Variables]
[vel_x]
family = MONOMIAL
order = FIRST
[]
[vel_y]
family = MONOMIAL
order = FIRST
[]
[pressure]
family = MONOMIAL
order = CONSTANT
[]
[vel_bar_x]
family = SIDE_HIERARCHIC
order = FIRST
[]
[vel_bar_y]
family = SIDE_HIERARCHIC
order = FIRST
[]
[pressure_bar]
family = SIDE_HIERARCHIC
order = FIRST
[]
[]
[HDGKernels]
[momentum_x_convection]
type = AdvectionIPHDGKernel
variable = vel_x
face_variable = vel_bar_x
velocity = 'velocity'
coeff = ${rho}
[]
[momentum_x_diffusion]
type = NavierStokesStressIPHDGKernel
variable = vel_x
face_variable = vel_bar_x
diffusivity = 'mu'
alpha = 6
pressure_variable = pressure
pressure_face_variable = pressure_bar
component = 0
[]
[momentum_y_convection]
type = AdvectionIPHDGKernel
variable = vel_y
face_variable = vel_bar_y
velocity = 'velocity'
coeff = ${rho}
[]
[momentum_y_diffusion]
type = NavierStokesStressIPHDGKernel
variable = vel_y
face_variable = vel_bar_y
diffusivity = 'mu'
alpha = 6
pressure_variable = pressure
pressure_face_variable = pressure_bar
component = 1
[]
[pressure_convection]
type = AdvectionIPHDGKernel
variable = pressure
face_variable = pressure_bar
velocity = 'velocity'
coeff = '${fparse -rho}'
self_advection = false
[]
[]
[Kernels]
[mass_matrix_pressure]
type = MassMatrix
variable = pressure
matrix_tags = 'mass'
density = '${fparse -1/gamma}'
[]
[grad_div_x]
type = GradDiv
variable = vel_x
u = vel_x
v = vel_y
gamma = ${gamma}
component = 0
[]
[grad_div_y]
type = GradDiv
variable = vel_y
u = vel_x
v = vel_y
gamma = ${gamma}
component = 1
[]
[]
[DGKernels]
[pb_mass]
type = MassMatrixDGKernel
variable = pressure_bar
matrix_tags = 'mass'
density = '${fparse -1/gamma}'
[]
[u_jump]
type = MassFluxPenalty
variable = vel_x
u = vel_x
v = vel_y
component = 0
gamma = ${gamma}
[]
[v_jump]
type = MassFluxPenalty
variable = vel_y
u = vel_x
v = vel_y
component = 1
gamma = ${gamma}
[]
[]
[BCs]
[momentum_x_diffusion_walls]
type = NavierStokesStressIPHDGDirichletBC
boundary = 'left bottom right'
variable = vel_x
face_variable = vel_bar_x
pressure_variable = pressure
pressure_face_variable = pressure_bar
alpha = 6
functor = '0'
diffusivity = 'mu'
component = 0
[]
[momentum_x_diffusion_top]
type = NavierStokesStressIPHDGDirichletBC
boundary = 'top'
variable = vel_x
face_variable = vel_bar_x
pressure_variable = pressure
pressure_face_variable = pressure_bar
alpha = 6
functor = '${U}'
diffusivity = 'mu'
component = 0
[]
[momentum_y_diffusion_all]
type = NavierStokesStressIPHDGDirichletBC
boundary = 'left bottom right top'
variable = vel_y
face_variable = vel_bar_y
pressure_variable = pressure
pressure_face_variable = pressure_bar
alpha = 6
functor = '0'
diffusivity = 'mu'
component = 1
[]
[mass_convection]
type = AdvectionIPHDGPrescribedFluxBC
face_variable = pressure_bar
variable = pressure
velocity = 'velocity'
coeff = '${fparse -rho}'
self_advection = false
boundary = 'left bottom top right'
prescribed_normal_flux = 0
[]
[pb_mass]
type = MassMatrixIntegratedBC
variable = pressure_bar
matrix_tags = 'mass'
boundary = 'left right bottom top'
density = '${fparse -1/gamma}'
[]
[u_jump_walls]
type = MassFluxPenaltyBC
variable = vel_x
u = vel_x
v = vel_y
component = 0
boundary = 'left right bottom'
gamma = ${gamma}
dirichlet_value = 'walls'
[]
[v_jump_walls]
type = MassFluxPenaltyBC
variable = vel_y
u = vel_x
v = vel_y
component = 1
boundary = 'left right bottom'
gamma = ${gamma}
dirichlet_value = 'walls'
[]
[u_jump_top]
type = MassFluxPenaltyBC
variable = vel_x
u = vel_x
v = vel_y
component = 0
boundary = 'top'
gamma = ${gamma}
dirichlet_value = 'top'
[]
[v_jump_top]
type = MassFluxPenaltyBC
variable = vel_y
u = vel_x
v = vel_y
component = 1
boundary = 'top'
gamma = ${gamma}
dirichlet_value = 'top'
[]
[]
[Functions]
[top]
type = ParsedVectorFunction
value_x = ${U}
value_y = 0
[]
[walls]
type = ParsedVectorFunction
value_x = 0
value_y = 0
[]
[]
[Materials]
[const]
type = ADGenericConstantMaterial
prop_names = 'rho mu'
prop_values = '${rho} ${mu}'
[]
[vel]
type = ADVectorFromComponentVariablesMaterial
vector_prop_name = 'velocity'
u = vel_x
v = vel_y
[]
[]
[Preconditioning]
[FSP]
type = FSP
topsplit = 'up'
[up]
splitting = 'u p'
splitting_type = schur
petsc_options_iname = '-pc_fieldsplit_schur_fact_type -pc_fieldsplit_schur_precondition -ksp_gmres_restart -ksp_type -ksp_pc_side -ksp_rtol'
petsc_options_value = 'full self 300 fgmres right 1e-4'
[]
[u]
vars = 'vel_x vel_y vel_bar_x vel_bar_y'
petsc_options = '-ksp_converged_reason'
petsc_options_iname = '-pc_type -ksp_type -ksp_rtol -ksp_gmres_restart -ksp_pc_side -pc_factor_mat_solver_type'
petsc_options_value = 'ilu gmres 1e-2 300 right strumpack'
[]
[p]
vars = 'pressure pressure_bar'
petsc_options = '-ksp_converged_reason'
petsc_options_iname = '-ksp_type -ksp_gmres_restart -ksp_rtol -pc_type -ksp_pc_side'
petsc_options_value = 'gmres 300 1e-2 ilu right'
[]
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
active = ''
[out]
type = Exodus
hide = 'pressure_average vel_bar_x vel_bar_y pressure_bar'
[]
[]
[Postprocessors]
[Re]
type = ParsedPostprocessor
pp_names = ''
expression = '${rho} * ${U} * ${l} / ${mu}'
[]
[pressure_average]
type = ElementAverageValue
variable = pressure
[]
[]
[Correctors]
[set_pressure]
type = NSPressurePin
pin_type = 'average'
variable = pressure
pressure_average = 'pressure_average'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/basic-primitive-pcnsfv-kt.i)
[GlobalParams]
fp = fp
limiter = 'central_difference'
two_term_boundary_expansion = true
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 1
xmin = .1
xmax = .6
nx = 2
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[pressure]
type = MooseVariableFVReal
[]
[sup_vel_x]
type = MooseVariableFVReal
[]
[T_fluid]
type = MooseVariableFVReal
[]
[]
[ICs]
[pressure]
type = FunctionIC
variable = pressure
function = 'exact_p'
[]
[sup_vel_x]
type = FunctionIC
variable = sup_vel_x
function = 'exact_sup_vel_x'
[]
[T_fluid]
type = FunctionIC
variable = T_fluid
function = 'exact_T'
[]
[]
[FVKernels]
[mass_advection]
type = PCNSFVKT
variable = pressure
eqn = "mass"
[]
[mass_fn]
type = FVBodyForce
variable = pressure
function = 'forcing_rho'
[]
[momentum_x_advection]
type = PCNSFVKT
variable = sup_vel_x
momentum_component = x
eqn = "momentum"
[]
[momentum_fn]
type = FVBodyForce
variable = sup_vel_x
function = 'forcing_rho_ud'
[]
[fluid_energy_advection]
type = PCNSFVKT
variable = T_fluid
eqn = "energy"
[]
[energy_fn]
type = FVBodyForce
variable = T_fluid
function = 'forcing_rho_et'
[]
[]
[FVBCs]
[mass_left]
variable = pressure
type = PCNSFVStrongBC
boundary = left
T_fluid = 'exact_T'
superficial_velocity = 'exact_superficial_velocity'
eqn = 'mass'
[]
[momentum_left]
variable = sup_vel_x
type = PCNSFVStrongBC
boundary = left
T_fluid = 'exact_T'
superficial_velocity = 'exact_superficial_velocity'
eqn = 'momentum'
momentum_component = 'x'
[]
[energy_left]
variable = T_fluid
type = PCNSFVStrongBC
boundary = left
T_fluid = 'exact_T'
superficial_velocity = 'exact_superficial_velocity'
eqn = 'energy'
[]
[mass_right]
variable = pressure
type = PCNSFVStrongBC
boundary = right
eqn = 'mass'
pressure = 'exact_p'
[]
[momentum_right]
variable = sup_vel_x
type = PCNSFVStrongBC
boundary = right
eqn = 'momentum'
momentum_component = 'x'
pressure = 'exact_p'
[]
[energy_right]
variable = T_fluid
type = PCNSFVStrongBC
boundary = right
eqn = 'energy'
pressure = 'exact_p'
[]
# help gradient reconstruction
[pressure_right]
type = FVFunctionDirichletBC
variable = pressure
function = exact_p
boundary = 'right'
[]
[sup_vel_x_left]
type = FVFunctionDirichletBC
variable = sup_vel_x
function = exact_sup_vel_x
boundary = 'left'
[]
[T_fluid_left]
type = FVFunctionDirichletBC
variable = T_fluid
function = exact_T
boundary = 'left'
[]
[]
[Materials]
[var_mat]
type = PorousPrimitiveVarMaterial
pressure = pressure
superficial_vel_x = sup_vel_x
T_fluid = T_fluid
porosity = porosity
[]
[porosity]
type = GenericFunctionMaterial
prop_names = 'porosity'
prop_values = 'eps'
[]
[]
[Functions]
[exact_rho]
type = ParsedFunction
expression = '3.48788261470924*cos(x)'
[]
[forcing_rho]
type = ParsedFunction
expression = '-3.45300378856215*sin(1.1*x)'
[]
[exact_rho_ud]
type = ParsedFunction
expression = '3.13909435323832*cos(1.1*x)'
[]
[forcing_rho_ud]
type = ParsedFunction
expression = '-0.9*(10.6975765229419*cos(1.2*x)/cos(x) - 0.697576522941849*cos(1.1*x)^2/cos(x)^2)*sin(x) + 0.9*(10.6975765229419*sin(x)*cos(1.2*x)/cos(x)^2 - 1.3951530458837*sin(x)*cos(1.1*x)^2/cos(x)^3 + 1.53466835047207*sin(1.1*x)*cos(1.1*x)/cos(x)^2 - 12.8370918275302*sin(1.2*x)/cos(x))*cos(x) + 3.13909435323832*sin(x)*cos(1.1*x)^2/cos(x)^2 - 6.9060075771243*sin(1.1*x)*cos(1.1*x)/cos(x)'
[]
[exact_rho_et]
type = ParsedFunction
expression = '26.7439413073546*cos(1.2*x)'
[]
[forcing_rho_et]
type = ParsedFunction
expression = '0.9*(3.48788261470924*(3.06706896551724*cos(1.2*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x) + 26.7439413073546*cos(1.2*x))*sin(x)*cos(1.1*x)/cos(x)^2 - 0.99*(3.48788261470924*(3.06706896551724*cos(1.2*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x) + 26.7439413073546*cos(1.2*x))*sin(1.1*x)/cos(x) + 0.9*(-(10.6975765229419*cos(1.2*x)/cos(x) - 0.697576522941849*cos(1.1*x)^2/cos(x)^2)*sin(x) + (10.6975765229419*sin(x)*cos(1.2*x)/cos(x)^2 - 1.3951530458837*sin(x)*cos(1.1*x)^2/cos(x)^3 + 1.53466835047207*sin(1.1*x)*cos(1.1*x)/cos(x)^2 - 12.8370918275302*sin(1.2*x)/cos(x))*cos(x) - 32.0927295688256*sin(1.2*x))*cos(1.1*x)/cos(x)'
[]
[exact_T]
type = ParsedFunction
expression = '0.0106975765229418*cos(1.2*x)/cos(x) - 0.000697576522941848*cos(1.1*x)^2/cos(x)^2'
[]
[exact_eps_p]
type = ParsedFunction
expression = '3.13909435323832*(3.06706896551724*cos(1.2*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x)'
[]
[exact_p]
type = ParsedFunction
expression = '3.48788261470924*(3.06706896551724*cos(1.2*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x)'
[]
[exact_sup_vel_x]
type = ParsedFunction
expression = '0.9*cos(1.1*x)/cos(x)'
[]
[exact_superficial_velocity]
type = ParsedVectorFunction
expression_x = '0.9*cos(1.1*x)/cos(x)'
[]
[eps]
type = ParsedFunction
expression = '0.9'
[]
[]
[Executioner]
solve_type = NEWTON
type = Transient
num_steps = 1
dtmin = 1
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_max_its = 50
line_search = bt
nl_rel_tol = 1e-12
nl_abs_tol = 1e-12
[]
[Outputs]
exodus = true
csv = true
[]
[Debug]
show_var_residual_norms = true
[]
[Postprocessors]
[h]
type = AverageElementSize
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2pressure]
type = ElementL2Error
variable = pressure
function = exact_p
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2sup_vel_x]
variable = sup_vel_x
function = exact_sup_vel_x
type = ElementL2Error
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2T_fluid]
variable = T_fluid
function = exact_T
type = ElementL2Error
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_element/ins/coupled-force/gravity-through-coupled-force-action.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1.0
ymin = 0
ymax = 1.0
nx = 16
ny = 16
[]
[]
[Variables]
[u]
family = LAGRANGE_VEC
[]
[]
[AuxVariables]
[gravity]
family = LAGRANGE_VEC
[]
[]
[ICs]
[gravity]
type = VectorConstantIC
x_value = '0'
y_value = '-9.81'
variable = gravity
[]
[]
[Modules]
[IncompressibleNavierStokes]
equation_type = steady-state
velocity_boundary = 'bottom right top left'
velocity_function = '0 0 0 0 0 0 0 0'
add_standard_velocity_variables_for_ad = false
pressure_pinned_node = 0
density_name = rho
dynamic_viscosity_name = mu
use_ad = true
laplace = true
family = LAGRANGE
order = FIRST
supg = true
pspg = true
has_coupled_force = true
[]
[]
[Kernels]
[u_diff]
type = VectorDiffusion
variable = u
[]
[]
[BCs]
[u_left]
type = VectorFunctionDirichletBC
variable = u
boundary = 'left'
function_x = 1
function_y = 1
[]
[u_right]
type = VectorFunctionDirichletBC
variable = u
boundary = 'right'
function_x = -1
function_y = -1
[]
[]
[Materials]
[const]
type = ADGenericConstantMaterial
prop_names = 'rho mu'
prop_values = '1 1'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -sub_pc_factor_levels -ksp_gmres_restart'
petsc_options_value = 'asm 6 200'
line_search = 'none'
nl_rel_tol = 1e-12
nl_max_its = 6
[]
[Outputs]
[out]
type = Exodus
hide = 'gravity'
[]
[]
[Functions]
[vector_func]
type = ParsedVectorFunction
expression_x = '-2*x + 1'
expression_y = '-2*x + 1'
[]
[vector_gravity_func]
type = ParsedVectorFunction
expression_x = '0'
expression_y = '-9.81'
[]
[]
(modules/level_set/examples/rotating_circle/circle_rotate_parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 32
ny = 32
uniform_refine = 2
[]
[AuxVariables]
[./velocity]
family = LAGRANGE_VEC
[../]
[]
[Variables]
[./phi]
[../]
[]
[BCs]
[./all]
type = DirichletBC
variable = phi
boundary = 'top bottom left right'
value = 0
[../]
[]
[Functions]
[./phi_exact]
type = LevelSetOlssonBubble
epsilon = 0.03
center = '0 0.5 0'
radius = 0.15
[../]
[./velocity_func]
type = ParsedVectorFunction
expression_x = '4*y'
expression_y = '-4*x'
[../]
[]
[ICs]
[./phi_ic]
type = FunctionIC
function = phi_exact
variable = phi
[../]
[./vel_ic]
type = VectorFunctionIC
variable = velocity
function = velocity_func
[]
[]
[Kernels]
[./time]
type = TimeDerivative
variable = phi
[../]
[./advection]
type = LevelSetAdvection
velocity = velocity
variable = phi
[../]
[]
[Postprocessors]
[./area]
type = LevelSetVolume
threshold = 0.5
variable = phi
location = outside
execute_on = 'initial timestep_end'
[../]
[./cfl]
type = LevelSetCFLCondition
velocity = velocity
execute_on = 'initial timestep_end'
[../]
[]
[Executioner]
type = Transient
solve_type = PJFNK
start_time = 0
end_time = 1.570796
scheme = crank-nicolson
petsc_options_iname = '-pc_type -sub_pc_type'
petsc_options_value = 'asm ilu'
[./TimeStepper]
type = PostprocessorDT
postprocessor = cfl
scale = 0.8
[../]
[]
[MultiApps]
[./reinit]
type = LevelSetReinitializationMultiApp
input_files = 'circle_rotate_sub.i'
execute_on = 'timestep_end'
[../]
[]
[Transfers]
[./to_sub]
type = MultiAppCopyTransfer
source_variable = phi
variable = phi
to_multi_app = reinit
execute_on = 'timestep_end'
[../]
[./to_sub_init]
type = MultiAppCopyTransfer
source_variable = phi
variable = phi_0
to_multi_app = reinit
execute_on = 'timestep_end'
[../]
[./from_sub]
type = MultiAppCopyTransfer
source_variable = phi
variable = phi
from_multi_app = reinit
execute_on = 'timestep_end'
[../]
[]
[Outputs]
csv = true
exodus = true
[]
(test/tests/mfem/kernels/graddiv.i)
# Grad-div problem using method of manufactured solutions,
# based on MFEM Example 4.
[Mesh]
type = MFEMMesh
file = ../mesh/beam-tet.mesh
dim = 3
uniform_refine = 1
[]
[Problem]
type = MFEMProblem
[]
[FESpaces]
[HDivFESpace]
type = MFEMVectorFESpace
fec_type = RT
fec_order = CONSTANT
ordering = "vdim"
[]
[L2FESpace]
type = MFEMScalarFESpace
fec_type = L2
fec_order = CONSTANT
[]
[]
[Variables]
[F]
type = MFEMVariable
fespace = HDivFESpace
[]
[]
[AuxVariables]
[divF]
type = MFEMVariable
fespace = L2FESpace
[]
[]
[AuxKernels]
[div]
type = MFEMDivAux
variable = divF
source = F
execute_on = TIMESTEP_END
[]
[]
[Functions]
[f]
type = ParsedVectorFunction
expression_x = '(1. + 2*kappa * kappa) * cos(kappa * x) * sin(kappa * y)'
expression_y = '(1. + 2*kappa * kappa) * cos(kappa * y) * sin(kappa * x)'
expression_z = '0'
symbol_names = kappa
symbol_values = 3.1415926535
[]
[F_exact]
type = ParsedVectorFunction
expression_x = 'cos(kappa * x) * sin(kappa * y)'
expression_y = 'cos(kappa * y) * sin(kappa * x)'
expression_z = '0'
symbol_names = kappa
symbol_values = 3.1415926535
[]
[]
[BCs]
[dirichlet]
type = MFEMVectorNormalDirichletBC
variable = F
boundary = '1 2 3'
vector_coefficient = F_exact
[]
[]
[Kernels]
[divdiv]
type = MFEMDivDivKernel
variable = F
[]
[mass]
type = MFEMVectorFEMassKernel
variable = F
[]
[source]
type = MFEMVectorFEDomainLFKernel
variable = F
vector_coefficient = f
[]
[]
[Preconditioner]
[ADS]
type = MFEMHypreADS
fespace = HDivFESpace
[]
[]
[Solver]
type = MFEMCGSolver
preconditioner = ADS
l_tol = 1e-16
l_max_its = 1000
print_level = 2
[]
[Executioner]
type = MFEMSteady
device = "cpu"
[]
[Outputs]
[ParaViewDataCollection]
type = MFEMParaViewDataCollection
file_base = OutputData/GradDiv
vtk_format = ASCII
[]
[]
(test/tests/auxkernels/functor_elemental_gradient/functor_gradient.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmin = 0
xmax = 3.141
ymin = 0
ymax = 3.141
[]
[Variables]
[u]
[]
[v]
[]
[w]
type = MooseVariableFVReal
[]
[]
[ICs]
[u_ic]
type = FunctionIC
variable = 'u'
function = parsed_function
[]
[v_ic]
type = FunctionIC
variable = 'v'
function = 'x'
[]
[w_ic]
type = FunctionIC
variable = 'w'
function = 'x + y'
[]
[]
[Functions]
[parsed_function]
type = ParsedFunction
value = 'sin(x)-cos(y/2)'
[]
[parsed_grad_function]
type = ParsedVectorFunction
expression_x = 'cos(x)'
expression_y = 'sin(y/2)/2'
[]
[parsed_gradx_function]
type = ParsedFunction
value = 'cos(x)'
[]
[]
[AuxVariables]
[funcGrad_u]
order = CONSTANT
family = MONOMIAL_VEC
[]
[auxGrad_u]
order = CONSTANT
family = MONOMIAL_VEC
[]
[auxGrad_v]
order = CONSTANT
family = MONOMIAL_VEC
[]
[auxGrad_fv]
order = CONSTANT
family = MONOMIAL_VEC
[]
[auxGrad_function]
order = CONSTANT
family = MONOMIAL_VEC
[]
[funcGrad_u_x]
order = CONSTANT
family = MONOMIAL
[]
[auxGrad_u_x]
order = CONSTANT
family = MONOMIAL
[]
[auxGrad_v_x]
order = CONSTANT
family = MONOMIAL
[]
[auxGrad_fv_x]
order = CONSTANT
family = MONOMIAL
[]
[auxGrad_function_x]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
# Verification
[vec]
type = VectorFunctionAux
variable = funcGrad_u
function = parsed_grad_function
[]
# Finite element variables with and without scaling by material
[grad_u]
type = ADFunctorElementalGradientAux
variable = auxGrad_u
functor = u
[]
[grad_v]
type = ADFunctorElementalGradientAux
variable = auxGrad_v
functor = v
factor_matprop = 'trig_material'
[]
# Finite volume variable
[grad_w]
type = ADFunctorElementalGradientAux
variable = auxGrad_fv
functor = w
factor = w
[]
# Functions
[grad_function]
type = FunctorElementalGradientAux
variable = auxGrad_function
functor = parsed_gradx_function
[]
# Output a component, line sampler does not do vector variables
[funcGrad_u_x]
type = VectorVariableComponentAux
variable = funcGrad_u_x
vector_variable = funcGrad_u
component = 'x'
[]
[auxGrad_u_x]
type = VectorVariableComponentAux
variable = auxGrad_u_x
vector_variable = auxGrad_u
component = 'x'
[]
[auxGrad_v_x]
type = VectorVariableComponentAux
variable = auxGrad_v_x
vector_variable = auxGrad_v
component = 'x'
[]
[funcGrad_fv_x]
type = VectorVariableComponentAux
variable = auxGrad_fv_x
vector_variable = auxGrad_fv
component = 'x'
[]
[auxGrad_function_x]
type = VectorVariableComponentAux
variable = auxGrad_function_x
vector_variable = auxGrad_function
component = 'x'
[]
[]
[Materials]
[steel]
type = ADGenericFunctionMaterial
prop_names = 'trig_material'
prop_values = 'parsed_gradx_function'
[]
[]
[VectorPostprocessors]
[results]
type = LineValueSampler
start_point = '0 1 0'
end_point = '3.141 1 0'
variable = 'funcGrad_u_x auxGrad_u_x auxGrad_v_x auxGrad_fv_x auxGrad_function_x'
num_points = 20
sort_by = x
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(test/tests/functions/parsed/function_curl.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmin = -1
ymin = -1
elem_type = QUAD9
[]
[Variables]
# u = (y, -x, 0)
[./u]
family = NEDELEC_ONE
order = FIRST
[../]
[]
[Functions]
# Simple "clockwise rotating" field in XY plane. curl(u) = (0, 0, -2)
[./field]
type = ParsedVectorFunction
expression_x = 'y'
expression_y = '-x'
curl_z = '-2'
[../]
[./ffn_x]
type = ParsedFunction
expression = 'y'
[../]
[./ffn_y]
type = ParsedFunction
expression = '-x'
[../]
[]
[Kernels]
[./diff]
type = VectorFEWave
variable = u
x_forcing_func = ffn_x
y_forcing_func = ffn_y
[../]
[]
[BCs]
[./top]
type = VectorCurlBC
curl_value = field
variable = u
boundary = 'left right top bottom'
[../]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = 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/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/varying-eps-basic-kt-mixed.i)
[GlobalParams]
fp = fp
limiter = 'central_difference'
two_term_boundary_expansion = true
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 1
xmin = .1
xmax = .6
nx = 2
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[pressure]
type = MooseVariableFVReal
[]
[sup_mom_x]
type = MooseVariableFVReal
[]
[T_fluid]
type = MooseVariableFVReal
[]
[]
[ICs]
[pressure]
type = FunctionIC
variable = pressure
function = 'exact_p'
[]
[sup_mom_x]
type = FunctionIC
variable = sup_mom_x
function = 'exact_rho_ud'
[]
[T_fluid]
type = FunctionIC
variable = T_fluid
function = 'exact_T'
[]
[]
[FVKernels]
[mass_advection]
type = PCNSFVKT
variable = pressure
eqn = "mass"
[]
[mass_fn]
type = FVBodyForce
variable = pressure
function = 'forcing_rho'
[]
[momentum_x_advection]
type = PCNSFVKT
variable = sup_mom_x
momentum_component = x
eqn = "momentum"
[]
[eps_grad]
type = PNSFVPGradEpsilon
variable = sup_mom_x
momentum_component = 'x'
epsilon_function = 'eps'
[]
[momentum_fn]
type = FVBodyForce
variable = sup_mom_x
function = 'forcing_rho_ud'
[]
[fluid_energy_advection]
type = PCNSFVKT
variable = T_fluid
eqn = "energy"
[]
[energy_fn]
type = FVBodyForce
variable = T_fluid
function = 'forcing_rho_et'
[]
[]
[FVBCs]
[mass_left]
variable = pressure
type = PCNSFVStrongBC
boundary = left
T_fluid = 'exact_T'
superficial_velocity = 'exact_superficial_velocity'
eqn = 'mass'
[]
[momentum_left]
variable = sup_mom_x
type = PCNSFVStrongBC
boundary = left
T_fluid = 'exact_T'
superficial_velocity = 'exact_superficial_velocity'
eqn = 'momentum'
momentum_component = 'x'
[]
[energy_left]
variable = T_fluid
type = PCNSFVStrongBC
boundary = left
T_fluid = 'exact_T'
superficial_velocity = 'exact_superficial_velocity'
eqn = 'energy'
[]
[mass_right]
variable = pressure
type = PCNSFVStrongBC
boundary = right
eqn = 'mass'
pressure = 'exact_p'
[]
[momentum_right]
variable = sup_mom_x
type = PCNSFVStrongBC
boundary = right
eqn = 'momentum'
momentum_component = 'x'
pressure = 'exact_p'
[]
[energy_right]
variable = T_fluid
type = PCNSFVStrongBC
boundary = right
eqn = 'energy'
pressure = 'exact_p'
[]
# help gradient reconstruction
[pressure_right]
type = FVFunctionDirichletBC
variable = pressure
function = exact_p
boundary = 'right'
[]
[sup_mom_x_left]
type = FVFunctionDirichletBC
variable = sup_mom_x
function = exact_rho_ud
boundary = 'left'
[]
[T_fluid_left]
type = FVFunctionDirichletBC
variable = T_fluid
function = exact_T
boundary = 'left'
[]
[]
[Materials]
[var_mat]
type = PorousMixedVarMaterial
pressure = pressure
superficial_rhou = sup_mom_x
T_fluid = T_fluid
porosity = porosity
[]
[porosity]
type = GenericFunctionMaterial
prop_names = 'porosity'
prop_values = 'eps'
[]
[]
[Functions]
[exact_rho]
type = ParsedFunction
expression = '3.48788261470924*cos(x)'
[]
[forcing_rho]
type = ParsedFunction
expression = '-3.83667087618017*sin(1.1*x)*cos(1.3*x) - 4.53424739912202*sin(1.3*x)*cos(1.1*x)'
[]
[exact_rho_ud]
type = ParsedFunction
expression = '3.48788261470924*cos(1.1*x)*cos(1.3*x)'
[]
[forcing_rho_ud]
type = ParsedFunction
expression = '(-(10.6975765229419*cos(1.5*x)/cos(x) - 0.697576522941849*cos(1.1*x)^2/cos(x)^2)*sin(x) + (10.6975765229419*sin(x)*cos(1.5*x)/cos(x)^2 - 1.3951530458837*sin(x)*cos(1.1*x)^2/cos(x)^3 + 1.53466835047207*sin(1.1*x)*cos(1.1*x)/cos(x)^2 - 16.0463647844128*sin(1.5*x)/cos(x))*cos(x))*cos(1.3*x) + 3.48788261470924*sin(x)*cos(1.1*x)^2*cos(1.3*x)/cos(x)^2 - 7.67334175236034*sin(1.1*x)*cos(1.1*x)*cos(1.3*x)/cos(x) - 4.53424739912202*sin(1.3*x)*cos(1.1*x)^2/cos(x)'
[]
[exact_rho_et]
type = ParsedFunction
expression = '26.7439413073546*cos(1.5*x)'
[]
[forcing_rho_et]
type = ParsedFunction
expression = '1.0*(3.48788261470924*(3.06706896551724*cos(1.5*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x) + 26.7439413073546*cos(1.5*x))*sin(x)*cos(1.1*x)*cos(1.3*x)/cos(x)^2 - 1.1*(3.48788261470924*(3.06706896551724*cos(1.5*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x) + 26.7439413073546*cos(1.5*x))*sin(1.1*x)*cos(1.3*x)/cos(x) - 1.3*(3.48788261470924*(3.06706896551724*cos(1.5*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x) + 26.7439413073546*cos(1.5*x))*sin(1.3*x)*cos(1.1*x)/cos(x) + 1.0*(-(10.6975765229419*cos(1.5*x)/cos(x) - 0.697576522941849*cos(1.1*x)^2/cos(x)^2)*sin(x) + (10.6975765229419*sin(x)*cos(1.5*x)/cos(x)^2 - 1.3951530458837*sin(x)*cos(1.1*x)^2/cos(x)^3 + 1.53466835047207*sin(1.1*x)*cos(1.1*x)/cos(x)^2 - 16.0463647844128*sin(1.5*x)/cos(x))*cos(x) - 40.1159119610319*sin(1.5*x))*cos(1.1*x)*cos(1.3*x)/cos(x)'
[]
[exact_T]
type = ParsedFunction
expression = '0.0106975765229418*cos(1.5*x)/cos(x) - 0.000697576522941848*cos(1.1*x)^2/cos(x)^2'
[]
[exact_eps_p]
type = ParsedFunction
expression = '3.48788261470924*(3.06706896551724*cos(1.5*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x)*cos(1.3*x)'
[]
[exact_p]
type = ParsedFunction
expression = '3.48788261470924*(3.06706896551724*cos(1.5*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x)'
[]
[exact_sup_vel_x]
type = ParsedFunction
expression = '1.0*cos(1.1*x)*cos(1.3*x)/cos(x)'
[]
[eps]
type = ParsedFunction
expression = 'cos(1.3*x)'
[]
[exact_superficial_velocity]
type = ParsedVectorFunction
expression_x = '1.0*cos(1.1*x)*cos(1.3*x)/cos(x)'
[]
[]
[Executioner]
solve_type = NEWTON
type = Transient
num_steps = 1
dtmin = 1
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_max_its = 50
line_search = bt
nl_rel_tol = 1e-12
nl_abs_tol = 1e-12
[]
[Outputs]
exodus = true
csv = true
[]
[Debug]
show_var_residual_norms = true
[]
[Postprocessors]
[h]
type = AverageElementSize
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2pressure]
type = ElementL2Error
variable = pressure
function = exact_p
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2sup_mom_x]
variable = sup_mom_x
function = exact_rho_ud
type = ElementL2Error
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2T_fluid]
variable = T_fluid
function = exact_T
type = ElementL2Error
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_element/ins/coupled-force/steady-function.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1.0
ymin = 0
ymax = 1.0
nx = 16
ny = 16
[]
[./corner_node]
type = ExtraNodesetGenerator
new_boundary = 'pinned_node'
nodes = '0'
input = gen
[../]
[]
[Variables]
[./velocity]
family = LAGRANGE_VEC
[../]
[./p]
[../]
[u]
family = LAGRANGE_VEC
[]
[]
[ICs]
[velocity]
type = VectorConstantIC
x_value = 1e-15
y_value = 1e-15
variable = velocity
[]
[]
[Kernels]
[./mass]
type = INSADMass
variable = p
[../]
[./mass_pspg]
type = INSADMassPSPG
variable = p
[../]
[./momentum_convection]
type = INSADMomentumAdvection
variable = velocity
[../]
[./momentum_viscous]
type = INSADMomentumViscous
variable = velocity
[../]
[./momentum_pressure]
type = INSADMomentumPressure
variable = velocity
pressure = p
integrate_p_by_parts = true
[../]
[momentum_coupled_force]
type = INSADMomentumCoupledForce
variable = velocity
vector_function = 'vector_func'
[]
[./momentum_supg]
type = INSADMomentumSUPG
variable = velocity
velocity = velocity
[../]
[u_diff]
type = VectorDiffusion
variable = u
[]
[]
[BCs]
[./no_slip]
type = VectorFunctionDirichletBC
variable = velocity
boundary = 'bottom right left top'
[../]
[./pressure_pin]
type = DirichletBC
variable = p
boundary = 'pinned_node'
value = 0
[../]
[u_left]
type = VectorFunctionDirichletBC
variable = u
boundary = 'left'
function_x = 1
function_y = 1
[]
[u_right]
type = VectorFunctionDirichletBC
variable = u
boundary = 'right'
function_x = -1
function_y = -1
[]
[]
[Materials]
[./const]
type = ADGenericConstantMaterial
prop_names = 'rho mu'
prop_values = '1 1'
[../]
[ins_mat]
type = INSADTauMaterial
velocity = velocity
pressure = p
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -sub_pc_factor_levels -ksp_gmres_restart'
petsc_options_value = 'asm 6 200'
line_search = 'none'
nl_rel_tol = 1e-12
nl_max_its = 6
[]
[Outputs]
exodus = true
[]
[Functions]
[vector_func]
type = ParsedVectorFunction
expression_x = '-2*x + 1'
expression_y = '-2*x + 1'
[]
[]
(modules/navier_stokes/test/tests/finite_element/ins/coupled-force/steady-action-function.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1.0
ymin = 0
ymax = 1.0
nx = 16
ny = 16
[]
[]
[Variables]
[u]
family = LAGRANGE_VEC
[]
[]
[Modules]
[IncompressibleNavierStokes]
equation_type = steady-state
velocity_boundary = 'bottom right top left'
velocity_function = '0 0 0 0 0 0 0 0'
add_standard_velocity_variables_for_ad = false
pressure_pinned_node = 0
density_name = rho
dynamic_viscosity_name = mu
use_ad = true
laplace = true
family = LAGRANGE
order = FIRST
supg = true
pspg = true
has_coupled_force = true
coupled_force_vector_function = 'vector_func'
[]
[]
[Kernels]
[u_diff]
type = VectorDiffusion
variable = u
[]
[]
[BCs]
[u_left]
type = VectorFunctionDirichletBC
variable = u
boundary = 'left'
function_x = 1
function_y = 1
[]
[u_right]
type = VectorFunctionDirichletBC
variable = u
boundary = 'right'
function_x = -1
function_y = -1
[]
[]
[Materials]
[const]
type = ADGenericConstantMaterial
prop_names = 'rho mu'
prop_values = '1 1'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -sub_pc_factor_levels -ksp_gmres_restart'
petsc_options_value = 'asm 6 200'
line_search = 'none'
nl_rel_tol = 1e-12
nl_max_its = 6
[]
[Outputs]
exodus = true
[]
[Functions]
[vector_func]
type = ParsedVectorFunction
expression_x = '-2*x + 1'
expression_y = '-2*x + 1'
[]
[]
(test/tests/kernels/vector_dot_dot/vector_test.i)
# Tests calculation of first and second time derivative
# of a coupled vector variable in a material
# a_vec(x,y,z,t) = [t*(t*x + y), t*y, 0]
# a_vec_dot(x,y,z,t) = [2*t*x + y, y, 0]
# a_vec_dot_dot(x,y,z,t) = [2*x, 0, 0]
#
# IMPORTANT NOTE:
# Currently, this test produces a_vec_dot and a_vec_dot_dot that contains oscillations over time.
# This is a known by-product of Newmark Beta time integration (see the Newmark Beta documentation),
# but as of Summer 2019, there is no alternative time integrator in MOOSE that can dampen these
# oscillations. This test is used as coverage for the function call coupledVectorDotDot.
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 4
ymin = 0
ymax = 4
nx = 8
ny = 8
[]
[Functions]
[a_fn]
type = ParsedVectorFunction
expression_x = 't * (t * x + y)'
expression_y = 't * y'
expression_z = 0
[]
[]
[AuxVariables]
[a]
family = LAGRANGE_VEC
order = FIRST
[]
[]
[AuxKernels]
[a_ak]
type = VectorFunctionAux
variable = a
function = a_fn
[]
[]
[Materials]
[cm]
type = VectorCoupledValuesMaterial
variable = a
[]
[]
[Variables]
[u] # u is zero
family = LAGRANGE_VEC
order = FIRST
[]
[]
[Kernels]
[td]
type = VectorTimeDerivative
variable = u
[]
[]
[Executioner]
type = Transient
dt = 1
num_steps = 3
[TimeIntegrator]
type = NewmarkBeta
[]
[]
[Outputs]
[./out]
type = Exodus
output_material_properties = true
show_material_properties = 'a_value a_dot a_dot_dot a_dot_du a_dot_dot_du'
execute_on = 'TIMESTEP_END'
[../]
[]
(modules/navier_stokes/test/tests/finite_volume/cns/heated-channel/transient-porous-kt-primitive.i)
p_initial=1.01e5
T=273.15
u_in=10
eps=1
superficial_vel_in=${fparse u_in * eps}
[GlobalParams]
fp = fp
limiter = 'vanLeer'
two_term_boundary_expansion = true
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 1
xmin = 0
xmax = 10
nx = 100
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[pressure]
type = MooseVariableFVReal
initial_condition = ${p_initial}
[]
[superficial_vel_x]
type = MooseVariableFVReal
initial_condition = ${superficial_vel_in}
[]
[temperature]
type = MooseVariableFVReal
initial_condition = ${T}
[]
[]
[AuxVariables]
[rho]
type = MooseVariableFVReal
[]
[superficial_rhou]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[rho]
type = ADMaterialRealAux
variable = rho
property = rho
execute_on = 'timestep_end'
[]
[superficial_rhou]
type = ADMaterialRealAux
variable = superficial_rhou
property = superficial_rhou
execute_on = 'timestep_end'
[]
[]
[FVKernels]
[mass_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rho_dt'
variable = pressure
[]
[mass_advection]
type = PCNSFVKT
variable = pressure
eqn = "mass"
[]
[momentum_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rhou_dt'
variable = superficial_vel_x
[]
[momentum_advection]
type = PCNSFVKT
variable = superficial_vel_x
eqn = "momentum"
momentum_component = 'x'
[]
[energy_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rho_et_dt'
variable = temperature
[]
[energy_advection]
type = PCNSFVKT
variable = temperature
eqn = "energy"
[]
[heat]
type = FVBodyForce
variable = temperature
value = 1e6
[]
[]
[FVBCs]
[rho_left]
type = PCNSFVStrongBC
boundary = 'left'
variable = pressure
superficial_velocity = 'superficial_vel_in'
T_fluid = ${T}
eqn = 'mass'
[]
[rhou_left]
type = PCNSFVStrongBC
boundary = 'left'
variable = superficial_vel_x
superficial_velocity = 'superficial_vel_in'
T_fluid = ${T}
eqn = 'momentum'
momentum_component = 'x'
[]
[rho_et_left]
type = PCNSFVStrongBC
boundary = 'left'
variable = temperature
superficial_velocity = 'superficial_vel_in'
T_fluid = ${T}
eqn = 'energy'
[]
[rho_right]
type = PCNSFVStrongBC
boundary = 'right'
variable = pressure
pressure = ${p_initial}
eqn = 'mass'
[]
[rhou_right]
type = PCNSFVStrongBC
boundary = 'right'
variable = superficial_vel_x
pressure = ${p_initial}
eqn = 'momentum'
momentum_component = 'x'
[]
[rho_et_right]
type = PCNSFVStrongBC
boundary = 'right'
variable = temperature
pressure = ${p_initial}
eqn = 'energy'
[]
# Use these to help create more accurate cell centered gradients for cells adjacent to boundaries
[T_left]
type = FVDirichletBC
variable = temperature
value = ${T}
boundary = 'left'
[]
[sup_vel_left]
type = FVDirichletBC
variable = superficial_vel_x
value = ${superficial_vel_in}
boundary = 'left'
[]
[p_right]
type = FVDirichletBC
variable = pressure
value = ${p_initial}
boundary = 'right'
[]
[]
[Functions]
[superficial_vel_in]
type = ParsedVectorFunction
expression_x = '${superficial_vel_in}'
[]
[]
[Materials]
[var_mat]
type = PorousPrimitiveVarMaterial
pressure = pressure
T_fluid = temperature
superficial_vel_x = superficial_vel_x
fp = fp
porosity = porosity
[]
[fluid_only]
type = GenericConstantMaterial
prop_names = 'porosity'
prop_values = '${eps}'
[]
[]
[Executioner]
solve_type = NEWTON
type = Transient
nl_max_its = 20
[TimeStepper]
type = IterationAdaptiveDT
dt = 5e-5
optimal_iterations = 10
[]
steady_state_detection = false
steady_state_tolerance = 1e-12
abort_on_solve_fail = false
end_time = 100
nl_abs_tol = 1e-8
dtmin = 5e-5
automatic_scaling = true
compute_scaling_once = false
verbose = true
petsc_options_iname = '-pc_type -pc_factor_mat_solver_type -pc_factor_shift_type -snes_linesearch_minlambda'
petsc_options_value = 'lu mumps NONZERO 1e-3 '
[]
[Outputs]
[exo]
type = Exodus
execute_on = 'final'
[]
[dof]
type = DOFMap
execute_on = 'initial'
[]
checkpoint = true
[]
[Debug]
show_var_residual_norms = true
[]
(modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/rotated-2d-bkt-function-porosity-mixed.i)
p_initial=1.01e5
T=273.15
# u refers to the superficial velocity
u_in=1
rho_in=1.30524
sup_mom_y_in=${fparse u_in * rho_in}
user_limiter='upwind'
friction_coeff=10
[GlobalParams]
fp = fp
two_term_boundary_expansion = true
limiter = ${user_limiter}
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1
nx = 3
ymin = 0
ymax = 18
ny = 90
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[pressure]
type = MooseVariableFVReal
initial_condition = ${p_initial}
[]
[sup_mom_x]
type = MooseVariableFVReal
initial_condition = 1e-15
scaling = 1e-2
[]
[sup_mom_y]
type = MooseVariableFVReal
initial_condition = 1e-15
scaling = 1e-2
[]
[T_fluid]
type = MooseVariableFVReal
initial_condition = ${T}
scaling = 1e-5
[]
[]
[AuxVariables]
[vel_y]
type = MooseVariableFVReal
[]
[rho]
type = MooseVariableFVReal
[]
[eps]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[vel_y]
type = ADMaterialRealAux
variable = vel_y
property = vel_y
execute_on = 'timestep_end'
[]
[rho]
type = ADMaterialRealAux
variable = rho
property = rho
execute_on = 'timestep_end'
[]
[eps]
type = MaterialRealAux
variable = eps
property = porosity
execute_on = 'timestep_end'
[]
[]
[FVKernels]
[mass_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rho_dt'
variable = pressure
[]
[mass_advection]
type = PCNSFVKT
variable = pressure
eqn = "mass"
[]
[momentum_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rhou_dt'
variable = sup_mom_x
[]
[momentum_advection]
type = PCNSFVKT
variable = sup_mom_x
eqn = "momentum"
momentum_component = 'x'
[]
[eps_grad]
type = PNSFVPGradEpsilon
variable = sup_mom_x
momentum_component = 'x'
epsilon_function = 'eps'
[]
[drag]
type = PCNSFVMomentumFriction
variable = sup_mom_x
momentum_component = 'x'
Darcy_name = 'cl'
momentum_name = superficial_rhou
[]
[momentum_time_y]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rhov_dt'
variable = sup_mom_y
[]
[momentum_advection_y]
type = PCNSFVKT
variable = sup_mom_y
eqn = "momentum"
momentum_component = 'y'
[]
[eps_grad_y]
type = PNSFVPGradEpsilon
variable = sup_mom_y
momentum_component = 'y'
epsilon_function = 'eps'
[]
[drag_y]
type = PCNSFVMomentumFriction
variable = sup_mom_y
momentum_component = 'y'
Darcy_name = 'cl'
momentum_name = superficial_rhov
[]
[energy_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rho_et_dt'
variable = T_fluid
[]
[energy_advection]
type = PCNSFVKT
variable = T_fluid
eqn = "energy"
[]
[]
[FVBCs]
[rho_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = pressure
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'mass'
velocity_function_includes_rho = true
[]
[rhou_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = sup_mom_x
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'momentum'
momentum_component = 'x'
velocity_function_includes_rho = true
[]
[rhov_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = sup_mom_y
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'momentum'
momentum_component = 'y'
velocity_function_includes_rho = true
[]
[rho_et_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = T_fluid
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'energy'
velocity_function_includes_rho = true
[]
[rho_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = pressure
pressure = ${p_initial}
eqn = 'mass'
[]
[rhou_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = sup_mom_x
pressure = ${p_initial}
eqn = 'momentum'
momentum_component = 'x'
[]
[rhov_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = sup_mom_y
pressure = ${p_initial}
eqn = 'momentum'
momentum_component = 'y'
[]
[rho_et_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = T_fluid
pressure = ${p_initial}
eqn = 'energy'
[]
[wall_pressure_x]
type = PCNSFVImplicitMomentumPressureBC
momentum_component = 'x'
boundary = 'left right'
variable = sup_mom_x
[]
[wall_pressure_y]
type = PCNSFVImplicitMomentumPressureBC
momentum_component = 'y'
boundary = 'left right'
variable = sup_mom_y
[]
# Use these to help create more accurate cell centered gradients for cells adjacent to boundaries
[T_bottom]
type = FVDirichletBC
variable = T_fluid
value = ${T}
boundary = 'bottom'
[]
[sup_mom_x_bottom_and_walls]
type = FVDirichletBC
variable = sup_mom_x
value = 0
boundary = 'bottom left right'
[]
[sup_mom_y_walls]
type = FVDirichletBC
variable = sup_mom_y
value = 0
boundary = 'left right'
[]
[sup_mom_y_bottom]
type = FVDirichletBC
variable = sup_mom_y
value = ${sup_mom_y_in}
boundary = 'bottom'
[]
[p_top]
type = FVDirichletBC
variable = pressure
value = ${p_initial}
boundary = 'top'
[]
[]
[Functions]
[ud_in]
type = ParsedVectorFunction
expression_x = '0'
expression_y = '${sup_mom_y_in}'
[]
[eps]
type = ParsedFunction
expression = 'if(y < 2.8, 1,
if(y < 3.2, 1 - .5 / .4 * (y - 2.8),
if(y < 6.8, .5,
if(y < 7.2, .5 - .25 / .4 * (y - 6.8),
if(y < 10.8, .25,
if(y < 11.2, .25 + .25 / .4 * (y - 10.8),
if(y < 14.8, .5,
if(y < 15.2, .5 + .5 / .4 * (y - 14.8),
1))))))))'
[]
[]
[Materials]
[var_mat]
type = PorousMixedVarMaterial
pressure = pressure
T_fluid = T_fluid
superficial_rhou = sup_mom_x
superficial_rhov = sup_mom_y
fp = fp
porosity = porosity
[]
[porosity]
type = GenericFunctionMaterial
prop_names = 'porosity'
prop_values = 'eps'
[]
[ad_generic]
type = ADGenericConstantVectorMaterial
prop_names = 'cl'
prop_values = '${friction_coeff} ${friction_coeff} ${friction_coeff}'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
solve_type = NEWTON
line_search = 'bt'
type = Transient
nl_max_its = 20
[TimeStepper]
type = IterationAdaptiveDT
dt = 5e-5
optimal_iterations = 6
growth_factor = 1.2
[]
num_steps = 10000
end_time = 500
nl_abs_tol = 1e-7
petsc_options_iname = '-pc_type -pc_factor_mat_solver_type'
petsc_options_value = 'lu mumps'
[]
[Outputs]
[out]
type = Exodus
execute_on = 'final'
[]
checkpoint = true
[]
[Debug]
show_var_residual_norms = true
[]
(test/tests/kernels/vector_fe/ad_vector_kernel.i)
# This example reproduces the libmesh vector_fe example 3 results
# using automatic differentiation
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 20
xmin = -1
ymin = -1
elem_type = QUAD9
[]
[Variables]
[u]
family = NEDELEC_ONE
order = FIRST
[]
[]
[Kernels]
[diff]
type = ADVectorFEWave
variable = u
x_forcing_func = x_ffn
y_forcing_func = y_ffn
[]
[]
[BCs]
[bnd]
type = VectorCurlPenaltyDirichletBC
boundary = 'left right top bottom'
penalty = 1e10
function = sln
variable = u
[]
[]
[Functions]
[x_ffn]
type = ParsedFunction
expression = '(2*pi*pi + 1)*cos(pi*x)*sin(pi*y)'
[]
[y_ffn]
type = ParsedFunction
expression = '-(2*pi*pi + 1)*sin(pi*x)*cos(pi*y)'
[]
[sln]
type = ParsedVectorFunction
expression_x = 'cos(pi*x)*sin(pi*y)'
expression_y = '-sin(pi*x)*cos(pi*y)'
curl_z = '-2*pi*cos(pi*x)*cos(pi*y)'
[]
[]
[Postprocessors]
active = ''
[L2Error]
type = ElementVectorL2Error
variable = u
function = sln
[]
[HCurlSemiError]
type = ElementHCurlSemiError
variable = u
function = sln
[]
[HCurlError]
type = ElementHCurlError
variable = u
function = sln
[]
[]
[Preconditioning]
[pre]
type = SMP
[]
[]
[Executioner]
type = Steady
solve_type = LINEAR
petsc_options_iname = -pc_type
petsc_options_value = lu
[]
[Outputs]
exodus = true
[]
(modules/level_set/examples/rotating_circle/circle_rotate_supg.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 32
ny = 32
uniform_refine = 2
[]
[AuxVariables]
[./velocity]
family = LAGRANGE_VEC
[../]
[]
[Variables]
[./phi]
[../]
[]
[Functions]
[./phi_exact]
type = LevelSetOlssonBubble
epsilon = 0.03
center = '0 0.5 0'
radius = 0.15
[../]
[./velocity_func]
type = ParsedVectorFunction
expression_x = '4*y'
expression_y = '-4*x'
[../]
[]
[ICs]
[./phi_ic]
type = FunctionIC
function = phi_exact
variable = phi
[../]
[./vel_ic]
type = VectorFunctionIC
variable = velocity
function = velocity_func
[]
[]
[Kernels]
[./time]
type = TimeDerivative
variable = phi
[../]
[./advection]
type = LevelSetAdvection
velocity = velocity
variable = phi
[../]
[./advection_supg]
type = LevelSetAdvectionSUPG
velocity = velocity
variable = phi
[../]
[./time_supg]
type = LevelSetTimeDerivativeSUPG
velocity = velocity
variable = phi
[../]
[]
[Postprocessors]
[./area]
type = LevelSetVolume
threshold = 0.5
variable = phi
location = outside
execute_on = 'initial timestep_end'
[../]
[./cfl]
type = LevelSetCFLCondition
velocity = velocity
execute_on = 'initial'
[../]
[]
[Executioner]
type = Transient
solve_type = PJFNK
start_time = 0
end_time = 1.570796
scheme = crank-nicolson
petsc_options_iname = '-pc_type -sub_pc_type'
petsc_options_value = 'asm ilu'
[./TimeStepper]
type = PostprocessorDT
postprocessor = cfl
scale = 0.8
[../]
[]
[Outputs]
csv = true
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/basic-conserved-pcnsfv-kt.i)
[GlobalParams]
fp = fp
limiter = 'central_difference'
two_term_boundary_expansion = true
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 1
xmin = .1
xmax = .6
nx = 2
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[rho]
type = MooseVariableFVReal
[]
[rho_ud]
type = MooseVariableFVReal
[]
[rho_et]
type = MooseVariableFVReal
[]
[]
[ICs]
[pressure]
type = FunctionIC
variable = rho
function = 'exact_rho'
[]
[sup_vel_x]
type = FunctionIC
variable = rho_ud
function = 'exact_rho_ud'
[]
[T_fluid]
type = FunctionIC
variable = rho_et
function = 'exact_rho_et'
[]
[]
[FVKernels]
[mass_advection]
type = PCNSFVKT
variable = rho
eqn = "mass"
[]
[mass_fn]
type = FVBodyForce
variable = rho
function = 'forcing_rho'
[]
[momentum_x_advection]
type = PCNSFVKT
variable = rho_ud
momentum_component = x
eqn = "momentum"
[]
[momentum_fn]
type = FVBodyForce
variable = rho_ud
function = 'forcing_rho_ud'
[]
[fluid_energy_advection]
type = PCNSFVKT
variable = rho_et
eqn = "energy"
[]
[energy_fn]
type = FVBodyForce
variable = rho_et
function = 'forcing_rho_et'
[]
[]
[FVBCs]
[mass_left]
variable = rho
type = PCNSFVStrongBC
boundary = left
T_fluid = 'exact_T'
superficial_velocity = 'exact_superficial_velocity'
eqn = 'mass'
[]
[momentum_left]
variable = rho_ud
type = PCNSFVStrongBC
boundary = left
T_fluid = 'exact_T'
superficial_velocity = 'exact_superficial_velocity'
eqn = 'momentum'
momentum_component = 'x'
[]
[energy_left]
variable = rho_et
type = PCNSFVStrongBC
boundary = left
T_fluid = 'exact_T'
superficial_velocity = 'exact_superficial_velocity'
eqn = 'energy'
[]
[mass_right]
variable = rho
type = PCNSFVStrongBC
boundary = right
eqn = 'mass'
pressure = 'exact_p'
[]
[momentum_right]
variable = rho_ud
type = PCNSFVStrongBC
boundary = right
eqn = 'momentum'
momentum_component = 'x'
pressure = 'exact_p'
[]
[energy_right]
variable = rho_et
type = PCNSFVStrongBC
boundary = right
eqn = 'energy'
pressure = 'exact_p'
[]
# help gradient reconstruction
[rho_right]
type = FVFunctionDirichletBC
variable = rho
function = exact_rho
boundary = 'right'
[]
[rho_ud_left]
type = FVFunctionDirichletBC
variable = rho_ud
function = exact_rho_ud
boundary = 'left'
[]
[rho_et_left]
type = FVFunctionDirichletBC
variable = rho_et
function = exact_rho_et
boundary = 'left'
[]
[]
[Materials]
[var_mat]
type = PorousConservedVarMaterial
rho = rho
superficial_rhou = rho_ud
rho_et = rho_et
porosity = porosity
[]
[porosity]
type = GenericFunctionMaterial
prop_names = 'porosity'
prop_values = 'eps'
[]
[]
[Functions]
[exact_rho]
type = ParsedFunction
expression = '3.48788261470924*cos(x)'
[]
[forcing_rho]
type = ParsedFunction
expression = '-3.45300378856215*sin(1.1*x)'
[]
[exact_rho_ud]
type = ParsedFunction
expression = '3.13909435323832*cos(1.1*x)'
[]
[forcing_rho_ud]
type = ParsedFunction
expression = '-0.9*(10.6975765229419*cos(1.2*x)/cos(x) - 0.697576522941849*cos(1.1*x)^2/cos(x)^2)*sin(x) + 0.9*(10.6975765229419*sin(x)*cos(1.2*x)/cos(x)^2 - 1.3951530458837*sin(x)*cos(1.1*x)^2/cos(x)^3 + 1.53466835047207*sin(1.1*x)*cos(1.1*x)/cos(x)^2 - 12.8370918275302*sin(1.2*x)/cos(x))*cos(x) + 3.13909435323832*sin(x)*cos(1.1*x)^2/cos(x)^2 - 6.9060075771243*sin(1.1*x)*cos(1.1*x)/cos(x)'
[]
[exact_rho_et]
type = ParsedFunction
expression = '26.7439413073546*cos(1.2*x)'
[]
[forcing_rho_et]
type = ParsedFunction
expression = '0.9*(3.48788261470924*(3.06706896551724*cos(1.2*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x) + 26.7439413073546*cos(1.2*x))*sin(x)*cos(1.1*x)/cos(x)^2 - 0.99*(3.48788261470924*(3.06706896551724*cos(1.2*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x) + 26.7439413073546*cos(1.2*x))*sin(1.1*x)/cos(x) + 0.9*(-(10.6975765229419*cos(1.2*x)/cos(x) - 0.697576522941849*cos(1.1*x)^2/cos(x)^2)*sin(x) + (10.6975765229419*sin(x)*cos(1.2*x)/cos(x)^2 - 1.3951530458837*sin(x)*cos(1.1*x)^2/cos(x)^3 + 1.53466835047207*sin(1.1*x)*cos(1.1*x)/cos(x)^2 - 12.8370918275302*sin(1.2*x)/cos(x))*cos(x) - 32.0927295688256*sin(1.2*x))*cos(1.1*x)/cos(x)'
[]
[exact_T]
type = ParsedFunction
expression = '0.0106975765229418*cos(1.2*x)/cos(x) - 0.000697576522941848*cos(1.1*x)^2/cos(x)^2'
[]
[exact_eps_p]
type = ParsedFunction
expression = '3.13909435323832*(3.06706896551724*cos(1.2*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x)'
[]
[exact_p]
type = ParsedFunction
expression = '3.48788261470924*(3.06706896551724*cos(1.2*x)/cos(x) - 0.2*cos(1.1*x)^2/cos(x)^2)*cos(x)'
[]
[exact_sup_vel_x]
type = ParsedFunction
expression = '0.9*cos(1.1*x)/cos(x)'
[]
[exact_superficial_velocity]
type = ParsedVectorFunction
expression_x = '0.9*cos(1.1*x)/cos(x)'
[]
[eps]
type = ParsedFunction
expression = '0.9'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
solve_type = NEWTON
type = Transient
num_steps = 1
dtmin = 1
petsc_options = '-snes_linesearch_monitor'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_max_its = 50
line_search = bt
[]
[Outputs]
exodus = true
csv = true
[]
[Debug]
show_var_residual_norms = true
[]
[Postprocessors]
[h]
type = AverageElementSize
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2rho]
type = ElementL2Error
variable = rho
function = exact_rho
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2rho_ud]
variable = rho_ud
function = exact_rho_ud
type = ElementL2Error
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2rho_et]
variable = rho_et
function = exact_rho_et
type = ElementL2Error
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[]
(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
[]
(test/tests/ics/vector_function_ic/vector_function_ic.i)
[Mesh]
type = GeneratedMesh
dim = 3
nx = 2
ny = 2
nz = 2
[]
[Problem]
solve = false
kernel_coverage_check = false
[]
[Variables/A]
family = LAGRANGE_VEC
[]
[ICs/A]
type = VectorFunctionIC
variable = A
function = func
[]
[Functions/func]
type = ParsedVectorFunction
expression_x = '2*x'
expression_y = '3*y'
expression_z = 'z*z'
[]
[Executioner]
type = Steady
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/dc.i)
p_initial=1.01e5
T=273.15
# u refers to the superficial velocity
u_in=1
rho_in=1.30524
sup_mom_y_in=${fparse u_in * rho_in}
user_limiter='min_mod'
friction_coeff=10
[GlobalParams]
fp = fp
two_term_boundary_expansion = true
limiter = ${user_limiter}
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1
nx = 3
ymin = 0
ymax = 18
ny = 90
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[pressure]
type = MooseVariableFVReal
initial_condition = ${p_initial}
[]
[sup_mom_x]
type = MooseVariableFVReal
initial_condition = 1e-15
[]
[sup_mom_y]
type = MooseVariableFVReal
initial_condition = 1e-15
[]
[T_fluid]
type = MooseVariableFVReal
initial_condition = ${T}
[]
[]
[AuxVariables]
[vel_y]
type = MooseVariableFVReal
[]
[rho]
type = MooseVariableFVReal
[]
[eps]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[vel_y]
type = ADMaterialRealAux
variable = vel_y
property = vel_y
execute_on = 'timestep_end'
[]
[rho]
type = ADMaterialRealAux
variable = rho
property = rho
execute_on = 'timestep_end'
[]
[eps]
type = MaterialRealAux
variable = eps
property = porosity
execute_on = 'timestep_end'
[]
[]
[FVKernels]
[mass_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rho_dt'
variable = pressure
[]
[mass_advection]
type = PCNSFVKTDC
variable = pressure
eqn = "mass"
[]
[momentum_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rhou_dt'
variable = sup_mom_x
[]
[momentum_advection]
type = PCNSFVKTDC
variable = sup_mom_x
eqn = "momentum"
momentum_component = 'x'
[]
[eps_grad]
type = PNSFVPGradEpsilon
variable = sup_mom_x
momentum_component = 'x'
epsilon_function = 'eps'
[]
[drag]
type = PCNSFVMomentumFriction
variable = sup_mom_x
momentum_component = 'x'
Darcy_name = 'cl'
momentum_name = superficial_rhou
[]
[momentum_time_y]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rhov_dt'
variable = sup_mom_y
[]
[momentum_advection_y]
type = PCNSFVKTDC
variable = sup_mom_y
eqn = "momentum"
momentum_component = 'y'
[]
[eps_grad_y]
type = PNSFVPGradEpsilon
variable = sup_mom_y
momentum_component = 'y'
epsilon_function = 'eps'
[]
[drag_y]
type = PCNSFVMomentumFriction
variable = sup_mom_y
momentum_component = 'y'
Darcy_name = 'cl'
momentum_name = superficial_rhov
[]
[energy_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rho_et_dt'
variable = T_fluid
[]
[energy_advection]
type = PCNSFVKTDC
variable = T_fluid
eqn = "energy"
[]
[]
[FVBCs]
[rho_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = pressure
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'mass'
velocity_function_includes_rho = true
[]
[rhou_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = sup_mom_x
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'momentum'
momentum_component = 'x'
velocity_function_includes_rho = true
[]
[rhov_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = sup_mom_y
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'momentum'
momentum_component = 'y'
velocity_function_includes_rho = true
[]
[rho_et_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = T_fluid
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'energy'
velocity_function_includes_rho = true
[]
[rho_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = pressure
pressure = ${p_initial}
eqn = 'mass'
[]
[rhou_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = sup_mom_x
pressure = ${p_initial}
eqn = 'momentum'
momentum_component = 'x'
[]
[rhov_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = sup_mom_y
pressure = ${p_initial}
eqn = 'momentum'
momentum_component = 'y'
[]
[rho_et_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = T_fluid
pressure = ${p_initial}
eqn = 'energy'
[]
[wall_pressure_x]
type = PCNSFVImplicitMomentumPressureBC
momentum_component = 'x'
boundary = 'left right'
variable = sup_mom_x
[]
[wall_pressure_y]
type = PCNSFVImplicitMomentumPressureBC
momentum_component = 'y'
boundary = 'left right'
variable = sup_mom_y
[]
# Use these to help create more accurate cell centered gradients for cells adjacent to boundaries
[T_bottom]
type = FVDirichletBC
variable = T_fluid
value = ${T}
boundary = 'bottom'
[]
[sup_mom_x_bottom_and_walls]
type = FVDirichletBC
variable = sup_mom_x
value = 0
boundary = 'bottom left right'
[]
[sup_mom_y_walls]
type = FVDirichletBC
variable = sup_mom_y
value = 0
boundary = 'left right'
[]
[sup_mom_y_bottom]
type = FVDirichletBC
variable = sup_mom_y
value = ${sup_mom_y_in}
boundary = 'bottom'
[]
[p_top]
type = FVDirichletBC
variable = pressure
value = ${p_initial}
boundary = 'top'
[]
[]
[Functions]
[ud_in]
type = ParsedVectorFunction
expression_x = '0'
expression_y = '${sup_mom_y_in}'
[]
[eps]
type = ParsedFunction
expression = 'if(y < 2.8, 1,
if(y < 3.2, 1 - .5 / .4 * (y - 2.8),
if(y < 6.8, .5,
if(y < 7.2, .5 - .25 / .4 * (y - 6.8),
if(y < 10.8, .25,
if(y < 11.2, .25 + .25 / .4 * (y - 10.8),
if(y < 14.8, .5,
if(y < 15.2, .5 + .5 / .4 * (y - 14.8),
1))))))))'
[]
[]
[Materials]
[var_mat]
type = PorousMixedVarMaterial
pressure = pressure
T_fluid = T_fluid
superficial_rhou = sup_mom_x
superficial_rhov = sup_mom_y
porosity = porosity
[]
[porosity]
type = GenericFunctionMaterial
prop_names = 'porosity'
prop_values = 'eps'
[]
[ad_generic]
type = ADGenericConstantVectorMaterial
prop_names = 'cl'
prop_values = '${friction_coeff} ${friction_coeff} ${friction_coeff}'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
solve_type = NEWTON
line_search = 'bt'
type = Transient
nl_max_its = 20
[TimeStepper]
type = IterationAdaptiveDT
dt = 5e-5
optimal_iterations = 6
growth_factor = 1.2
[]
num_steps = 10
nl_abs_tol = 1e-8
automatic_scaling = true
compute_scaling_once = false
resid_vs_jac_scaling_param = 0.5
verbose = true
steady_state_detection = true
steady_state_tolerance = 1e-8
normalize_solution_diff_norm_by_dt = false
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Outputs]
[out]
type = Exodus
[]
[]
[Debug]
show_var_residual_norms = true
[]
[Postprocessors]
active = ''
[num_nl]
type = NumNonlinearIterations
[]
[total_nl]
type = CumulativeValuePostprocessor
postprocessor = num_nl
[]
[]
(modules/level_set/test/tests/reinitialization/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 8
ny = 8
uniform_refine = 3 #1/64
[]
[AuxVariables]
[./velocity]
family = LAGRANGE_VEC
[../]
[]
[Variables]
[./phi]
[../]
[]
[Functions]
[./phi_exact]
type = LevelSetOlssonBubble
epsilon = 0.05
center = '0.5 0.5 0'
radius = 0.15
[../]
[./velocity_func]
type = ParsedVectorFunction
expression_x = '1'
expression_y = '1'
[../]
[]
[BCs]
[./Periodic]
[./all]
variable = phi
auto_direction = 'x y'
[../]
[../]
[]
[ICs]
[./phi_ic]
type = FunctionIC
function = phi_exact
variable = phi
[../]
[./vel_ic]
type = VectorFunctionIC
variable = velocity
function = velocity_func
[]
[]
[Kernels]
[./time]
type = TimeDerivative
variable = phi
[../]
[./advection]
type = LevelSetAdvection
velocity = velocity
variable = phi
[../]
[]
[Postprocessors]
[./area]
type = LevelSetVolume
threshold = 0.5
variable = phi
location = outside
execute_on = 'initial timestep_end'
[../]
[./cfl]
type = LevelSetCFLCondition
velocity = velocity
execute_on = 'initial'
[../]
[]
[Executioner]
type = Transient
solve_type = PJFNK
start_time = 0
end_time = 1
nl_rel_tol = 1e-12
scheme = crank-nicolson
petsc_options_iname = '-pc_type -sub_pc_type'
petsc_options_value = 'asm ilu'
[./TimeStepper]
type = PostprocessorDT
postprocessor = cfl
scale = 1
[../]
[]
[MultiApps]
[./reinit]
type = LevelSetReinitializationMultiApp
input_files = 'reinit.i'
execute_on = 'timestep_end'
[../]
[]
[Transfers]
[./to_sub]
type = MultiAppCopyTransfer
variable = phi
source_variable = phi
to_multi_app = reinit
execute_on = 'timestep_end'
[../]
[./to_sub_init]
type = MultiAppCopyTransfer
variable = phi_0
source_variable = phi
to_multi_app = reinit
execute_on = 'timestep_end'
[../]
[./from_sub]
type = MultiAppCopyTransfer
variable = phi
source_variable = phi
from_multi_app = reinit
execute_on = timestep_end
[../]
[]
[Outputs]
exodus = true
[]