- 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.
- execute_onLINEARThe list of flag(s) indicating when this object should be executed, the available options include FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM.
Default:LINEAR
C++ Type:ExecFlagEnum
Controllable:No
Description:The list of flag(s) indicating when this object should be executed, the available options include FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM.
- 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]
# 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'
[../]
[]
[BCs]
[./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/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/implicit-euler-basic-kt-primitive.i)
- (test/tests/dgkernels/passive-scalar-channel-flow/test.i)
- (modules/electromagnetics/test/tests/benchmarks/evanescent_wave/evanescent_wave.i)
- (test/tests/auxkernels/functor_elemental_gradient/functor_gradient.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/basic-conserved-pcnsfv-kt.i)
- (test/tests/kernels/vector_fe/coupled_electrostatics.i)
- (modules/electromagnetics/test/tests/kernels/vector_helmholtz/vector_current_source.i)
- (test/tests/kernels/vector_fe/vector_kernel.i)
- (modules/navier_stokes/test/tests/finite_element/ins/cg-dg-hybrid/channel-flow/channel-hybrid.i)
- (test/tests/kernels/vector_dot_dot/vector_test.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/varying-eps-basic-kt-primitive.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/hllc.i)
- (test/tests/transfers/multiapp_copy_transfer/vector-variable-transfer/parent_L2_LagrangeVec.i)
- (modules/level_set/test/tests/kernels/advection/advection_mms.i)
- (modules/level_set/test/tests/verification/1d_level_set_mms/level_set_mms.i)
- (test/tests/functions/linear_combination_function/lcf_vector.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_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)
- (test/tests/functions/parsed/function_curl.i)
- (modules/level_set/examples/rotating_circle/circle_rotate_parent.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/basic-primitive-pcnsfv-kt.i)
- (modules/geochemistry/test/tests/kinetics/bio_zoning_flow.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/dc.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/rotated-2d-bkt-function-porosity-mixed.i)
- (modules/geochemistry/test/tests/kernels/advection_1.i)
- (modules/level_set/test/tests/verification/1d_level_set_supg_mms/1d_level_set_supg_mms.i)
- (test/tests/functions/parsed/vector_function.i)
- (modules/level_set/examples/circle/circle_16.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/heated-channel/transient-porous-kt-primitive.i)
- (modules/navier_stokes/test/tests/finite_element/ins/coupled-force/gravity-through-coupled-force.i)
- (modules/level_set/examples/rotating_circle/circle_rotate.i)
- (modules/level_set/test/tests/reinitialization/parent.i)
- (modules/electromagnetics/test/tests/bcs/vector_robin_bc/portbc_waves.i)
- (modules/navier_stokes/test/tests/finite_element/ins/coupled-force/gravity-through-coupled-force-action.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/mms/1d-with-bcs/varying-eps-hllc.i)
- (test/tests/ics/vector_function_ic/vector_function_ic.i)
- (modules/navier_stokes/test/tests/finite_element/ins/coupled-force/steady-function.i)
- (modules/level_set/examples/rotating_circle/circle_rotate_supg.i)
- (test/tests/auxkernels/vector_function_aux/vector_function_aux.i)
- (modules/navier_stokes/test/tests/finite_element/ins/coupled-force/steady-action-function.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/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
[]
(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/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/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
[]
(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'
[]
[]
(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/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
[]
(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/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
[]
(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/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'
[]
[]
(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
[]
(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
[]
(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/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 -pc_sub_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/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/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_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
[]
(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/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 -pc_sub_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
[]
(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/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/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/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
[]
(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/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 -pc_sub_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/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/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 -pc_sub_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/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_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/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 -pc_sub_type'
petsc_options_value = 'asm ilu'
[./TimeStepper]
type = PostprocessorDT
postprocessor = cfl
scale = 0.8
[../]
[]
[Outputs]
csv = true
exodus = true
[]
(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 -pc_sub_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
[]
(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/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/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'
[]
[]
(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_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/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 -pc_sub_type'
petsc_options_value = 'asm ilu'
[./TimeStepper]
type = PostprocessorDT
postprocessor = cfl
scale = 0.8
[../]
[]
[Outputs]
csv = true
exodus = 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/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'
[]
[]