Skip to content

Commit

Permalink
improve convergence and clean up:
Browse files Browse the repository at this point in the history
- use AD to improve convergence
- tighten tolerances
- increase max time step to reduce computational time
- remove heavy tests since the test now runs in less than 3 seconds
- update documentation
- regold
  • Loading branch information
simopier committed Oct 28, 2024
1 parent f61dc23 commit fe118d5
Show file tree
Hide file tree
Showing 8 changed files with 1,622 additions and 35,499 deletions.
14 changes: 7 additions & 7 deletions doc/content/verification_and_validation/val-2a.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ where $C$ is the concentration of deuterium in PCA, $t$ is the time, $D$ is the
Second, the deuterium recombines into gas on both sides of the PCA sample. By assuming that the recombination process is at steady state (which is not a necessary assumption in TMAP8, but appropriate in this case), it is described as the following surface flux:

\begin{equation} \label{eq:recombination}
J = A (K_r C^2 - K_d P),
J = 2 A (K_r C^2 - K_d P),
\end{equation}

where $J$ is the recombination flux out of the sample sides, $A$ is the area on the upstream or downstream side, $P$ is the pressure on the corresponding side, and $K_r$ and $K_d$ are the recombination and dissociation coefficients, respectively.
where $J$ is the recombination flux out of the sample sides, $A$ is the area on the upstream or downstream side, $P$ is the pressure on the corresponding side, and $K_r$ and $K_d$ are the recombination and dissociation coefficients, respectively. The factor 2 accounts for the fact that 2 deuterium atoms form one D$_2$ molecule.

The objective of this simulation is to determine the permeation flux on the downstream side and match the experimental data published in [!cite](anderl1985tritium) and reproduced in [val-2a_comparison].

Expand All @@ -45,7 +45,7 @@ where $F$ is the implantation flux provided in [val-2a_flux_and_pressure_TMAP4],
The pressures on the upstream and downstream sides are close to vacuum pressures, and have only little impact for the recombination on both sides [!citep](longhurst1992verification,ambrosek2008verification). Thus, TMAP8 ignores the impact of pressure on the boundary conditions to simplify the model. The recombination is described as a simplified version of [eq:recombination]:

\begin{equation} \label{eq:recombination_ignore_Pressure}
J = A K_r C^2.
J = 2 A K_r C^2.
\end{equation}

## Case and Model Parameters
Expand All @@ -65,12 +65,12 @@ The beam flux on the upstream side of the sample during the experiment is presen
!alert warning title=Typo in [!cite](longhurst1992verification)
The times listed in [!cite](longhurst1992verification) for TMAP8 for the starts and ends the beam are not accurate. instead, TMAP8 uses the times directly from [!cite](anderl1985tritium) to better correspond to experimental conditions.

