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 ver-1kc-2 #231

Merged
merged 25 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from 6 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
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ TMAP8 also contains [example cases](examples/tmap_index.md), which showcase how
| 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-1kb | [Henry’s Law Boundaries with No Volumetric Source](ver-1kb.md) |
| ver-1kc | [Sieverts’ Law Boundaries with No Volumetric Source](ver-1kc.md) |
| ver-1kc-1 | [Sieverts’ Law Boundaries with No Volumetric Source](ver-1kc-1.md) |
| ver-1kc-2 | [Sieverts’ Law Boundaries with Chemical Reaction and No Volumetric Source](ver-1kc-2.md) |

# List of benchmarking cases
Expand Down
71 changes: 59 additions & 12 deletions doc/content/verification_and_validation/ver-1kc-2.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,59 @@
# ver-1kc-2

# Sieverts’ Law Boundaries with No Volumetric Source
# Sieverts’ Law Boundaries with Chemical Reactions and No Volumetric Source

## General Case Description

Two enclosures are separated by a membrane that allows diffusion according to Sieverts' law, with no volumetric source present. Enclosure 2 has twice the volume of Enclosure 1.
Two enclosures are separated by a membrane that allows diffusion according to Sieverts' law and chemical reactions, with no volumetric source present. Enclosure 2 has twice the volume of Enclosure 1.

## Case Set Up

This verification problem is taken from [!cite](ambrosek2008verification).

Unlike the ver-1kc-1 case, which only considers tritium T$_2$, this setup describes a diffusion system in which tritium T$_2$, dihydrogen H$_2$ and tritium hybride HT are modeled across a one-dimensional domain split into two enclosures. The total system length is $2.5 \times 10^{-4}$ m, divided into 100 segments. The system operates at a constant temperature of 500 Kelvin. Initial tritium T$_2$ and dihydrogen H$_2$ pressures are specified as $10^{5}$ Pa for Enclosure 1 and $10^{-10}$ Pa for Enclosure 2. Initially, there is no tritium hybride HT in either enclosures.
Unlike the (ver-1kc-1)[ver-1kc-1.md] case, which only considers tritium T$_2$, this setup describes a diffusion system in which tritium T$_2$, dihydrogen H$_2$ and HT are modeled across a one-dimensional domain split into two enclosures. The total system length is $2.5 \times 10^{-4}$ m, divided into 100 segments. The system operates at a constant temperature of 500 Kelvin. Initial tritium T$_2$ and dihydrogen H$_2$ pressures are specified as $10^{5}$ Pa for Enclosure 1 and $10^{-10}$ Pa for Enclosure 2. Initially, there is no HT in either enclosure.

The reaction between the species is described as follows

\begin{equation}
\text{H}_2 + \text{T}_2 \leftrightarrow 2\text{HT}
\end{equation}

The kinematic evolutions of the species are given by the following equations

\begin{equation}
\frac{d C_{\text{HT}}}{dt} = 2K_1 C_{\text{H}_2} C_{\text{T}_2} - K_2 C_{\text{HT}}^2
\end{equation}

\begin{equation}
\frac{d C_{\text{H}_2}}{dt} = -K_1 C_{\text{H}_2} C_{\text{T}_2} + \frac{1}{2} K_2 C_{\text{HT}}^2
\end{equation}

\begin{equation}
\frac{d C_{\text{T}_2}}{dt} = -K_1 c_{\text{H}_2} C_{\text{T}_2} + \frac{1}{2} K_2 C_{\text{HT}}^2
\end{equation}

where $K_1$ and $K_2$ represent the reaction rates for the forward and reverse reactions, respectively.

At equilibrium, the time derivatives are zero

\begin{equation}
2K_1 C_{\text{H}_2} C_{\text{T}_2} - K_2 C_{\text{HT}}^2 = 0
\end{equation}

From this, we deduce

\begin{equation}
P_{\text{HT}} = \eta \sqrt{P_{\text{H}_2} P_{\text{T}_2}}
\end{equation}

where the equilibrium constant $\eta$ is defined as

\begin{equation}
\eta = \sqrt{\frac{2K_1}{K_2}}
\end{equation}

Similarly to TMAP7, the equilibrium constant $\eta$ has been set to a fixed value of $\eta = 2$.

