Skip to content

Add gauge pressure, cubic meter per second, and fluence units, #1666

Open
dadge wants to merge 3 commits into
angularsen:masterfrom
iterorganization:master
Open

Add gauge pressure, cubic meter per second, and fluence units, #1666
dadge wants to merge 3 commits into
angularsen:masterfrom
iterorganization:master

Conversation

@dadge

@dadge dadge commented May 19, 2026

Copy link
Copy Markdown

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

  • Added the new quantity Fluence with its base unit NeutronPerSquareCentimeter, including its JSON definition, generated code, and nanoFramework project and nuspec files. [1] [2] [3] [4] [5] [6]

Power Unit Extensions

  • Added 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

  • Added gauge pressure units PascalG (Pa(g)) and BarG (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/)

dadge added 3 commits May 19, 2026 14:15
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).
@dadge

dadge commented May 19, 2026

Copy link
Copy Markdown
Author

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).

image

Thank you !

@github-actions

Copy link
Copy Markdown
Contributor

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.

@angularsen

Copy link
Copy Markdown
Owner

@claude review

@claude

claude Bot commented Jul 19, 2026

Copy link
Copy Markdown

Claude Code is working…

I'll analyze this and get back to you.

View job run

@angularsen angularsen left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
  • PascalCubicMeterPerSecond power 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants