Added dynamic viscosity
This commit is contained in:
1 parent
4b4cc70764
commit
07b5364c97
5 files changed
+65
No files matched your search
@@ -140,6 +140,9 @@ struct dim_concentration : derived_dimension<Child, U, exp<M, 1>, exp<L, -3>> {}
|
||||
template<typename Child, Unit U, DimensionOf<dim_luminous_intensity> I, DimensionOf<dim_length> L>
|
||||
struct dim_luminance : derived_dimension<Child, U, exp<I, 1>, exp<L, -2>> {};
|
||||
|
||||
template<typename Child, Unit U, DimensionOf<dim_pressure> P, DimensionOf<dim_time> T>
|
||||
struct dim_dynamic_viscosity : derived_dimension<Child, U, exp<P, 1>, exp<T, 1>> {};
|
||||
|
||||
} // namespace physical
|
||||
|
||||
template<typename T>
|
||||
@@ -235,4 +238,7 @@ concept Concentration = physical::QuantityOf<T, physical::dim_concentration>;
|
||||
template<typename T>
|
||||
concept Luminance = physical::QuantityOf<T, physical::dim_luminance>;
|
||||
|
||||
template<typename T>
|
||||
concept DynamicViscosity = physical::QuantityOf<T, physical::dim_dynamic_viscosity>;
|
||||
|
||||
} // namespace units
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "si/constants.h"
|
||||
#include "si/current_density.h"
|
||||
#include "si/density.h"
|
||||
#include "si/dynamic_viscosity.h"
|
||||
#include "si/frequency.h"
|
||||
#include "si/inductance.h"
|
||||
#include "si/luminance.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/time.h>
|
||||
#include <units/physical/si/pressure.h>
|
||||
#include <units/quantity.h>
|
||||
|
||||
namespace units::si {
|
||||
|
||||
struct pascal_second : unit<pascal_second> {};
|
||||
struct dim_dynamic_viscosity : physical::dim_dynamic_viscosity<dim_dynamic_viscosity, pascal_second, dim_pressure, dim_time> {};
|
||||
|
||||
template<Unit U, Scalar Rep = double>
|
||||
using dynamic_viscosity = quantity<dim_dynamic_viscosity, U, Rep>;
|
||||
|
||||
inline namespace literals {
|
||||
|
||||
// Pa·s
|
||||
constexpr auto operator"" q_Pa_s(unsigned long long l) { return dynamic_viscosity<pascal_second, std::int64_t>(l); }
|
||||
constexpr auto operator"" q_Pa_s(long double l) { return dynamic_viscosity<pascal_second, long double>(l); }
|
||||
|
||||
} // namespace literals
|
||||
|
||||
} // namespace units::si
|
||||
|
||||
Reference in new issue
Block a user