The diffusion process for each species in the two enclosures can be expressed by

\begin{equation}
Expand All @@ -29,8 +65,8 @@ and
\end{equation}

where $C_1$ and $C_2$ represent the concentration fields in enclosures 1 and 2 respectively, $t$ is the time, and $D$ denotes the diffusivity.
Note that the diffusivity may vary across different species and enclosures. However, in this case, it is assumed to be identical for all.

This case is similar to the [ver-1kb](ver-1kb.md) case, with the key difference being that sorption here follows Sieverts' law instead of Henry's law.
The concentration in Enclosure 1 is related to the partial pressure and concentration in Enclosure 2 via the interface sorption law:

\begin{equation}
Expand All @@ -41,44 +77,55 @@ where $R$ is the ideal gas constant in J/mol/K, $T$ is the temperature in K, $K$

## Results

We assume that $K = \frac{10}{\sqrt{RT}}$, which is expected to result in $C_1 = 10 \sqrt{C_2}$ at equilibrium.
As illustrated in [ver-1kc-2_comparison_time_k10], similarly to ver-1kc-1, T$_2$ and H$_2$ pressures reach equilibrium in both enclosures. What is new, however, is that HT is produced in both enclosures following the sorption law. The concentration ratios for T$_2$, H$_2$, and HT between enclosures 1 and 2, shown in [ver-1kc-2_concentration_ratio_T2_k10], [ver-1kc-2_concentration_ratio_H2_k10], and [ver-1kc-2_concentration_ratio_HT_k10], demonstrate that the results obtained with TMAP8 are consistent with the analytical results derived from the sorption law for $K \sqrt{RT} = 10$.
We assume that $K = 10/\sqrt{RT}$, which is expected to result in $C_1 = 10 \sqrt{C_2}$ at equilibrium.
As illustrated in [ver-1kc-2_comparison_time_k10], similarly to ver-1kc-1, T$_2$ and H$_2$ pressures reach equilibrium in both enclosures. What is new, however, is that HT is produced in both enclosures following the sorption law.

Thus, it is crucial to ensure that the chemical equilibrium between HT, T$_2$ and H$_2$ is achieved. This can be verified in both enclosures by examining the ratio between $P_{\text{HT}}$ and $\sqrt{P_{\text{H}_2} P_{\text{T}_2}}$, which must equal $\eta=2$.
As shown in [ver-1kc-2_equilibrium_constant_k10], this ratio approaches $\eta=2$ for both enclosures, as observed in TMAP7. However, achieving this balance involves a compromise. On one hand, $K_1$ must be sufficiently large to ensure that the chemical kinetics in Enclosure 1 are significantly faster than other processes, such as diffusion and surface sorption. On the other hand, $K_2$ should not be excessively large, as this could hinder the diffusion of species into Enclosure 2, where no species are initially present.

The concentration ratios for T$_2$, H$_2$, and HT between enclosures 1 and 2, shown in [ver-1kc-2_concentration_ratio_T2_k10], [ver-1kc-2_concentration_ratio_H2_k10], and [ver-1kc-2_concentration_ratio_HT_k10], demonstrate that the results obtained with TMAP8 are consistent with the analytical results derived from the sorption law for $K \sqrt{RT} = 10$.

As shown in [ver-1kc-2_mass_conservation_k10], mass is conserved between the two enclosures over time for all species. The variation in mass is only $0.4$ % for T$_2$ and H$_2$. This variation in mass can be further minimized by refining the mesh, i.e., increasing the number of segments in the domain.

!media comparison_ver-1kc-2.py
image_name=ver-1kc-2_comparison_time_k10.png
style=width:50%;margin-bottom:2%;margin-left:auto;margin-right:auto
id=ver-1kc-2_comparison_time_k10
caption=Evolution of species concentration over time governed by Sieverts' law with $K = \frac{10}{\sqrt{RT}}$.
caption=Evolution of species concentration over time governed by Sieverts' law with $K = 10/\sqrt{RT}$.

!media comparison_ver-1kc-2.py
image_name=ver-1kc-2_equilibrium_constant_k10.png
style=width:50%;margin-bottom:2%;margin-left:auto;margin-right:auto
id=ver-1kc-2_equilibrium_constant_k10
caption=Equilibrium constant as a function of time.

