Closed RemDelaporteMathurin closed 7 months ago
@RemDelaporteMathurin The case is taken from TMAP4. Is TMAP7 ver-1a same as TMAP4 ver-1a?
Sorry I may have gotten mixed up in links. I'll recap:
It is clear here that the TMAP8 results are from TMAP4 and not TMAP7 as I mentionned. Apologies.
Note: i think the $T$ in the exponential here should be lowercase $t$.
Now, when I try to compare the TMAP8 results to the analytical solution (equation) given in the docs and in TMAP4 ref, it doesn't produce the plotted results. See below:
However, when plotting the cumulative release from the enclosure (ie the integral of the particle flux at x=0) I obtain the correct curve:
My question is therefore:
Could you please provide the script with which you obtain the analytical solution values in the analytical.csv file (assuming it's not simply copy pasted from the TMAP4 report)?
Would it be possible that the authors of the TMAP7 report notice an error in the analytical expression of the TMAP4 report which would have justified changing the metric that is used to verify the code?
Thank you so much for your support on this - very - intriguing issue.
Update:
I tried to derive the expression for the cumulative flux shown above.
Starting from the analytical solution of the concentration given in the TMAP7 report (Equation 1):
$$ c(x,t) = 2 L P{0} S \sum{n=1}^{\infty} \frac{e^{- D t \alpha_n^2} \sin{\left(x \alpha_n \right)}}{\left(L + l \left(L^{2} + \alpha_n^2\right)\right) \sin{\left(l \alpha_n \right)}} $$
where $\alpha_n$ are the roots of
$$ \alpha_n = \frac{L}{\tan(\alpha_n \ l)} $$
NOTE: the $\alpha_n$ are different in this report compared to TMAP4/TMAP8
The cumulative release $\mathrm{R}$ is given by:
$$ \mathrm{R} = \int_0^t J(x=0, t) dt = \int0^t D \nabla c |{x=0} dt $$
From the expression of the concentration we can obtain:
$$ \mathrm{R}= 2 L P{0} S \sum{n=1}^{\infty} \frac{1 - e^{- D t_{f} \alpha_n^{2}}}{\left(L + l \left(L^{2} + \alpha_n^2\right)\right) \alpha_n\sin{\left(l \alpha_n \right)}} $$
Now multiplying by the surface area and normalising by the initial quantity of particles in the enclosure, the fractional release $\mathrm{FR}$ is:
$$ \mathrm{FR} = \frac{\mathrm{R} \ A}{P_0 \ V / (k_B T)} $$
Finally:
$$ \mathrm{FR} = \frac{2 L S A}{V / (kB T)} \sum{n=1}^{\infty} \frac{1 - e^{- D t_{f} \alpha_n^{2}}}{\left(L + l \left(L^{2} + \alpha_n^2\right)\right) \alpha_n\sin{\left(l \alpha_n \right)}} $$
I plotted this expression against the one of the TMAP4/TMAP8 docs as well as the expression from TMAP7.
If I'm not mistaken this expression is very different from the one given in the TMAP4/TMAP8. And yet it seems to reproduce the analytical results obtained by TMAP4/TMAP8. The code to produce this is below.
Maybe an error was made in the derivation of the TMAP4 analytical solution? It's impossible to tell as the authors of the report give no details (or references) on how they obtained this analytical solution.
Hi! Any update on this? @cticenhour
Hi Remi! I am unaware of whether @singhgp4321 has had the chance to look at your explorations on these discrepancies yet, but I have set aside time in the morning to take a look at this and will report back when I have something useful to contribute. 😄
@RemDelaporteMathurin I plotted the analytical curve for TMAP4 results based on the numbers they have in the report, and it is not based on their analytical expression. I am not sure why the values from the analytical expression don't match their results . . . May be there is an error in the expression, as you indicate.
@singhgp4321 thanks for the reply
Whenever possible, especially in a V&V, one should avoid simply copy pasting things from past reports and hard-coding data like this. The result is that the documentation page is misleading to users.
Do you confirm that the figure of merit you are computing and comparing to the analytical solution is the integral of the cumulative flux on the non-exposed surface normalised by the initial quantity of H in the enclosure?
I believe it is very important to clarify this and fix any wrong equation to avoid confusing users like me! V&V should be a reliable and robust process. If one claims an certain equation is solved, then one should solve/implement this equation, not take results from decades ago for granted.
✅ Some verification cases do that correctly like the ver-1b case, the ver-1d case, the ver-1fa case, the ver-1fb case, and the ver-1g case
❌ But a couple of cases (representing almost 40% of the verification cases!) have a hard-coded analytical solution that could very well suffer the same issues like ver-1c: https://github.com/idaholab/TMAP8/blob/22acf97325e7fa040e6ac44741a52f4e5f88ebb2/test/tests/ver-1c/comparison_ver-1c.py#L20
@RemDelaporteMathurin Are you sure that the analytical solution in TMAP4 is wrong?
Are you sure that the analytical solution in TMAP4 is wrong?
I mean you are more than welcome to try and plot it yourself. I shared all the code to reproduce the figures I showed. I'd love to be proven wrong - maybe I made a mistake somewhere.
That's why I asked if you guys had plotted the analytical solution given in TMAP4 - I tried, it didn't work. I tried rederiving the analytical solution myself - and it works. Nothing more I can do really.
@RemDelaporteMathurin, thank you for pointing these things out and being thorough in your description of the potential issue! I'll look into your comments and the cause of the differences between TMAP4/7 later this week and come back to you with an explanation or a fix.
@RemDelaporteMathurin To give a brief update on my end - yesterday, I did get to speak to @humrickhouse about the discrepancies here, and he suggested that the green and blue functions in your last plot (from TMAP4 and TMAP7 manuals respectively) may be representations of fractional release from different sides of the enclosure. He said he wasn't sure why the lead author for the TMAP7 manual decided to change the plotted quantity between releases, but that he may chime in here if he has time. I had less time than I thought yesterday, so will be looking through this today. As @simopier said, thanks again for pointing this out, and we'll get back to you soon!
the green and blue functions in your last plot (from TMAP4 and TMAP7 manuals respectively) may be representations of fractional release from different sides of the enclosure
That is possible. In the TMAP7 report, $x=0$ is the side not exposed to the gas where $c=0$ and $x=l$ is the surface exposed to the gas.
I'm more interested in comparing the red and green curves (and points). The way I rederived the analytical equation is computing the fractional release at $x=0$ (from the TMAP7 analytical solution of the concentration field). Looking at the TMAP8 file, the metric is the flux integral on the right hand side:
And the right hand side corresponds to $c=0$:
Which means that the equation given in TMAP4/TMAP8 should be equivalent to the equation I derived above. Again, the most straightforward way of unravelling the mystery here is to simply plot the equation given in TMAP4/TMAP8... 😄
Interesting. Agreed! 😄 Will chime back in soon.
I started to dig into ver-1a and created a PR with some changes and some discussions around the next steps to address this issue: #86.
As discussed in #86 there was a typo in my code. Both the analytical solution I derived from the TMAP7 solution and the TMAP4 solutions were equivalent!
Closing this.
I will add to what @RemDelaporteMathurin said that significant improvements have been done to the ver-1a case to include verification case 1a from TMAP7 (in addition to the existing 1a from TMAP4), increase transparency/documentation/reproducibility, and fix other typos as a response to this issue being created.
The PR https://github.com/idaholab/TMAP8/pull/86 with these changes is currently under review and will be pushed once it satisfies reviewers.
Thank you all (especially @RemDelaporteMathurin) again for your engagement and contribution.
Hi all!
I recently looked at the ver-1a verification case and I noticed the solution differs from that of the TMAP7 V&V.
This is the fractional release of TMAP8:
This is the fractional release of TMAP7:
I've looked at the parameters and they all look the same in TMAP8 and TMAP7 (page C-3 of V&V document):
Could you comment on this difference? Is there a parameter that I missed?
Thanks in advance!!