-
Notifications
You must be signed in to change notification settings - Fork 41
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 3 commits
1f0a889
bf6bf19
b45e478
a1c5994
f01815d
2d7ecdb
95aa871
5aab71c
6eda1d2
5a7781d
f2bbd02
1a8f9d5
665e9dc
18bc8ae
cd15982
1957cf5
b89dcb1
ca29026
cb243bf
18f8087
ec189d5
e367d06
01e4e71
d75e528
1e05cb6
2f1e06b
7549dde
167df2a
8d41469
2c3ef8b
56f55d2
c4a7f74
d997bd4
6a4086e
af29870
d0d473f
d17213f
e8a6758
ea81512
09e7cdf
72cd0b0
8fb26e4
939966b
c80aa68
fd24053
2c0e137
aba9b3c
9d47079
67ab91b
6572413
b4dfb1a
43718d5
db0997f
3753f7d
a9108ff
f71f4db
556bd1b
26101e2
59cd57f
5d4d10e
fdf51b4
3c02387
222926a
08a586a
b957d50
cc9dc9e
534463f
e67e9be
a3be3fb
6abb2cb
6c03c81
10102f3
bb204af
4d11a94
b307479
c14da46
a16a88f
2e92c64
5a48370
f4b52c8
5422deb
58779a4
097ca24
78273b5
59eb1ca
1a7eff9
bca3fb0
7b21f39
134fdf4
a997607
e28b7c8
45fa6e0
ab9e876
b0da036
c94cbdd
4ef6a28
3fdbb02
25d0d83
fa79738
400bbb3
b510a23
8b854b8
df7679f
1a3e97e
4ba1a1d
3464267
9a3a2f5
6699bcf
2534b89
ec9d175
991b650
28fa0d7
06b6e92
4a7917a
d6906cb
5ce6c4f
5e8f573
89c77c1
2cc21d5
4f51d7e
00c9ba9
a297d9d
f7da5e6
f1b9951
a8e84a5
e9984e3
dc93762
8edf98f
47db332
81175f4
d5b26eb
643c36a
c0c333e
953a5f0
fe081a8
151b2f3
f554e9e
fa700f5
18718cd
d936011
8e2935b
be109e0
8c628f8
4d9ee20
acf1317
6ddfcba
0238c67
9f916af
251d2d5
07f6896
17fe39e
0e98f9b
115b6c8
a27aedc
41c82f8
e3a23d0
4b26bcf
3f610e7
6befa48
9fefb26
734d76a
b770b76
f6490cb
d83f381
3802ae0
7deb99a
04f2b59
39c4727
ae9627a
ed5d566
8179653
884a139
5e8aec5
ab7cb36
ec9fab4
6f6f174
f728772
5b3e2ac
e5057c9
8f20b17
5b4b326
a287718
9c520a5
0318c17
668c104
3fd8f22
20bc8cc
217f3cd
9250213
6dea12e
75f998f
ce938e0
95cfa22
ca37bf6
35a2cd6
f9f80cb
f5423b9
d24c73b
5ca15a8
4e1a9fe
ac34363
99b2c49
a145400
d07f6a2
1580af4
c6a1241
b2941de
664aef6
5f884b8
3f2f3aa
d9f1e61
345489a
4a2e176
8fb096a
392f3ca
c02b6c1
84d91a6
885723b
0454246
f930d16
85a0263
c9b8c7f
15d2be4
c0d86a1
6f9f45c
de04f8e
f8b31bf
68faf48
5b8a6e7
d0fab02
61d2774
f952c4e
87c7d47
ad8b07e
bebd1a0
ec04130
2f64bdd
af8ae3a
b5399ca
1a0c67f
1cec720
0685813
84774e1
3c6984e
8b1bc23
cd9dbba
491e938
4c67aa5
a9e9456
aa036a6
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 |
|---|---|---|
|
|
@@ -16,13 +16,20 @@ $K_b$ and $K_f$ are the backward and forward surface reaction rate in 1/s, respe | |
| $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$. | ||
|
|
||
| [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). | ||
| [YHx_PCT_Data] shows the data used in this interface kernel. The experimental data originates from [!cite](Lundin_1962). | ||
| The [YHx_PCT_fit_2D] shows high and low pressure fit with the high pressure fit from [!cite](Matthews2021SWIFT) and the low-pressure is a newly fitted curve. | ||
|
|
||
| !media comparison_YHx_PCT.py | ||
|
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. Please use the same colors as for the following figure. You use the same type of color palette, but it would be easier for the reader if you used the same color for the same temperature in both figures. |
||
| image_name=YHx_PCT_Data.png | ||
| style=width:80%;margin-bottom:2%;margin-left:auto;margin-right:auto | ||
| id=YHx_PCT_Data | ||
| caption=PCT data for YHx from [!cite](Lundin_1962). | ||
|
Anthony-Bowers08 marked this conversation as resolved.
Outdated
|
||
|
|
||
| !media comparison_YHx_PCT.py | ||
|
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 do you cut the low pressure data at an atomic fraction of 0.5? It can/should go further than that, especially for higher temperatures.
Contributor
Author
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. The fit becomes severely offset to the PCT data for values above 0.5. Please schedule a meeting to discuss if interested. |
||
| 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 YHx from [!cite](Lundin_1962) with high pressure fits from [!cite](Matthews2021SWIFT) implemented in TMAP8, and test results. | ||
|
Anthony-Bowers08 marked this conversation as resolved.
Outdated
|
||
|
|
||
| The plateau representing phase transition is captured as [!citep](Matthews2021SWIFT): | ||
| \begin{equation} \label{eq:pressure_plateau} | ||
|
|
@@ -37,16 +44,15 @@ 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} | ||
| In the high pressure region, the atomic fraction $f_{at}$ is determined as [!citep](Matthews2021SWIFT): | ||
| \begin{equation} | ||
| 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}, | ||
| \end{equation} | ||
| where $P$ is the hydrogen partial pressure in Pa. This fit is plotted in [YHx_PCT_fit_2D]. | ||
| where $P$ is the hydrogen partial pressure in Pa. While in the low pressure region, the atomic fraction $f_{at}$ is determined as: | ||
|
Anthony-Bowers08 marked this conversation as resolved.
Outdated
|
||
| \begin{equation} | ||
| f_{at}(T,P) = 0.5-\left[0.001+\exp(-89.75 + 0.0975 T + (1.20 - 4.41 \times 10^{-3} T) (\log\left(P_{lim}(T) - P\right)))\right]^{-1}, | ||
|
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. Are you cutting the low pressure region to an atomic fraction of 0.5 because of the 0.5 at the start of this expression?
Contributor
Author
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. If you are referring to the cut off in the .C file, then yes. |
||
| \end{equation} | ||
|
Anthony-Bowers08 marked this conversation as resolved.
|
||
|
|
||
|
Anthony-Bowers08 marked this conversation as resolved.
|
||
| 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. | ||
|
|
||
| ## Test | ||
|
|
||
|
|
@@ -59,7 +65,7 @@ To model the interface, the input file employs the [InterfaceDiffusion.md] objec | |
| \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(1473.15 K, $5 \times 10^{4}$ Pa). While the low pressure test for ($T$, $P$) = (1473.15 K, $3 \times 10^{3}$ Pa), (1273.15 K, $3 \times 10^{2}$ Pa), (1573.15 K, $5 \times 10^{3}$ Pa), and(1573.15 K, $6 \times 10^{2}$ Pa). | ||
|
Anthony-Bowers08 marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## Example Input File Syntax | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,10 @@ | ||
| /************************************************************/ | ||
| /*************************************************************/ | ||
|
Anthony-Bowers08 marked this conversation as resolved.
Outdated
|
||
| /* DO NOT MODIFY THIS HEADER */ | ||
| /* TMAP8: Tritium Migration Analysis Program, Version 8 */ | ||
| /* */ | ||
| /* Copyright 2021 - 2025 Battelle Energy Alliance, LLC */ | ||
| /* ALL RIGHTS RESERVED */ | ||
| /************************************************************/ | ||
| /*************************************************************/ | ||
|
Anthony-Bowers08 marked this conversation as resolved.
Outdated
|
||
|
|
||
| #include "ADMatInterfaceReactionYHxPCT.h" | ||
|
|
||
|
|
@@ -53,30 +53,57 @@ ADMatInterfaceReactionYHxPCT::computeQpResidual(Moose::DGResidualType type) | |
| using std::pow; | ||
| ADReal r = 0; | ||
|
|
||
| // tolerance for the pressure being closed to the plateau region | ||
| const Real tolerance = 10; // Pa | ||
|
|
||
| // Calculate the equilibrium concentration value based on PCT curve | ||
| // (/2 because two atoms for a molecule) (pressure in Pa) | ||
| // (2 because two atoms for a molecule | ||
|
Anthony-Bowers08 marked this conversation as resolved.
Outdated
|
||
| 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) | ||
| // Plateau/limit pressure (Pa) | ||
|
Anthony-Bowers08 marked this conversation as resolved.
Outdated
|
||
| auto limit_pressure = exp(-26.1 + 3.88e-2 * _neighbor_temperature[_qp] - | ||
| 9.7e-6 * Utility::pow<2>(_neighbor_temperature[_qp])); | ||
|
|
||
| // 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))) | ||
| // define atomic fraction variable | ||
| ADReal atomic_fraction = 0.0; | ||
|
|
||
|
Anthony-Bowers08 marked this conversation as resolved.
|
||
| if (!_silence_warnings && ((neighbor_pressure < 0.011) || (neighbor_pressure > 1.e6))) | ||
|
simopier marked this conversation as resolved.
Outdated
|
||
| 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 > limit_pressure && abs(neighbor_pressure - limit_pressure) < tolerance) | ||
|
Anthony-Bowers08 marked this conversation as resolved.
Outdated
|
||
| { | ||
| // High pressure region, near limit | ||
| atomic_fraction = 0.5; | ||
|
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. Are you sure you want it to be set to 0,5 here? coming from the high pressure region, why would you pick 0.5 here?
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 comment still holds. |
||
| } | ||
| else if (neighbor_pressure > limit_pressure) | ||
| { | ||
| // High pressure region (far enough from plateau) | ||
| 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); | ||
| } | ||
| else if ((neighbor_pressure < limit_pressure) && | ||
| (abs(neighbor_pressure - limit_pressure) < tolerance)) | ||
| { | ||
| // Low pressure region, near limit | ||
| atomic_fraction = 1.0; | ||
| } | ||
| else if (neighbor_pressure < limit_pressure) | ||
| { | ||
| // Low pressure region (far enough from plateau) | ||
| atomic_fraction = | ||
| 0.5 - pow(0.001 + exp(-8.97e01 + 9.75e-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. documentation lists 8.975e01 instead of 8.97e01.
Contributor
Author
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. Completed (This is for me, ignore PC) |
||
| (1.20 - 4.41e-3 * _neighbor_temperature[_qp]) * | ||
| log(max(limit_pressure - neighbor_pressure, 1e-10))), | ||
| -1); | ||
| } | ||
|
|
||
| // Convert to concentration | ||
| auto _surface_equilibrium_concentration = atomic_fraction * _density[_qp]; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.