From 62960f424386de1a74a9495c5943fc802311747d Mon Sep 17 00:00:00 2001 From: Pierre-Clement Simon Date: Thu, 16 May 2024 18:20:04 -0600 Subject: [PATCH] Add new test that input a field variable into `EquilibriumBC/enclosure_var` (Close. #134) (Ref. #133) --- test/tests/bcs/EquilibriumBC/equilibriumBC.i | 82 +++++++++++++++++++ .../EquilibriumBC/gold/equilibriumBC_out.csv | 3 + test/tests/bcs/EquilibriumBC/tests | 10 +++ 3 files changed, 95 insertions(+) create mode 100644 test/tests/bcs/EquilibriumBC/equilibriumBC.i create mode 100644 test/tests/bcs/EquilibriumBC/gold/equilibriumBC_out.csv create mode 100644 test/tests/bcs/EquilibriumBC/tests diff --git a/test/tests/bcs/EquilibriumBC/equilibriumBC.i b/test/tests/bcs/EquilibriumBC/equilibriumBC.i new file mode 100644 index 00000000..4a2f3b10 --- /dev/null +++ b/test/tests/bcs/EquilibriumBC/equilibriumBC.i @@ -0,0 +1,82 @@ +# Simple test to ensure that EquilibriumBC's enclosure_var can take in a field variable + +[Mesh] + type = GeneratedMesh + dim = 1 +[] + +[Variables] + [u] + [] +[] + +[AuxVariables] + [v] + initial_condition = 1 + [] +[] + +[Kernels] + [diff] + type = MatDiffusion + variable = u + diffusivity = 1 + [] + [time] + type = TimeDerivative + variable = u + [] +[] + +[BCs] + [right] + type = DirichletBC + value = 0 + variable = u + boundary = 'right' + [] + [left] + type = EquilibriumBC + variable = u + enclosure_var = v + boundary = 'left' + Ko = 1 + temperature = 1 + [] +[] + +[Postprocessors] + [flux_surface_left] + type = SideDiffusiveFluxIntegral + variable = u + diffusivity = 1 + boundary = 'left' + execute_on = 'initial nonlinear linear timestep_end' + [] +[] + +[Executioner] + type = Transient + dt = .1 + num_steps = 1 + solve_type = PJFNK + automatic_scaling = true + dtmin = .1 + l_max_its = 30 + nl_max_its = 5 + petsc_options = '-snes_converged_reason -ksp_monitor_true_residual' + petsc_options_iname = '-pc_type -mat_mffd_err' + petsc_options_value = 'lu 1e-5' + line_search = 'bt' + scheme = 'bdf2' + timestep_tolerance = 1e-8 +[] + +[Outputs] + file_base = equilibriumBC_out + perf_graph = true + [csv] + type = CSV + execute_on = 'initial timestep_end' + [] +[] diff --git a/test/tests/bcs/EquilibriumBC/gold/equilibriumBC_out.csv b/test/tests/bcs/EquilibriumBC/gold/equilibriumBC_out.csv new file mode 100644 index 00000000..ef9f2781 --- /dev/null +++ b/test/tests/bcs/EquilibriumBC/gold/equilibriumBC_out.csv @@ -0,0 +1,3 @@ +time,flux_surface_left +0,0 +0.1,-1 \ No newline at end of file diff --git a/test/tests/bcs/EquilibriumBC/tests b/test/tests/bcs/EquilibriumBC/tests new file mode 100644 index 00000000..8ee83621 --- /dev/null +++ b/test/tests/bcs/EquilibriumBC/tests @@ -0,0 +1,10 @@ +[Tests] + [equilibriumBC_fiel_variable] + type = 'CSVDiff' + input = 'equilibriumBC.i' + csvdiff = 'equilibriumBC_out.csv' + issues = '#134' + design = 'EquilibriumBC.md' + requirement = 'The system shall compute the flux imposed by EquilibriumBC when a field variable is used for the enclosure variable.' + [] +[]