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 | List of all members
PhQ::ReynoldsNumber< NumericType > Class Template Reference

Reynolds number of a fluid flow. Measures the local turbulence of a fluid flow. Represents the ratio of local inertial forces to local viscous forces in a fluid flow. See also PhQ::MassDensity, PhQ::Speed, PhQ::Length, PhQ::DynamicViscosity, and PhQ::KinematicViscosity. More...

#include "ReynoldsNumber.hpp"

Public Member Functions

 ReynoldsNumber ()=default
 Default constructor. Constructs a Reynolds number with an uninitialized value. More...
 
constexpr ReynoldsNumber (const NumericType value)
 Constructor. Constructs a Reynolds number with a given value. More...
 
constexpr ReynoldsNumber (const MassDensity< NumericType > &mass_density, const Speed< NumericType > &speed, const Length< NumericType > &length, const DynamicViscosity< NumericType > &dynamic_viscosity)
 Constructor. Constructs a Reynolds number from a given mass density, speed, length, and dynamic viscosity using the definition of the Reynolds number. More...
 
constexpr ReynoldsNumber (const Speed< NumericType > &speed, const Length< NumericType > &length, const KinematicViscosity< NumericType > &kinematic_viscosity)
 Constructor. Constructs a Reynolds number from a given speed, length, and kinematic viscosity using the definition of the Reynolds number. More...
 
 ~ReynoldsNumber () noexcept=default
 Destructor. Destroys this Reynolds number. More...
 
constexpr ReynoldsNumber (const ReynoldsNumber< NumericType > &other)=default
 Copy constructor. Constructs a Reynolds number by copying another one. More...
 
template<typename OtherNumericType >
constexpr ReynoldsNumber (const ReynoldsNumber< OtherNumericType > &other)
 Copy constructor. Constructs a Reynolds number by copying another one. More...
 
constexpr ReynoldsNumber (ReynoldsNumber< NumericType > &&other) noexcept=default
 Move constructor. Constructs a Reynolds number by moving another one. More...
 
constexpr ReynoldsNumber< NumericType > & operator= (const ReynoldsNumber< NumericType > &other)=default
 Copy assignment operator. Assigns this Reynolds number by copying another one. More...
 
template<typename OtherNumericType >
constexpr ReynoldsNumber< NumericType > & operator= (const ReynoldsNumber< OtherNumericType > &other)
 Copy assignment operator. Assigns this Reynolds number by copying another one. More...
 
constexpr ReynoldsNumber< NumericType > & operator= (ReynoldsNumber< NumericType > &&other) noexcept=default
 Move assignment operator. Assigns this Reynolds number by moving another one. More...
 
constexpr PhQ::DynamicViscosity< NumericType > DynamicViscosity (const PhQ::MassDensity< NumericType > &mass_density, const PhQ::Speed< NumericType > &speed, const PhQ::Length< NumericType > &length) const
 
constexpr PhQ::KinematicViscosity< NumericType > KinematicViscosity (const PhQ::Speed< NumericType > &speed, const PhQ::Length< NumericType > &length) const
 
constexpr PhQ::Length< NumericType > Length (const PhQ::DynamicViscosity< NumericType > &dynamic_viscosity, const PhQ::MassDensity< NumericType > &mass_density, const PhQ::Speed< NumericType > &speed) const
 
constexpr PhQ::Length< NumericType > Length (const PhQ::KinematicViscosity< NumericType > &kinematic_viscosity, const PhQ::Speed< NumericType > &speed) const
 
constexpr PhQ::MassDensity< NumericType > MassDensity (const PhQ::DynamicViscosity< NumericType > &dynamic_viscosity, const PhQ::Speed< NumericType > &speed, const PhQ::Length< NumericType > &length) const
 
constexpr PhQ::Speed< NumericType > Speed (const PhQ::DynamicViscosity< NumericType > &dynamic_viscosity, const PhQ::MassDensity< NumericType > &mass_density, const PhQ::Length< NumericType > &length) const
 
constexpr PhQ::Speed< NumericType > Speed (const PhQ::KinematicViscosity< NumericType > &kinematic_viscosity, const PhQ::Length< NumericType > &length) const
 
constexpr ReynoldsNumber< NumericType > operator+ (const ReynoldsNumber< NumericType > &reynolds_number) const
 
constexpr ReynoldsNumber< NumericType > operator- (const ReynoldsNumber< NumericType > &reynolds_number) const
 
