-
Notifications
You must be signed in to change notification settings - Fork 47
Extended PCT capabilities to low pressure for YHx #292
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
base: devel
Are you sure you want to change the base?
Changes from all commits
ad10b9e
d219b0b
1fbdeba
0bf9b0e
5f2c08c
c987485
c742ba4
df0f78a
1dbb767
5c206cf
6cba918
1ab734d
ada6136
708e9de
dd222da
44ce762
2720935
10fd3ac
cfe19eb
3e4a9db
11e7392
4e2ae1c
b9cdfc5
e3518e0
0805b48
2e14281
ee008c5
b6b7a6f
9aebb1a
ec4b29b
33a21f6
b1bda8f
a1e8185
d5f50c9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,31 +4,59 @@ | |||||||||||
|
|
||||||||||||
| ## Description | ||||||||||||
|
|
||||||||||||
| The composition of metal hydrides like yttrium hydride (YHx) is described by pressure-composition-temperature (PCT) data. | ||||||||||||
| The composition of metal hydrides like yttrium hydride (YH$_{x}$) is described by pressure-composition-temperature (PCT) data. | ||||||||||||
| In TMAP8, the PCT curve can be imposed by an interface kernel that then dictates the material composition. | ||||||||||||
| Hence, the `ADMatInterfaceReactionYHxPCT` interface kernel imposes the surface concentration of H in YHx based on the input pressure (Pa) and temperature (K). `ADMatInterfaceReactionYHxPCT` is related to [ADMatInterfaceReaction.md], but includes the YHx PCT curves. | ||||||||||||
| Hence, the `ADMatInterfaceReactionYHxPCT` interface kernel imposes the surface concentration of H in YH$_{x}$ based on the input pressure (Pa) and temperature (K). `ADMatInterfaceReactionYHxPCT` is related to [ADMatInterfaceReaction.md], but includes the YH$_{x}$ PCT curves. | ||||||||||||
| At the interface between a solid (main) and a gas (neighbor), it imposes: | ||||||||||||
| \begin{equation} \label{eq:test_interfacereactionYHxPCT} | ||||||||||||
| \frac{d C_s}{dt} = 0 = K_b f_{at}(T,P) \rho - K_f C_s , | ||||||||||||
| \frac{d C_s}{dt} = 0 = K_b f_{at}(T,P) \rho - K_f C_s, | ||||||||||||
| \end{equation} | ||||||||||||
| where $C_s$ is the surface H concentration in mol/m$^3$, | ||||||||||||
| $K_b$ and $K_f$ are the backward and forward surface reaction rate in 1/s, respectively, | ||||||||||||
| $f_{at}(T,P)$ is the composition in atomic fraction of H in YHx given a gas temperature $T$ and gas pressure $P$, | ||||||||||||
| and $\rho$ is the yttrium atomic density in mol/m$^3$. | ||||||||||||
| $f_{at}(T,P)$ is the composition in atomic fraction of H in YH$_{x}$ given a gas temperature $T$ and gas pressure $P$, | ||||||||||||
| and $\rho$ is the yttrium molar density in mol/m$^3$. | ||||||||||||
|
|
||||||||||||
| [YHx_PCT_fit_2D] shows the data used in this interface kernel along with TMAP8 simulation results and analytical fits. The experimental data originates from [!cite](Lundin_1962). | ||||||||||||
|
|
||||||||||||
| [YHx_PCT_fit_2D] shows the data used in this interface kernel. The experimental data originates from [!cite](Lundin_1962), and the fit is from [!cite](Matthews2021SWIFT). | ||||||||||||
|
|
||||||||||||
| !media comparison_YHx_PCT.py | ||||||||||||
| image_name=YHx_PCT_fit_2D.png | ||||||||||||
| style=width:80%;margin-bottom:2%;margin-left:auto;margin-right:auto | ||||||||||||
| id=YHx_PCT_fit_2D | ||||||||||||
| caption=PCT data for YHx from [!cite](Lundin_1962) with fits from [!cite](Matthews2021SWIFT) implemented in TMAP8, and test results. | ||||||||||||
| caption=PCT data for YH$_{x}$ sampled from [!cite](Lundin_1962) with TMAP8 simulation results and analytical fits. | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| To incorporate the entire PCT curve in TMAP8, the curve was divided into three regions: the low-pressure (LP) region, the plateau region (PR), and the high-pressure (HP) region. The fitting procedures and the modeling approach for each region are described below. | ||||||||||||
|
|
||||||||||||
| \begin{equation}\label{eq:atomic_fraction_HP} | ||||||||||||
| f_{at,LP}(T,P) = f_{at,max,LP}(T)-10\left[1 \times 10^{-3}+\exp(-50.0 + 5.73 \times 10^{-2} T + ( 8.30 \times 10^{-1} - 2.69 \times 10^{-3} T) (\log\left(P_{lim}(T) - P \right)))\right]^{-1}, | ||||||||||||
| \end{equation} | ||||||||||||
|
|
||||||||||||
| \begin{equation}\label{eq:atomic_fraction_PR} | ||||||||||||
| f_{at,PR}(T,P) = 1.33 - 2.18 \times 10^{-4}, T | ||||||||||||
| \left( 10.6 - 4.35 \times 10^{-3}, T \right) | ||||||||||||
| \log\left( \frac{P}{\gamma P_{\text{lim}}} \right), | ||||||||||||
| \end{equation} | ||||||||||||
| and | ||||||||||||
| \begin{equation}\label{eq:atomic_fraction_LP} | ||||||||||||
| f_{at,HP}(T,P) = 2.00-1.0015\left[f_{at,min,HP}(T)+\exp(24.89 - 2.53 \times 10^{-2} T + ( -3.98 \times 10^{-1} + 1.00 \times 10^{-3} T) (\log\left(P - P_{lim}(T)\right)))\right]^{-1} | ||||||||||||
| \end{equation} | ||||||||||||
|
|
||||||||||||
| where $\gamma$ is a tolerance factor set to 1.15. While ${f_{max,LP}(T)}$ and ${f_{min,HP}(T)}$ represents maximum and miniumum atomic ratio per temperature in the low pressure and high high region, respectively. These formulas are expressed as: | ||||||||||||
|
|
||||||||||||
| The plateau representing phase transition is captured as [!citep](Matthews2021SWIFT): | ||||||||||||
| \begin{equation}\label{eq:atomic_fraction_LP_Max} | ||||||||||||
| f_{at,max,LP}(T)=1.01\times10^{-6}T^{2}-2.56\times10^{-3}T+2.16 | ||||||||||||
| \end{equation} | ||||||||||||
| and | ||||||||||||
| \begin{equation}\label{eq:atomic_fraction_HP_Min} | ||||||||||||
| f_{at,min,HP}(T)=-1.01\times10^{-6}T^{2}+2.55\times10^{-3}T-5.61\times10^{-1}. | ||||||||||||
| \end{equation} | ||||||||||||
|
|
||||||||||||
| The plateau ($P_{lim}$) representing phase transition is captured as [!citep](Matthews2021SWIFT): | ||||||||||||
| \begin{equation} \label{eq:pressure_plateau} | ||||||||||||
| P_{lim} = \exp\left(-26.1+3.88 \times 10^{-2} T - 9.7 \times 10^{-6} T^2 \right), | ||||||||||||
| P_{lim} = \exp\left(-26.1+3.88 \times 10^{-2} T - 9.7 \times 10^{-6} T^2 \right). | ||||||||||||
| \end{equation} | ||||||||||||
| with $P_{lim}$ being the hydrogen partial pressure limit delineating the plateau in Pa and $T$ being the temperature in K. | ||||||||||||
|
|
||||||||||||
| This fit is shown in [YHx_PCT_plateau_pressure_fit]. | ||||||||||||
|
|
||||||||||||
| !media comparison_YHx_PCT.py | ||||||||||||
|
|
@@ -37,16 +65,37 @@ This fit is shown in [YHx_PCT_plateau_pressure_fit]. | |||||||||||
| id=YHx_PCT_plateau_pressure_fit | ||||||||||||
| caption=Fit phase transition region as pressure as a function of temperature. | ||||||||||||
|
|
||||||||||||
| The model currently only captures the high pressure region of the data, i.e., for pressure and temperatures above the plateau. | ||||||||||||
| In this region, the atomic fraction $f_{at}$ is determined as [!citep](Matthews2021SWIFT): | ||||||||||||
| \begin{equation} \label{eq:atomic_fraction} | ||||||||||||
| f_{at}(T,P) = 2-\left[1+\exp(21.6 -0.0225 T + (-0.0445 + 7.18 \times 10^{-4} T) (\log\left(P - P_{lim}(T)\right)))\right]^{-1}, | ||||||||||||
| These fits are applied within the following conditional statement for entire PCT modelling capabilities | ||||||||||||
|
|
||||||||||||
| \begin{equation} | ||||||||||||
| \text{If} \left (\frac{P}{P_{\text{lim}}}\right) > 1.15: | ||||||||||||
| \quad f_{at,HP}(T,P) | ||||||||||||
| \end{equation} | ||||||||||||
|
Anthony-Bowers08 marked this conversation as resolved.
|
||||||||||||
|
|
||||||||||||
| \begin{equation} | ||||||||||||
| \text{Else-if} \left (\frac{P}{P_{\text{lim}}}\right) <1.05: | ||||||||||||
| \quad f_{at,LP}(T,P) | ||||||||||||
| \end{equation} | ||||||||||||
|
|
||||||||||||
| \begin{equation} | ||||||||||||
| \text{Else: } | ||||||||||||
| \quad f_{at,PR}(T,P). | ||||||||||||
| \end{equation} | ||||||||||||
| where $P$ is the hydrogen partial pressure in Pa. This fit is plotted in [YHx_PCT_fit_2D]. | ||||||||||||
|
|
||||||||||||
| The [!param](/InterfaceKernels/ADMatInterfaceReactionYHxPCT/silence_warnings) option can be used to dictate how TMAP8 reacts when the pressure gets out of bounds. | ||||||||||||
| If `silence_warnings = false`, which is the default behavior, then TMAP8 will print a warning stating that the pressure and temperature are outside the bounds of the atomic fraction correlation. | ||||||||||||
| If `silence_warnings = true`, then TMAP8 will let the simulation continue without issuing any warnings. | ||||||||||||
| The validity of this present fit is between: | ||||||||||||
| \begin{equation} \label{eq:bounds} | ||||||||||||
| 100 < P\,\text{[Pa]} < 10^{5} | ||||||||||||
| \end{equation} | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| The ${f_{at,max,LP}(T)}$ and ${f_{at,min,HP}(T)}$ are quadratic fits that were verified by plotting the fit against the PCT data shown in the figure below. Evidently,the ${f_{at,min,HP}(T)}$ suffer slight losses due to non-symmetry of plateau region. Nonetheless, the fits are suitable for modelling purposes. | ||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also, what do you mean by |
||||||||||||
|
|
||||||||||||
| !media comparison_YHx_PCT.py | ||||||||||||
| image_name=YHx_PCT_Plateau_EndPoints_comparison.png | ||||||||||||
| style=width:80%;margin-bottom:2%;margin-left:auto;margin-right:auto | ||||||||||||
| id=YHx_PCT_Plateau_EndPoints_comparison | ||||||||||||
| caption=Boundary of atomic ratio fit vs. PCT data from [!cite](Lundin_1962). | ||||||||||||
|
|
||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
|
|
||||||||||||
| ## Test | ||||||||||||
|
|
||||||||||||
|
|
@@ -57,9 +106,36 @@ To model the interface, the input file employs the [InterfaceDiffusion.md] objec | |||||||||||
| \begin{equation} \label{eq:test_interfacereaction} | ||||||||||||
| \frac{d C_s}{dt} = 0 = K (f_{at}(T,P) \rho - C_s), | ||||||||||||
| \end{equation} | ||||||||||||
| where $\rho$ is the yttrium atomic density. | ||||||||||||
|
|
||||||||||||
| The results of the test for ($T$, $P$) = (1173.15 K, $1 \times 10^{3}$ Pa), (1173.15 K, $1 \times 10^{4}$ Pa), (1173.15 K, $5 \times 10^{4}$ Pa), and(1473.15 K, $5 \times 10^{4}$ Pa) are shown in [YHx_PCT_fit_2D] and show good agreement with [eq:atomic_fraction]. | ||||||||||||
|
|
||||||||||||
| The results of the high pressure test for ($T$, $P$) = (1173.15 K, $1 \times 10^{3}$ Pa), (1173.15 K, $1 \times 10^{4}$ Pa), (1173.15 K, $5 \times 10^{4}$ Pa), and(1273.15 K, $3 \times 10^{3}$ Pa), | ||||||||||||
| and the results for the the low pressure test for ($T$, $P$) =(1273.15 K, $3 \times 10^{2}$ Pa), (1473.15 K, $3 \times 10^{3}$ Pa), (1573.15 K, $6 \times 10^{2}$ Pa) and (1573.15 K, $6 \times 10^{2}$ Pa) | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| The [YHx_PCT_fit_2D] figure compares the analytical fits, the independent low‑pressure model, and the independent high‑pressure model against the experimental data. Overall, the analytical fits show reasonable agreement with the measurements, yielding average root‑mean‑square errors of 0.19 for the low‑pressure region and 0.04 for the high‑pressure region. The low‑pressure fit, however, exhibits noticeable deviations near the tail ends of the dataset. This behavior is likely influenced by clusters of data points at higher temperatures, which can lead to poorer fitting performance. In contrast, the independent low‑ and high‑pressure TMAP8 simulations align well with the analytical trends, demonstrating consistency between the analytical approach and the model-based predictions. | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| ### Overall PCT testing | ||||||||||||
|
|
||||||||||||
| [!file](/YHx_PCT.i) also tests the entire PCT modelling curves in TMAP8. The simulation follows the same structure as before, but has an arbitrarily high diffusion value to acheive steady-state quickly. The model also includes a linear pressure increase to cover the entire PCT curve. The [YHx_PCT_fit_2D] shows the PCT fit against the experimental data. Evidently, the fit exhibits moderate error, but the deviations remain within an acceptable range for modeling purposes | ||||||||||||
|
|
||||||||||||
| \begin{equation} | ||||||||||||
| P = P_{\text{initial}} + t \frac{P_{\text{max}} - P_{\text{initial}}}{t_{\text{end}}}. | ||||||||||||
| \end{equation} | ||||||||||||
|
|
||||||||||||
| The testing conditions include | ||||||||||||
| ($T$, $P_{initial}$) = (1173.15 K, $2 \times 10^{2}$ Pa), | ||||||||||||
| (1223.15 K, $2 \times 10^{2}$ Pa), | ||||||||||||
| (1273.15 K, $2 \times 10^{2}$ Pa), | ||||||||||||
| (1323.15 K, $2 \times 10^{2}$ Pa), | ||||||||||||
| (1373.15 K, $2 \times 10^{2}$ Pa), | ||||||||||||
| (1423.15 K, $2 \times 10^{2}$ Pa), | ||||||||||||
| (1473.15 K, $2 \times 10^{2}$ Pa), | ||||||||||||
| (1523.15 K, $2 \times 10^{2}$ Pa), | ||||||||||||
| and (1573.15 K, $2 \times 10^{2}$ Pa). | ||||||||||||
|
|
||||||||||||
| The [YHx_PCT_fit_2D] shows the PCT fit against the experimental data. Evidently, the fit exhibits moderate error with an averaged value of 15%, but the deviations remain within an acceptable range for modeling purposes. | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| ## Example Input File Syntax | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -47,36 +47,68 @@ ADMatInterfaceReactionYHxPCT::ADMatInterfaceReactionYHxPCT(const InputParameters | |||||
| ADReal | ||||||
| ADMatInterfaceReactionYHxPCT::computeQpResidual(Moose::DGResidualType type) | ||||||
| { | ||||||
|
|
||||||
| // Variables | ||||||
| ADReal r = 0; | ||||||
|
|
||||||
| // tolerance for the pressure being closed to the plateau region | ||||||
| const Real tolerance = 1.15; // % | ||||||
| using std::exp; | ||||||
| using std::log; | ||||||
| using std::max; | ||||||
| using std::pow; | ||||||
| ADReal r = 0; | ||||||
|
|
||||||
| // Calculate the equilibrium concentration value based on PCT curve | ||||||
| // (/2 because two atoms for a molecule) (pressure in Pa) | ||||||
| // Gas pressure (Pa): R * T * c / 2 (two atoms per molecule) | ||||||
| auto neighbor_pressure = | ||||||
| PhysicalConstants::ideal_gas_constant * _neighbor_temperature[_qp] * _neighbor_value[_qp] / 2; | ||||||
|
|
||||||
| // Calculate the value of the pressures for the phase transition plateau (pressure in Pa) | ||||||
| auto limit_pressure = exp(-26.1 + 3.88e-2 * _neighbor_temperature[_qp] - | ||||||
| 9.7e-6 * Utility::pow<2>(_neighbor_temperature[_qp])); | ||||||
| auto Plim = exp(-26.1 + 3.88e-2 * _neighbor_temperature[_qp] - | ||||||
| 9.70e-6 * Utility::pow<2>(_neighbor_temperature[_qp])); | ||||||
|
|
||||||
| // define atomic fraction variable | ||||||
| ADReal atomic_fraction = 0.0; | ||||||
|
|
||||||
| // define atomic ratio maximum fit variable for the low and high pressure region, respectively | ||||||
| ADReal At_Max_LP_fit = 1.01e-6 * Utility::pow<2>(_neighbor_temperature[_qp]) - | ||||||
| 2.56e-3 * _neighbor_temperature[_qp] + 2.16; | ||||||
|
|
||||||
| ADReal At_Min_HP_fit = -1.01e-6 * Utility::pow<2>(_neighbor_temperature[_qp]) + | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This fit doesn't work that well. Why not use a different expression here? |
||||||
| 2.55e-3 * _neighbor_temperature[_qp] - 5.6e-01; | ||||||
|
|
||||||
| // return warning if the PCT curves is used out of bounds (pressure in Pa) | ||||||
| if (!_silence_warnings && ((neighbor_pressure < limit_pressure) || (neighbor_pressure > 1.e6))) | ||||||
| if (!_silence_warnings && ((neighbor_pressure < 1.e2) || (neighbor_pressure > 1.e6))) | ||||||
| mooseDoOnce(mooseWarning("In YHxPCT: pressure ", | ||||||
| neighbor_pressure, | ||||||
| "Pa and temperature ", | ||||||
| _neighbor_temperature[_qp], | ||||||
| "K are outside the bounds of the atomic fraction correlation. See " | ||||||
| "documentation for YHxPCT material.")); | ||||||
|
|
||||||
| // Calculate the atomic fraction based on the PCT curve | ||||||
| auto atomic_fraction = | ||||||
| 2. - pow(1. + exp(21.6 - 0.0225 * _neighbor_temperature[_qp] + | ||||||
| (-0.0445 + 7.18e-4 * _neighbor_temperature[_qp]) * | ||||||
| (log(max(neighbor_pressure - limit_pressure, 1e-10)))), | ||||||
| -1); | ||||||
| if (neighbor_pressure / Plim > 1.15) | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the 1.15 value here directly linked to the tolerance? Or gamma in the documentation? |
||||||
| { | ||||||
| atomic_fraction = | ||||||
| 2. - 1.0015 * pow(At_Min_HP_fit + exp(24.89 - 2.53e-02 * _neighbor_temperature[_qp] + | ||||||
| (-3.98e-01 + 0.001 * _neighbor_temperature[_qp]) * | ||||||
| log(max(neighbor_pressure - Plim, 1.e-10))), | ||||||
| -1); | ||||||
| } | ||||||
| else if (neighbor_pressure / Plim < 1.05) | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not a value below 1?
Suggested change
|
||||||
| { | ||||||
| // Low pressure region | ||||||
| atomic_fraction = | ||||||
| At_Max_LP_fit - 10 * pow(1.e-03 + exp(-50.0 + 5.73e-2 * _neighbor_temperature[_qp] + | ||||||
| (0.830 - 2.69e-3 * _neighbor_temperature[_qp]) * | ||||||
| log(max(Plim - neighbor_pressure, 1.e-10))), | ||||||
| -1); | ||||||
| } | ||||||
| else | ||||||
| { | ||||||
| // Plateau Region | ||||||
| atomic_fraction = 1.33 - 2.18e-04 * _neighbor_temperature[_qp] + | ||||||
| (1.06e01 - 4.35e-03 * _neighbor_temperature[_qp]) * | ||||||
| log(neighbor_pressure / (tolerance * Plim)); | ||||||
| } | ||||||
|
|
||||||
| // Convert to concentration | ||||||
| auto _surface_equilibrium_concentration = atomic_fraction * _density[_qp]; | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.