Skip to content

Added ThermalConductance quantity - #1753

Open
gdeepak02 wants to merge 5 commits into
angularsen:masterfrom
gdeepak02:dgarg/AddedThermalConductance
Open

gdeepak02 wants to merge 5 commits into
angularsen:masterfrom
gdeepak02:dgarg/AddedThermalConductance

Conversation

@gdeepak02

Copy link
Copy Markdown

No description provided.

@gdeepak02

gdeepak02 commented Nov 6, 2026 •

Copy link
Copy Markdown
Author

This will need the previous pull request to go in first to sort out build issues

#1752

@gdeepak02 gdeepak02 left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I had dependencies updated locally (from this PR) to be able to build and run tests. All tests passed fine for me locally.

@tmilnthorp

Copy link
Copy Markdown
Collaborator

Looks good overall. A few things:

  1. Could you add the reciprocal relation to ThermalResistance in UnitRelations.json, like the other reciprocal pairs (e.g. ElectricResistivity/ElectricConductivity)?
    "1 = ThermalConductance.WattPerKelvin * ThermalResistance.KelvinPerWatt",
    
  2. Typo in XmlDocSummary: "temperature difference.. It is" has a double period.
  3. Optional: Btu/(h·°F) is how HVAC UA values are usually quoted, and a Kilo prefix (kW/K) would match the siblings like HeatTransferCoefficient.

@gdeepak02

Copy link
Copy Markdown
Author

Thanks @tmilnthorp . I have pushed the code update. Please take a look when you get a chance.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The reciprocal thermal relation lacks tests for both Inverse() directions and non-base-unit normalization.

1 open issue
What changed in this PR

Adds ThermalConductance to UnitsNet’s generated quantity APIs, with unit conversions and relationships to power, temperature difference, and thermal resistance.

Changes:

  • Defines five thermal conductance units, their conversions, and abbreviations.
  • Adds reciprocal conversion with thermal resistance and arithmetic operators involving power and temperature difference.
  • Adds numeric extensions and generated/custom tests.
File Description
UnitsNet/​GeneratedCode/​Units/​ThermalConductanceUnit.g.cs Defines the five unit enum values.
UnitsNet/​GeneratedCode/​Resources/​ThermalConductance.restext Supplies unit abbreviations.
UnitsNet/​GeneratedCode/​Quantity.g.cs Registers the quantity and reciprocal pair.
UnitsNet/​GeneratedCode/​Quantities/​ThermalResistance.g.cs Adds inversion to thermal conductance.
UnitsNet/​GeneratedCode/​Quantities/​ThermalConductance.g.cs Implements the generated quantity API.
UnitsNet/​GeneratedCode/​Quantities/​TemperatureDelta.g.cs Adds multiplication by thermal conductance.
UnitsNet/​GeneratedCode/​Quantities/​Power.g.cs Adds thermal conductance division operators.
UnitsNet.Tests/​GeneratedCode/​TestsBase/​ThermalConductanceTestsBase.g.cs Adds standard quantity and conversion tests.
UnitsNet.Tests/​GeneratedCode/​IQuantityTests.g.cs Covers dynamic creation and quantity metadata.
UnitsNet.Tests/​CustomCode/​ThermalConductanceTests.cs Supplies conversion expectations and operator tests.
UnitsNet.NumberExtensions/​GeneratedCode/​NumberToThermalConductanceExtensions.g.cs Adds numeric extension methods.
UnitsNet.NumberExtensions.Tests/​GeneratedCode/​NumberToThermalConductanceExtensionsTest.g.cs Tests numeric extension methods.
UnitsNet.NumberExtensions.CS14/​GeneratedCode/​NumberToThermalConductanceExtensions.g.cs Adds C# 14 extension properties.
UnitsNet.NumberExtensions.CS14.Tests/​GeneratedCode/​NumberToThermalConductanceExtensionsTest.g.cs Tests C# 14 extension properties.
Common/​UnitRelations.json Defines reciprocal and power relationships.
Common/​UnitEnumValues.g.json Records stable unit enum identifiers.
Common/​UnitDefinitions/​ThermalConductance.json Defines dimensions, units, conversions, and localization.

Review effort: Balanced

Comment thread Common/UnitRelations.json Resolved

@gdeepak02 gdeepak02 left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I have resolved the issues highlighted by Tristan and Copilot. This pull request seems ready to merge. Please review the pull request and let me know if I missed anything.

This branch has not been deployed

No deployments
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.

3 participants