MFlowCode / MFC

Exascale simulation of multiphase/physics fluid dynamics
https://mflowcode.github.io
MIT License
132 stars 56 forks source link

Fix pressure in probe output files #454

Closed haochey closed 3 weeks ago

haochey commented 3 weeks ago

Description

This PR corrects the primitive pressure output in probe files.

Type of change

Please delete options that are not relevant.

Scope

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

Test Configuration:

sbryngelson commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

Sounds good, thanks!