Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions Common/UnitDefinitions/ThermalConductance.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"Name": "ThermalConductance",
"BaseUnit": "WattPerKelvin",
"XmlDocSummary": "Thermal conductance is a measure of the rate of heat flow through a specific object or component per unit of temperature difference.. It is measured in units of watts per kelvin (W/K).",
"BaseDimensions": {
"L": 2,
"M": 1,
"T": -3,
"Θ": -1
},
"Units": [
{
"SingularName": "WattPerKelvin",
"PluralName": "WattsPerKelvin",
"BaseUnits": {
"L": "Meter",
"M": "Kilogram",
"T": "Second",
"Θ": "Kelvin"
},
"FromUnitToBaseFunc": "{x}",
"FromBaseToUnitFunc": "{x}",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "W/K" ]
}
]
},
{
"SingularName": "WattPerDegreeCelsius",
"PluralName": "WattsPerDegreeCelsius",
"BaseUnits": {
"L": "Meter",
"M": "Kilogram",
"T": "Second",
"Θ": "DegreeCelsius"
},
"FromUnitToBaseFunc": "{x}",
"FromBaseToUnitFunc": "{x}",
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "W/°C" ]
}
]
}
]
}
4 changes: 4 additions & 0 deletions Common/UnitEnumValues.g.json
Original file line number Diff line number Diff line change
Expand Up @@ -1508,6 +1508,10 @@
"WattPerMeterKelvin": 2,
"BtuPerSecondInchFahrenheit": 6
},
"ThermalConductance": {
"WattPerDegreeCelsius": 1,
"WattPerKelvin": 2
},
"ThermalResistance": {
"DegreeCelsiusPerWatt": 10,
"KelvinPerWatt": 11
Expand Down
1 change: 1 addition & 0 deletions Common/UnitRelations.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
"Power.Watt = LinearPowerDensity.WattPerMeter * Length.Meter",
"Power.Watt = PowerDensity.WattPerCubicMeter * Volume.CubicMeter",
"Power.Watt = SpecificEnergy.JoulePerKilogram * MassFlow.KilogramPerSecond",
"Power.Watt = ThermalConductance.WattPerKelvin * TemperatureDelta.Kelvin",
"Power.Watt = Torque.NewtonMeter * RotationalSpeed.RadianPerSecond",
"Pressure.NewtonPerSquareMeter = Force.Newton * ReciprocalArea.InverseSquareMeter",
"Pressure.NewtonPerSquareMeter = ForcePerLength.NewtonPerMeter * ReciprocalLength.InverseMeter",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions UnitsNet.Tests/CustomCode/ThermalConductanceTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by \generate-code.bat.
//
// Changes to this file will be lost when the code is regenerated.
// The build server regenerates the code before each build and a pre-build
// step will regenerate the code on each local build.
//
// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
//
// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
// Add UnitDefinitions\MyQuantity.json and run generate-code.bat to generate new units or quantities.
//
// </auto-generated>
//------------------------------------------------------------------------------

// Licensed under MIT No Attribution, see LICENSE file at the root.
// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet.

using System;

namespace UnitsNet.Tests.CustomCode
{
public class ThermalConductanceTests : ThermalConductanceTestsBase
{
protected override double WattsPerKelvinInOneWattPerKelvin => 1;

protected override double WattsPerDegreeCelsiusInOneWattPerKelvin => 1;

[Fact]
public void ThermalConductanceTimesTemperatureDeltaEqualsPower()
{
ThermalConductance thermalConductance = ThermalConductance.FromWattsPerKelvin(2);
TemperatureDelta temperatureDelta = TemperatureDelta.FromKelvins(6);
Power expected = Power.FromWatts(12);

Assert.Equal(expected, thermalConductance * temperatureDelta);
Assert.Equal(expected, temperatureDelta * thermalConductance);
Assert.Equal(temperatureDelta, expected / thermalConductance);
Assert.Equal(thermalConductance, expected / temperatureDelta);
}
}
}
2 changes: 2 additions & 0 deletions UnitsNet.Tests/GeneratedCode/IQuantityTests.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading