From fd05b50e5ccf463bc86ffcd19c520754e5bc03e7 Mon Sep 17 00:00:00 2001 From: rhaas Date: Fri, 11 Jan 2013 15:04:15 +0000 Subject: GRHydro_InitData: add parameter to offset radial origin r_code = r_KS - r0 with r0=1M by default. This avoids placing the central singularity on the grid. From: Roland Haas git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinInitialData/GRHydro_InitData/trunk@196 ac85fae7-cede-4708-beff-ae01c7fa1c26 --- param.ccl | 5 +++++ src/GRHydro_BondiM.c | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/param.ccl b/param.ccl index 51c4c9d..1eb8e46 100644 --- a/param.ccl +++ b/param.ccl @@ -381,6 +381,11 @@ CCTK_REAL bondi_bmag "B_0 parameter for magnetized Bondi" 0:* :: "Anything positive" } 0.01 +CCTK_REAL bondi_radial_offset "redefine r_grid=r_KS-r0 to avoid singularity on grid" +{ + 0:* :: "Any positive number" +} 0.0 + CCTK_BOOLEAN set_bondi_beta_sonicpt "Set plasma beta parameter instead of bondi_bmag" { } no diff --git a/src/GRHydro_BondiM.c b/src/GRHydro_BondiM.c index ef7c1c5..f947abb 100644 --- a/src/GRHydro_BondiM.c +++ b/src/GRHydro_BondiM.c @@ -1097,6 +1097,21 @@ void GRHydro_BondiM(CCTK_ARGUMENTS) xpos[YY] = y[i] ; xpos[ZZ] = z[i] ; + if (bondi_radial_offset > 0.) { + double rspher_orig = sqrt(SQR(xpos[XX])+SQR(xpos[YY])+SQR(xpos[ZZ])); + double rspher_new = rspher_orig + bondi_radial_offset; + if(rspher_orig < SMALL_BONDI) { + xpos[XX] = rspher_new; + xpos[YY] = 0.; + xpos[ZZ] = 0.; + } else { + for(int n = XX ; n <= ZZ ; n++) { + xpos[n] *= rspher_new/rspher_orig; + } + } + } + + switch( coord_type ) { case COORD_BOYERLINDQUIST : -- cgit v1.2.3