!media comparison_ver-1kc-2.py
image_name=ver-1kc-2_concentration_ratio_T2_k10.png
style=width:50%;margin-bottom:2%;margin-left:auto;margin-right:auto
id=ver-1kc-2_concentration_ratio_T2_k10
caption=Tritium concentrations ratio between enclosures 1 and 2 at the interface for $K = \frac{10}{\sqrt{RT}}$. This verifies TMAP8's ability to apply Sieverts' law across the interface.
caption=T$_2$ concentration ratio between enclosures 1 and 2 at the interface for $K = 10/\sqrt{RT}$. This verifies TMAP8's ability to apply Sieverts' law across the interface.

!media comparison_ver-1kc-2.py
image_name=ver-1kc-2_concentration_ratio_H2_k10.png
style=width:50%;margin-bottom:2%;margin-left:auto;margin-right:auto
id=ver-1kc-2_concentration_ratio_H2_k10
caption=Dihydrogen concentrations ratio between enclosures 1 and 2 at the interface for $K = \frac{10}{\sqrt{RT}}$. This verifies TMAP8's ability to apply Sieverts' law across the interface.
caption=H$_2$ concentration ratio between enclosures 1 and 2 at the interface for $K = 10/\sqrt{RT}$. This verifies TMAP8's ability to apply Sieverts' law across the interface.

!media comparison_ver-1kc-2.py
image_name=ver-1kc-2_concentration_ratio_HT_k10.png
style=width:50%;margin-bottom:2%;margin-left:auto;margin-right:auto
id=ver-1kc-2_concentration_ratio_HT_k10
caption=Tritium hybride concentrations ratio between enclosures 1 and 2 at the interface for $K = \frac{10}{\sqrt{RT}}$. This verifies TMAP8's ability to apply Sieverts' law across the interface.
caption=HT concentration ratio between enclosures 1 and 2 at the interface for $K = 10/\sqrt{RT}$. This verifies TMAP8's ability to apply Sieverts' law across the interface.

!media comparison_ver-1kc-2.py
image_name=ver-1kc-2_mass_conservation_k10.png
style=width:50%;margin-bottom:2%;margin-left:auto;margin-right:auto
id=ver-1kc-2_mass_conservation_k10
caption=Total mass conservation across both enclosures over time for $K = \frac{10}{\sqrt{RT}}$.
caption=Total mass conservation across both enclosures over time for $K = 10/\sqrt{RT}$.

## Input files

!style halign=left
The input file for this case can be found at [/ver-1kc-2.i]. To limit the computational costs of the test cases, the tests run a version of the file with a coarser mesh and less number of time steps. More information about the changes can be found in the test specification file for this case [/ver-1kc-2/tests].
The input file for this case can be found at [/ver-1kc-2.i].

!bibtex bibliography
7 changes: 4 additions & 3 deletions test/tests/ver-1kc-2/comparison_ver-1kc-2.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,11 @@
gs = gridspec.GridSpec(1,1)
ax = fig.add_subplot(gs[0])

ax.plot(TMAP8_time_k10, equilibrium_constant_encl_1, label = r"Equilibrium constant in Enclosure 1", c='tab:blue')
ax.plot(TMAP8_time_k10, equilibrium_constant_encl_2, label = r"Equilibrium constant in Enclosure 2", c='tab:red', linestyle='--')
ax.plot(TMAP8_time_k10, equilibrium_constant_encl_1, label = r"Enclosure 1", c='tab:blue')
ax.plot(TMAP8_time_k10, equilibrium_constant_encl_2, label = r"Enclosure 2", c='tab:red')
ax.axhline(y=2, color='tab:green', linestyle='--', label='TMAP7 Equilibrium Constant')
ax.set_xlabel('Time (s)')
ax.set_ylabel(r"Equilibrium constant in Enclosure 1")
ax.set_ylabel(r"Equilibrium constant $P_{\text{HT}} / \sqrt{P_{\text{H}_2} P_{\text{T}_2}}$")
ax.legend(loc="best")
ax.grid(which='major', color='0.65', linestyle='--', alpha=0.3)
fig.savefig('ver-1kc-2_equilibrium_constant_k10.png', bbox_inches='tight', dpi=300)
Expand Down
Loading