!table id=val-2a_set_up_values_TMAP4 caption=Values of material properties.
!table id=val-2a_set_up_values_TMAP4 caption=Values of material properties. Note that $K_d$ are currently not used in teh input file since the upstream and downstream pressure do not noticeably influence the results.
| Parameter | Description | Value | Units | Reference |
| --------- | ------------------------------------ | ----------------------------------------------------------- | --------------------- | --------------------- |
| $K_{d,l}$ | upstream dissociation coefficient | 8.959 $\times 10^{18} (1-0.9999 \exp(-6 \times 10^{-5} t))$ | at/m$^2$/s/Pa$^{0.5}$ | [!cite](longhurst1992verification) |
| $K_{d,r}$ | downstream dissociation coefficient | 1.7918$\times 10^{15}$ | at/m$^2$/s/Pa$^{0.5}$ | [!cite](longhurst1992verification) |
| $K_{r,l}$ | upstream recombination coefficient | 1$\times 10^{-27} (1-0.9999 \exp(-6 \times 10^{-5} t))$ | m$^4$/at/s | [!cite](longhurst1992verification) |
| $K_{r,l}$ | upstream recombination coefficient | 1$\times 10^{-27} (1-0.9999 \exp(-6 \times 10^{-5} t))$ | m$^4$/at/s | Inspired from [!cite](longhurst1992verification) |
| $K_{r,r}$ | downstream recombination coefficient | 2$\times 10^{-31}$ | m$^4$/at/s | [!cite](anderl1985tritium) |
| $P_{l}$ | upstream pressure | 0 | Pa | [!cite](anderl1985tritium) |
| $P_{r}$ | downstream pressure | 0 | Pa | [!cite](anderl1985tritium) |
Expand All @@ -88,13 +88,13 @@ Both TMAP4 [!citep](longhurst1992verification) and TMAP7 [!citep](ambrosek2008ve

## Results

[val-2a_comparison] shows the comparison of the TMAP8 calculation and the experimental data from [!cite](anderl1985tritium). There is reasonable agreement between the TMAP predictions and the experimental data with a root mean square percentage error of RMSPE = 26.10 %. Note that the agreement could be improved by adjusting the model parameters. It is also possible to perform this optimization with [MOOSE's stochastic tools module](https://mooseframework.inl.gov/modules/stochastic_tools/index.html).
[val-2a_comparison] shows the comparison of the TMAP8 calculation and the experimental data from [!cite](anderl1985tritium). There is reasonable agreement between the TMAP predictions and the experimental data with a root mean square percentage error of RMSPE = 25.95 %. Note that the agreement could be improved by adjusting the model parameters. It is also possible to perform this optimization with [MOOSE's stochastic tools module](https://mooseframework.inl.gov/modules/stochastic_tools/index.html).

!media comparison_val-2a.py
image_name=val-2a_comparison.png
style=width:50%;margin-bottom:2%;margin-left:auto;margin-right:auto
id=val-2a_comparison
caption=Comparison of TMAP8 calculation with the experimental data on the downstream side of the sample. TMAP8 accurately replicate the experimental data.
caption=Comparison of TMAP8 calculation with the experimental data on the downstream side of the sample. TMAP8 accurately replicates the experimental data.

## Input files

Expand Down
6 changes: 3 additions & 3 deletions test/tests/val-2a/comparison_val-2a.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def numerical_solution_on_experiment_input(experiment_input, tmap_input, tmap_ou
gs = gridspec.GridSpec(1, 1)
ax = fig.add_subplot(gs[0])

ax.plot(simulation_time_TMAP4/3600, simulation_recom_flux_right_TMAP4, linestyle='-', label=r"TMAP8", c='tab:brown')
ax.plot(simulation_time_TMAP4/3600, simulation_recom_flux_right_TMAP4, linestyle='-', label=r"TMAP8", c='tab:gray')
ax.plot(experiment_time_TMAP4/3600, experiment_flux_TMAP4, linestyle='--', label=r"experiment", c='k')

ax.set_xlabel(u'time (hr)')
Expand All @@ -68,7 +68,7 @@ def numerical_solution_on_experiment_input(experiment_input, tmap_input, tmap_ou
ax.text(1e4/3600.0,40e15, 'RMSPE = %.2f '%RMSPE+'%',fontweight='bold')
ax.minorticks_on()
ax.ticklabel_format(axis='y', style='sci', scilimits=(15,15))
plt.savefig(f'{TMAP4_file_base}.png', bbox_inches='tight')
plt.savefig(f'{TMAP4_file_base}.png', bbox_inches='tight', dpi=300)
plt.close(fig)


Expand Down Expand Up @@ -98,5 +98,5 @@ def numerical_solution_on_experiment_input(experiment_input, tmap_input, tmap_ou
ax.set_xlim(left=0,right=3e-8)
plt.grid(visible=True, which='major', color='0.65', linestyle='--', alpha=0.3)
ax.minorticks_on()
plt.savefig(f'val-2a_comparison_normal_distribution.png', bbox_inches='tight')
plt.savefig(f'val-2a_comparison_normal_distribution.png', bbox_inches='tight', dpi=300)
plt.close(fig)
Loading

0 comments on commit fe118d5

Please sign in to comment.