Physical Quantities  v1.0.0
C++ library of physical quantities, physical models, and units of measure for scientific computing. https://github.com/acodcha/phq
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | List of all members
PhQ::DynamicViscosity< NumericType > Class Template Reference

Dynamic viscosity, also known as molecular dynamic viscosity. Dynamic viscosity is the relationship between the viscous stress of a material and its corresponding strain rate. Not to be confused with kinematic viscosity, which is dynamic viscosity divided by mass density; see PhQ::KinematicViscosity and PhQ::MassDensity. Also not to be confused with bulk dynamic viscosity; see PhQ::BulkDynamicViscosity. More...

#include "DynamicViscosity.hpp"

Public Member Functions

 DynamicViscosity ()=default
 Default constructor. Constructs a dynamic viscosity with an uninitialized value. More...
 
 DynamicViscosity (const NumericType value, const Unit::DynamicViscosity unit)
 Constructor. Constructs a dynamic viscosity with a given value expressed in a given dynamic viscosity unit. More...
 
constexpr DynamicViscosity (const MassDensity< NumericType > &mass_density, const KinematicViscosity< NumericType > &kinematic_viscosity)
 Constructor. Constructs a dynamic viscosity from a given mass density and kinematic viscosity using the definition of kinematic viscosity. More...
 
constexpr DynamicViscosity (const MassDensity< NumericType > &mass_density, const Speed< NumericType > &speed, const Length< NumericType > &length, const ReynoldsNumber< NumericType > &reynolds_number)
 Constructor. Constructs a dynamic viscosity from a given mass density, speed, length, and Reynolds number using the definition of the Reynolds number. More...
 
constexpr DynamicViscosity (const PrandtlNumber< NumericType > &prandtl_number, const ScalarThermalConductivity< NumericType > &scalar_thermal_conductivity, const SpecificIsobaricHeatCapacity< NumericType > &specific_isobaric_heat_capacity)
 Constructor. Constructs a dynamic viscosity from a given Prandtl number, scalar thermal conductivity, and specific isobaric heat capacity using the definition of the Prandtl number. More...
 
 ~DynamicViscosity () noexcept=default
 Destructor. Destroys this dynamic viscosity. More...
 
constexpr DynamicViscosity (const DynamicViscosity< NumericType > &other)=default
 Copy constructor. Constructs a dynamic viscosity by copying another one. More...
 
template<typename OtherNumericType >
constexpr DynamicViscosity (const DynamicViscosity< OtherNumericType > &other)
 Copy constructor. Constructs a dynamic viscosity by copying another one. More...
 
constexpr DynamicViscosity (DynamicViscosity< NumericType > &&other) noexcept=default
 Move constructor. Constructs a dynamic viscosity by moving another one. More...
 
constexpr DynamicViscosity< NumericType > & operator= (const DynamicViscosity< NumericType > &other)=default
 Copy assignment operator. Assigns this dynamic viscosity by copying another one. More...
 
template<typename OtherNumericType >
constexpr DynamicViscosity< NumericType > & operator= (const DynamicViscosity< OtherNumericType > &other)
 Copy assignment operator. Assigns this dynamic viscosity by copying another one. More...
 
constexpr DynamicViscosity< NumericType > & operator= (DynamicViscosity< NumericType > &&other) noexcept=default
 Move assignment operator. Assigns this dynamic viscosity by moving another one. More...
 
constexpr DynamicViscosity< NumericType > operator+ (const DynamicViscosity< NumericType > &dynamic_viscosity) const
 
constexpr DynamicViscosity< NumericType > operator- (const DynamicViscosity< NumericType > &dynamic_viscosity) const
 
constexpr DynamicViscosity< NumericType > operator* (const NumericType number) const
 
constexpr DynamicViscosity< NumericType > operator/ (const NumericType number) const
 
constexpr KinematicViscosity< NumericType > operator/ (const MassDensity< NumericType > &mass_density) const
 
constexpr MassDensity< NumericType > operator/ (const KinematicViscosity< NumericType > &kinematic_viscosity) const
 
constexpr NumericType operator/ (const DynamicViscosity< NumericType > &dynamic_viscosity) const noexcept
 
constexpr void operator+= (const DynamicViscosity< NumericType > &dynamic_viscosity) noexcept
 
