Skip to content

Commit

Permalink
Add new test that input a field variable into `EquilibriumBC/enclosur…
Browse files Browse the repository at this point in the history
…e_var`

(Close. #134)
(Ref. #133)
  • Loading branch information
simopier committed May 17, 2024
1 parent b022ca9 commit 62960f4
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 0 deletions.
82 changes: 82 additions & 0 deletions test/tests/bcs/EquilibriumBC/equilibriumBC.i
Original file line number Diff line number Diff line change
@@ -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'
[]
[]
3 changes: 3 additions & 0 deletions test/tests/bcs/EquilibriumBC/gold/equilibriumBC_out.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
time,flux_surface_left
0,0
0.1,-1
10 changes: 10 additions & 0 deletions test/tests/bcs/EquilibriumBC/tests
Original file line number Diff line number Diff line change
@@ -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.'
[]
[]

0 comments on commit 62960f4

Please sign in to comment.