Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add validation case 2e in TMAP8 #236

Merged
merged 16 commits into from
Feb 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions doc/content/bib/tmap8.bib
Original file line number Diff line number Diff line change
Expand Up @@ -287,3 +287,25 @@ @article{li2010analytical
year={2010},
publisher={American Society of Civil Engineers}
}

@article{kizu2001co,
title={Co-permeation of deuterium and hydrogen through Pd},
author={Kizu, Kaname and Pisarev, Alexander and Tanabe, Tetsuo},
journal={Journal of nuclear materials},
volume={289},
number={3},
pages={291--302},
year={2001},
publisher={Elsevier}
}

@article{katz1960permeability,
title={Permeability and diffusivity of hydrogen through a palladium tube},
author={Katz, OM and Gulbransen, EA},
journal={Review of Scientific Instruments},
volume={31},
number={6},
pages={615--617},
year={1960},
publisher={American Institute of Physics}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions doc/content/verification_and_validation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ TMAP8 also contains [example cases](examples/tmap_index.md), which showcase how
| val-2b | [Diffusion Experiment in Beryllium](val-2b.md) |
| val-2c | [Test Cell Release Experiment](val-2c.md) |
| val-2d | [Thermal Desorption Spectroscopy on Tungsten](val-2d.md) |
| val-2e | [Co-permeation of H$_2$ and D$_2$ through Pd](val-2e.md) |
269 changes: 269 additions & 0 deletions doc/content/verification_and_validation/val-2e.md

Large diffs are not rendered by default.

516 changes: 516 additions & 0 deletions test/tests/val-2e/comparison_val-2e.py

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions test/tests/val-2e/gold/experiment_mixture_D2.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Pressure [Pa],Flux [mol/m^2/s]
0.004524216780801966, 1.0021452340650378e-7
0.009543936007219683, 3.024744477072597e-7
0.020181302822182397, 0.0000013152516076740708
0.05063429662262204, 0.000005530298399072939
0.10148666410400967, 0.00001580286558514525
0.20064074399563508, 0.000030048247009339013
0.5065570349826607, 0.00006243221125096368
0.9685644277381521, 0.00010229385426517369
9 changes: 9 additions & 0 deletions test/tests/val-2e/gold/experiment_mixture_H2.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Pressure [Pa],Flux [mol/m^2/s]
0.004524216780801966, 0.000016166803744912416
0.009543936007219683, 0.00001511692005263664
0.020181302822182397, 0.00001335726025542993
0.05063429662262204, 0.00001146281130068396
0.10148666410400967, 0.000010206576599745438
0.20064074399563508, 0.000008518344580100988
0.5065570349826607, 0.00000818067037762332
0.9685644277381521, 0.000007885899693103643
9 changes: 9 additions & 0 deletions test/tests/val-2e/gold/experiment_mixture_HD.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Pressure [Pa],Flux [mol/m^2/s]
0.004524216780801966, 0.000002818483593315244
0.009543936007219683, 0.000005106005498112279
0.020181302822182397, 0.000010042054016459564
0.05063429662262204, 0.00001422257161865392
0.10148666410400967, 0.00002414424958172987
0.20064074399563508, 0.00003499241701722998
0.5065570349826607, 0.00004774417882543832
0.9685644277381521, 0.00005610373559038218
14 changes: 14 additions & 0 deletions test/tests/val-2e/gold/experiment_thick_825K.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Pressure [Pa],Flux [mol/m^2/s]
0.00025187096604994995, 4.1669071191580695e-8
0.0006024670878789285, 1.0076403360649629e-7
0.0013000864451623367, 2.2048939031166577e-7
0.0026600460054627072, 4.4690988889173473e-7
0.007205366617339495, 0.0000012608080007769607
0.014432095191314873, 0.000002358452741876647
0.026904699060306493, 0.00000391242350655847
0.06523592779765103, 0.00000902350274837349
0.12125980505922447, 0.000015105368429667453
0.30287960219682436, 0.00003058623999675382
0.786652200915388, 0.00006728861195174498
1.6308796662254377, 0.00010944721752538247
3.346249117973162, 0.00019943803510445436
14 changes: 14 additions & 0 deletions test/tests/val-2e/gold/experiment_thin_825K.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Pressure [Pa],Flux [mol/m^2/s]
0.0002416910178739083, 1.2200612799523452e-7
0.0005540899625183756, 2.2697495080063419e-7
0.002558628599014938, 8.547185968699137e-7
0.007158267277180123, 0.000002426195242477441
0.01334145188049612, 0.000004412188025353658
0.027154478917097786, 0.000008404409530476977
0.06450496803903671, 0.000017856843040052643
0.06450496803903671, 0.000017856843040052643
0.122356383049439, 0.000032141100248366645
0.305636827730252, 0.00005569775468853237
0.7920170027376378, 0.00011852656979112164
1.6094362804002411, 0.00020815045604912088
3.3550520753894255, 0.0003639512294750235
12 changes: 12 additions & 0 deletions test/tests/val-2e/gold/experiment_thin_865K.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Pressure [Pa],Flux [mol/m^2/s]
0.0012373183982408427, 5.005117047364166e-7
0.0025759243252609612, 0.0000013257916186586545
0.007221709215138166, 0.0000028169085231215905
0.01323134639087021, 0.00000520072015970521
0.027012385245199815, 0.000011037605079022432
0.06521648398262139, 0.00002194307189507736
0.12112974446851635, 0.000038144812206228325
0.30389251627486413, 0.00006694304551247713
0.7867460063528895, 0.00015552294551086454
1.609820142228338, 0.00026025843121689355
3.351487053249286, 0.0004598238033786746
438 changes: 438 additions & 0 deletions test/tests/val-2e/gold/val-2ea_out.csv

Large diffs are not rendered by default.

Binary file added test/tests/val-2e/gold/val-2ea_out.e
Binary file not shown.
438 changes: 438 additions & 0 deletions test/tests/val-2e/gold/val-2eb_out.csv

Large diffs are not rendered by default.

Binary file added test/tests/val-2e/gold/val-2eb_out.e
Binary file not shown.
438 changes: 438 additions & 0 deletions test/tests/val-2e/gold/val-2ec_out.csv

Large diffs are not rendered by default.

Binary file added test/tests/val-2e/gold/val-2ec_out.e
Binary file not shown.
259 changes: 259 additions & 0 deletions test/tests/val-2e/gold/val-2ed_out.csv

Large diffs are not rendered by default.

Binary file added test/tests/val-2e/gold/val-2ed_out.e
Binary file not shown.
261 changes: 261 additions & 0 deletions test/tests/val-2e/gold/val-2ee_out.csv

Large diffs are not rendered by default.

Binary file added test/tests/val-2e/gold/val-2ee_out.e
Binary file not shown.
8 changes: 8 additions & 0 deletions test/tests/val-2e/parameters_deuterium_gas.params
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Physical Constants
# Note that we do NOT use the same number of digits as in TMAP7.
# This is to be consistent with PhysicalConstant.h
kb = '${units 1.380649e-23 J/K}' # Boltzmann constant
R = '${units 8.31446261815324 J/mol/K}' # Gas constant

# Model data used in TMAP7 case
temperature = '${units 825 K}'
8 changes: 8 additions & 0 deletions test/tests/val-2e/parameters_three_gases.params
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Physical Constants
# Note that we do NOT use the same number of digits as in TMAP7.
# This is to be consistent with PhysicalConstant.h
kb = '${units 1.380649e-23 J/K}' # Boltzmann constant
R = '${units 8.31446261815324 J/mol/K}' # Gas constant

# Model data used in TMAP7 case
temperature = '${units 870 K}'
80 changes: 80 additions & 0 deletions test/tests/val-2e/tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
[Tests]
design = 'MatReaction.md MatBodyForce.md EquilibriumBC.md MatNeumannBC.md'
verification = 'val-2e.md'
issues = '#12'
[val-2ea_csvdiff]
type = CSVDiff
input = val-2ea.i
csvdiff = val-2ea_out.csv
requirement = 'The system shall be able to model permeation of Deuterium from a 0.05 mm thick membrane at 825 K to generate CSV data for use in comparisons with the experimental data.'
[]
[val-2ea]
type = Exodiff
input = val-2ea.i
should_execute = False # this test relies on the output files from val-2ea_csvdiff, so it shouldn't be run twice
exodiff = val-2ea_out.e
requirement = 'The system shall be able to model permeation of Deuterium from a 0.05 mm thick membrane at 825 K.'
[]
[val-2eb_csvdiff]
type = CSVDiff
input = val-2ea.i
csvdiff = val-2eb_out.csv
cli_args = 'slab_thickness="${units 2.5e-5 m -> mum}" file_name="val-2eb_out"'
requirement = 'The system shall be able to model permeation of Deuterium from a 0.025 mm thin membrane at 825 K to generate CSV data for use in comparisons with the experimental data.'
[]
[val-2eb]
type = Exodiff
input = val-2ea.i
should_execute = False # this test relies on the output files from val-2eb_csvdiff, so it shouldn't be run twice
exodiff = val-2eb_out.e
cli_args = 'slab_thickness="${units 2.5e-5 m -> mum}" file_name="val-2eb_out"'
requirement = 'The system shall be able to model permeation of Deuterium from a 0.025 mm thin membrane at 825 K.'
[]
[val-2ec_csvdiff]
type = CSVDiff
input = val-2ea.i
csvdiff = val-2ec_out.csv
cli_args = 'temperature="${units 865 K}" slab_thickness="${units 2.5e-5 m -> mum}" file_name="val-2ec_out"'
requirement = 'The system shall be able to model permeation of Deuterium from a 0.025 mm thin membrane at 865 K to generate CSV data for use in comparisons with the experimental data.'
[]
[val-2ec]
type = Exodiff
input = val-2ea.i
should_execute = False # this test relies on the output files from val-2ec_csvdiff, so it shouldn't be run twice
exodiff = val-2ec_out.e
cli_args = 'temperature="${units 865 K}" slab_thickness="${units 2.5e-5 m -> mum}" file_name="val-2ec_out"'
requirement = 'The system shall be able to model permeation of Deuterium from a 0.025 mm thin membrane at 865 K and generate an exodus file.'
[]
[val-2ed_csvdiff]
type = CSVDiff
input = val-2ed.i
csvdiff = val-2ed_out.csv
requirement = 'The system shall be able to model permeation of mixture gas from a 0.025 mm thin membrane at 870 K using lawdep boundary conditions to generate CSV data for use in comparisons with the experimental data.'
[]
[val-2ed]
type = Exodiff
input = val-2ed.i
should_execute = False # this test relies on the output files from val-2ed_csvdiff, so it shouldn't be run twice
exodiff = val-2ed_out.e
requirement = 'The system shall be able to model permeation of mixture gas with chemical reaction from a 0.025 mm thin membrane at 870 K using lawdep boundary conditions and generate an exodus file.'
[]
[val-2ee_csvdiff]
type = CSVDiff
input = val-2ee.i
csvdiff = val-2ee_out.csv
requirement = 'The system shall be able to model permeation of mixture gas from a 0.025 mm thin membrane at 870 K using ratedep boundary conditions to generate CSV data for use in comparisons with the experimental data.'
[]
[val-2ee]
type = Exodiff
input = val-2ee.i
should_execute = False # this test relies on the output files from val-2ee_csvdiff, so it shouldn't be run twice
exodiff = val-2ee_out.e
requirement = 'The system shall be able to model permeation of mixture gas with chemical reaction from a 0.025 mm thin membrane at 870 K using ratedep boundary conditions and generate an exodus file.'
[]
[ver-2e_comparison]
type = RunCommand
command = 'python3 comparison_val-2e.py'
requirement = 'The system shall be able to generate comparison plots between the analytical solution and experimental data of validation case 2e, modeling the permeation of Deuterium from a membrane.'
required_python_packages = 'matplotlib numpy pandas os'
[]
[]
185 changes: 185 additions & 0 deletions test/tests/val-2e/val-2e_base.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
# Base input file for Validation Problem #2ea #2eb #2ec #2ed #2ee
# Include [Mesh], [Problem], [Kernels] for D2 and D, [Materials] for D,
# [Postprocessors] for D2 and D, [Debug], [Preconditioning],
# [Executioner] and [Outputs] blocks

# This input file is not meant to run on its own and is included in case-specific input files.

# Enclosure data used in TMAP7 case
surface_area = '${units 1.8e-4 m^2 -> mum^2}'
pressure_enclosure4 = '${units 1e-10 Pa}'
volume_enclosure = '${units 0.005 m^3 -> mum^3}'
flow_rate = '${units 0.1 m^3/s -> mum^3/s}'
flow_rate_by_V = '${fparse flow_rate / volume_enclosure}'

# Diffusion data used in TMAP7 case
diffusivity_pre_D = '${units 2.636e-4 m^2/s -> mum^2/s}'
diffusivity_energy_D = '${units ${fparse 1315.8 * R} J/mol}'

# Modeling data used in current case
num_node = 20 # -
concentration_to_pressure_conversion_factor = '${units ${fparse kb*temperature} Pa*m^3 -> Pa*mum^3}'

[Mesh]
[generated]
type = GeneratedMeshGenerator
dim = 1
nx = '${num_node}'
xmax = '${slab_thickness}'
[]
[]

[Problem]
type = ReferenceResidualProblem
reference_vector = 'ref'
extra_tag_vectors = 'ref'
[]

[Kernels]
# Gas flow kernels
# Equation for D2 in enclosure upstream
[timeDerivative_upstream_D2]
type = ADTimeDerivative
variable = D2_pressure_upstream
extra_vector_tags = 'ref'
[]
[MatReaction_upstream_D2_influx_5]
type = ADMatReaction
variable = D2_pressure_upstream
v = 'D2_pressure_enclosure5'
reaction_rate = ${flow_rate_by_V}
extra_vector_tags = 'ref'
[]
[MatReaction_upstream_D2_influx_1]
type = ADMatReaction
variable = D2_pressure_upstream
v = 'D2_pressure_enclosure1'
reaction_rate = ${flow_rate_by_V}
extra_vector_tags = 'ref'
[]
[MatReaction_upstream_D2_outflux_4]
type = ADMatReaction
variable = D2_pressure_upstream
v = 'D2_pressure_upstream'
reaction_rate = -${flow_rate_by_V}
extra_vector_tags = 'ref'
[]
# Equation for enclosure downstream
[timeDerivative_D2_downstream]
type = ADTimeDerivative
variable = D2_pressure_downstream
extra_vector_tags = 'ref'
[]
[MatReaction_downstream_D2_influx_1]
type = ADMatReaction
variable = D2_pressure_downstream
v = 'D2_pressure_enclosure1'
reaction_rate = ${flow_rate_by_V}
extra_vector_tags = 'ref'
[]
[MatReaction_downstream_D2_outflux_4]
type = ADMatReaction
variable = D2_pressure_downstream
v = 'D2_pressure_downstream'
reaction_rate = -${flow_rate_by_V}
extra_vector_tags = 'ref'
[]

# Diffusion kernels
[timeDerivative_diffusion_D]
type = ADTimeDerivative
variable = D_concentration
extra_vector_tags = 'ref'
[]
[MatDiffusion_diffusion_D]
type = ADMatDiffusion
variable = D_concentration
diffusivity = diffusivity_D
extra_vector_tags = 'ref'
[]
[]

[Materials]
[diffusivity_D]
type = ADParsedMaterial
property_name = 'diffusivity_D'
expression = '${diffusivity_pre_D} * exp( - ${diffusivity_energy_D} / ${R} / ${temperature})'
[]
[]

[Postprocessors]
# Pressure
[pressure_upstream_D2]
type = SideAverageValue
variable = D2_pressure_upstream
boundary = right
[]
[pressure_downstream_D2]
type = SideAverageValue
variable = D2_pressure_downstream
boundary = left
[]
# Flux
[flux_surface_right_D]
type = SideDiffusiveFluxIntegral
variable = D_concentration
diffusivity = diffusivity_D_nonAD
boundary = 'right'
execute_on = 'initial timestep_end'
outputs = 'console csv exodus'
[]
[flux_surface_left_D]
type = SideDiffusiveFluxIntegral
variable = D_concentration
diffusivity = diffusivity_D_nonAD
boundary = 'left'
execute_on = 'initial timestep_end'
outputs = 'console csv exodus'
[]
[]

[Debug]
show_var_residual_norms = true
[]

[Preconditioning]
[smp]
type = SMP
full = true
[]
[]

[Executioner]
type = Transient
scheme = bdf2
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
automatic_scaling = true
compute_scaling_once = true
line_search = none
nl_rel_tol = 1e-10
nl_abs_tol = 1e-10
dtmax = 5
end_time = ${simulation_time}
nl_max_its = 15
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.01
optimal_iterations = 12
iteration_window = 1
growth_factor = 1.1
cutback_factor = 0.9
cutback_factor_at_failure = 0.9
[]
[]

[Outputs]
file_base = ${file_name}
exodus = true
perf_graph = true
[csv]
type = CSV
execute_on = 'initial timestep_end'
[]
[]
Loading