constexpr void operator-= (const DynamicViscosity< NumericType > &dynamic_viscosity) noexcept
 
constexpr void operator*= (const NumericType number) noexcept
 
constexpr void operator/= (const NumericType number) noexcept
 
constexpr double Value () const noexcept
 Value of this physical quantity expressed in its standard unit of measure. More...
 
double Value (const Unit::DynamicViscosity unit) const
 Value of this physical quantity expressed in a given unit of measure. More...
 
constexpr double StaticValue () const
 Value of this physical quantity expressed in a given unit of measure. This method can be evaluated statically at compile-time. More...
 
constexpr double & MutableValue () noexcept
 Returns the value of this physical quantity expressed in its standard unit of measure as a mutable value. More...
 
constexpr void SetValue (const double value) noexcept
 Sets the value of this physical quantity expressed in its standard unit of measure to the given value. More...
 
std::string Print () const
 Prints this physical quantity as a string. This physical quantity's value is expressed in its standard unit of measure. More...
 
std::string Print (const Unit::DynamicViscosity unit) const
 Prints this physical quantity as a string. This physical quantity's value is expressed in the given unit of measure. More...
 
std::string JSON () const
 Serializes this physical quantity as a JSON message. This physical quantity's value is expressed in its standard unit of measure. More...
 
std::string JSON (const Unit::DynamicViscosity unit) const
 Serializes this physical quantity as a JSON message. This physical quantity's value is expressed in the given unit of measure. More...
 
std::string XML () const
 Serializes this physical quantity as an XML message. This physical quantity's value is expressed in its standard unit of measure. More...
 
std::string XML (const Unit::DynamicViscosity unit) const
 Serializes this physical quantity as an XML message. This physical quantity's value is expressed in the given unit of measure. More...
 
std::string YAML () const
 Serializes this physical quantity as a YAML message. This physical quantity's value is expressed in its standard unit of measure. More...
 
std::string YAML (const Unit::DynamicViscosity unit) const
 Serializes this physical quantity as a YAML message. This physical quantity's value is expressed in the given unit of measure. More...
 

Static Public Member Functions

static constexpr DynamicViscosity< NumericType > Zero ()
 Statically creates a dynamic viscosity of zero. More...
 
template<Unit::DynamicViscosity Unit>
static constexpr DynamicViscosity< NumericType > Create (const NumericType value)
 Statically creates a dynamic viscosity with a given value expressed in a given dynamic viscosity unit. More...
 
static constexpr const PhQ::DimensionsDimensions ()
 Physical dimension set of this physical quantity. More...
 
static constexpr Unit::DynamicViscosity Unit ()
 Standard unit of measure for this physical quantity. This physical quantity's value is stored internally in this unit of measure. More...
 

Protected Attributes

double value
 Value of this physical quantity expressed in its standard unit of measure. More...
 

Private Member Functions

constexpr DynamicViscosity (const NumericType value)
 Constructor. Constructs a dynamic viscosity with a given value expressed in the standard dynamic viscosity unit. More...
 

Detailed Description

template<typename NumericType = double>
class PhQ::DynamicViscosity< NumericType >

Dynamic viscosity, also known as molecular dynamic viscosity. Dynamic viscosity is the relationship between the viscous stress of a material and its corresponding strain rate. Not to be confused with kinematic viscosity, which is dynamic viscosity divided by mass density; see PhQ::KinematicViscosity and PhQ::MassDensity. Also not to be confused with bulk dynamic viscosity; see PhQ::BulkDynamicViscosity.

Definition at line 57 of file DynamicViscosity.hpp.

Constructor & Destructor Documentation

◆ DynamicViscosity() [1/9]

template<typename NumericType = double>
PhQ::DynamicViscosity< NumericType >::DynamicViscosity ( )
default

Default constructor. Constructs a dynamic viscosity with an uninitialized value.

◆ DynamicViscosity() [2/9]

template<typename NumericType = double>
PhQ::DynamicViscosity< NumericType >::DynamicViscosity ( const NumericType  value,
const Unit::DynamicViscosity< NumericType >  unit 
)
inline

Constructor. Constructs a dynamic viscosity with a given value expressed in a given dynamic viscosity unit.

Definition at line 64 of file DynamicViscosity.hpp.

◆ DynamicViscosity() [3/9]

