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

Pipe Diameter Unit error #92

Closed
malcolm-dsider opened this issue Jan 23, 2024 · 6 comments · Fixed by softwareengineerprogrammer/GEOPHIRES#3 or #99
Closed

Pipe Diameter Unit error #92

malcolm-dsider opened this issue Jan 23, 2024 · 6 comments · Fixed by softwareengineerprogrammer/GEOPHIRES#3 or #99
Assignees
Labels
bug Something isn't working

Comments

@malcolm-dsider
Copy link
Collaborator

There seems to be a problem with pipe diameters, reproducible with Example 1.

Example one says:

Production Well Diameter,7, ---[inch]
Injection Well Diameter,7, ---[inch]

But reports them as:

  Injection well casing ID:                               0.005 meter
  Production well casing ID:                              0.005 meter

0.005 is 0.19685039 Inches!

Debugging indicates that this is not just a conversion error in reporting - the value of 0.005 is being passed into the Output object.

It sounds like a double conversion or some confusion about when conversion is need... I will track it down.

@malcolm-dsider malcolm-dsider self-assigned this Jan 23, 2024
@softwareengineerprogrammer softwareengineerprogrammer added the bug Something isn't working label Jan 23, 2024
@softwareengineerprogrammer
Copy link
Collaborator

softwareengineerprogrammer commented Jan 23, 2024

Production Well Diameter,7, ---[inch]
Injection Well Diameter,7, ---[inch]

Injection well casing ID: 0.005 meter
Production well casing ID: 0.005 meter

malcolm-dsider added a commit to malcolm-dsider/geophires-x-nrel that referenced this issue Jan 23, 2024
@malcolm-dsider
Copy link
Collaborator Author

This issue is fixed in the HIP-RA-X branch and committed. As @kfbeckers pointed out, it was NOT impacting the internal calculations, only the reporting. As suggested by @softwareengineerprogrammer, the bug was in the Parameters object.ConvertUnitsBack function.

The impact of this fix will be somewhat annoying; - some of the unit tests will fail because the "correct" examples are, in fact, not correct but rather have the wrong units due to this bug. A simple update of the "correct" files will fix the unit tests.

@softwareengineerprogrammer
Copy link
Collaborator

softwareengineerprogrammer commented Jan 24, 2024

Re-opening because fix is still pending integration into repository, tentatively planning to include in softwareengineerprogrammer#3; but impact to unit tests may merit doing as a separate PR to limit complexity.

@softwareengineerprogrammer
Copy link
Collaborator

Looking at this now; the suggested fix does not resolve. Rather, the issue appears to be in special casing logic in WellBores.py:

# special case: production and injection well diameters are input as inches and call calculations
# assume meters! Check and change if needed, assuming anything > 2 must be talking about inches
if self.injwelldiam.value > 2.0:
self.injwelldiam.value = self.injwelldiam.value * 0.0254
self.injwelldiam.CurrentUnits = LengthUnit.METERS
self.injwelldiam.UnitsMatch = False
if self.prodwelldiam.value > 2.0:
self.prodwelldiam.value = self.prodwelldiam.value * 0.0254
self.prodwelldiam.CurrentUnits = LengthUnit.METERS
self.prodwelldiam.UnitsMatch = False

(Will continue investigating fix, just wanted to make a note of this)

@malcolm-dsider
Copy link
Collaborator Author

malcolm-dsider commented Jan 24, 2024 via email

softwareengineerprogrammer added a commit to softwareengineerprogrammer/GEOPHIRES that referenced this issue Jan 28, 2024
softwareengineerprogrammer added a commit to softwareengineerprogrammer/GEOPHIRES that referenced this issue Jan 29, 2024
@softwareengineerprogrammer
Copy link
Collaborator

softwareengineerprogrammer commented Jan 29, 2024

Addressed in #99

bpulluta pushed a commit to bpulluta/python-geophires-x that referenced this issue Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants