Skip to content

Commit

Permalink
Add a radial expansion to the BBH ID pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
knelli2 committed Jan 4, 2024
1 parent b1241fe commit 267bc02
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
14 changes: 14 additions & 0 deletions support/Pipelines/Bbh/InitialData.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def id_parameters(
mass_ratio: float,
separation: float,
orbital_angular_velocity: float,
radial_expansion: float,
refinement_level: int,
polynomial_order: int,
):
Expand All @@ -30,6 +31,7 @@ def id_parameters(
mass_ratio: Defined as q = M_A / M_B >= 1.
separation: Coordinate separation D of the black holes.
orbital_angular_velocity: Omega_0.
radial_expansion: adot_0.
refinement_level: h-refinement level.
polynomial_order: p-refinement level.
"""
Expand All @@ -50,6 +52,7 @@ def id_parameters(
"ExcisionRadiusRight": 0.89 * 2.0 * M_A,
"ExcisionRadiusLeft": 0.89 * 2.0 * M_B,
"OrbitalAngularVelocity": orbital_angular_velocity,
"RadialExpansion": radial_expansion,
# Resolution
"L": refinement_level,
"P": polynomial_order,
Expand All @@ -60,6 +63,7 @@ def generate_id(
mass_ratio: float,
separation: float,
orbital_angular_velocity: float,
radial_expansion: float,
refinement_level: int,
polynomial_order: int,
id_input_file_template: Union[str, Path] = ID_INPUT_FILE_TEMPLATE,
Expand All @@ -81,6 +85,7 @@ def generate_id(
mass_ratio=mass_ratio,
separation=separation,
orbital_angular_velocity=orbital_angular_velocity,
radial_expansion=radial_expansion,
refinement_level=refinement_level,
polynomial_order=polynomial_order,
)
Expand Down Expand Up @@ -112,6 +117,15 @@ def generate_id(
help="Orbital angular velocity Omega_0.",
required=True,
)
@click.option(
"--radial-expansion",
"-a",
type=float,
help=(
"Radial expansion velocity adot0 which is radial velocity over radius."
),
required=True,
)
@click.option(
"--refinement-level",
"-L",
Expand Down
2 changes: 1 addition & 1 deletion support/Pipelines/Bbh/InitialData.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Background: &background
Spin: [0., 0., 0.]
Center: [0., 0., 0.]
AngularVelocity: {{ OrbitalAngularVelocity }}
Expansion: 0.
Expansion: {{ RadialExpansion }}
LinearVelocity: [0., 0., 0.]
FalloffWidths: [4.8, 4.8]

Expand Down
4 changes: 4 additions & 0 deletions tests/support/Pipelines/Bbh/Test_InitialData.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def test_generate_id(self):
mass_ratio=1.5,
separation=20.0,
orbital_angular_velocity=0.01,
radial_expansion=-1.0e-5,
refinement_level=1,
polynomial_order=5,
)
Expand All @@ -39,6 +40,7 @@ def test_generate_id(self):
self.assertAlmostEqual(params["ExcisionRadiusRight"], 1.068)
self.assertAlmostEqual(params["ExcisionRadiusLeft"], 0.712)
self.assertEqual(params["OrbitalAngularVelocity"], 0.01)
self.assertEqual(params["RadialExpansion"], -1.0e-5)
self.assertEqual(params["L"], 1)
self.assertEqual(params["P"], 5)
# COM is zero
Expand All @@ -60,6 +62,8 @@ def test_cli(self):
"20",
"--orbital-angular-velocity",
"0.01",
"--radial-expansion",
"-1.0e-5",
"--refinement-level",
"1",
"--polynomial-order",
Expand Down

0 comments on commit 267bc02

Please sign in to comment.