Physical Quantities  v1.0.0
C++ library of physical quantities, physical models, and units of measure for scientific computing. https://github.com/acodcha/phq
CompressibleNewtonianFluid.hpp
Go to the documentation of this file.
1 // Copyright © 2020-2024 Alexandre Coderre-Chabot
2 //
3 // This file is part of Physical Quantities (PhQ), a C++ library of physical quantities, physical
4 // models, and units of measure for scientific computing.
5 //
6 // Physical Quantities is hosted at:
7 // https://github.com/acodcha/phq
8 //
9 // Physical Quantities is licensed under the MIT License:
10 // https://mit-license.org
11 //
12 // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
13 // associated documentation files (the "Software"), to deal in the Software without restriction,
14 // including without limitation the rights to use, copy, modify, merge, publish, distribute,
15 // sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
16 // furnished to do so, subject to the following conditions:
17 // - The above copyright notice and this permission notice shall be included in all copies or
18 // substantial portions of the Software.
19 // - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
20 // BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
22 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM
23 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 
25 #ifndef PHQ_CONSTITUTIVE_MODEL_COMPRESSIBLE_NEWTONIAN_FLUID_HPP
26 #define PHQ_CONSTITUTIVE_MODEL_COMPRESSIBLE_NEWTONIAN_FLUID_HPP
27 
28 #include <cstddef>
29 #include <functional>
30 #include <ostream>
31 #include <string>
32 
33 #include "../Base.hpp"
34 #include "../BulkDynamicViscosity.hpp"
35 #include "../ConstitutiveModel.hpp"
36 #include "../DynamicViscosity.hpp"
37 #include "../Strain.hpp"
38 #include "../StrainRate.hpp"
39 #include "../Stress.hpp"
40 #include "../SymmetricDyad.hpp"
41 #include "../Unit/Frequency.hpp"
42 #include "../Unit/Pressure.hpp"
43 
44 namespace PhQ {
45 
46 /// \brief Constitutive model for a compressible Newtonian fluid. This is the simplest constitutive
47 /// model for a compressible fluid. It is similar to the model for an incompressible Newtonian
48 /// fluid, but also includes the effect of the volumetric component of the strain rate tensor in
49 /// addition to its deviatoric component.
50 template <typename NumericType = double>
52 public:
53  /// \brief Default constructor. Constructs a compressible Newtonian fluid constitutive model with
54  /// an uninitialized dynamic viscosity and bulk dynamic viscosity.
56 
57  /// \brief Constructor. Constructs a compressible Newtonian fluid constitutive model from a given
58  /// dynamic viscosity. Initializes the bulk dynamic viscosity to zero.
59  explicit constexpr CompressibleNewtonianFluid(
62  bulk_dynamic_viscosity(PhQ::BulkDynamicViscosity<NumericType>::Zero()) {}
63 
64  /// \brief Constructor. Constructs a compressible Newtonian fluid constitutive model from a given
65  /// dynamic viscosity and bulk dynamic viscosity.
71 
72  /// \brief Destructor. Destroys this compressible Newtonian fluid constitutive model.
73  ~CompressibleNewtonianFluid() noexcept override = default;
74 
75  /// \brief Copy constructor. Constructs a compressible Newtonian fluid constitutive model by
76  /// copying another one.
77  constexpr CompressibleNewtonianFluid(const CompressibleNewtonianFluid& other) = default;
78 
79  /// \brief Move constructor. Constructs a compressible Newtonian fluid constitutive model by
80  /// moving another one.
81  constexpr CompressibleNewtonianFluid(CompressibleNewtonianFluid&& other) noexcept = default;
82 
83  /// \brief Copy assignment operator. Assigns this compressible Newtonian fluid constitutive model
84  /// by copying another one.
85  CompressibleNewtonianFluid& operator=(const CompressibleNewtonianFluid& other) = default;
86 
87  /// \brief Move assignment operator. Assigns this compressible Newtonian fluid constitutive model
88  /// by moving another one.
89  CompressibleNewtonianFluid& operator=(CompressibleNewtonianFluid&& other) noexcept = default;
90 
91  /// \brief Dynamic viscosity of this compressible Newtonian fluid constitutive model.
92  [[nodiscard]] inline constexpr const PhQ::DynamicViscosity<NumericType>&
93  DynamicViscosity() const noexcept {
94  return dynamic_viscosity;
95  }
96 
97  /// \brief Bulk dynamic viscosity of this compressible Newtonian fluid constitutive model.
98  [[nodiscard]] inline constexpr const PhQ::BulkDynamicViscosity<NumericType>&
99  BulkDynamicViscosity() const noexcept {
100  return bulk_dynamic_viscosity;
101  }
102 
103  /// \brief Returns this constitutive model's type.
104  [[nodiscard]] inline ConstitutiveModel::Type GetType() const noexcept override {
106  }
107 
108  /// \brief Returns the stress resulting from a given strain and strain rate. Since this is a
109  /// compressible Newtonian fluid constitutive model, the strain does not contribute to the stress
110  /// and is ignored.
111  [[nodiscard]] inline PhQ::Stress<float> Stress(
112  const PhQ::Strain<float>& /*strain*/,
113  const PhQ::StrainRate<float>& strain_rate) const override {
114  return this->Stress(strain_rate);
115  }
116 
117  /// \brief Returns the stress resulting from a given strain and strain rate. Since this is a
118  /// compressible Newtonian fluid constitutive model, the strain does not contribute to the stress
119  /// and is ignored.
120  [[nodiscard]] inline PhQ::Stress<double> Stress(
121  const PhQ::Strain<double>& /*strain*/,
122  const PhQ::StrainRate<double>& strain_rate) const override {
123  return this->Stress(strain_rate);
124  }
125 
126  /// \brief Returns the stress resulting from a given strain and strain rate. Since this is a
127  /// compressible Newtonian fluid constitutive model, the strain does not contribute to the stress
128  /// and is ignored.
129  [[nodiscard]] inline PhQ::Stress<long double> Stress(
130  const PhQ::Strain<long double>& /*strain*/,
131  const PhQ::StrainRate<long double>& strain_rate) const override {
132  return this->Stress(strain_rate);
133  }
134 
135  /// \brief Returns the stress resulting from a given strain. Since this is a compressible
136  /// Newtonian fluid constitutive model, the strain does not contribute to the stress, so this
137  /// always returns a stress of zero.
138  [[nodiscard]] inline PhQ::Stress<float> Stress(
139  const PhQ::Strain<float>& /*strain*/) const override {
140  return PhQ::Stress<float>::Zero();
141  }
142 
143  /// \brief Returns the stress resulting from a given strain. Since this is a compressible
144  /// Newtonian fluid constitutive model, the strain does not contribute to the stress, so this
145  /// always returns a stress of zero.
146  [[nodiscard]] inline PhQ::Stress<double> Stress(
147  const PhQ::Strain<double>& /*strain*/) const override {
148  return PhQ::Stress<double>::Zero();
149  }
150 
151  /// \brief Returns the stress resulting from a given strain. Since this is a compressible
152  /// Newtonian fluid constitutive model, the strain does not contribute to the stress, so this
153  /// always returns a stress of zero.
154  [[nodiscard]] inline PhQ::Stress<long double> Stress(
155  const PhQ::Strain<long double>& /*strain*/) const override {
157  }
158 
159  /// \brief Returns the stress resulting from a given strain rate.
160  [[nodiscard]] inline PhQ::Stress<float> Stress(
161  const PhQ::StrainRate<float>& strain_rate) const override {
162  // stress = a * strain_rate + b * trace(strain_rate) * identity_matrix
163  // a = 2 * dynamic_viscosity
164  // b = bulk_dynamic_viscosity
165  const float a{static_cast<float>(2) * static_cast<float>(dynamic_viscosity.Value())};
166  const float b{static_cast<float>(bulk_dynamic_viscosity.Value())
167  * static_cast<float>(strain_rate.Value().Trace())};
168  return PhQ::Stress<float>{
169  SymmetricDyad<float>{a * static_cast<SymmetricDyad<float>>(strain_rate.Value())}
170  + SymmetricDyad<float>{ b, static_cast<float>(0), static_cast<float>(0), b,
171  static_cast<float>(0), b},
172  Standard<Unit::Pressure>
173  };
174  }
175 
176  /// \brief Returns the stress resulting from a given strain rate.
177  [[nodiscard]] inline PhQ::Stress<double> Stress(
178  const PhQ::StrainRate<double>& strain_rate) const override {
179  // stress = a * strain_rate + b * trace(strain_rate) * identity_matrix
180  // a = 2 * dynamic_viscosity
181  // b = bulk_dynamic_viscosity
182  const double a{static_cast<double>(2) * static_cast<double>(dynamic_viscosity.Value())};
183  const double b{static_cast<double>(bulk_dynamic_viscosity.Value())
184  * static_cast<double>(strain_rate.Value().Trace())};
185  return PhQ::Stress<double>{
186  SymmetricDyad<double>{a * static_cast<SymmetricDyad<double>>(strain_rate.Value())}
187  + SymmetricDyad<double>{ b, static_cast<double>(0), static_cast<double>(0), b,
188  static_cast<double>(0), b},
189  Standard<Unit::Pressure>
190  };
191  }
192 
193  /// \brief Returns the stress resulting from a given strain rate.
194  [[nodiscard]] inline PhQ::Stress<long double> Stress(
195  const PhQ::StrainRate<long double>& strain_rate) const override {
196  // stress = a * strain_rate + b * trace(strain_rate) * identity_matrix
197  // a = 2 * dynamic_viscosity
198  // b = bulk_dynamic_viscosity
199  const long double a{
200  static_cast<long double>(2) * static_cast<long double>(dynamic_viscosity.Value())};
201  const long double b{static_cast<long double>(bulk_dynamic_viscosity.Value())
202  * static_cast<long double>(strain_rate.Value().Trace())};
204  SymmetricDyad<long double>{a * static_cast<SymmetricDyad<long double>>(strain_rate.Value())}
205  + SymmetricDyad<long double>{ b, static_cast<long double>(0),
206  static_cast<long double>(0), b,
207  static_cast<long double>(0), b},
208  Standard<Unit::Pressure>
209  };
210  }
211 
212  /// \brief Returns the strain resulting from a given stress. Since this is a compressible
213  /// Newtonian fluid constitutive model, stress does not depend on strain, so this always returns a
214  /// strain of zero.
215  [[nodiscard]] inline PhQ::Strain<float> Strain(
216  const PhQ::Stress<float>& /*stress*/) const override {
217  return PhQ::Strain<float>::Zero();
218  }
219 
220  /// \brief Returns the strain resulting from a given stress. Since this is a compressible
221  /// Newtonian fluid constitutive model, stress does not depend on strain, so this always returns a
222  /// strain of zero.
223  [[nodiscard]] inline PhQ::Strain<double> Strain(
224  const PhQ::Stress<double>& /*stress*/) const override {
225  return PhQ::Strain<double>::Zero();
226  }
227 
228  /// \brief Returns the strain resulting from a given stress. Since this is a compressible
229  /// Newtonian fluid constitutive model, stress does not depend on strain, so this always returns a
230  /// strain of zero.
231  [[nodiscard]] inline PhQ::Strain<long double> Strain(
232  const PhQ::Stress<long double>& /*stress*/) const override {
234  }
235 
236  /// \brief Returns the strain rate resulting from a given stress.
237  [[nodiscard]] inline PhQ::StrainRate<float> StrainRate(
238  const PhQ::Stress<float>& stress) const override {
239  // strain_rate = a * stress + b * trace(stress) * identity_matrix
240  // a = 1 / (2 * dynamic_viscosity)
241  // b = -1 * bulk_dynamic_viscosity /
242  // (2 * dynamic_viscosity * (2 * dynamic_viscosity + 3 * bulk_dynamic_viscosity))
243  const float a{static_cast<float>(1)
244  / (static_cast<float>(2) * static_cast<float>(dynamic_viscosity.Value()))};
245  const float b{
246  static_cast<float>(-bulk_dynamic_viscosity.Value())
247  / (static_cast<float>(2) * static_cast<float>(dynamic_viscosity.Value())
248  * (static_cast<float>(2) * static_cast<float>(dynamic_viscosity.Value())
249  + static_cast<float>(3) * static_cast<float>(bulk_dynamic_viscosity.Value())))};
250  const float c{b * static_cast<float>(stress.Value().Trace())};
251  return PhQ::StrainRate<float>{
252  a * static_cast<SymmetricDyad<float>>(stress.Value())
253  + SymmetricDyad<float>{c, static_cast<float>(0), static_cast<float>(0), c,
254  static_cast<float>(0), c},
255  Standard<Unit::Frequency>
256  };
257  }
258 
259  /// \brief Returns the strain rate resulting from a given stress.
260  [[nodiscard]] inline PhQ::StrainRate<double> StrainRate(
261  const PhQ::Stress<double>& stress) const override {
262  // strain_rate = a * stress + b * trace(stress) * identity_matrix
263  // a = 1 / (2 * dynamic_viscosity)
264  // b = -1 * bulk_dynamic_viscosity /
265  // (2 * dynamic_viscosity * (2 * dynamic_viscosity + 3 * bulk_dynamic_viscosity))
266  const double a{static_cast<double>(1)
267  / (static_cast<double>(2) * static_cast<double>(dynamic_viscosity.Value()))};
268  const double b{
269  static_cast<double>(-bulk_dynamic_viscosity.Value())
270  / (static_cast<double>(2) * static_cast<double>(dynamic_viscosity.Value())
271  * (static_cast<double>(2) * static_cast<double>(dynamic_viscosity.Value())
272  + static_cast<double>(3) * static_cast<double>(bulk_dynamic_viscosity.Value())))};
273  const double c{b * static_cast<double>(stress.Value().Trace())};
275  a * static_cast<SymmetricDyad<double>>(stress.Value())
276  + SymmetricDyad<double>{c, static_cast<double>(0), static_cast<double>(0), c,
277  static_cast<double>(0), c},
278  Standard<Unit::Frequency>
279  };
280  }
281 
282  /// \brief Returns the strain rate resulting from a given stress.
284  const PhQ::Stress<long double>& stress) const override {
285  // strain_rate = a * stress + b * trace(stress) * identity_matrix
286  // a = 1 / (2 * dynamic_viscosity)
287  // b = -1 * bulk_dynamic_viscosity /
288  // (2 * dynamic_viscosity * (2 * dynamic_viscosity + 3 * bulk_dynamic_viscosity))
289  const long double a{
290  static_cast<long double>(1)
291  / (static_cast<long double>(2) * static_cast<long double>(dynamic_viscosity.Value()))};
292  const long double b{
293  static_cast<long double>(-bulk_dynamic_viscosity.Value())
294  / (static_cast<long double>(2) * static_cast<long double>(dynamic_viscosity.Value())
295  * (static_cast<long double>(2) * static_cast<long double>(dynamic_viscosity.Value())
296  + static_cast<long double>(3)
297  * static_cast<long double>(bulk_dynamic_viscosity.Value())))};
298  const long double c{b * static_cast<long double>(stress.Value().Trace())};
300  a * static_cast<SymmetricDyad<long double>>(stress.Value())
301  + SymmetricDyad<long double>{c, static_cast<long double>(0),
302  static_cast<long double>(0), c,
303  static_cast<long double>(0), c},
304  Standard<Unit::Frequency>
305  };
306  }
307 
308  /// \brief Prints this compressible Newtonian fluid constitutive model as a string.
309  [[nodiscard]] inline std::string Print() const override {
310  return {"Type = " + std::string{Abbreviation(this->GetType())}
311  + ", Dynamic Viscosity = " + dynamic_viscosity.Print()
312  + ", Bulk Dynamic Viscosity = " + bulk_dynamic_viscosity.Print()};
313  }
314 
315  /// \brief Serializes this compressible Newtonian fluid constitutive model as a JSON message.
316  [[nodiscard]] inline std::string JSON() const override {
317  return {R"({"type":")" + SnakeCase(Abbreviation(this->GetType())) + R"(","dynamic_viscosity":)"
318  + dynamic_viscosity.JSON()
319  + ",\"bulk_dynamic_viscosity\":" + bulk_dynamic_viscosity.JSON() + "}"};
320  }
321 
322  /// \brief Serializes this compressible Newtonian fluid constitutive model as an XML message.
323  [[nodiscard]] inline std::string XML() const override {
324  return {"<type>" + SnakeCase(Abbreviation(this->GetType())) + "</type><dynamic_viscosity>"
325  + dynamic_viscosity.XML() + "</dynamic_viscosity><bulk_dynamic_viscosity>"
326  + bulk_dynamic_viscosity.XML() + "</bulk_dynamic_viscosity>"};
327  }
328 
329  /// \brief Serializes this compressible Newtonian fluid constitutive model as a YAML message.
330  [[nodiscard]] inline std::string YAML() const override {
331  return {"{type:\"" + SnakeCase(Abbreviation(this->GetType()))
332  + "\",dynamic_viscosity:" + dynamic_viscosity.YAML()
333  + ",bulk_dynamic_viscosity:" + bulk_dynamic_viscosity.YAML() + "}"};
334  }
335 
336 private:
337  /// \brief Dynamic viscosity of this compressible Newtonian fluid constitutive model.
339 
340  /// \brief Bulk dynamic viscosity of this compressible Newtonian fluid constitutive model.
342 };
343 
344 template <typename NumericType>
345 inline constexpr bool operator==(
347  const typename ConstitutiveModel::CompressibleNewtonianFluid<NumericType>& right) noexcept {
348  return left.DynamicViscosity() == right.DynamicViscosity()
349  && left.BulkDynamicViscosity() == right.BulkDynamicViscosity();
350 }
351 
352 template <typename NumericType>
353 inline constexpr bool operator!=(
355  const typename ConstitutiveModel::CompressibleNewtonianFluid<NumericType>& right) noexcept {
356  return left.DynamicViscosity() != right.DynamicViscosity()
357  || left.BulkDynamicViscosity() != right.BulkDynamicViscosity();
358 }
359 
360 template <typename NumericType>
361 inline constexpr bool operator<(
363  const typename ConstitutiveModel::CompressibleNewtonianFluid<NumericType>& right) noexcept {
364  if (left.DynamicViscosity() != right.DynamicViscosity()) {
365  return left.DynamicViscosity() < right.DynamicViscosity();
366  }
367  return left.BulkDynamicViscosity() < right.BulkDynamicViscosity();
368 }
369 
370 template <typename NumericType>
371 inline constexpr bool operator>(
373  const typename ConstitutiveModel::CompressibleNewtonianFluid<NumericType>& right) noexcept {
374  if (left.DynamicViscosity() != right.DynamicViscosity()) {
375  return left.DynamicViscosity() > right.DynamicViscosity();
376  }
377  return left.BulkDynamicViscosity() > right.BulkDynamicViscosity();
378 }
379 
380 template <typename NumericType>
381 inline constexpr bool operator<=(
383  const typename ConstitutiveModel::CompressibleNewtonianFluid<NumericType>& right) noexcept {
384  return !(left > right);
385 }
386 
387 template <typename NumericType>
388 inline constexpr bool operator>=(
390  const typename ConstitutiveModel::CompressibleNewtonianFluid<NumericType>& right) noexcept {
391  return !(left < right);
392 }
393 
394 template <typename NumericType>
395 inline std::ostream& operator<<(
396  std::ostream& stream,
398  stream << model.Print();
399  return stream;
400 }
401 
402 } // namespace PhQ
403 
404 namespace std {
405 
406 template <typename NumericType>
407 struct hash<typename PhQ::ConstitutiveModel::CompressibleNewtonianFluid<NumericType>> {
408  size_t operator()(
410  size_t result{17};
411  result = static_cast<size_t>(31) * result
413  result = static_cast<size_t>(31) * result
415  return result;
416  }
417 };
418 
419 } // namespace std
420 
421 #endif // PHQ_CONSTITUTIVE_MODEL_COMPRESSIBLE_NEWTONIAN_FLUID_HPP
Bulk dynamic viscosity, also known as volume dynamic viscosity or dilatational dynamic viscosity....
Constitutive model for a compressible Newtonian fluid. This is the simplest constitutive model for a ...
PhQ::Stress< long double > Stress(const PhQ::Strain< long double > &) const override
Returns the stress resulting from a given strain. Since this is a compressible Newtonian fluid consti...
PhQ::Stress< long double > Stress(const PhQ::StrainRate< long double > &strain_rate) const override
Returns the stress resulting from a given strain rate.
constexpr CompressibleNewtonianFluid(const DynamicViscosity< NumericType > &dynamic_viscosity, const BulkDynamicViscosity< NumericType > &bulk_dynamic_viscosity)
Constructor. Constructs a compressible Newtonian fluid constitutive model from a given dynamic viscos...
PhQ::Strain< double > Strain(const PhQ::Stress< double > &) const override
Returns the strain resulting from a given stress. Since this is a compressible Newtonian fluid consti...
std::string YAML() const override
Serializes this compressible Newtonian fluid constitutive model as a YAML message.
PhQ::Stress< float > Stress(const PhQ::Strain< float > &, const PhQ::StrainRate< float > &strain_rate) const override
Returns the stress resulting from a given strain and strain rate. Since this is a compressible Newton...
PhQ::Stress< long double > Stress(const PhQ::Strain< long double > &, const PhQ::StrainRate< long double > &strain_rate) const override
Returns the stress resulting from a given strain and strain rate. Since this is a compressible Newton...
PhQ::Stress< double > Stress(const PhQ::StrainRate< double > &strain_rate) const override
Returns the stress resulting from a given strain rate.
PhQ::StrainRate< float > StrainRate(const PhQ::Stress< float > &stress) const override
Returns the strain rate resulting from a given stress.
constexpr const PhQ::BulkDynamicViscosity< NumericType > & BulkDynamicViscosity() const noexcept
Bulk dynamic viscosity of this compressible Newtonian fluid constitutive model.
constexpr CompressibleNewtonianFluid(const DynamicViscosity< NumericType > &dynamic_viscosity)
Constructor. Constructs a compressible Newtonian fluid constitutive model from a given dynamic viscos...
CompressibleNewtonianFluid()
Default constructor. Constructs a compressible Newtonian fluid constitutive model with an uninitializ...
PhQ::Stress< double > Stress(const PhQ::Strain< double > &, const PhQ::StrainRate< double > &strain_rate) const override
Returns the stress resulting from a given strain and strain rate. Since this is a compressible Newton...
std::string XML() const override
Serializes this compressible Newtonian fluid constitutive model as an XML message.
std::string JSON() const override
Serializes this compressible Newtonian fluid constitutive model as a JSON message.
PhQ::Stress< float > Stress(const PhQ::Strain< float > &) const override
Returns the stress resulting from a given strain. Since this is a compressible Newtonian fluid consti...
PhQ::Strain< long double > Strain(const PhQ::Stress< long double > &) const override
Returns the strain resulting from a given stress. Since this is a compressible Newtonian fluid consti...
PhQ::BulkDynamicViscosity< NumericType > bulk_dynamic_viscosity
Bulk dynamic viscosity of this compressible Newtonian fluid constitutive model.
PhQ::DynamicViscosity< NumericType > dynamic_viscosity
Dynamic viscosity of this compressible Newtonian fluid constitutive model.
constexpr const PhQ::DynamicViscosity< NumericType > & DynamicViscosity() const noexcept
Dynamic viscosity of this compressible Newtonian fluid constitutive model.
~CompressibleNewtonianFluid() noexcept override=default
Destructor. Destroys this compressible Newtonian fluid constitutive model.
std::string Print() const override
Prints this compressible Newtonian fluid constitutive model as a string.
PhQ::Strain< float > Strain(const PhQ::Stress< float > &) const override
Returns the strain resulting from a given stress. Since this is a compressible Newtonian fluid consti...
ConstitutiveModel::Type GetType() const noexcept override
Returns this constitutive model's type.
PhQ::Stress< float > Stress(const PhQ::StrainRate< float > &strain_rate) const override
Returns the stress resulting from a given strain rate.
PhQ::Stress< double > Stress(const PhQ::Strain< double > &) const override
Returns the stress resulting from a given strain. Since this is a compressible Newtonian fluid consti...
PhQ::StrainRate< double > StrainRate(const PhQ::Stress< double > &stress) const override
Returns the strain rate resulting from a given stress.
PhQ::StrainRate< long double > StrainRate(const PhQ::Stress< long double > &stress) const override
Returns the strain rate resulting from a given stress.
Abstract base class for a material's constitutive model, which is a model that defines the relationsh...
Type
Type of a material's constitutive model.
@ CompressibleNewtonianFluid
Compressible Newtonian fluid constitutive model.
constexpr const PhQ::SymmetricDyad< NumericType > & Value() const noexcept
Value of this physical quantity expressed in its standard unit of measure.
Dynamic viscosity, also known as molecular dynamic viscosity. Dynamic viscosity is the relationship b...
Three-dimensional Euclidean strain rate symmetric dyadic tensor. Time rate of change of strain....
Definition: StrainRate.hpp:51
Three-dimensional Euclidean strain symmetric dyadic tensor. Contains six components in Cartesian coor...
Definition: Strain.hpp:68
static constexpr Strain< NumericType > Zero()
Statically creates a strain tensor of zero.
Definition: Strain.hpp:136
Three-dimensional Euclidean Cauchy stress symmetric dyadic tensor. Contains six components in Cartesi...
Definition: Stress.hpp:50
static constexpr Stress< NumericType > Zero()
Statically creates a stress tensor of zero.
Definition: Stress.hpp:105
Symmetric three-dimensional Euclidean dyadic tensor. Contains six components in Cartesian coordinates...
constexpr NumericType Trace() const noexcept
Returns the trace of this three-dimensional symmetric dyadic tensor.
Namespace that encompasses all of the Physical Quantities library's content.
constexpr bool operator<(const Acceleration< NumericType > &left, const Acceleration< NumericType > &right) noexcept
constexpr bool operator<=(const Acceleration< NumericType > &left, const Acceleration< NumericType > &right) noexcept
constexpr bool operator>(const Acceleration< NumericType > &left, const Acceleration< NumericType > &right) noexcept
constexpr bool operator==(const Acceleration< NumericType > &left, const Acceleration< NumericType > &right) noexcept
constexpr bool operator>=(const Acceleration< NumericType > &left, const Acceleration< NumericType > &right) noexcept
std::string SnakeCase(const std::string_view string)
Returns a copy of the given string in snake case: all characters are lowercase and all spaces are rep...
Definition: Base.hpp:263
std::string_view Abbreviation(const Enumeration enumeration)
Returns the abbreviation of a given enumeration value. For example, PhQ::Abbreviation(PhQ::Unit::Time...
Definition: Base.hpp:89
constexpr bool operator!=(const Acceleration< NumericType > &left, const Acceleration< NumericType > &right) noexcept
std::ostream & operator<<(std::ostream &stream, const Acceleration< NumericType > &acceleration)