Skip to content

Commit

Permalink
Adding val-1e case
Browse files Browse the repository at this point in the history
  • Loading branch information
singhgp4321 committed Jul 30, 2022
1 parent c43b050 commit 5f22b5c
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 0 deletions.
22 changes: 22 additions & 0 deletions doc/content/verification/val-1e.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# val-1e

# Diffusion in a composite layer
Documentation is missing!

### Notes

The trapping test features some oscillations in the solution for whatever
reason. In order for the oscillations to not take over the simulation, it seems
that the ratio of the **inverse of the Fourier number** must be kept
sufficiently high, e.g. `h^2 / (D * dt)`. Included in this directory are three
`png` files that show the permeation for different `h` and `dt` values. They are
summarized below:

- `nx-80.png`: `nx = 80` and `dt = .0625`
- `nx-40.png`: `nx = 40` and `dt = .25`
- `nx-20.png`: `nx = 20` and `dt = 1`

The oscillations in the permeation graph go away with increasing fineness in the
mesh and in `dt`.

!bibtex bibliography
Binary file added test/tests/val-1e/gold/val-1e_out.e
Binary file not shown.
11 changes: 11 additions & 0 deletions test/tests/val-1e/tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Tests]
design = 'Diffusion.md TimeDerivative.md DirichletBC.md'
issues = '#12'
[exo]
type = Exodiff
input = val-1e.i
exodiff = val-1e_out.e
cli_args = 'Executioner/dt=1 Mesh/nx=198'
requirement = 'The system shall be able to model transient diffusion through a composite slab with a constant concentration boundary condition as the species source.'
[]
[]
108 changes: 108 additions & 0 deletions test/tests/val-1e/val-1e.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1000
xmax = 99e-6 #=========================
[]

[Variables]
[./u]
[../]
[]

[AuxVariables]
[./flux_x]
order = FIRST
family = MONOMIAL
[../]
[]

[Functions]
[diffusivity_value]
type = ParsedFunction
value = 'if(x<33e-6, 1.274e-7, 2.622e-11)' #=========================
[]
[]

[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./time]
type = TimeDerivative
variable = u
[../]
[]

[AuxKernels]
[./flux_x]
type = DiffusionFluxAux
diffusivity = diffusivity_value
variable = flux_x
diffusion_variable = u
component = x
[../]
[]

[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 3.0537 #=========================
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 0
[../]
[]

[VectorPostprocessors]
[line]
type = LineValueSampler
start_point = '0 0 0'
end_point = '99e-6 0 0' #=========================
num_points = 199
sort_by = 'x'
variable = u
[]
[]

[Postprocessors]
[conc_point1]
type = PointValue
variable = u
point = '40.5e-6 0 0' #=========================
[]
[flux_point2]
type = PointValue
variable = flux_x
point = '40.5e-6 0 0' #=========================
[]
[]

[Executioner]
type = Transient
end_time = 50
dt = .1
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
l_tol = 1e-8
scheme = 'crank-nicolson'
nl_abs_tol = 1e-14 #=========================
automatic_scaling = true
compute_scaling_once = true
[]

[Outputs]
exodus = true
[csv]
type = CSV
interval = 10
[]
perf_graph = true
[]

0 comments on commit 5f22b5c

Please sign in to comment.