template<typename NumericType = double>
constexpr PhQ::DynamicViscosity< NumericType >::DynamicViscosity ( const MassDensity< NumericType > &  mass_density,
const KinematicViscosity< NumericType > &  kinematic_viscosity 
)
inlineconstexpr

Constructor. Constructs a dynamic viscosity from a given mass density and kinematic viscosity using the definition of kinematic viscosity.

Definition at line 69 of file DynamicViscosity.hpp.

◆ DynamicViscosity() [4/9]

template<typename NumericType = double>
constexpr PhQ::DynamicViscosity< NumericType >::DynamicViscosity ( const MassDensity< NumericType > &  mass_density,
const Speed< NumericType > &  speed,
const Length< NumericType > &  length,
const ReynoldsNumber< NumericType > &  reynolds_number 
)
constexpr

Constructor. Constructs a dynamic viscosity from a given mass density, speed, length, and Reynolds number using the definition of the Reynolds number.

◆ DynamicViscosity() [5/9]

template<typename NumericType = double>
constexpr PhQ::DynamicViscosity< NumericType >::DynamicViscosity ( const PrandtlNumber< NumericType > &  prandtl_number,
const ScalarThermalConductivity< NumericType > &  scalar_thermal_conductivity,
const SpecificIsobaricHeatCapacity< NumericType > &  specific_isobaric_heat_capacity 
)
constexpr

Constructor. Constructs a dynamic viscosity from a given Prandtl number, scalar thermal conductivity, and specific isobaric heat capacity using the definition of the Prandtl number.

◆ ~DynamicViscosity()

template<typename NumericType = double>
PhQ::DynamicViscosity< NumericType >::~DynamicViscosity ( )
defaultnoexcept

Destructor. Destroys this dynamic viscosity.

◆ DynamicViscosity() [6/9]

template<typename NumericType = double>
constexpr PhQ::DynamicViscosity< NumericType >::DynamicViscosity ( const DynamicViscosity< NumericType > &  other)
constexprdefault

Copy constructor. Constructs a dynamic viscosity by copying another one.

◆ DynamicViscosity() [7/9]

template<typename NumericType = double>
template<typename OtherNumericType >
constexpr PhQ::DynamicViscosity< NumericType >::DynamicViscosity ( const DynamicViscosity< OtherNumericType > &  other)
inlineexplicitconstexpr

Copy constructor. Constructs a dynamic viscosity by copying another one.

Definition at line 94 of file DynamicViscosity.hpp.

◆ DynamicViscosity() [8/9]

template<typename NumericType = double>
constexpr PhQ::DynamicViscosity< NumericType >::DynamicViscosity ( DynamicViscosity< NumericType > &&  other)
constexprdefaultnoexcept

Move constructor. Constructs a dynamic viscosity by moving another one.

◆ DynamicViscosity() [9/9]

template<typename NumericType = double>
constexpr PhQ::DynamicViscosity< NumericType >::DynamicViscosity ( const NumericType  value)
inlineexplicitconstexprprivate

Constructor. Constructs a dynamic viscosity with a given value expressed in the standard dynamic viscosity unit.

Definition at line 181 of file DynamicViscosity.hpp.

Member Function Documentation

◆ Create()

template<typename NumericType = double>
template<Unit::DynamicViscosity Unit>
static constexpr DynamicViscosity<NumericType> PhQ::DynamicViscosity< NumericType >::Create ( const NumericType  value)
inlinestaticconstexpr

Statically creates a dynamic viscosity with a given value expressed in a given dynamic viscosity unit.

Definition at line 124 of file DynamicViscosity.hpp.

References PhQ::DimensionalScalar< Unit::DynamicViscosity, double >::value.

◆ Dimensions()

static constexpr const PhQ::Dimensions& PhQ::DimensionalScalar< Unit::DynamicViscosity , double >::Dimensions ( )
inlinestaticconstexprinherited

Physical dimension set of this physical quantity.

Definition at line 54 of file DimensionalScalar.hpp.

◆ JSON() [1/2]

std::string PhQ::DimensionalScalar< Unit::DynamicViscosity , double >::JSON ( ) const
inlineinherited

Serializes this physical quantity as a JSON message. This physical quantity's value is expressed in its standard unit of measure.

Definition at line 107 of file DimensionalScalar.hpp.

◆ JSON() [2/2]

