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 2 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
simopier marked this conversation as resolved.
Show resolved Hide resolved
simopier marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 2 additions & 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,8 @@ 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)
| 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
14 changes: 9 additions & 5 deletions doc/content/verification_and_validation/ver-1ka.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,25 @@

## 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.
This problem involves two enclosures connected by a diffusive membrane that follows Sieverts law for diffusion. Both enclosures contain hydrogen (H$_2$), tritium (T$_2$), and tritium gas (HT). In the first enclosure, there is an initial inventory of only hydrogen (H$_2$) along with a constant volumetric source rate of tritium (T$_2$). The second enclosure starts out empty.

## 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:
The rise in pressure of T$_2$ molecules in the first enclosure can be monitored by not enabling T$_2$ molecules to traverse the membrane between the two enclosures (no tritium flux). Consequently, the rate of pressure increase in the first enclosure can be expressed as:

\begin{equation}
lkadz marked this conversation as resolved.
Show resolved Hide resolved
\frac{dP_{T_2}}{dt} = \frac{S}{V} kT
\frac{dP_{T_2}}{dt} = \frac{S}{V} kT,
\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.
where $S$ represents the volumetric T$_2$ 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
In this case, $S$ is set to 10$^{20}$ molecules/m$^{-3}$/s, $V = 1$ m$^3$, and the temperature of the enclosure is constant at $T = 500$ K.

## Results
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.
[ver-1ka_comparison_time] as a function of time. The TMAP8 code predictions match very well with the analytical solution with a root mean squared percentage error of RMSPE $= xxxxx$ %.
simopier marked this conversation as resolved.
Show resolved Hide resolved

!media comparison_ver-1ka.py
lkadz marked this conversation as resolved.
Show resolved Hide resolved
image_name=ver-1ka_comparison_time.png
Expand Down
6 changes: 3 additions & 3 deletions test/tests/ver-1ka/comparison_ver-1ka.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
csv_folder = "./gold/ver-1ka_out.csv"
expt_data = pd.read_csv(csv_folder)
TMAP8_time = expt_data['time']
TMAP8_pres = expt_data['v']
TMAP8_pressure = expt_data['v']
lkadz marked this conversation as resolved.
Show resolved Hide resolved

# Calculate the theoretical expression for pressure
analytical_pressure = (S / V) * kb * T * TMAP8_time
Expand All @@ -31,12 +31,12 @@
ax = fig.add_subplot(gs[0])

# Plot the experimental data
ax.plot(TMAP8_time/3600, TMAP8_pres, linestyle='-', color='magenta', label='TMAP8', linewidth=3)
ax.plot(TMAP8_time/3600, TMAP8_pressure, linestyle='-', color='magenta', label='TMAP8', linewidth=3)

# Plot the selected theoretical data
ax.plot(TMAP8_time/3600, analytical_pressure, marker='+', linestyle='', color='black', label=r"theory", markersize=10)

RMSE_pressure = np.linalg.norm(TMAP8_pres-analytical_pressure)
RMSE_pressure = np.linalg.norm(TMAP8_pressure-analytical_pressure)
err_percent_pressure = RMSE_pressure*100/np.mean(analytical_pressure)

# Add text annotation for RMSPE on the plot
Expand Down
11 changes: 9 additions & 2 deletions test/tests/ver-1ka/tests
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@
design = 'ODETimeDerivative.md ParsedODEKernel.md'
issues = '#12'
verification = 'ver-1ka.md'
[csv]
[ver-1ka_csv]
type = CSVDiff
input = ver-1ka.i
csvdiff = ver-1ka_out.csv
requirement = 'The system shall be able to model the tritium volumetric source in one enclosure'
requirement = 'The system shall be able to model a tritium volumetric source in one enclosure'
[]
[ver-1ka_comparison]
type = RunCommand
command = 'python3 comparison_ver-1ka.py'
requirement = 'The system shall be able to generate comparison plots between the analytical solution and simulated solution of verification case 1ka, modeling a tritium volumetric source in one enclosure.'
prereq = ver-1ka_csv
lkadz marked this conversation as resolved.
Show resolved Hide resolved
required_python_packages = 'matplotlib numpy pandas os git'
[]
[]
lkadz marked this conversation as resolved.
Show resolved Hide resolved