Skip to content
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

Ver 1kb #201

Merged
merged 29 commits into from
Nov 25, 2024
Merged

Ver 1kb #201

merged 29 commits into from
Nov 25, 2024

Conversation

Lee01Atom
Copy link
Contributor

@Lee01Atom Lee01Atom commented Oct 25, 2024

(Ref. #12)

@Lee01Atom Lee01Atom changed the title Add ver-1kb case (Ref. #12) Ver-1kb case (Ref. #12) Oct 25, 2024
@Lee01Atom Lee01Atom changed the title Ver-1kb case (Ref. #12) Ver-1kb case Oct 25, 2024
@Lee01Atom Lee01Atom changed the title Ver-1kb case Ver 1kb Oct 25, 2024
@simopier simopier self-assigned this Oct 25, 2024
@simopier simopier added the V&V Relevant to V&V label Oct 25, 2024
@simopier
Copy link
Collaborator

@Lee01Atom, please update the comment at the top of the page to list the related issue (see what i did on your previous PR).

Copy link
Collaborator

@simopier simopier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are some general comments after a rapid preliminary review:

  • Please add a couple metrics to make this a verification case (we need comparison to an analytical solution. You could add a postprocessor to keep track of mass conservation (see tests in interfaceSorption), and another to measure the concentration jump at the interface and make sure that it is equal to the expected value from Henry's law (see tests in interfaceSorption).
  • Please explain why you use both InterfaceDiffusion and InterfaceSorption. InterfaceSorption should be enough since it also accounts for diffusion through the interface. This might be over constraining your system. Note that InterfaceSorption also takes in the diffusivities (see Add val 2c to TMAP8 for Test Cell Experiment #197).
  • You will need a tests file to run this case
  • Your nl_abs_tol = 1e-6 and nl_rel_tol = 1e-6 are quite large (defaults are 1e-30 and 1e-8, respectively). Do you really need them to be this high? (see input files in interfaceSorption)
  • I think your petsc options should be more like what is used in interfaceSorption tests

@moosebuild
Copy link

moosebuild commented Oct 25, 2024

Job Documentation, step Sync to remote on 5ba0851 wanted to post the following:

View the site here

This comment will be updated on new commits.

@moosebuild
Copy link

moosebuild commented Oct 25, 2024

Job Coverage, step Generate coverage on 5ba0851 wanted to post the following:

Coverage

Coverage did not change

Full coverage report

This comment will be updated on new commits.

@simopier
Copy link
Collaborator

You currently get the following error:

##########################################################################
ERROR: The following files contain trailing whitespace after applying your patch:
	test/tests/ver-1kb/ver-1kb.i

Run the "delete_trailing_whitespace.sh" script in your $MOOSE_DIR/scripts directory.
##########################################################################

Check both these links out to automatically solve these issues in VSCode:

  1. https://mooseframework.inl.gov/help/development/VSCode.html
  2. https://stackoverflow.com/questions/30884131/remove-trailing-spaces-automatically-or-with-a-shortcut

Copy link
Collaborator

@simopier simopier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update @Lee01Atom!

  1. you are missing the alias for comparison_ver-1kb.py in the doc/content/verification_and_validation/figures folder.
  2. The documentation currently does not show any verification, in the sense that it does not verify mass conservation or the fact that the solubility law is properly computed. You need to check these metrics in a quantitative way to make it a valuable verification case. (see the last figure in the documentation in Clean up and Update val-2b #202 as an example).

doc/content/verification_and_validation/ver-1kb.md Outdated Show resolved Hide resolved
doc/content/verification_and_validation/ver-1kb.md Outdated Show resolved Hide resolved
test/tests/ver-1kb/tests Outdated Show resolved Hide resolved
doc/content/verification_and_validation/ver-1kb.md Outdated Show resolved Hide resolved
doc/content/verification_and_validation/ver-1kb.md Outdated Show resolved Hide resolved
test/tests/ver-1kb/ver-1kb.i Outdated Show resolved Hide resolved
test/tests/ver-1kb/ver-1kb.i Outdated Show resolved Hide resolved
test/tests/ver-1kb/ver-1kb.i Show resolved Hide resolved
test/tests/ver-1kb/ver-1kb.i Outdated Show resolved Hide resolved
test/tests/ver-1kb/ver-1kb.i Show resolved Hide resolved
Copy link
Collaborator

@simopier simopier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're getting there. The main remaining gaps are (1) the documentation, which meeds more more content to detail the case and explain the results and quantitatively show that TMAP8 accurately models this case in a way (see specific comments), and (2) the solubility value.

I looked at the input file and the case a little bit, and I think I understand why you are not getting the expected results.

Henry's law states C2 = KP1, and the TMAP7 case explains that the pressures of the two enclosures are expected to equilibrate at the same value, which is also shown in their figure with the results. For that reason, I believe that they defined the solubility Kin a way that ensured that at equilibrium: P1=P2, or C2 = C1. Since C2 = KP1 = K C R T, I think they picked K = 1/R/T. The reason you are not getting the same result as them with the same K value is because you are not using the same units. If you set up K = 1 / R / T, you will be able to reproduce their results.

However, I don't think this is a a very interested result since the concentration jump at the interface is effectively 0. So here's what I think would make this case more valuable:

Create two different sub-cases within this case, one with (a) K = 1 / R / T, and one with (b) K = 10 / R / T or any other value to show that TMAP8 can reproduce the TMAP7 case without any jump (i.e., a) and model a concentration jump at the interface (i.e., b). For both case, plot the pressure evolution over time in both enclosure, show that mass is conserved, and show that the concentration jump is properly simulated (0 for sub-case a, and KRT for sub-case b).

You can create subcase (b) simply by creating a new test in the tests file and update the solubility value with the cli_agrs argument (see case ver-1jb as an example on how to do that).

Please let me know if you have any questions, or if anything is unclear.

test/tests/ver-1kb/ver-1kb.i Outdated Show resolved Hide resolved
test/tests/ver-1kb/comparison_ver-1kb.py Show resolved Hide resolved
test/tests/ver-1kb/tests Outdated Show resolved Hide resolved
test/tests/ver-1kb/tests Outdated Show resolved Hide resolved
test/tests/ver-1kb/ver-1kb.i Outdated Show resolved Hide resolved
test/tests/ver-1kb/ver-1kb.i Show resolved Hide resolved
test/tests/ver-1kb/ver-1kb.i Outdated Show resolved Hide resolved
test/tests/ver-1kb/ver-1kb.i Outdated Show resolved Hide resolved
test/tests/ver-1kb/ver-1kb.i Outdated Show resolved Hide resolved
Copy link
Collaborator

@simopier simopier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Lee01Atom, here are some additional comments that should help you fix the failure in the test environment and improve this case.

Let me know if you have any questions. You're on the right track!

doc/content/verification_and_validation/ver-1kb.md Outdated Show resolved Hide resolved
doc/content/verification_and_validation/ver-1kb.md Outdated Show resolved Hide resolved
doc/content/verification_and_validation/ver-1kb.md Outdated Show resolved Hide resolved
doc/content/verification_and_validation/ver-1kb.md Outdated Show resolved Hide resolved
test/tests/ver-1kb/tests Outdated Show resolved Hide resolved
test/tests/ver-1kb/tests Show resolved Hide resolved
test/tests/ver-1kb/tests Outdated Show resolved Hide resolved
test/tests/ver-1kb/tests Outdated Show resolved Hide resolved
test/tests/ver-1kb/gold/ver-1kb_out_k1.csv Outdated Show resolved Hide resolved
test/tests/ver-1kb/tests Outdated Show resolved Hide resolved
@simopier
Copy link
Collaborator

The heavy test fail is unrelated to this PR.

Copy link
Collaborator

@simopier simopier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Lee01Atom! Here are a few comments/suggestions for improvements.

Let me know if you have any questions.

doc/content/verification_and_validation/ver-1kb.md Outdated Show resolved Hide resolved
doc/content/verification_and_validation/ver-1kb.md Outdated Show resolved Hide resolved
doc/content/verification_and_validation/ver-1kb.md Outdated Show resolved Hide resolved
doc/content/verification_and_validation/ver-1kb.md Outdated Show resolved Hide resolved
doc/content/verification_and_validation/ver-1kb.md Outdated Show resolved Hide resolved
test/tests/ver-1kb/gold/ver-1kb_out.csv Outdated Show resolved Hide resolved
test/tests/ver-1kb/tests Outdated Show resolved Hide resolved
test/tests/ver-1kb/ver-1kb.i Outdated Show resolved Hide resolved
test/tests/ver-1kb/ver-1kb.i Outdated Show resolved Hide resolved
Copy link
Collaborator

@simopier simopier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You will need to update the gold files since we changed the simulation time.

doc/content/verification_and_validation/ver-1kb.md Outdated Show resolved Hide resolved
doc/content/verification_and_validation/ver-1kb.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@simopier simopier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some new comments.

Before pushing new commits, make sure to run the tests and build the documentation locally to fix any easy-to-catch bugs/failures/issues. That will accelerate the development process and limit the number of iterations here.

Another thing: I think you should make the simulation time even shorter since most of the interesting changes happen on the very left side of the figures. You should also update the time units from hours to seconds, at that point.

Let me know if you have any questions.

doc/content/verification_and_validation/ver-1kb.md Outdated Show resolved Hide resolved
doc/content/verification_and_validation/ver-1kb.md Outdated Show resolved Hide resolved
doc/content/verification_and_validation/ver-1kb.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@simopier simopier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments.

doc/content/verification_and_validation/ver-1kb.md Outdated Show resolved Hide resolved
doc/content/verification_and_validation/ver-1kb.md Outdated Show resolved Hide resolved
doc/content/verification_and_validation/ver-1kb.md Outdated Show resolved Hide resolved
doc/content/verification_and_validation/ver-1kb.md Outdated Show resolved Hide resolved
doc/content/verification_and_validation/ver-1kb.md Outdated Show resolved Hide resolved
test/tests/ver-1kb/comparison_ver-1kb.py Outdated Show resolved Hide resolved
test/tests/ver-1kb/comparison_ver-1kb.py Outdated Show resolved Hide resolved
@simopier
Copy link
Collaborator

I'm wondering something: Could you refine the node size (and increase the number of nodes) and see the impact it has on mass conservation? I think we could improve it.

As you do that, make sure to update the documentation accordingly.

Co-authored-by: Pierre-Clement Simon <[email protected]>
@Lee01Atom
Copy link
Contributor Author

I'm wondering something: Could you refine the node size (and increase the number of nodes) and see the impact it has on mass conservation? I think we could improve it.

As you do that, make sure to update the documentation accordingly.

When I increase the number of nodes (e.g., from 100 to 1,000), the percentage of mass variation indeed decreases by a factor of 10.
However, the test for ver-1kb_exodus_concentration_jump fails because two elements have midpoints so close that Exodiff cannot distinguish them.

Copy link
Collaborator

@simopier simopier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It sees like you update part of the documentation, but not the input file.

doc/content/verification_and_validation/ver-1kb.md Outdated Show resolved Hide resolved
doc/content/verification_and_validation/ver-1kb.md Outdated Show resolved Hide resolved
doc/content/verification_and_validation/ver-1kb.md Outdated Show resolved Hide resolved
@simopier
Copy link
Collaborator

I'm wondering something: Could you refine the node size (and increase the number of nodes) and see the impact it has on mass conservation? I think we could improve it.

As you do that, make sure to update the documentation accordingly.

When I increase the number of nodes (e.g., from 100 to 1,000), the percentage of mass variation indeed decreases by a factor of 10.
However, the test for ver-1kb_exodus_concentration_jump fails because two elements have midpoints so close that Exodiff cannot distinguish them.

There are ways to avoid this failure with Exodiff not recognizing that two points are different because they are too close. For example, we can update the length unit of the case so that the number representing the distance is above the exodiff threshold (which is an absolute value without units directly associated with it). or we can use a .exodiff file to modify the that tolerance and reduce it.
In this case, I think it is reasonable to use 100 nodes in the mesh, and acknowledge in the documentation that the mass variations can be further minimized by using a finer mesh.

Copy link
Collaborator

@simopier simopier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you so much for this contribution, @Lee01Atom!

I think the remaining cases should be easy with your current experience, but feel free to reach out with any questions.

@simopier simopier merged commit 9027d7d into idaholab:devel Nov 25, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
V&V Relevant to V&V
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants