Add gauge pressure, cubic meter per second, and fluence units, #1666
Add gauge pressure, cubic meter per second, and fluence units, #1666dadge wants to merge 3 commits into
Conversation
The usage is deprecated but still prevails in industry. At ITER Organization, we need those unit for business use cases.
At ITER Organization, we need those unit for business use cases.
At ITER Organization, we need those unit for business use cases. In nuclear reactor physics, fluence is the time-integrated neutron flux. It is commonly expressed in neutrons per square centimeter (n/cm²). For example, the fast neutron fluence with energy greater than one mega-electronvolt (velocity greater than 13,830 km/s) received by the wall of a reactor vessel at end-of-life can reach 6 × 10¹⁹ n/cm² (equivalent to one mole per square meter).
|
Hey @angularsen ! Sorry to bother, but the Azure Pipelines is crashing and I don't think it's is related t any of my changes but I may be wrong ? in Any case the error message is not helpful to identify the issue (and I cannot re run it).
Thank you ! |
|
This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
|
@claude review |
|
I'll analyze this and get back to you. |
angularsen
left a comment
There was a problem hiding this comment.
Thanks for the contribution, but I don't think we should merge this PR as-is.
This combines several unrelated changes that need separate decisions:
Fluence- gauge pressure units
PascalCubicMeterPerSecondpower units
Fluence is a no from me in this shape. It currently only has one unit, so there is nothing to convert between. We normally require multiple units for a new quantity, as described in the new quantity/unit guidelines. The exception is when the quantity is widely used enough that the typed quantity representation is valuable on its own, and I don't see that case made here.
For gauge pressure, I don't think we should add PascalG/BarG as generated PressureUnit values. We already have ReferencePressure/PressureReference for absolute, gauge, and vacuum pressure, including configurable atmospheric pressure. Modeling gauge pressure as normal generated pressure units with a fixed 101325 Pa reference overlaps with that API and can make arithmetic surprising. Prefixes on offset units also look risky, since the generated formulas can end up scaling the offset in surprising ways.
The power unit change may be useful, but it should be a separate PR. It also needs at least the singular/plural naming fixed.
To move this forward, please split this into smaller PRs. I would start with the power unit if you still need it. The gauge-pressure part should probably be a design discussion around the existing ReferencePressure API. If the missing piece is parsing or formatting strings like bar(g) or Pa(g), I think we should look at extending that API instead of adding generated pressure units.


This pull request introduces support for the new physical quantity "Fluence" (measured in neutrons per square centimeter) to UnitsNet, along with enhancements to Power and Pressure units. It adds new gauge pressure units (e.g., bar(g), Pa(g)) and extends the Power quantity with PascalCubicMeterPerSecond and its metric prefixes. The changes include new unit definitions, code generation, and updates to enums and project files.
New Quantity and Units
Fluencewith its base unitNeutronPerSquareCentimeter, including its JSON definition, generated code, and nanoFramework project and nuspec files. [1] [2] [3] [4] [5] [6]Power Unit Extensions
PascalCubicMeterPerSecond(with metric prefixes) to Power units, including JSON definition, enum values, and generated property accessors in the Power quantity. [1] [2] [3] [4] [5] [6] [7] [8]Pressure Unit Extensions
PascalG(Pa(g)) andBarG(bar(g)), with their conversion logic, localizations, and enum values. [1] [2] [3]These changes expand UnitsNet's coverage for nuclear physics and engineering use cases, providing new units and quantities with full support in the codebase. The new units are useful for ITER organization, the international research project to create the first nuclear fusion reactor ( https://www.iter.org/)