You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR fixes a bug in QBMM module. There are missing Re_inv in coeffs with indices 22 and 23. I found this bug based on dimensional analysis and @anandrdbz confirmed this by directly expanding out the equation.
Test suites failed with corrected form are also updated in this PR.
Type of change
Please delete options that are not relevant.
Bug fix (non-breaking change which fixes an issue)
New feature (non-breaking change which adds functionality)
Something else
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.
How Has This Been Tested?
What computers and compilers did you use to test this: MacBook M4 Pro
PR Type
Bug fix
Description
Fix missing Re_inv terms in QBMM coefficients
Update test suite golden files for corrected equations
Diagram Walkthrough
flowchart LR
A["QBMM coefficients"] --> B["Add Re_inv to coeffs[22,23]"]
B --> C["Update test golden files"]
The same fix is applied to two identical code blocks at lines 611-612 and 682-683. This suggests potential code duplication that could be refactored to reduce maintenance burden.
coeffs(22, i1, i2) =-i2*4._wp*Re_inv/(rho*rho*c)
coeffs(23, i1, i2) =-i2*4._wp*Re_inv/(rho*rho*c*c)
coeffs(24, i1, i2) = i2*16._wp*Re_inv*Re_inv/(rho*rho*c)
if (.not. f_is_default(Web)) then
coeffs(25, i1, i2) = i2*8._wp*Re_inv/Web/(rho*rho*c)
end if
coeffs(26, i1, i2) =-12._wp*i2*gam*Re_inv/(rho*rho*c*c)
end if
coeffs(27, i1, i2) =3._wp*i2*gam*R_v*Tw/(c*rho)
coeffs(28, i1, i2) =3._wp*i2*gam*R_v*Tw/(c*c*rho)
if (.not. f_is_default(Re_inv)) then
coeffs(29, i1, i2) =12._wp*i2*gam*R_v*Tw*Re_inv/(rho*rho*c*c)
end if
coeffs(30, i1, i2) =3._wp*i2*gam/(c*rho)
coeffs(31, i1, i2) =3._wp*i2*gam/(c*c*rho)
if (.not. f_is_default(Re_inv)) then
coeffs(32, i1, i2) =12._wp*i2*gam*Re_inv/(rho*rho*c*c)
end ifend ifend ifend do; end do
end subroutine s_coeff_nonpoly
!Coefficient array for polytropic model (pb for each R0 bin accounted for in wght_pb)
puresubroutines_coeff(pres, rho, c, coeffs)
$:GPU_ROUTINE(function_name='s_coeff',parallelism='[seq]', &
& cray_inline=True)
real(wp), intent(in) :: pres, rho, c
real(wp), dimension(nterms, 0:2, 0:2), intent(out) :: coeffs
integer:: i1, i2
coeffs =0._wpdo i2 =0, 2; do i1 =0, 2if ((i1 + i2) <=2) thenif (bubble_model == 3) then
! RPE
coeffs(1, i1, i2) =-1._wp*i2*pres/rho
coeffs(2, i1, i2) =-3._wp*i2/2._wp
coeffs(3, i1, i2) = i2/rho
coeffs(4, i1, i2) = i1
if (.not. f_is_default(Re_inv)) coeffs(5, i1, i2) =-4._wp*i2*Re_inv/rho
if (.not. f_is_default(Web)) coeffs(6, i1, i2) =-2._wp*i2/Web/rho
coeffs(7, i1, i2) = i2*pv/rho
elseif (bubble_model == 2) then
! KM with approximation of 1/(1-V/C) =1+V/C
coeffs(1, i1, i2) =-3._wp*i2/2._wp
coeffs(2, i1, i2) =-i2/c
coeffs(3, i1, i2) = i2/(2._wp*c*c)
coeffs(4, i1, i2) =-i2*pres/rho
coeffs(5, i1, i2) =-2._wp*i2*pres/(c*rho)
coeffs(6, i1, i2) =-i2*pres/(c*c*rho)
coeffs(7, i1, i2) = i2/rho
coeffs(8, i1, i2) =2._wp*i2/(c*rho)
coeffs(9, i1, i2) = i2/(c*c*rho)
coeffs(10, i1, i2) =-3._wp*i2*gam/(c*rho)
coeffs(11, i1, i2) =-3._wp*i2*gam/(c*c*rho)
coeffs(12, i1, i2) = i1
coeffs(13, i1, i2) = i2*(pv)/rho
coeffs(14, i1, i2) =2._wp*i2*(pv)/(c*rho)
coeffs(15, i1, i2) = i2*(pv)/(c*c*rho)
if (.not. f_is_default(Re_inv)) coeffs(16, i1, i2) =-i2*4._wp*Re_inv/rho
if (.not. f_is_default(Web)) coeffs(17, i1, i2) =-i2*2._wp/Web/rho
if (.not. f_is_default(Re_inv)) then
coeffs(18, i1, i2) = i2*6._wp*Re_inv/(rho*c)
coeffs(19, i1, i2) =-i2*2._wp*Re_inv/(rho*c*c)
coeffs(20, i1, i2) = i2*4._wp*pres*Re_inv/(rho*rho*c)
coeffs(21, i1, i2) = i2*4._wp*pres*Re_inv/(rho*rho*c*c)
coeffs(22, i1, i2) =-i2*4._wp*Re_inv/(rho*rho*c)
coeffs(23, i1, i2) =-i2*4._wp*Re_inv/(rho*rho*c*c)
❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.23%. Comparing base (e56d6dc) to head (cfb50a0). ⚠️ Report is 1 commits behind head on master.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Description
This PR fixes a bug in QBMM module. There are missing
Re_invincoeffswith indices 22 and 23. I found this bug based on dimensional analysis and @anandrdbz confirmed this by directly expanding out the equation.Test suites failed with corrected form are also updated in this PR.
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.
How Has This Been Tested?
PR Type
Bug fix
Description
Fix missing
Re_invterms in QBMM coefficientsUpdate test suite golden files for corrected equations
Diagram Walkthrough
File Walkthrough
1 files
Add missing Re_inv terms to coefficients10 files
Update test metadata for corrected QBMMUpdate test metadata for corrected QBMMUpdate test metadata for corrected QBMMUpdate test metadata for corrected QBMMUpdate test metadata for corrected QBMMUpdate test metadata for corrected QBMMUpdate test metadata for corrected QBMMUpdate test metadata for corrected QBMMUpdate test metadata for corrected QBMMUpdate test metadata for corrected QBMM10 files