10 #include "DataStructures/DataVector.hpp" 13 #include "PointwiseFunctions/AnalyticSolutions/GeneralRelativity/KerrSchild.hpp" 14 #include "PointwiseFunctions/GeneralRelativity/Tags.hpp" 15 #include "PointwiseFunctions/Hydro/EquationsOfState/EquationOfState.hpp" 16 #include "PointwiseFunctions/Hydro/EquationsOfState/PolytropicFluid.hpp" 17 #include "PointwiseFunctions/Hydro/Tags.hpp" 64 template <
typename DataType>
65 struct IntermediateVars;
74 static constexpr
OptionString help = {
"Mass of the black hole."};
75 static type lower_bound() noexcept {
return 0.0; }
82 "Schwarzschild radius where fluid becomes supersonic."};
83 static type lower_bound() noexcept {
return 0.0; }
90 "The density of the fluid at the sonic radius."};
91 static type lower_bound() noexcept {
return 0.0; }
98 "The polytropic exponent for the polytropic fluid."};
99 static type lower_bound() noexcept {
return 1.0; }
106 "The strength of the radial magnetic field."};
112 "Bondi-Michel solution with a radial magnetic field using \n" 113 "the Schwarzschild coordinate system. Quantities prefixed with \n" 114 "`sonic` refer to field quantities evaluated at the radius \n" 115 "where the fluid speed overtakes the sound speed."};
124 BondiMichel(Mass::type mass, SonicRadius::type sonic_radius,
125 SonicDensity::type sonic_density,
126 PolytropicExponent::type polytropic_exponent,
127 MagFieldStrength::type mag_field_strength) noexcept;
130 template <
typename DataType,
typename...
Tags>
133 tmpl::list<Tags...> )
const 138 auto intermediate_vars = IntermediateVars<DataType>{
139 rest_mass_density_at_infinity_,
140 mass_accretion_rate_over_four_pi_,
142 polytropic_constant_,
143 polytropic_exponent_,
144 bernoulli_constant_squared_minus_one_,
149 not tmpl::list_contains_v<hydro::grmhd_tags<DataType>,
Tags>...>,
150 background_spacetime_};
151 return {get<Tags>(
variables(x, tmpl::list<Tags>{}, intermediate_vars))...};
154 template <
typename DataType,
typename Tag>
157 tmpl::list<Tag> )
const noexcept {
159 x, tmpl::list<Tag>{},
160 IntermediateVars<DataType>{
161 rest_mass_density_at_infinity_, mass_accretion_rate_over_four_pi_,
162 mass_, polytropic_constant_, polytropic_exponent_,
163 bernoulli_constant_squared_minus_one_, sonic_radius_,
165 not tmpl::list_contains_v<hydro::grmhd_tags<DataType>, Tag>,
166 background_spacetime_});
170 void pup(PUP::er& ) noexcept;
173 return equation_of_state_;
180 template <
typename DataType>
181 auto variables(
const tnsr::I<DataType, 3>& x,
183 const IntermediateVars<DataType>& vars)
const noexcept
186 template <
typename DataType>
188 const tnsr::I<DataType, 3>& x,
190 const IntermediateVars<DataType>& vars)
const noexcept
193 template <
typename DataType>
194 auto variables(
const tnsr::I<DataType, 3>& x,
196 const IntermediateVars<DataType>& vars)
const noexcept
199 template <
typename DataType>
201 const tnsr::I<DataType, 3>& x,
204 const IntermediateVars<DataType>& vars)
const noexcept
208 template <
typename DataType>
210 const tnsr::I<DataType, 3>& x,
213 const IntermediateVars<DataType>& vars)
const noexcept
217 template <
typename DataType>
219 const tnsr::I<DataType, 3>& x,
221 const IntermediateVars<DataType>& vars)
const noexcept
224 template <
typename DataType>
225 auto variables(
const tnsr::I<DataType, 3>& x,
227 const IntermediateVars<DataType>& vars)
const noexcept
230 template <
typename DataType>
231 auto variables(
const tnsr::I<DataType, 3>& x,
233 const IntermediateVars<DataType>& vars)
const noexcept
236 template <
typename DataType,
typename Tag,
241 IntermediateVars<DataType>& vars)
const 243 return {std::move(get<Tag>(vars.kerr_schild_soln))};
246 template <
typename DataType>
247 struct IntermediateVars {
249 double rest_mass_density_at_infinity,
250 double in_mass_accretion_rate_over_four_pi,
double in_mass,
251 double in_polytropic_constant,
double in_polytropic_exponent,
252 double in_bernoulli_constant_squared_minus_one,
double in_sonic_radius,
253 double in_sonic_density,
const tnsr::I<DataType, 3>& x,
257 DataType rest_mass_density{};
258 double mass_accretion_rate_over_four_pi{};
260 double polytropic_constant{};
261 double polytropic_exponent{};
262 double bernoulli_constant_squared_minus_one{};
263 double sonic_radius{};
264 double sonic_density{};
265 double bernoulli_root_function(
double rest_mass_density_guess,
266 double current_radius)
const noexcept;
267 tuples::tagged_tuple_from_typelist<
268 typename gr::Solutions::KerrSchild::tags<DataType>>
273 SonicRadius::type sonic_radius_ =
275 SonicDensity::type sonic_density_ =
277 PolytropicExponent::type polytropic_exponent_ =
279 MagFieldStrength::type mag_field_strength_ =
281 double sonic_fluid_speed_squared_ =
283 double sonic_sound_speed_squared_ =
286 double mass_accretion_rate_over_four_pi_ =
288 double bernoulli_constant_squared_minus_one_ =
290 double rest_mass_density_at_infinity_ =
The radius at which the fluid becomes supersonic.
Definition: BondiMichel.hpp:79
Defines class tuples::TaggedTuple.
The strength of the radial magnetic field.
Definition: BondiMichel.hpp:103
The polytropic exponent for the polytropic fluid.
Definition: BondiMichel.hpp:95
Bondi-Michel accretion with superposed magnetic field in Schwarzschild spacetime in Kerr-Schild coord...
Definition: BondiMichel.hpp:63
constexpr bool flat_any_v
A non-short-circuiting logical OR between bools 'B"".
Definition: TMPL.hpp:528
T signaling_NaN(T... args)
Defines classes and functions for making classes creatable from input files.
Define prefixes for DataBox tags.
The rest mass density of the fluid at the sonic radius.
Definition: BondiMichel.hpp:87
Defines the type alias Requires.
const char *const OptionString
The string used in option structs.
Definition: Options.hpp:26
tuples::TaggedTuple< Tags... > variables(const tnsr::I< DataType, 3 > &x, const double, tmpl::list< Tags... >) const noexcept
Retrieve a collection of hydro variables at (x, t)
Definition: BondiMichel.hpp:131
An associative container that is indexed by structs.
Definition: TaggedTuple.hpp:272
Defines a list of useful type aliases for tensors.
Wraps the template metaprogramming library used (brigand)
Kerr black hole in Kerr-Schild coordinates.
Definition: KerrSchild.hpp:209
typename Requires_detail::requires_impl< B >::template_error_type_failed_to_meet_requirements_on_template_parameters Requires
Express requirements on the template parameters of a function or class, replaces std::enable_if_t ...
Definition: Requires.hpp:67
The mass of the black hole.
Definition: BondiMichel.hpp:72
Items related to general relativistic magnetohydrodynamics (GRMHD)
Definition: Characteristics.hpp:34