constexpr ReynoldsNumber< NumericType > operator* (const NumericType number) const
 
constexpr ReynoldsNumber< NumericType > operator/ (const NumericType number) const
 
constexpr NumericType operator/ (const ReynoldsNumber< NumericType > &reynolds_number) const noexcept
 
constexpr void operator+= (const ReynoldsNumber< NumericType > &reynolds_number) noexcept
 
constexpr void operator-= (const ReynoldsNumber< NumericType > &reynolds_number) 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. More...
 
constexpr double & MutableValue () noexcept
 Returns the value of this physical quantity as a mutable value. More...
 
constexpr void SetValue (const double value) noexcept
 Sets the value of this physical quantity to the given value. More...
 
std::string Print () const
 Prints this physical quantity as a string. More...
 
std::string JSON () const
 Serializes this physical quantity as a JSON message. More...
 
std::string XML () const
 Serializes this physical quantity as an XML message. More...
 
std::string YAML () const
 Serializes this physical quantity as a YAML message. More...
 

Static Public Member Functions

static constexpr ReynoldsNumber< NumericType > Zero ()
 Statically creates a Reynolds number of zero. More...
 
static constexpr PhQ::Dimensions Dimensions ()
 Physical dimension set of this physical quantity. Since this physical quantity is dimensionless, its physical dimension set is simply the null set. More...
 

Protected Attributes

double value
 Value of this physical quantity. More...
 

Detailed Description

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

Reynolds number of a fluid flow. Measures the local turbulence of a fluid flow. Represents the ratio of local inertial forces to local viscous forces in a fluid flow. See also PhQ::MassDensity, PhQ::Speed, PhQ::Length, PhQ::DynamicViscosity, and PhQ::KinematicViscosity.

Definition at line 45 of file ReynoldsNumber.hpp.

Constructor & Destructor Documentation

◆ ReynoldsNumber() [1/7]

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

Default constructor. Constructs a Reynolds number with an uninitialized value.

◆ ReynoldsNumber() [2/7]

template<typename NumericType = double>
constexpr PhQ::ReynoldsNumber< NumericType >::ReynoldsNumber ( const NumericType  value)
inlineexplicitconstexpr

Constructor. Constructs a Reynolds number with a given value.

Definition at line 51 of file ReynoldsNumber.hpp.

◆ ReynoldsNumber() [3/7]

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

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

Definition at line 56 of file ReynoldsNumber.hpp.

◆ ReynoldsNumber() [4/7]

template<typename NumericType = double>
constexpr PhQ::ReynoldsNumber< NumericType >::ReynoldsNumber ( const Speed< NumericType > &  speed,
const Length< NumericType > &  length,
const KinematicViscosity< NumericType > &  kinematic_viscosity 
)
inlineconstexpr

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

Definition at line 64 of file ReynoldsNumber.hpp.

◆ ~ReynoldsNumber()

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

Destructor. Destroys this Reynolds number.

◆ ReynoldsNumber() [5/7]

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

Copy constructor. Constructs a Reynolds number by copying another one.

◆ ReynoldsNumber() [6/7]

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

Copy constructor. Constructs a Reynolds number by copying another one.

Definition at line 76 of file ReynoldsNumber.hpp.

◆ ReynoldsNumber() [7/7]

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

Move constructor. Constructs a Reynolds number by moving another one.

Member Function Documentation

◆ Dimensions()

static constexpr PhQ::Dimensions PhQ::DimensionlessScalar< double >::Dimensions ( )
inlinestaticconstexprinherited

Physical dimension set of this physical quantity. Since this physical quantity is dimensionless, its physical dimension set is simply the null set.

Definition at line 55 of file DimensionlessScalar.hpp.

◆ DynamicViscosity()

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

Definition at line 102 of file ReynoldsNumber.hpp.

◆ JSON()

std::string PhQ::DimensionlessScalar< double >::JSON ( ) const
inlineinherited

Serializes this physical quantity as a JSON message.

Definition at line 80 of file DimensionlessScalar.hpp.

◆ KinematicViscosity()

template<typename NumericType = double>
constexpr PhQ::KinematicViscosity<NumericType> PhQ::ReynoldsNumber< NumericType >::KinematicViscosity ( const PhQ::Speed< NumericType > &  speed,
const PhQ::Length< NumericType > &  length 
) const
inlineconstexpr

Definition at line 108 of file ReynoldsNumber.hpp.

