@@ -58,34 +58,49 @@ public:
58
58
59
59
AMREX_GPU_HOST_DEVICE AMREX_INLINE
60
60
static void CorotatingEfieldSpherical (amrex::Real const r, amrex::Real const theta,
61
- amrex::Real const phi, amrex::Real const time,
61
+ amrex::Real const phi, amrex::Real const chi,
62
+ amrex::Real const time,
62
63
amrex::Real const omega_star_data,
63
64
amrex::Real const ramp_omega_time_data,
64
65
amrex::Real const Bstar,
65
66
amrex::Real const Rstar,
66
67
amrex::Real const dRstar,
67
68
amrex::Real &Er, amrex::Real &Etheta, amrex::Real &Ephi)
68
69
{
69
- amrex::ignore_unused (phi);
70
70
amrex::Real omega = Omega (omega_star_data, time , ramp_omega_time_data);
71
+ // Polar angle
71
72
amrex::Real c_theta = std::cos (theta);
72
73
amrex::Real s_theta = std::sin (theta);
74
+ // Oblique angle
75
+ amrex::Real c_chi = std::cos (chi);
76
+ amrex::Real s_chi = std::sin (chi);
77
+ // Instantaneous phase, psi = phi - Omega*t (phi is the azimuthal angle)
78
+ // Refer to Pg. 6 of Jeromi Petri's 2016 paper
79
+ amrex::Real psi = phi - omega*time ;
80
+ amrex::Real c_psi = std::cos (psi);
81
+ // Ratio : Rstar/r
73
82
amrex::Real r_ratio;
74
83
if (r > 0 ) {
75
84
r_ratio = Rstar/r;
76
85
} else {
77
86
r_ratio = Rstar/(dRstar*0.5 );
78
87
}
79
88
amrex::Real r2 = r_ratio * r_ratio;
80
- // Michel and Li -- eq 14 , 15
81
- Er = Bstar * omega * r2 * Rstar * s_theta * s_theta;
82
- Etheta = -Bstar * omega * r2 * Rstar * 2.0 * s_theta * c_theta;
83
- Ephi = 0.0 ; // aligned magnetic and rotation axis
89
+ // Corotating electric field inside the pulsar that corresponds to dipole magnetic field
90
+ // Eq 2.9 (a-c) Jeromi Petri 2016
91
+ Er = Bstar * omega * r2 * Rstar *
92
+ ( c_chi * s_theta * s_theta
93
+ - s_chi * c_theta * s_theta * c_psi);
94
+ Etheta = -Bstar * omega * r2 * Rstar *
95
+ ( c_chi * 2 ._rt * s_theta * c_theta
96
+ + s_chi * 2 ._rt * s_theta * s_theta * c_psi);
97
+ Ephi = 0 ._rt ;
84
98
}
85
99
86
100
AMREX_GPU_HOST_DEVICE AMREX_INLINE
87
101
static void ExternalEFieldSpherical (amrex::Real const r, amrex::Real const theta,
88
- amrex::Real const phi, amrex::Real const time,
102
+ amrex::Real const phi, amrex::Real const chi,
103
+ amrex::Real const time,
89
104
amrex::Real const omega_star_data,
90
105
amrex::Real const ramp_omega_time_data,
91
106
amrex::Real const Bstar, amrex::Real const Rstar,
@@ -94,38 +109,59 @@ public:
94
109
int const ApplyCorotatingEField,
95
110
amrex::Real &Er, amrex::Real &Etheta, amrex::Real &Ephi)
96
111
{
97
- amrex::ignore_unused (phi, corotatingE_maxradius);
112
+ amrex::ignore_unused (corotatingE_maxradius);
98
113
amrex::Real omega = Omega (omega_star_data, time , ramp_omega_time_data);
114
+ // Polar angle
99
115
amrex::Real c_theta = std::cos (theta);
100
116
amrex::Real s_theta = std::sin (theta);
117
+ // Oblique angle
118
+ amrex::Real c_chi = std::cos (chi);
119
+ amrex::Real s_chi = std::sin (chi);
120
+ // Instantaneous phase, psi = phi - Omega*t (phi is the azimuthal angle)
121
+ // Refer to Pg. 6 of Jeromi Petri's 2016 paper
122
+ amrex::Real psi = phi - omega*time ;
123
+ amrex::Real c_psi = std::cos (psi);
124
+ amrex::Real s_psi = std::sin (psi);
125
+
101
126
amrex::Real r_ratio = Rstar/r;
102
127
// inside pulsar
103
- // if (r <= corotatingE_maxradius) {
104
128
if (ApplyCorotatingEField == 1 ) {
105
129
amrex::Real r2 = r_ratio * r_ratio;
106
- // Michel and Li -- eq 14 , 15
107
- Er = Bstar * omega * r2 * Rstar * s_theta * s_theta;
108
- Etheta = -Bstar * omega * r2 * Rstar * 2.0 * s_theta * c_theta;
109
- Ephi = 0.0 ; // aligned magnetic and rotation axis
130
+ // Corotating electric field inside the pulsar that corresponds to dipole magnetic field
131
+ // Eq 2.9 (a-c) Jeromi Petri 2016
132
+ Er = Bstar * omega * r2 * Rstar *
133
+ ( c_chi * s_theta * s_theta
134
+ - s_chi * c_theta * s_theta * c_psi);
135
+ Etheta = -Bstar * omega * r2 * Rstar *
136
+ ( c_chi * 2 ._rt * s_theta * c_theta
137
+ + s_chi * 2 ._rt * s_theta * s_theta * c_psi);
138
+ Ephi = 0 ._rt ;
110
139
}
111
140
112
141
// outside pulsar
113
- // if (r > corotatingE_maxradius) {
114
142
if (ApplyCorotatingEField == 0 ) {
115
- amrex::Real r4 = r_ratio*r_ratio*r_ratio*r_ratio;
116
- // Taking derivative of phi given in eq 30 of Michel and Li
117
- Er = Bstar * omega * Rstar * r4 * (1.0 -3.0 *c_theta*c_theta);
143
+ amrex::Real r2 = r_ratio * r_ratio;
144
+ amrex::Real r4 = r2 * r2;
145
+ // Equations 2.8(a) - 2.8(c)
146
+ Er = Bstar * omega * Rstar * r4 *
147
+ ( c_chi * (1 ._rt - 3 ._rt * c_theta * c_theta)
148
+ - 3 ._rt * s_chi * c_theta * s_theta * c_psi );
118
149
if (Eexternal_monopole == 1 ) {
119
- Er += (2.0 /3.0 ) * omega * Bstar * Rstar * r_ratio * r_ratio;
150
+ // Monopole term from central charge = Qc/(4*pi*eps0*r^2)
151
+ // For dipolar magnetic field, Qc = 8pi/3 * eps0*Omega*Bstar*Rstar^3*c_chi
152
+ Er += (2 ._rt /3 ._rt ) * omega * Bstar * Rstar * r2 * c_chi;
120
153
}
121
- Etheta = (-1.0 ) * Bstar * omega * Rstar * r4 * (2.0 *s_theta*c_theta);
122
- Ephi = 0.0 ;
154
+ Etheta = Bstar * omega * Rstar *
155
+ ( r2 * s_chi * (r2*std::cos (2 ._rt *theta) - 1 ._rt ) * c_psi
156
+ - r4 * c_chi * std::sin (2 ._rt *theta) );
157
+ Ephi = Bstar * omega * Rstar * r2 * (1 ._rt - r2) * s_chi * c_theta * s_psi;
123
158
}
124
159
}
125
160
126
161
AMREX_GPU_HOST_DEVICE AMREX_INLINE
127
162
static void ExternalEMonopoleSpherical (amrex::Real const r, amrex::Real const theta,
128
- amrex::Real const phi, amrex::Real const time,
163
+ amrex::Real const phi, amrex::Real const chi,
164
+ amrex::Real const time,
129
165
amrex::Real const omega_star_data,
130
166
amrex::Real const ramp_omega_time_data,
131
167
amrex::Real const Bstar, amrex::Real const Rstar,
@@ -134,39 +170,55 @@ public:
134
170
amrex::ignore_unused (phi, theta);
135
171
amrex::Real omega = Omega (omega_star_data, time , ramp_omega_time_data);
136
172
amrex::Real r_ratio = Rstar/r;
173
+ amrex::Real r2 = r_ratio * r_ratio;
174
+ amrex::Real c_chi = std::cos (chi);
137
175
138
- Er = (2.0 /3.0 ) * omega * Bstar * Rstar * r_ratio * r_ratio ;
176
+ Er = (2 ._rt /3 ._rt ) * omega * Bstar * Rstar * r2 * c_chi ;
139
177
Etheta = 0 .;
140
178
Ephi = 0 .;
141
179
142
180
}
143
181
144
182
AMREX_GPU_HOST_DEVICE AMREX_INLINE
145
183
static void ExternalBFieldSpherical (amrex::Real const r, amrex::Real const theta,
146
- amrex::Real const phi, amrex::Real const time,
184
+ amrex::Real const phi, amrex::Real const chi,
185
+ amrex::Real const time,
186
+ amrex::Real const omega_star_data,
187
+ amrex::Real const ramp_omega_time_data,
147
188
amrex::Real const Bstar, amrex::Real const Rstar,
148
189
amrex::Real const dRstar,
149
190
amrex::Real &Br, amrex::Real &Btheta, amrex::Real &Bphi)
150
191
{
151
- amrex::ignore_unused (phi, time );
192
+ // Polar angle
152
193
amrex::Real c_theta = std::cos (theta);
153
194
amrex::Real s_theta = std::sin (theta);
195
+ // Oblique angle
196
+ amrex::Real c_chi = std::cos (chi);
197
+ amrex::Real s_chi = std::sin (chi);
198
+ // Instantaneous phase, psi = phi - Omega*t (phi is the azimuthal angle)
199
+ // Refer to Pg. 6 of Jeromi Petri's 2016 paper
200
+ amrex::Real omega = Omega (omega_star_data, time , ramp_omega_time_data);
201
+ amrex::Real psi = phi - omega*time ;
202
+ amrex::Real c_psi = std::cos (psi);
203
+ amrex::Real s_psi = std::sin (psi);
204
+
154
205
amrex::Real r_ratio;
155
206
if (r > 0 ) {
156
207
r_ratio = Rstar/r;
157
208
} else {
158
209
r_ratio = Rstar/(dRstar*0.5 );
159
210
}
160
211
amrex::Real r3 = r_ratio*r_ratio*r_ratio;
161
- // Michel and Li -- eq 14 and 15 from michel and li
162
- // dipole B field inside and outside the pulsar
163
- Br = 2.0 * Bstar*r3* c_theta;
164
- Btheta = Bstar*r3* s_theta;
165
- Bphi = 0.0 ;
212
+ // The full dipole magnetic field as f(theta, phi, omega, t, and Chi)
213
+ // Eqs 2.7(a) - 2.7(c) from Jeromi Petri 2016 paper
214
+ Br = 2 ._rt * Bstar * r3 * ( c_chi * c_theta + s_chi * s_theta * c_psi) ;
215
+ Btheta = Bstar * r3 * ( c_chi * s_theta - s_chi * c_theta * c_psi) ;
216
+ Bphi = Bstar * r3 * s_chi * s_psi ;
166
217
}
167
218
168
219
AMREX_GPU_HOST_DEVICE AMREX_INLINE
169
- static void getExternalEBOnParticle ( amrex::Real const r, amrex::Real const theta, amrex::Real const phi,
220
+ static void getExternalEBOnParticle ( amrex::Real const r, amrex::Real const theta,
221
+ amrex::Real const phi, amrex::Real const chi,
170
222
const int AddExternalMonopoleOnly, const int AddPulsarVacuumEFields,
171
223
const int AddBDipoleOutsideRstar, const int AddPulsarVacuumBFields,
172
224
amrex::Real const corotatingE_maxradius,
@@ -184,7 +236,7 @@ public:
184
236
amrex::Real Er = 0 .0_rt;
185
237
amrex::Real Etheta = 0 .0_rt;
186
238
amrex::Real Ephi = 0 .0_rt;
187
- ExternalEMonopoleSpherical (r, theta, phi, cur_time, omega_star,
239
+ ExternalEMonopoleSpherical (r, theta, phi, chi, cur_time, omega_star,
188
240
ramp_omega_time, Bstar, Rstar,
189
241
Er, Etheta, Ephi);
190
242
amrex::Real Ex_monopole = 0 ._rt ;
@@ -206,7 +258,7 @@ public:
206
258
amrex::Real Ephi = 0 .0_rt;
207
259
int ApplyCorotatingEField = 0 ;
208
260
if (r <= corotatingE_maxradius) ApplyCorotatingEField = 1 ;
209
- ExternalEFieldSpherical (r, theta, phi, cur_time, omega_star,
261
+ ExternalEFieldSpherical (r, theta, phi, chi, cur_time, omega_star,
210
262
ramp_omega_time, Bstar, Rstar,
211
263
corotatingE_maxradius,
212
264
E_external_monopole,
@@ -229,8 +281,10 @@ public:
229
281
amrex::Real Br = 0 ._rt ;
230
282
amrex::Real Btheta = 0 ._rt ;
231
283
amrex::Real Bphi = 0 ._rt ;
232
- ExternalBFieldSpherical (r, theta, phi, cur_time, Bstar, Rstar, dR_star,
233
- Br, Btheta, Bphi);
284
+ ExternalBFieldSpherical (r, theta, phi, chi, cur_time,
285
+ omega_star, ramp_omega_time,
286
+ Bstar, Rstar, dR_star,
287
+ Br, Btheta, Bphi);
234
288
amrex::Real Bx_dipole = 0 ._rt ;
235
289
amrex::Real By_dipole = 0 ._rt ;
236
290
amrex::Real Bz_dipole = 0 ._rt ;
@@ -246,8 +300,10 @@ public:
246
300
amrex::Real Br = 0 ._rt ;
247
301
amrex::Real Btheta = 0 ._rt ;
248
302
amrex::Real Bphi = 0 ._rt ;
249
- ExternalBFieldSpherical (r, theta, phi, cur_time, Bstar, Rstar, dR_star,
250
- Br, Btheta, Bphi);
303
+ ExternalBFieldSpherical (r, theta, phi, chi, cur_time,
304
+ omega_star, ramp_omega_time,
305
+ Bstar, Rstar, dR_star,
306
+ Br, Btheta, Bphi);
251
307
amrex::Real Bx_dipole = 0 ._rt ;
252
308
amrex::Real By_dipole = 0 ._rt ;
253
309
amrex::Real Bz_dipole = 0 ._rt ;
@@ -262,7 +318,8 @@ public:
262
318
263
319
264
320
AMREX_GPU_HOST_DEVICE AMREX_INLINE
265
- static void EnforceTheoreticalEBOnParticle ( amrex::Real const r, amrex::Real const theta, amrex::Real const phi,
321
+ static void EnforceTheoreticalEBOnParticle ( amrex::Real const r, amrex::Real const theta,
322
+ amrex::Real const phi, amrex::Real const chi,
266
323
amrex::Real const theory_max_radius,
267
324
amrex::Real const corotatingE_maxradius,
268
325
const int E_external_monopole,
@@ -285,7 +342,7 @@ public:
285
342
amrex::Real Ex_theory = 0 ._rt ;
286
343
amrex::Real Ey_theory = 0 ._rt ;
287
344
amrex::Real Ez_theory = 0 ._rt ;
288
- ExternalEFieldSpherical (r, theta, phi, cur_time, omega_star, ramp_omega_time,
345
+ ExternalEFieldSpherical (r, theta, phi, chi, cur_time, omega_star, ramp_omega_time,
289
346
Bstar, Rstar, corotatingE_maxradius, E_external_monopole,
290
347
ApplyCorotatingEField, Er, Etheta, Ephi);
291
348
// Compute theoretical Bfield in spherical coordinates
@@ -295,7 +352,8 @@ public:
295
352
amrex::Real Bx_theory = 0 ._rt ;
296
353
amrex::Real By_theory = 0 ._rt ;
297
354
amrex::Real Bz_theory = 0 ._rt ;
298
- ExternalBFieldSpherical (r, theta, phi, cur_time, Bstar, Rstar, dR_star, Br, Btheta, Bphi);
355
+ ExternalBFieldSpherical (r, theta, phi, chi, cur_time, omega_star, ramp_omega_time,
356
+ Bstar, Rstar, dR_star, Br, Btheta, Bphi);
299
357
// Convert Efield from spherical to Cartesian
300
358
ConvertSphericalToCartesianXComponent (Er, Etheta, Ephi, r, theta, phi, Ex_theory);
301
359
ConvertSphericalToCartesianYComponent (Er, Etheta, Ephi, r, theta, phi, Ey_theory);
0 commit comments