forked from mpusz/mp-units
Added thermal conductivity
This commit is contained in:
@@ -149,6 +149,9 @@ struct dim_heat_capacity : derived_dimension<Child, U, exp<E, 1>, exp<T, -1>> {}
|
||||
template<typename Child, Unit U, DimensionOf<dim_heat_capacity> C, DimensionOf<dim_mass> M>
|
||||
struct dim_specific_heat_capacity : derived_dimension<Child, U, exp<C, 1>, exp<M, -1>> {};
|
||||
|
||||
template<typename Child, Unit U, DimensionOf<dim_power> P, DimensionOf<dim_length> L, DimensionOf<dim_thermodynamic_temperature> T>
|
||||
struct dim_thermal_conductivity : derived_dimension<Child, U, exp<P, 1>, exp<L, -1>, exp<T, -1>> {};
|
||||
|
||||
} // namespace physical
|
||||
|
||||
template<typename T>
|
||||
@@ -253,4 +256,7 @@ concept HeatCapacity = physical::QuantityOf<T, physical::dim_heat_capacity>;
|
||||
template<typename T>
|
||||
concept SpecificHeatCapacity = physical::QuantityOf<T, physical::dim_specific_heat_capacity>;
|
||||
|
||||
template<typename T>
|
||||
concept ThermalConductivity = physical::QuantityOf<T, physical::dim_thermal_conductivity>;
|
||||
|
||||
} // namespace units
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include "si/pressure.h"
|
||||
#include "si/resistance.h"
|
||||
#include "si/surface_tension.h"
|
||||
#include "si/thermal_conductivity.h"
|
||||
#include "si/velocity.h"
|
||||
#include "si/voltage.h"
|
||||
#include "si/volume.h"
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
// The MIT License (MIT)
|
||||
//
|
||||
// Copyright (c) 2018 Mateusz Pusz
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <units/physical/dimensions.h>
|
||||
#include <units/physical/si/power.h>
|
||||
#include <units/physical/si/temperature.h>
|
||||
#include <units/quantity.h>
|
||||
|
||||
namespace units::si {
|
||||
|
||||
struct watt_per_metre_kelvin : unit<watt_per_metre_kelvin> {};
|
||||
|
||||
struct dim_thermal_conductivity : physical::dim_thermal_conductivity<dim_thermal_conductivity, watt_per_metre_kelvin, dim_power, dim_length, dim_thermodynamic_temperature> {};
|
||||
|
||||
template<Unit U, Scalar Rep = double>
|
||||
using thermal_conductivity = quantity<dim_thermal_conductivity, U, Rep>;
|
||||
|
||||
inline namespace literals {
|
||||
|
||||
// J/K
|
||||
constexpr auto operator"" q_W_per_m_K(unsigned long long l) { return thermal_conductivity<watt_per_metre_kelvin, std::int64_t>(l); }
|
||||
constexpr auto operator"" q_W_per_m_K(long double l) { return thermal_conductivity<watt_per_metre_kelvin, long double>(l); }
|
||||
|
||||
} // namespace literals
|
||||
|
||||
} // namespace units::si
|
||||
Reference in New Issue
Block a user