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

Ver 1ka #183

Merged
merged 24 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion doc/content/verification_and_validation/index.md
simopier marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ TMAP8 also contains [example cases](examples/tmap_index.md), which showcase how
| ver-1ha | [Convective Gas Outflow Problem](ver-1ha.md) |
| ver-1ja | [Radioactive Decay of Mobile Tritium in a Slab](ver-1ja.md) |
| ver-1jb | [Radioactive Decay of Mobile Tritium in a Slab with a Distributed Trap Concentration](ver-1jb.md) |

| ver-1ka | [Simple Volumetric Source](ver-1ka.md)
lkadz marked this conversation as resolved.
Show resolved Hide resolved

# List of benchmarking cases

Expand Down
33 changes: 33 additions & 0 deletions doc/content/verification_and_validation/ver-1ka.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# ver-1ka

# Simple Volumetric Source

## General Case Description

This problem involves two enclosures connected by a diffusive membrane that follows Sieverts law for diffusion. Both enclosures contain hydrogen (H$_2$), deuterium (T$_2$), and hydrogen deuteride (HT). In the first enclosure, there is an initial inventory of only hydrogen (H$_2$) along with a constant volumetric source rate of deuterium (T$_2$). The second enclosure starts out empty.
lkadz marked this conversation as resolved.
Show resolved Hide resolved

## Case Set up
lkadz marked this conversation as resolved.
Show resolved Hide resolved

This verification problem is taken from [!cite](longhurst1992verification).
lkadz marked this conversation as resolved.
Show resolved Hide resolved
The rise in pressure of T$_2$ molecules in the first enclosure can be monitored by using a non-flow type membrane between the two enclosures. Consequently, the rate of pressure increase can be expressed as:
lkadz marked this conversation as resolved.
Show resolved Hide resolved

\begin{equation}
lkadz marked this conversation as resolved.
Show resolved Hide resolved
\frac{dP_{T_2}}{dt} = \frac{S}{V} kT
lkadz marked this conversation as resolved.
Show resolved Hide resolved
\end{equation}

where $S$ represents the volumetric source rate, $V$ is the volume of the enclosure, $k$ is the Boltzmann constant, and $T$ is the temperature of the enclosure.
lkadz marked this conversation as resolved.
Show resolved Hide resolved

lkadz marked this conversation as resolved.
Show resolved Hide resolved
Comparison of the TMAP8 results and the analytical solution is shown in
lkadz marked this conversation as resolved.
Show resolved Hide resolved
[ver-1ka_comparison_time] as a function of time. The TMAP8 code predictions match very well with the analytical solution.
lkadz marked this conversation as resolved.
Show resolved Hide resolved

!media figures/ver-1ka_comparison_time.png
style=width:50%;margin-bottom:2%
id=ver-1ka_comparison_time
caption=Comparison of T$_2$ partial pressure in an enclosure with no loss pathways as function of time calculated through TMAP8 and analytically
simopier marked this conversation as resolved.
Show resolved Hide resolved

## Input files

!style halign=left
The input file for this case can be found at [/ver-1ka.i], which is also used as tests in TMAP8 at [/ver-1ka/tests].

!bibtex bibliography
27 changes: 27 additions & 0 deletions test/tests/ver-1ka/comparison_ver-1ka.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import numpy as np
lkadz marked this conversation as resolved.
Show resolved Hide resolved
import pandas as pd
import matplotlib.pyplot as plt

df = pd.read_csv('./gold/ver-1ka_out.csv')

S = 1e20 # m^-3 * s^-1
V = 1 # m^3
kb = 1.380649e-23 # Boltzmann constant (J/K)
T = 500 # K

t_csv = df['time']
v = df['v']
t = np.arange(0, 10801, 540)

expression = (S / V) * kb * T * t

plt.plot(t_csv/3600, v, linestyle='-', color='magenta', label='TMAP8', linewidth=3)
plt.plot(t/3600, expression, marker='+', linestyle='', color='black', label=r"theory", markersize=10)

plt.gca().yaxis.set_major_formatter(plt.FuncFormatter(lambda val, pos: '{:.1e}'.format(val)))

plt.xlabel('Time (hr)')
plt.ylabel('Pressure (Pa)')
plt.legend()
plt.grid(True)
plt.savefig('ver-1ka_comparison_time.png', bbox_inches='tight')
Loading