forked from idaholab/TMAP8
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Lee
authored and
Lee
committed
Oct 4, 2024
1 parent
422a6fc
commit b669053
Showing
6 changed files
with
108,120 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
||
## Case Set up | ||
|
||
This verification problem is taken from [!cite](longhurst1992verification). | ||
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: | ||
|
||
\begin{equation} | ||
\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. | ||
|
||
Comparison of the TMAP8 results and the analytical solution is shown in | ||
[ver-1ka_comparison_time] as a function of time. The TMAP8 code predictions match very well with the analytical solution. | ||
|
||
!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 | ||
|
||
## 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import numpy as np | ||
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') |
Oops, something went wrong.