std::string PhQ::DimensionalScalar< Unit::DynamicViscosity , double >::JSON ( const UnitType  unit) const
inlineinherited

Serializes this physical quantity as a JSON message. This physical quantity's value is expressed in the given unit of measure.

Definition at line 117 of file DimensionalScalar.hpp.

◆ MutableValue()

constexpr double & PhQ::DimensionalScalar< Unit::DynamicViscosity , double >::MutableValue ( )
inlineconstexprnoexceptinherited

Returns the value of this physical quantity expressed in its standard unit of measure as a mutable value.

Definition at line 83 of file DimensionalScalar.hpp.

◆ operator*()

template<typename NumericType = double>
constexpr DynamicViscosity<NumericType> PhQ::DynamicViscosity< NumericType >::operator* ( const NumericType  number) const
inlineconstexpr

◆ operator*=()

template<typename NumericType = double>
constexpr void PhQ::DynamicViscosity< NumericType >::operator*= ( const NumericType  number)
inlineconstexprnoexcept

◆ operator+()

template<typename NumericType = double>
constexpr DynamicViscosity<NumericType> PhQ::DynamicViscosity< NumericType >::operator+ ( const DynamicViscosity< NumericType > &  dynamic_viscosity) const
inlineconstexpr

◆ operator+=()

template<typename NumericType = double>
constexpr void PhQ::DynamicViscosity< NumericType >::operator+= ( const DynamicViscosity< NumericType > &  dynamic_viscosity)
inlineconstexprnoexcept

◆ operator-()

template<typename NumericType = double>
constexpr DynamicViscosity<NumericType> PhQ::DynamicViscosity< NumericType >::operator- ( const DynamicViscosity< NumericType > &  dynamic_viscosity) const
inlineconstexpr

◆ operator-=()

template<typename NumericType = double>
constexpr void PhQ::DynamicViscosity< NumericType >::operator-= ( const DynamicViscosity< NumericType > &  dynamic_viscosity)
inlineconstexprnoexcept

◆ operator/() [1/4]

template<typename NumericType = double>
constexpr NumericType PhQ::DynamicViscosity< NumericType >::operator/ ( const DynamicViscosity< NumericType > &  dynamic_viscosity) const
inlineconstexprnoexcept

◆ operator/() [2/4]

template<typename NumericType = double>
constexpr MassDensity<NumericType> PhQ::DynamicViscosity< NumericType >::operator/ ( const KinematicViscosity< NumericType > &  kinematic_viscosity) const
inlineconstexpr

Definition at line 152 of file DynamicViscosity.hpp.

◆ operator/() [3/4]

template<typename NumericType = double>
constexpr KinematicViscosity<NumericType> PhQ::DynamicViscosity< NumericType >::operator/ ( const MassDensity< NumericType > &  mass_density) const
inlineconstexpr

Definition at line 147 of file DynamicViscosity.hpp.

◆ operator/() [4/4]

template<typename NumericType = double>
constexpr DynamicViscosity<NumericType> PhQ::DynamicViscosity< NumericType >::operator/ ( const NumericType  number) const
inlineconstexpr

◆ operator/=()

template<typename NumericType = double>
constexpr void PhQ::DynamicViscosity< NumericType >::operator/= ( const NumericType  number)
inlineconstexprnoexcept

◆ operator=() [1/3]

template<typename NumericType = double>
constexpr DynamicViscosity<NumericType>& PhQ::DynamicViscosity< NumericType >::operator= ( const DynamicViscosity< NumericType > &  other)
constexprdefault

Copy assignment operator. Assigns this dynamic viscosity by copying another one.

◆ operator=() [2/3]

template<typename NumericType = double>
template<typename OtherNumericType >
constexpr DynamicViscosity<NumericType>& PhQ::DynamicViscosity< NumericType >::operator= ( const DynamicViscosity< OtherNumericType > &  other)
inlineconstexpr

Copy assignment operator. Assigns this dynamic viscosity by copying another one.

Definition at line 106 of file DynamicViscosity.hpp.

References PhQ::DimensionalScalar< UnitType, NumericType >::Value(), and PhQ::DimensionalScalar< Unit::DynamicViscosity, double >::value.

◆ operator=() [3/3]

