@@ -67,19 +67,13 @@ std::shared_ptr<KHARMAPackage> KBoundaries::Initialize(ParameterInput *pin, std:
6767 // Option to excise a bit at the poles when calculating fluxes
6868 bool excise_polar_flux = pin->GetOrAddBoolean (" boundaries" , " excise_polar_flux" , false );
6969 params.Add (" excise_polar_flux" , excise_polar_flux);
70- if (excise_polar_flux) {
71- // These options are opposites
72- pin->SetBoolean (" boundaries" , " zero_polar_flux" , false );
73- // TODO check whether the user explicitly set these false and yell instead of silent override
74- pin->SetBoolean (" boundaries" , " reconnect_B3_inner_x2" , true );
75- pin->SetBoolean (" boundaries" , " reconnect_B3_outer_x2" , true );
76- // These are themselves unstable, and don't help the wake much
77- // pin->SetBoolean("boundaries", "cancel_T3_inner_x2", true);
78- // pin->SetBoolean("boundaries", "cancel_T3_outer_x2", true);
79- }
8070 // Otherwise, those fluxes should be zero
81- bool zero_polar_flux = pin->GetOrAddBoolean (" boundaries" , " zero_polar_flux" , spherical);
71+ bool zero_polar_flux = pin->GetOrAddBoolean (" boundaries" , " zero_polar_flux" , spherical && !excise_polar_flux );
8272 params.Add (" zero_polar_flux" , zero_polar_flux);
73+ // Throw an error if both are set
74+ if (excise_polar_flux && zero_polar_flux) {
75+ throw std::runtime_error (" Cannot set both boundaries/excise_polar_flux and boundaries/zero_polar_flux!" );
76+ }
8377
8478 // Apply physical boundaries to conserved GRMHD variables rho u^r, T^mu_nu
8579 // Probably inadvisable?
@@ -199,7 +193,8 @@ std::shared_ptr<KHARMAPackage> KBoundaries::Initialize(ParameterInput *pin, std:
199193 bool clean_face_B = pin->GetOrAddBoolean (" boundaries" , " clean_face_B_" + bname, (btype == " outflow" ));
200194 params.Add (" clean_face_B_" +bname, clean_face_B);
201195 // Forcibly reconnect field loops that get trapped around the polar boundary
202- bool reconnect_B3 = pin->GetOrAddBoolean (" boundaries" , " reconnect_B3_" + bname, false );
196+ // Needed to keep excised-flux transmitting boundaries stable
197+ bool reconnect_B3 = pin->GetOrAddBoolean (" boundaries" , " reconnect_B3_" + bname, excise_flux);
203198 params.Add (" reconnect_B3_" +bname, reconnect_B3);
204199
205200 // Special EMF averaging. Allows B3 to "slip" around the pole
0 commit comments