◆ Length() [1/2]

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

Definition at line 113 of file ReynoldsNumber.hpp.

◆ Length() [2/2]

template<typename NumericType = double>
constexpr PhQ::Length<NumericType> PhQ::ReynoldsNumber< NumericType >::Length ( const PhQ::KinematicViscosity< NumericType > &  kinematic_viscosity,
const PhQ::Speed< NumericType > &  speed 
) const
inlineconstexpr

Definition at line 120 of file ReynoldsNumber.hpp.

◆ MassDensity()

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

Definition at line 126 of file ReynoldsNumber.hpp.

◆ MutableValue()

constexpr double & PhQ::DimensionlessScalar< double >::MutableValue ( )
inlineconstexprnoexceptinherited

Returns the value of this physical quantity as a mutable value.

Definition at line 65 of file DimensionlessScalar.hpp.

◆ operator*()

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

Definition at line 155 of file ReynoldsNumber.hpp.

References PhQ::DimensionlessScalar< double >::value.

◆ operator*=()

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

Definition at line 176 of file ReynoldsNumber.hpp.

References PhQ::DimensionlessScalar< double >::value.

◆ operator+()

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

◆ operator+=()

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

Definition at line 168 of file ReynoldsNumber.hpp.

References PhQ::DimensionlessScalar< double >::value.

◆ operator-()

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

◆ operator-=()

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

Definition at line 172 of file ReynoldsNumber.hpp.

References PhQ::DimensionlessScalar< double >::value.

◆ operator/() [1/2]

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

Definition at line 159 of file ReynoldsNumber.hpp.

References PhQ::DimensionlessScalar< double >::value.

◆ operator/() [2/2]

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

Definition at line 163 of file ReynoldsNumber.hpp.

References PhQ::DimensionlessScalar< double >::value.

◆ operator/=()

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

Definition at line 180 of file ReynoldsNumber.hpp.

References PhQ::DimensionlessScalar< double >::value.

◆ operator=() [1/3]

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

Copy assignment operator. Assigns this Reynolds number by copying another one.

◆ operator=() [2/3]

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

Copy assignment operator. Assigns this Reynolds number by copying another one.

Definition at line 88 of file ReynoldsNumber.hpp.

References PhQ::DimensionlessScalar< NumericType >::Value(), and PhQ::DimensionlessScalar< double >::value.

◆ operator=() [3/3]

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

Move assignment operator. Assigns this Reynolds number by moving another one.

◆ Print()

std::string PhQ::DimensionlessScalar< double >::Print ( ) const
inlineinherited

Prints this physical quantity as a string.

Definition at line 75 of file DimensionlessScalar.hpp.

◆ SetValue()

constexpr void PhQ::DimensionlessScalar< double >::SetValue ( const double  value)
inlineconstexprnoexceptinherited

Sets the value of this physical quantity to the given value.

Definition at line 70 of file DimensionlessScalar.hpp.

◆ Speed() [1/2]

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

Definition at line 132 of file ReynoldsNumber.hpp.

◆ Speed() [2/2]

template<typename NumericType = double>
constexpr PhQ::Speed<NumericType> PhQ::ReynoldsNumber< NumericType >::Speed ( const PhQ::KinematicViscosity< NumericType > &  kinematic_viscosity,
const PhQ::Length< NumericType > &  length 
) const
inlineconstexpr

Definition at line 139 of file ReynoldsNumber.hpp.

◆ Value()

constexpr double PhQ::DimensionlessScalar< double >::Value ( ) const
inlineconstexprnoexceptinherited

Value of this physical quantity.

Definition at line 60 of file DimensionlessScalar.hpp.

◆ XML()

std::string PhQ::DimensionlessScalar< double >::XML ( ) const
inlineinherited

Serializes this physical quantity as an XML message.

Definition at line 85 of file DimensionlessScalar.hpp.

◆ YAML()

std::string PhQ::DimensionlessScalar< double >::YAML ( ) const
inlineinherited

Serializes this physical quantity as a YAML message.

Definition at line 90 of file DimensionlessScalar.hpp.

◆ Zero()

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

Statically creates a Reynolds number of zero.

Definition at line 98 of file ReynoldsNumber.hpp.

Member Data Documentation

◆ value

double PhQ::DimensionlessScalar< double >::value
protectedinherited

Value of this physical quantity.

Definition at line 143 of file DimensionlessScalar.hpp.


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