template<typename NumericType = double>
constexpr DynamicViscosity<NumericType>& PhQ::DynamicViscosity< NumericType >::operator= ( DynamicViscosity< NumericType > &&  other)
constexprdefaultnoexcept

Move assignment operator. Assigns this dynamic viscosity by moving another one.

◆ Print() [1/2]

std::string PhQ::DimensionalScalar< Unit::DynamicViscosity , double >::Print ( ) const
inlineinherited

Prints this physical quantity as a string. This physical quantity's value is expressed in its standard unit of measure.

Definition at line 95 of file DimensionalScalar.hpp.

◆ Print() [2/2]

std::string PhQ::DimensionalScalar< Unit::DynamicViscosity , double >::Print ( const UnitType  unit) const
inlineinherited

Prints this physical quantity as a string. This physical quantity's value is expressed in the given unit of measure.

Definition at line 101 of file DimensionalScalar.hpp.

◆ SetValue()

constexpr void PhQ::DimensionalScalar< Unit::DynamicViscosity , double >::SetValue ( const NumericType  value)
inlineconstexprnoexceptinherited

Sets the value of this physical quantity expressed in its standard unit of measure to the given value.

Definition at line 89 of file DimensionalScalar.hpp.

◆ StaticValue()

constexpr double PhQ::DimensionalScalar< Unit::DynamicViscosity , double >::StaticValue ( ) const
inlineconstexprinherited

Value of this physical quantity expressed in a given unit of measure. This method can be evaluated statically at compile-time.

Definition at line 77 of file DimensionalScalar.hpp.

◆ Unit()

static constexpr Unit::DynamicViscosity PhQ::DimensionalScalar< Unit::DynamicViscosity , double >::Unit ( )
inlinestaticconstexprinherited

Standard unit of measure for this physical quantity. This physical quantity's value is stored internally in this unit of measure.

Definition at line 60 of file DimensionalScalar.hpp.

◆ Value() [1/2]

constexpr double PhQ::DimensionalScalar< Unit::DynamicViscosity , double >::Value ( ) const
inlineconstexprnoexceptinherited

Value of this physical quantity expressed in its standard unit of measure.

Definition at line 65 of file DimensionalScalar.hpp.

◆ Value() [2/2]

double PhQ::DimensionalScalar< Unit::DynamicViscosity , double >::Value ( const UnitType  unit) const
inlineinherited

Value of this physical quantity expressed in a given unit of measure.

Definition at line 70 of file DimensionalScalar.hpp.

◆ XML() [1/2]

std::string PhQ::DimensionalScalar< Unit::DynamicViscosity , double >::XML ( ) const
inlineinherited

Serializes this physical quantity as an XML message. This physical quantity's value is expressed in its standard unit of measure.

Definition at line 127 of file DimensionalScalar.hpp.

◆ XML() [2/2]

std::string PhQ::DimensionalScalar< Unit::DynamicViscosity , double >::XML ( const UnitType  unit) const
inlineinherited

Serializes this physical quantity as an XML message. This physical quantity's value is expressed in the given unit of measure.

Definition at line 137 of file DimensionalScalar.hpp.

◆ YAML() [1/2]

std::string PhQ::DimensionalScalar< Unit::DynamicViscosity , double >::YAML ( ) const
inlineinherited

Serializes this physical quantity as a YAML message. This physical quantity's value is expressed in its standard unit of measure.

Definition at line 147 of file DimensionalScalar.hpp.

◆ YAML() [2/2]

std::string PhQ::DimensionalScalar< Unit::DynamicViscosity , double >::YAML ( const UnitType  unit) const
inlineinherited

Serializes this physical quantity as a YAML message. This physical quantity's value is expressed in the given unit of measure.

Definition at line 157 of file DimensionalScalar.hpp.

◆ Zero()

template<typename NumericType = double>
static constexpr DynamicViscosity<NumericType> PhQ::DynamicViscosity< NumericType >::Zero ( )
inlinestaticconstexpr

Statically creates a dynamic viscosity of zero.

Definition at line 117 of file DynamicViscosity.hpp.

Member Data Documentation

◆ value

double PhQ::DimensionalScalar< Unit::DynamicViscosity , double >::value
protectedinherited

Value of this physical quantity expressed in its standard unit of measure.

Definition at line 221 of file DimensionalScalar.hpp.


The documentation for this class was generated from the following file: