Skip to content

Commit

Permalink
BBH ID: set Gaussian falloff widths
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsvu committed Apr 12, 2024
1 parent c2fa145 commit b683530
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
13 changes: 13 additions & 0 deletions support/Pipelines/Bbh/InitialData.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
ID_INPUT_FILE_TEMPLATE = Path(__file__).parent / "InitialData.yaml"


def L1_distance(m1, m2, separation):
"""Distance of the L1 Lagrangian point from m1, in Newtonian gravity"""
return separation * (0.5 - 0.227 * np.log10(m2 / m1))


def id_parameters(
mass_ratio: float,
dimensionless_spin_a: Sequence[float],
Expand Down Expand Up @@ -49,6 +54,7 @@ def id_parameters(
M_B = 1.0 / (1.0 + mass_ratio)
x_A = separation / (1.0 + mass_ratio)
x_B = x_A - separation
# Spins
chi_A = np.asarray(dimensionless_spin_a)
r_plus_A = M_A * (1.0 + np.sqrt(1 - np.dot(chi_A, chi_A)))
Omega_A = -0.5 * chi_A / r_plus_A
Expand All @@ -57,6 +63,11 @@ def id_parameters(
r_plus_B = M_B * (1.0 + np.sqrt(1 - np.dot(chi_B, chi_B)))
Omega_B = -0.5 * chi_B / r_plus_B
Omega_B[2] += orbital_angular_velocity
# Falloff widths of superposition
L1_dist_A = L1_distance(M_A, M_B, separation)
L1_dist_B = separation - L1_dist_A
falloff_width_A = 3.0 / 5.0 * L1_dist_A
falloff_width_B = 3.0 / 5.0 * L1_dist_B
return {
"MassRight": M_A,
"MassLeft": M_B,
Expand All @@ -78,6 +89,8 @@ def id_parameters(
"HorizonRotationLeft_x": Omega_B[0],
"HorizonRotationLeft_y": Omega_B[1],
"HorizonRotationLeft_z": Omega_B[2],
"FalloffWidthRight": falloff_width_A,
"FalloffWidthLeft": falloff_width_B,
# Resolution
"L": refinement_level,
"P": polynomial_order,
Expand Down
4 changes: 3 additions & 1 deletion support/Pipelines/Bbh/InitialData.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ Background: &background
AngularVelocity: {{ OrbitalAngularVelocity }}
Expansion: {{ RadialExpansionVelocity }}
LinearVelocity: [0., 0., 0.]
FalloffWidths: [4.8, 4.8]
FalloffWidths:
- {{ FalloffWidthLeft }}
- {{ FalloffWidthRight }}

InitialGuess: *background

Expand Down
2 changes: 2 additions & 0 deletions tests/support/Pipelines/Bbh/Test_InitialData.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ def test_generate_id(self):
[params[f"HorizonRotationLeft_{xyz}"] for xyz in "xyz"],
[-0.337933017966707, -0.422416272458383, -0.49689952695006],
)
self.assertAlmostEqual(params["FalloffWidthRight"], 6.479672589667676)
self.assertAlmostEqual(params["FalloffWidthLeft"], 5.520327410332324)
self.assertEqual(params["L"], 1)
self.assertEqual(params["P"], 5)
# COM is zero
Expand Down

0 comments on commit b683530

Please sign in to comment.