Line data Source code
1 0 : // Distributed under the MIT License.
2 : // See LICENSE.txt for details.
3 :
4 : #pragma once
5 :
6 : #include "DataStructures/Tensor/TypeAliases.hpp"
7 : #include "Utilities/Gsl.hpp"
8 :
9 : /*!
10 : * \brief Items related to solving for irrotational bns initial data
11 : * See e.g. \cite BaumgarteShapiro Ch. 15 (P. 523)
12 : */
13 0 : namespace hydro::initial_data::irrotational_bns {
14 : /// @{
15 : /// \brief Compute the shift plus a spatial vector \f$ k^i\f$ representing
16 : /// the local binary rotation \f$B^i = \beta^i + k^i\f$
17 : ///
18 : template <typename DataType>
19 1 : void rotational_shift(
20 : gsl::not_null<tnsr::I<DataType, 3>*> result,
21 : const tnsr::I<DataType, 3>& shift,
22 : const tnsr::I<DataType, 3>& spatial_rotational_killing_vector);
23 :
24 : template <typename DataType>
25 1 : tnsr::I<DataType, 3> rotational_shift(
26 : const tnsr::I<DataType, 3>& shift,
27 : const tnsr::I<DataType, 3>& spatial_rotational_killing_vector);
28 : /// @}
29 :
30 : /// @{
31 : /// \brief Compute the stress-energy corresponding to the rotation shift.
32 : /// (this has no corresponding equation number in \cite BaumgarteShapiro, it
33 : /// is defined for convenience in evaluating fluxes and sources for the DG
34 : /// scheme.)
35 : ///
36 : ///
37 : /// \f[\Sigma^i_j = \frac{1}{2}\frac{B^iB_j}{\alpha^2}\f]
38 : ///
39 : template <typename DataType>
40 1 : void rotational_shift_stress(gsl::not_null<tnsr::II<DataType, 3>*> result,
41 : const tnsr::I<DataType, 3>& rotational_shift,
42 : const Scalar<DataType>& lapse);
43 : template <typename DataType>
44 1 : tnsr::II<DataType, 3> rotational_shift_stress(
45 : const tnsr::I<DataType, 3>& rotational_shift,
46 : const Scalar<DataType>& lapse);
47 : /// @}
48 :
49 : /// @{
50 : /// \brief Compute derivative \f$ \partial_i (B^j / \alpha^2) \f$
51 : ///
52 : /// Here \f$ \partial_i \f$ is the spatial partial derivative, \f$ \alpha\f$ is
53 : /// the lapse and \f$B^i\f$ the rotational shift). The derivatives passed as
54 : /// arguments should be spatial partial derivatives.
55 : template <typename DataType>
56 1 : void derivative_rotational_shift_over_lapse_squared(
57 : gsl::not_null<tnsr::iJ<DataType, 3>*> result,
58 : const tnsr::I<DataType, 3>& rotational_shift,
59 : const tnsr::iJ<DataType, 3>& deriv_of_shift, const Scalar<DataType>& lapse,
60 : const tnsr::i<DataType, 3>& deriv_of_lapse,
61 : const tnsr::iJ<DataType, 3>& deriv_of_spatial_rotational_killing_vector);
62 : template <typename DataType>
63 1 : tnsr::iJ<DataType, 3> derivative_rotational_shift_over_lapse_squared(
64 : const tnsr::I<DataType, 3>& rotational_shift,
65 : const tnsr::iJ<DataType, 3>& deriv_of_shift, const Scalar<DataType>& lapse,
66 : const tnsr::i<DataType, 3>& deriv_of_lapse,
67 : const tnsr::iJ<DataType, 3>& deriv_of_spatial_rotational_killing_vector);
68 : /// @}
69 :
70 : /// @{
71 : /// \brief Compute the specific enthalpy squared from other hydro variables and
72 : /// the spacetime
73 : ///
74 : /// The eqn. is identical in content to \cite BaumgarteShapiro 15.76, it
75 : /// computes the specific enthalpy \f$ h \f$
76 : /*!
77 : \f[
78 : h^2 = \frac{1}{\alpha^2} \left(C + B^i D_i \Phi\right)^2 - D_i
79 : \Phi D^i \Phi
80 : \f]
81 : */
82 : /// Where \f$\Phi \f$ is the velocity potential, and \f$C\f$ is the
83 : /// Euler-constant, which in a slowly rotating, slowly orbiting configuration
84 : /// becomes the central specific enthalpy times the central lapse
85 : template <typename DataType>
86 1 : void specific_enthalpy_squared(
87 : gsl::not_null<Scalar<DataType>*> result,
88 : const tnsr::I<DataType, 3>& rotational_shift, const Scalar<DataType>& lapse,
89 : const tnsr::i<DataType, 3>& velocity_potential_gradient,
90 : const tnsr::II<DataType, 3>& inverse_spatial_metric,
91 : double euler_enthalpy_constant);
92 : template <typename DataType>
93 1 : Scalar<DataType> specific_enthalpy_squared(
94 : const tnsr::I<DataType, 3>& rotational_shift, const Scalar<DataType>& lapse,
95 : const tnsr::i<DataType, 3>& velocity_potential_gradient,
96 : const tnsr::II<DataType, 3>& inverse_spatial_metric,
97 : double euler_enthalpy_constant);
98 : /// @}
99 :
100 : /// @{
101 : /// \brief Compute the spatial rotational killing vector associated with uniform
102 : /// rotation around the z-axis.
103 : ///
104 : /// Taking \f$\Omega_j\f$ to be the uniform rotation axis (assumed in the
105 : /// z-direction) and \f$ \epsilon^{ijk}\f$ to be the Levi-Civita tensor
106 : /// (\f$\epsilon_{ijk} = \sqrt{\gamma} e_{ijk}\f$, with \f$e_{ijk}\f$ totally
107 : /// antisymmetric with \f$ e_{123} = 1\f$) , then
108 : /// the killing vector is given by (\cite BaumgarteShapiro 15.13) :
109 : /*!
110 : \f[ k^i = \epsilon^{ijk}\Omega_j x_k \f]
111 : */
112 : template <typename DataType>
113 1 : void spatial_rotational_killing_vector(
114 : gsl::not_null<tnsr::I<DataType, 3>*> result, const tnsr::I<DataType, 3>& x,
115 : double orbital_angular_velocity,
116 : const Scalar<DataType>& sqrt_det_spatial_metric);
117 : template <typename DataType>
118 1 : tnsr::I<DataType, 3> spatial_rotational_killing_vector(
119 : const tnsr::I<DataType, 3>& x, double orbital_angular_velocity,
120 : const Scalar<DataType>& sqrt_det_spatial_metric);
121 : /// @}
122 :
123 : /// @{
124 : /// \brief The spatial derivative of the spatial rotational killing vector
125 : ///
126 : /// As for `spatial_rotational_killing_vector`, assumes uniform rotation around
127 : /// the z-axis
128 : template <typename DataType>
129 1 : void divergence_spatial_rotational_killing_vector(
130 : gsl::not_null<Scalar<DataType>*> result, const tnsr::I<DataType, 3>& x,
131 : double orbital_angular_velocity,
132 : const Scalar<DataType>& sqrt_det_spatial_metric);
133 : template <typename DataType>
134 1 : Scalar<DataType> divergence_spatial_rotational_killing_vector(
135 : const tnsr::I<DataType, 3>& x, double orbital_angular_velocity,
136 : const Scalar<DataType>& sqrt_det_spatial_metric);
137 : } // namespace hydro::initial_data::irrotational_bns
|