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

Fix pressure in probe output files #454

Merged
merged 3 commits into from
Jun 9, 2024

Conversation

haochey
Copy link
Contributor

@haochey haochey commented Jun 7, 2024

Description

This PR corrects the primitive pressure output in probe files.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Scope

  • This PR comprises a set of related changes with a common goal

If you cannot check the above box, please split your PR into multiple PRs that each have a common goal.

Test Configuration:

  • What computers and compilers did you use to test this: MacOS 12.2.1

@haochey haochey requested a review from sbryngelson as a code owner June 7, 2024 05:12
@sbryngelson
Copy link
Member

This is a bit confusing to me - can you be more descriptive about what's going on here? also it looks like we use this computation many times. maybe we should create an intermediate variable for it:
0.5d0*(q_cons_vf(2)%sf(j - 2, k - 2, l)**2.d0)/ q_cons_vf(1)%sf(j - 2, k - 2, l)

@haochey
Copy link
Contributor Author

haochey commented Jun 7, 2024

This is a bit confusing to me - can you be more descriptive about what's going on here? also it looks like we use this computation many times. maybe we should create an intermediate variable for it: 0.5d0*(q_cons_vf(2)%sf(j - 2, k - 2, l)**2.d0)/ q_cons_vf(1)%sf(j - 2, k - 2, l)

Hi Spencer, this part of the code converts conservative variables to primitive variables when preparing the output variables for probes.

The previous code assumes hypoelasticity when computing primitive pressure for 2D cases, and then assumes non-hypoelasticity for 3D cases. I added conditional statement to discern conditions for hypoelasticity.

This is dynamic pressure:0.5d0*(q_cons_vf(2)%sf(j - 2, k - 2, l)**2.d0)/ q_cons_vf(1)%sf(j - 2, k - 2, l) . Yes! I agree I can use an intermediate variable.

@sbryngelson
Copy link
Member

Sounds good, thanks!

@sbryngelson sbryngelson merged commit 4dd7f25 into MFlowCode:master Jun 9, 2024
15 of 17 checks passed
@haochey haochey deleted the Data_Output branch November 5, 2024 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants