include/meltpooldg/compressible_flow/equation_of_state.hpp Source File

Developer Documentation: include/meltpooldg/compressible_flow/equation_of_state.hpp Source File
Developer Documentation
equation_of_state.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <deal.II/base/config.h>
4
5#include <deal.II/base/exceptions.h>
6#include <deal.II/base/tensor.h>
7#include <deal.II/base/vectorization.h>
8
13
14#include <cmath>
15#include <utility>
16
18{
23 template <typename T>
24 concept EOSIsConservativeValueView = requires(const T v) {
25 {
26 v.density()
27 };
28 {
29 v.velocity()
30 };
31 {
32 v.total_energy()
33 };
34 };
35
40 template <typename T>
41 concept EOSIsPrimitiveValueView = requires(const T v) {
42 {
43 v.pressure()
44 };
45 {
46 v.velocity()
47 };
48 {
49 v.temperature()
50 };
51 };
52
57 template <typename T>
58 concept EOSIsWritableConservativeValueView = requires(T v) {
59 {
60 v.density() = v.density()
61 };
62 {
63 v.momentum(0) = v.momentum(0)
64 };
65 {
66 v.total_energy() = v.total_energy()
67 };
68 };
69
74 template <typename T>
75 concept EOSIsWritablePrimitiveValueView = requires(T v) {
76 {
77 v.pressure() = v.pressure()
78 };
79 {
80 v.velocity(0) = v.velocity(0)
81 };
82 {
83 v.temperature() = v.temperature()
84 };
85 };
86
91 template <typename T>
92 concept EOSIsGradientView = requires(const T g) {
93 {
94 g.grad_density()
95 };
96 {
97 g.grad_velocity()
98 };
99 {
100 g.grad_total_energy()
101 };
102 };
103
108 template <typename T>
109 concept IdealGasIsMaterialView = requires(const T m) {
110 {
111 m.heat_capacity_ratio()
112 };
113 {
114 m.specific_gas_constant()
115 };
116 };
117
122 template <typename T>
123 concept StiffenedGasIsMaterialView = requires(const T m) {
124 {
125 m.heat_capacity_ratio()
126 };
127 {
128 m.specific_isobaric_heat()
129 };
130 {
131 m.stiffening_pressure()
132 };
133 };
134
139 template <typename T>
140 concept NobleAbelStiffenedGasIsMaterialView = requires(const T m) {
141 {
142 m.heat_capacity_ratio()
143 };
144 {
145 m.specific_isobaric_heat()
146 };
147 {
148 m.stiffening_pressure()
149 };
150 {
151 m.heat_bound()
152 };
153 {
154 m.covolume()
155 };
156 };
157
162 template <typename T>
163 concept WeaklyCompressibleIsMaterialView = requires(const T m) {
164 {
165 m.specific_isochoric_heat()
166 };
167 {
168 m.reference_state_sound_speed()
169 };
170 {
171 m.reference_state_density()
172 };
173 {
174 m.reference_state_pressure()
175 };
176 };
177
179 {
188 template <EOSIsConservativeValueView ValueView, IdealGasIsMaterialView MaterialView>
189 static inline DEAL_II_ALWAYS_INLINE //
190 auto
191 thermodynamic_pressure(const ValueView &value_view, const MaterialView &material_view)
192 {
193 return (material_view.heat_capacity_ratio() - 1.) *
194 (value_view.total_energy() -
195 value_view.density() * 0.5 *
196 scalar_product(value_view.velocity(), value_view.velocity()));
197 }
198
209 template <EOSIsConservativeValueView ValueView,
210 EOSIsGradientView GradientView,
211 IdealGasIsMaterialView MaterialView>
212 static inline DEAL_II_ALWAYS_INLINE //
213 auto
214 grad_temperature(const ValueView &value_view,
215 const GradientView &gradient_view,
216 const MaterialView &material_view)
217 {
218 const auto grad_E =
219 1. / value_view.density() *
220 (gradient_view.grad_total_energy() -
221 1. / value_view.density() * value_view.total_energy() * gradient_view.grad_density());
222
223 return (material_view.heat_capacity_ratio() - 1.0) / material_view.specific_gas_constant() *
224 (grad_E - matrix_vector_product(gradient_view.grad_velocity(), value_view.velocity()));
225 }
226
236 template <EOSIsConservativeValueView ValueView, IdealGasIsMaterialView MaterialView>
237 static inline DEAL_II_ALWAYS_INLINE //
238 auto
239 speed_of_sound(const ValueView &value_view, const MaterialView &material_view)
240 {
241 return std::sqrt(material_view.heat_capacity_ratio() *
242 thermodynamic_pressure(value_view, material_view) / value_view.density());
243 }
244
253 template <EOSIsConservativeValueView ValueView, IdealGasIsMaterialView MaterialView>
254 static inline DEAL_II_ALWAYS_INLINE //
255 auto
256 temperature(const ValueView &value_view, const MaterialView &material_view)
257 {
258 return thermodynamic_pressure(value_view, material_view) /
259 (material_view.specific_gas_constant() * value_view.density());
260 }
261
271 template <typename ValueType,
273 IdealGasIsMaterialView MaterialView>
274 static inline DEAL_II_ALWAYS_INLINE //
275 auto
276 inner_energy_from_pressure(const ValueType &pressure,
277 const ValueView &,
278 const MaterialView &material_view)
279 {
280 return pressure / (material_view.heat_capacity_ratio() - 1.);
281 }
282
290 template <typename ValueView, IdealGasIsMaterialView MaterialView>
291 static inline DEAL_II_ALWAYS_INLINE //
292 auto
293 specific_internal_energy(const ValueView &value_view, const MaterialView &material_view)
294 {
295 return thermodynamic_pressure(value_view, material_view) /
296 (value_view.density() * (material_view.heat_capacity_ratio() - 1.));
297 }
298
309 template <int dim,
310 EOSIsWritableConservativeValueView WritableConservativeValueView,
311 EOSIsPrimitiveValueView PrimitiveValueView,
312 IdealGasIsMaterialView MaterialView>
313 static inline DEAL_II_ALWAYS_INLINE //
314 void
315 conservative_from_primitive(WritableConservativeValueView &conservative_value_view,
316 const PrimitiveValueView &primitive_value_view,
317 const MaterialView &material_view)
318 {
319 const auto pressure = primitive_value_view.pressure();
320 const auto temperature = primitive_value_view.temperature();
321 const auto velocity = primitive_value_view.velocity();
322
323 const auto density = pressure / (material_view.specific_gas_constant() * temperature);
324
325 // density
326 conservative_value_view.density() = density;
327
328 // momentum
329 for (unsigned int d = 0; d < dim; ++d)
330 conservative_value_view.momentum(d) = density * velocity[d];
331
332 // total energy
333 conservative_value_view.total_energy() =
334 density * (material_view.specific_gas_constant() /
335 (material_view.heat_capacity_ratio() - 1.) * temperature +
336 0.5 * scalar_product(velocity, velocity));
337 }
338 };
339
341 {
350 template <EOSIsConservativeValueView ValueView, StiffenedGasIsMaterialView MaterialView>
351 static inline DEAL_II_ALWAYS_INLINE //
352 auto
353 thermodynamic_pressure(const ValueView &value_view, const MaterialView &material_view)
354 {
355 return (material_view.heat_capacity_ratio() - 1.) *
356 (value_view.total_energy() -
357 value_view.density() * 0.5 *
358 scalar_product(value_view.velocity(), value_view.velocity())) -
359 material_view.heat_capacity_ratio() * material_view.stiffening_pressure();
360 }
361
372 template <EOSIsConservativeValueView ValueView,
373 EOSIsGradientView GradientView,
374 StiffenedGasIsMaterialView MaterialView>
375 static inline DEAL_II_ALWAYS_INLINE //
376 auto
377 grad_temperature(const ValueView &value_view,
378 const GradientView &gradient_view,
379 const MaterialView &material_view)
380 {
381 const auto inv_rho = 1. / value_view.density();
382
383 const auto grad_E =
384 inv_rho * (gradient_view.grad_total_energy() -
385 inv_rho * value_view.total_energy() * gradient_view.grad_density());
386
387 return material_view.heat_capacity_ratio() / material_view.specific_isobaric_heat() *
388 (grad_E - matrix_vector_product(gradient_view.grad_velocity(), value_view.velocity()) +
389 material_view.stiffening_pressure() * inv_rho * inv_rho *
390 gradient_view.grad_density());
391 }
392
402 template <EOSIsConservativeValueView ValueView, StiffenedGasIsMaterialView MaterialView>
403 static inline DEAL_II_ALWAYS_INLINE //
404 auto
405 speed_of_sound(const ValueView &value_view, const MaterialView &material_view)
406 {
407 return std::sqrt(
408 material_view.heat_capacity_ratio() *
409 (thermodynamic_pressure(value_view, material_view) + material_view.stiffening_pressure()) /
410 value_view.density());
411 }
412
422 template <EOSIsConservativeValueView ValueView, StiffenedGasIsMaterialView MaterialView>
423 static inline DEAL_II_ALWAYS_INLINE //
424 auto
425 temperature(const ValueView &value_view, const MaterialView &material_view)
426 {
427 return (thermodynamic_pressure(value_view, material_view) +
428 material_view.stiffening_pressure()) *
429 material_view.heat_capacity_ratio() /
430 (material_view.specific_isobaric_heat() * value_view.density() *
431 (material_view.heat_capacity_ratio() - 1.));
432 }
433
443 template <typename ValueType,
445 StiffenedGasIsMaterialView MaterialView>
446 static inline DEAL_II_ALWAYS_INLINE //
447 auto
448 inner_energy_from_pressure(const ValueType &pressure,
449 const ValueView &,
450 const MaterialView &material_view)
451 {
452 return (pressure +
453 material_view.heat_capacity_ratio() * material_view.stiffening_pressure()) /
454 (material_view.heat_capacity_ratio() - 1.);
455 }
456
464 template <typename ValueView, StiffenedGasIsMaterialView MaterialView>
465 static inline DEAL_II_ALWAYS_INLINE //
466 auto
467 specific_internal_energy(const ValueView &value_view, const MaterialView &material_view)
468 {
469 return (thermodynamic_pressure(value_view, material_view) +
470 material_view.heat_capacity_ratio() * material_view.stiffening_pressure()) /
471 (value_view.density() * (material_view.heat_capacity_ratio() - 1.));
472 }
473
482 template <int dim,
483 EOSIsWritableConservativeValueView WritableConservativeValueView,
484 EOSIsPrimitiveValueView PrimitiveValueView,
485 StiffenedGasIsMaterialView MaterialView>
486 static inline DEAL_II_ALWAYS_INLINE //
487 void
488 conservative_from_primitive(WritableConservativeValueView &conservative_value_view,
489 const PrimitiveValueView &primitive_value_view,
490 const MaterialView &material_view)
491 {
492 const auto density =
493 (primitive_value_view.pressure() + material_view.stiffening_pressure()) *
494 material_view.heat_capacity_ratio() /
495 (material_view.specific_isobaric_heat() * primitive_value_view.temperature() *
496 (material_view.heat_capacity_ratio() - 1.));
497
498 // density
499 conservative_value_view.density() = density;
500
501 // momentum
502 for (unsigned int d = 0; d < dim; ++d)
503 conservative_value_view.momentum(d) = density * primitive_value_view.velocity(d);
504
505 // total energy
506 conservative_value_view.total_energy() =
507 density *
508 (material_view.specific_isobaric_heat() / material_view.heat_capacity_ratio() *
509 primitive_value_view.temperature() +
510 material_view.stiffening_pressure() / density +
511 0.5 * scalar_product(primitive_value_view.velocity(), primitive_value_view.velocity()));
512 }
513 };
514
516 {
525 template <EOSIsConservativeValueView ValueView,
527 static inline DEAL_II_ALWAYS_INLINE //
528 auto
529 thermodynamic_pressure(const ValueView &value_view, const MaterialView &material_view)
530 {
531 return ((material_view.heat_capacity_ratio() - 1.) *
532 (value_view.total_energy() -
533 0.5 * value_view.density() *
534 scalar_product(value_view.velocity(), value_view.velocity()) -
535 value_view.density() * material_view.heat_bound()) -
536 material_view.heat_capacity_ratio() * material_view.stiffening_pressure() *
537 (1. - value_view.density() * material_view.covolume())) /
538 (1. - value_view.density() * material_view.covolume());
539 }
540
551 template <EOSIsConservativeValueView ValueView,
552 EOSIsGradientView GradientView,
554 static inline DEAL_II_ALWAYS_INLINE //
555 auto
556 grad_temperature(const ValueView &value_view,
557 const GradientView &gradient_view,
558 const MaterialView &material_view)
559 {
560 const auto inv_rho = 1. / value_view.density();
561
562 const auto grad_E =
563 inv_rho * (gradient_view.grad_total_energy() -
564 inv_rho * value_view.total_energy() * gradient_view.grad_density());
565
566 return material_view.heat_capacity_ratio() / material_view.specific_isobaric_heat() *
567 (grad_E - matrix_vector_product(gradient_view.grad_velocity(), value_view.velocity()) +
568 material_view.stiffening_pressure() * inv_rho * inv_rho *
569 gradient_view.grad_density());
570 }
571
581 template <EOSIsConservativeValueView ValueView,
583 static inline DEAL_II_ALWAYS_INLINE //
584 auto
585 speed_of_sound(const ValueView &value_view, const MaterialView &material_view)
586 {
587 return std::sqrt(
588 material_view.heat_capacity_ratio() *
589 (thermodynamic_pressure(value_view, material_view) + material_view.stiffening_pressure()) /
590 (value_view.density() * (1. - value_view.density() * material_view.covolume())));
591 }
592
602 template <EOSIsConservativeValueView ValueView,
604 static inline DEAL_II_ALWAYS_INLINE //
605 auto
606 temperature(const ValueView &value_view, const MaterialView &material_view)
607 {
608 return (thermodynamic_pressure(value_view, material_view) +
609 material_view.stiffening_pressure()) *
610 (1. / value_view.density() - material_view.covolume()) *
611 material_view.heat_capacity_ratio() /
612 ((material_view.heat_capacity_ratio() - 1.) * material_view.specific_isobaric_heat());
613 }
614
625 template <typename ValueType,
628 static inline DEAL_II_ALWAYS_INLINE //
629 auto
630 inner_energy_from_pressure(const ValueType &pressure,
631 const ValueView &value_view,
632 const MaterialView &material_view)
633 {
634 return (pressure +
635 material_view.heat_capacity_ratio() * material_view.stiffening_pressure()) /
636 (material_view.heat_capacity_ratio() - 1.) *
637 (1. - value_view.density() * material_view.covolume()) +
638 value_view.density() * material_view.heat_bound();
639 }
640
648 template <typename ValueView, NobleAbelStiffenedGasIsMaterialView MaterialView>
649 static inline DEAL_II_ALWAYS_INLINE //
650 auto
651 specific_internal_energy(const ValueView &value_view, const MaterialView &material_view)
652 {
653 return (thermodynamic_pressure(value_view, material_view) +
654 material_view.heat_capacity_ratio() * material_view.stiffening_pressure()) /
655 (material_view.heat_capacity_ratio() - 1.) *
656 (1. / value_view.density() - material_view.covolume()) +
657 material_view.heat_bound();
658 }
659
668 template <int dim,
669 EOSIsWritableConservativeValueView WritableConservativeValueView,
670 EOSIsPrimitiveValueView PrimitiveValueView,
672 static inline DEAL_II_ALWAYS_INLINE //
673 void
674 conservative_from_primitive(WritableConservativeValueView &conservative_value_view,
675 const PrimitiveValueView &primitive_value_view,
676 const MaterialView &material_view)
677 {
678 const auto pressure = primitive_value_view.pressure();
679 const auto temperature = primitive_value_view.temperature();
680
681 const auto density =
682 (pressure + material_view.stiffening_pressure()) /
683 (material_view.specific_isobaric_heat() * temperature *
684 (material_view.heat_capacity_ratio() - 1.) / material_view.heat_capacity_ratio() +
685 material_view.covolume() * (pressure + material_view.stiffening_pressure()));
686
687 // density
688 conservative_value_view.density() = density;
689
690 // momentum
691 for (unsigned int d = 0; d < dim; ++d)
692 conservative_value_view.momentum(d) = density * primitive_value_view.velocity(d);
693
694 // total energy
695 conservative_value_view.total_energy() =
696 density *
697 (material_view.specific_isobaric_heat() / material_view.heat_capacity_ratio() *
699 material_view.stiffening_pressure() * (1. / density - material_view.covolume()) +
700 material_view.heat_bound() +
701 0.5 * scalar_product(primitive_value_view.velocity(), primitive_value_view.velocity()));
702 }
703 };
704
706 {
716 template <EOSIsConservativeValueView ValueView, WeaklyCompressibleIsMaterialView MaterialView>
717 static inline DEAL_II_ALWAYS_INLINE //
718 auto
719 thermodynamic_pressure(const ValueView &value_view, const MaterialView &material_view)
720 {
721 return material_view.reference_state_sound_speed() *
722 material_view.reference_state_sound_speed() *
723 (value_view.density() - material_view.reference_state_density()) +
724 material_view.reference_state_pressure();
725 }
726
737 template <EOSIsConservativeValueView ValueView,
738 EOSIsGradientView GradientView,
740 static inline DEAL_II_ALWAYS_INLINE //
741 auto
742 grad_temperature(const ValueView &value_view,
743 const GradientView &gradient_view,
744 const MaterialView &material_view)
745 {
746 const auto grad_E =
747 1. / value_view.density() *
748 (gradient_view.grad_total_energy() -
749 value_view.total_energy() / value_view.density() * gradient_view.grad_density());
750
751 return 1. / material_view.specific_isochoric_heat() *
752 (grad_E - matrix_vector_product(gradient_view.grad_velocity(), value_view.velocity()));
753 }
754
764 template <EOSIsConservativeValueView ValueView, WeaklyCompressibleIsMaterialView MaterialView>
765 static inline DEAL_II_ALWAYS_INLINE //
766 auto
767 speed_of_sound(const ValueView &value_view, const MaterialView &material_view)
768 {
769 // return type could be either vectorized or non-vectorized
770 using ReturnType = decltype(value_view.density());
771
772 return ReturnType(material_view.reference_state_sound_speed());
773 }
774
784 template <EOSIsConservativeValueView ValueView, WeaklyCompressibleIsMaterialView MaterialView>
785 static inline DEAL_II_ALWAYS_INLINE //
786 auto
787 temperature(const ValueView &value_view, const MaterialView &material_view)
788 {
789 return (value_view.total_energy() / value_view.density() -
790 0.5 * scalar_product(value_view.velocity(), value_view.velocity())) /
791 material_view.specific_isochoric_heat();
792 }
793
803 template <typename ValueType,
806 static inline DEAL_II_ALWAYS_INLINE //
807 auto
808 inner_energy_from_pressure(const ValueType &, const ValueView &, const MaterialView &)
809 {
810 AssertThrow(
811 false,
812 dealii::ExcMessage(
813 "inner_energy_from_pressure() is not defined for the weakly compressible EOS."));
814
815 return ValueType{};
816 }
817
824 template <typename ValueView, WeaklyCompressibleIsMaterialView MaterialView>
825 static inline DEAL_II_ALWAYS_INLINE //
826 auto
827 specific_internal_energy(const ValueView &value_view, const MaterialView &)
828 {
829 return value_view.total_energy() / value_view.density() -
830 0.5 * scalar_product(value_view.velocity(), value_view.velocity());
831 }
832
841 template <int dim,
842 EOSIsWritableConservativeValueView WritableConservativeValueView,
843 EOSIsPrimitiveValueView PrimitiveValueView,
845 static inline DEAL_II_ALWAYS_INLINE //
846 void
847 conservative_from_primitive(WritableConservativeValueView &conservative_value_view,
848 const PrimitiveValueView &primitive_value_view,
849 const MaterialView &material_view)
850 {
851 const auto pressure = primitive_value_view.pressure();
852 const auto temperature = primitive_value_view.temperature();
853 const auto velocity = primitive_value_view.velocity();
854
855 const auto density = (pressure - material_view.reference_state_pressure()) /
856 (material_view.reference_state_sound_speed() *
857 material_view.reference_state_sound_speed()) +
858 material_view.reference_state_density();
859
860 // density
861 conservative_value_view.density() = density;
862
863 // momentum
864 for (unsigned int d = 0; d < dim; ++d)
865 conservative_value_view.momentum(d) = density * velocity[d];
866
867 // total energy
868 conservative_value_view.total_energy() =
869 density * (material_view.specific_isochoric_heat() * temperature +
870 0.5 * scalar_product(velocity, velocity));
871 }
872 };
873
877 template <typename T>
878 concept HasSupportedEOS = requires {
879 {
880 T::supported_eos
881 } -> std::convertible_to<const std::array<CompressibleFlow::EquationOfState,
882 std::tuple_size_v<decltype(T::supported_eos)>> &>;
883 };
884
893 template <typename Derived, CompressibleFlow::EquationOfState EOS>
894 constexpr bool
896 {
897 return std::ranges::find(Derived::supported_eos, EOS) != Derived::supported_eos.end();
898 }
899
917 template <typename Derived, typename F>
918 inline DEAL_II_ALWAYS_INLINE decltype(auto)
919 dispatch_eos(CompressibleFlow::EquationOfState eos_type, F &&f)
920 {
921 auto check_support = [](CompressibleFlow::EquationOfState type) {
922 if constexpr (HasSupportedEOS<Derived>)
923 {
924 if (type == CompressibleFlow::EquationOfState::ideal_gas)
925 return supports_eos<Derived, CompressibleFlow::EquationOfState::ideal_gas>();
926 if (type == CompressibleFlow::EquationOfState::stiffened_gas)
927 return supports_eos<Derived, CompressibleFlow::EquationOfState::stiffened_gas>();
928 if (type == CompressibleFlow::EquationOfState::noble_abel_stiffened_gas)
929 return supports_eos<Derived,
930 CompressibleFlow::EquationOfState::noble_abel_stiffened_gas>();
931 if (type == CompressibleFlow::EquationOfState::weakly_compressible)
932 return supports_eos<Derived, CompressibleFlow::EquationOfState::weakly_compressible>();
933 return false;
934 }
935 return true;
936 };
937
938 switch (eos_type)
939 {
940 case CompressibleFlow::EquationOfState::ideal_gas:
941 if constexpr (check_support(CompressibleFlow::EquationOfState::ideal_gas))
942 return std::forward<F>(f)(IdealGasEOS{});
943 break;
944
945 case CompressibleFlow::EquationOfState::stiffened_gas:
946 if constexpr (check_support(CompressibleFlow::EquationOfState::stiffened_gas))
947 return std::forward<F>(f)(StiffenedGasEOS{});
948 break;
949
950 case CompressibleFlow::EquationOfState::noble_abel_stiffened_gas:
951 if constexpr (check_support(CompressibleFlow::EquationOfState::noble_abel_stiffened_gas))
952 return std::forward<F>(f)(NobleAbelStiffenedGasEOS{});
953 break;
954
955 case CompressibleFlow::EquationOfState::weakly_compressible:
956 if constexpr (check_support(CompressibleFlow::EquationOfState::weakly_compressible))
957 return std::forward<F>(f)(WeaklyCompressibleEOS{});
958 break;
959
960 default:
961 break;
962 }
963
964 AssertThrow(false, dealii::ExcMessage("The provided EOS is not supported by this View."));
965 }
966
967
968
977 template <int dim, ArithmeticType ValueType, typename Derived>
979 {
980 decltype(auto)
981 pressure() const
982 {
983 return dispatch_eos<Derived>(eos_type(), [&](auto eos) -> decltype(auto) {
984 return eos.thermodynamic_pressure(derived(), derived());
985 });
986 }
987
988 decltype(auto)
990 {
991 return dispatch_eos<Derived>(eos_type(), [&](auto eos) -> decltype(auto) {
992 return eos.temperature(derived(), derived());
993 });
994 }
995
996 decltype(auto)
998 {
999 return dispatch_eos<Derived>(eos_type(), [&](auto eos) -> decltype(auto) {
1000 return eos.speed_of_sound(derived(), derived());
1001 });
1002 }
1003
1004 decltype(auto)
1005 inner_energy_from_pressure(const ValueType &pressure) const
1006 {
1007 return dispatch_eos<Derived>(eos_type(), [&](auto eos) -> decltype(auto) {
1008 return eos.inner_energy_from_pressure(pressure, derived(), derived());
1009 });
1010 }
1011
1012 decltype(auto)
1014 {
1015 return dispatch_eos<Derived>(eos_type(), [&](auto eos) -> decltype(auto) {
1016 return eos.specific_internal_energy(derived(), derived());
1017 });
1018 }
1019
1020 private:
1021 decltype(auto)
1022 eos_type() const
1023 {
1024 return static_cast<const Derived &>(*this).eos_type();
1025 }
1026
1027 const Derived &
1028 derived() const
1029 {
1030 return static_cast<const Derived &>(*this);
1031 }
1032 };
1033
1042 template <int dim, typename Derived>
1044 {
1045 decltype(auto)
1047 {
1048 return dispatch_eos<Derived>(eos_type(), [&](auto eos) -> decltype(auto) {
1049 return eos.grad_temperature(derived(), derived(), derived());
1050 });
1051 }
1052
1053 private:
1054 const Derived &
1055 derived() const
1056 {
1057 return static_cast<const Derived &>(*this);
1058 }
1059
1060 decltype(auto)
1061 eos_type() const
1062 {
1063 return static_cast<const Derived &>(*this).eos_type();
1064 }
1065 };
1066} // namespace MeltPoolDG::Flow
Definition equation_of_state.hpp:24
Definition equation_of_state.hpp:92
Definition equation_of_state.hpp:41
Definition equation_of_state.hpp:58
Definition equation_of_state.hpp:75
Concept ensuring a type defines a specific, compatible supported_eos array.
Definition equation_of_state.hpp:878
Definition equation_of_state.hpp:109
Definition equation_of_state.hpp:140
Definition equation_of_state.hpp:123
Definition equation_of_state.hpp:163
Definition equation_of_state.hpp:18
DEAL_II_ALWAYS_INLINE decltype(auto) dispatch_eos(CompressibleFlow::EquationOfState eos_type, F &&f)
Definition equation_of_state.hpp:919
constexpr bool supports_eos()
Dispatch helper function that checks at compile-time whether an equation of state is supported.
Definition equation_of_state.hpp:895
dealii::VectorizedArray< number, N > scalar_product(const dealii::VectorizedArray< number, N > &scalar, const dealii::Tensor< 1, 1, dealii::VectorizedArray< number, N > > &vec)
Definition dealii_tensor.hpp:60
dealii::Tensor< 1, n_rows, number > matrix_vector_product(const dealii::Tensor< 1, n_rows, dealii::Tensor< 1, n_columns, number > > &matrix, const dealii::Tensor< 1, n_columns, number > &vector)
Definition dealii_tensor.hpp:80
Definition equation_of_state.hpp:1044
const Derived & derived() const
Definition equation_of_state.hpp:1055
decltype(auto) grad_temperature() const
Definition equation_of_state.hpp:1046
decltype(auto) eos_type() const
Definition equation_of_state.hpp:1061
Definition equation_of_state.hpp:979
const Derived & derived() const
Definition equation_of_state.hpp:1028
decltype(auto) speed_of_sound() const
Definition equation_of_state.hpp:997
decltype(auto) specific_internal_energy() const
Definition equation_of_state.hpp:1013
decltype(auto) eos_type() const
Definition equation_of_state.hpp:1022
decltype(auto) temperature() const
Definition equation_of_state.hpp:989
decltype(auto) pressure() const
Definition equation_of_state.hpp:981
decltype(auto) inner_energy_from_pressure(const ValueType &pressure) const
Definition equation_of_state.hpp:1005
Definition equation_of_state.hpp:179
static DEAL_II_ALWAYS_INLINE void conservative_from_primitive(WritableConservativeValueView &conservative_value_view, const PrimitiveValueView &primitive_value_view, const MaterialView &material_view)
Definition equation_of_state.hpp:315
static DEAL_II_ALWAYS_INLINE auto inner_energy_from_pressure(const ValueType &pressure, const ValueView &, const MaterialView &material_view)
Definition equation_of_state.hpp:276
static DEAL_II_ALWAYS_INLINE auto grad_temperature(const ValueView &value_view, const GradientView &gradient_view, const MaterialView &material_view)
Definition equation_of_state.hpp:214
static DEAL_II_ALWAYS_INLINE auto temperature(const ValueView &value_view, const MaterialView &material_view)
Definition equation_of_state.hpp:256
static DEAL_II_ALWAYS_INLINE auto speed_of_sound(const ValueView &value_view, const MaterialView &material_view)
Definition equation_of_state.hpp:239
static DEAL_II_ALWAYS_INLINE auto thermodynamic_pressure(const ValueView &value_view, const MaterialView &material_view)
Definition equation_of_state.hpp:191
static DEAL_II_ALWAYS_INLINE auto specific_internal_energy(const ValueView &value_view, const MaterialView &material_view)
Definition equation_of_state.hpp:293
Definition equation_of_state.hpp:516
static DEAL_II_ALWAYS_INLINE auto temperature(const ValueView &value_view, const MaterialView &material_view)
Definition equation_of_state.hpp:606
static DEAL_II_ALWAYS_INLINE void conservative_from_primitive(WritableConservativeValueView &conservative_value_view, const PrimitiveValueView &primitive_value_view, const MaterialView &material_view)
Definition equation_of_state.hpp:674
static DEAL_II_ALWAYS_INLINE auto thermodynamic_pressure(const ValueView &value_view, const MaterialView &material_view)
Definition equation_of_state.hpp:529
static DEAL_II_ALWAYS_INLINE auto speed_of_sound(const ValueView &value_view, const MaterialView &material_view)
Definition equation_of_state.hpp:585
static DEAL_II_ALWAYS_INLINE auto specific_internal_energy(const ValueView &value_view, const MaterialView &material_view)
Definition equation_of_state.hpp:651
static DEAL_II_ALWAYS_INLINE auto grad_temperature(const ValueView &value_view, const GradientView &gradient_view, const MaterialView &material_view)
Definition equation_of_state.hpp:556
static DEAL_II_ALWAYS_INLINE auto inner_energy_from_pressure(const ValueType &pressure, const ValueView &value_view, const MaterialView &material_view)
Definition equation_of_state.hpp:630
Definition equation_of_state.hpp:341
static DEAL_II_ALWAYS_INLINE auto specific_internal_energy(const ValueView &value_view, const MaterialView &material_view)
Definition equation_of_state.hpp:467
static DEAL_II_ALWAYS_INLINE auto inner_energy_from_pressure(const ValueType &pressure, const ValueView &, const MaterialView &material_view)
Definition equation_of_state.hpp:448
static DEAL_II_ALWAYS_INLINE auto temperature(const ValueView &value_view, const MaterialView &material_view)
Definition equation_of_state.hpp:425
static DEAL_II_ALWAYS_INLINE auto thermodynamic_pressure(const ValueView &value_view, const MaterialView &material_view)
Definition equation_of_state.hpp:353
static DEAL_II_ALWAYS_INLINE auto speed_of_sound(const ValueView &value_view, const MaterialView &material_view)
Definition equation_of_state.hpp:405
static DEAL_II_ALWAYS_INLINE void conservative_from_primitive(WritableConservativeValueView &conservative_value_view, const PrimitiveValueView &primitive_value_view, const MaterialView &material_view)
Definition equation_of_state.hpp:488
static DEAL_II_ALWAYS_INLINE auto grad_temperature(const ValueView &value_view, const GradientView &gradient_view, const MaterialView &material_view)
Definition equation_of_state.hpp:377
Definition equation_of_state.hpp:706
static DEAL_II_ALWAYS_INLINE auto thermodynamic_pressure(const ValueView &value_view, const MaterialView &material_view)
Definition equation_of_state.hpp:719
static DEAL_II_ALWAYS_INLINE auto speed_of_sound(const ValueView &value_view, const MaterialView &material_view)
Definition equation_of_state.hpp:767
static DEAL_II_ALWAYS_INLINE auto grad_temperature(const ValueView &value_view, const GradientView &gradient_view, const MaterialView &material_view)
Definition equation_of_state.hpp:742
static DEAL_II_ALWAYS_INLINE auto specific_internal_energy(const ValueView &value_view, const MaterialView &)
Definition equation_of_state.hpp:827
static DEAL_II_ALWAYS_INLINE void conservative_from_primitive(WritableConservativeValueView &conservative_value_view, const PrimitiveValueView &primitive_value_view, const MaterialView &material_view)
Definition equation_of_state.hpp:847
static DEAL_II_ALWAYS_INLINE auto inner_energy_from_pressure(const ValueType &, const ValueView &, const MaterialView &)
Definition equation_of_state.hpp:808
static DEAL_II_ALWAYS_INLINE auto temperature(const ValueView &value_view, const MaterialView &material_view)
Definition equation_of_state.hpp:787