-
Notifications
You must be signed in to change notification settings - Fork 393
Add VolumePerLength #604
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
Add VolumePerLength #604
Conversation
Hi and thanks for contributing! I'm a little on the fence on adding too domain specific quantities though, to avoid blowing up the size of this library. We don't yet have a good story for tackling that. Some ideas have been floating on having separate nugets for it, but there is the issue of overlap between domains and no good way to have statically typed conversions between those domains. Another option is plugging in quantities and conversions at runtime, but that story is not yet fleshed out. What do you think @tmilnthorp ? Common enough to include? |
Good question. Regardless though I would not make it a specific quantity like this. DrillStringCapacity is not really a quantity, but volume per length is. If we included it, I'd recommend creating a VolumePerLength quantity that supports barrels per foot, liters per meter, gallons per mile, etc. Also this calculation is specifically for barrels per foot for a cylindrical object. You can have cubic inches per foot of square pipe for example. Or cubic feet per foot of coiled air hose (need hose diameter, coil diameter, coil spacing, etc. to figure out). Some of those conversions get very specific. Regardless though, it just boils down to calculating how much volume something has based on the geometry of its container. |
What would be required in order for a VolumePerLength quantity to be accepted to merge in? I could make the necessary changes. My team particularly needs the calculation for a cylindrical object. |
While we think about it, are you able to create your own calculation methods? public static Volume CalculateInnerCapacity( Length innerDiameter, Length length )
{
var bblFt = Math.Pow( innerDiameter.Inches, 2.0 ) / 1029.4;
return Volume.FromOilBarrels( bblFt / length.Feet );
} |
We'll look into it. We wanted to avoid handling conversions from bbl/ft to l/m and back in our code, but could do it for now. Keep me posted about the VolumePerLength quantity and I'll make the changes when you have made a decision. Thanks! |
I was thinking the same thing. It's almost as if adding a new quantity
At least I can find some hits on google on https://www.vici-jour.com/tubing/conv_ch.php I'm good with adding VolumePerLength, how about you @tmilnthorp ? @adelmoral Adding a new quantity is not too complicated, we have detailed steps here: I'm happy to assist if you have any questions on the process. |
I forgot this was a PR and not an issue, you have already followed the wiki steps, so what I believe remains is to:
If you want to add extra methods beyond what is generated, you put those in For example: CustomCode\Volume.extra.cs The convention is that the result type dictates what file to put it in. |
@adelmoral Did you read my last feedback on how to move this PR along? Did it make sense to you? Let me know if anything is unclear. |
Apologies for the late reply, it has been a busy past couple of weeks. I'll go ahead and make the changes above ASAP. |
I have no idea what base unit to put for that.
Nuget on the way out. |
The capacity of drill string is an essential issue in oil well control. The capacity of drillpipe, drill collars or hole is the volume of fluid that can be contained within them. (https://en.wikipedia.org/wiki/Oil_well_control#Capacity)
The units for drill string capacity are bbl/ft or l/m.