Skip to content

Commit b84322b

Browse files
committed
merge branches
2 parents c9fa62b + 5751f0c commit b84322b

14 files changed

Lines changed: 603 additions & 19 deletions

src/main/checksetup.f90

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,8 @@ end subroutine check_setup_dustfrac
932932
!+
933933
!------------------------------------------------------------------
934934
subroutine check_gr(npart,nerror,xyzh,vxyzu)
935-
use metric_tools, only:pack_metric,unpack_metric
935+
use metric_tools, only:pack_metric,unpack_metric,imet_rn,imetric
936+
use metric, only:charge,mass1
936937
use utils_gr, only:get_u0
937938
use part, only:isdead_or_accreted,ien_type,ien_entropy,ien_etotal,ien_entropy_s
938939
use units, only:in_geometric_units,get_G_code,get_c_code
@@ -977,6 +978,16 @@ subroutine check_gr(npart,nerror,xyzh,vxyzu)
977978
nerror = nerror + 1
978979
endif
979980

981+
if (imetric==imet_rn) then
982+
if (abs(mass1-1.) > tiny(0.)) then
983+
print*, ' mass1 in code units shall be unity for proper interpretation'
984+
nerror = nerror + 1
985+
endif
986+
elseif (abs(charge) > 0.) then
987+
print*,' charge should be zero for this metric'
988+
nerror = nerror + 1
989+
endif
990+
980991
end subroutine check_gr
981992

982993
!------------------------------------------------------------------

src/main/extern_gr.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ end subroutine get_grforce_all
118118
!---------------------------------------------------------------------------
119119
subroutine dt_grforce(xyzh,fext,dtf)
120120
use physcon, only:pi
121-
use metric_tools, only:imetric,imet_schwarzschild,imet_kerr
121+
use metric_tools, only:imetric,imet_schwarzschild,imet_kerr,imet_rn
122122
use metric, only:mass1
123123
real, intent(in) :: xyzh(4),fext(3)
124124
real, intent(out) :: dtf
@@ -133,7 +133,7 @@ subroutine dt_grforce(xyzh,fext,dtf)
133133
endif
134134

135135
select case (imetric)
136-
case (imet_schwarzschild,imet_kerr)
136+
case (imet_schwarzschild,imet_kerr,imet_rn)
137137
r2 = xyzh(1)*xyzh(1) + xyzh(2)*xyzh(2) + xyzh(3)*xyzh(3)
138138
r = sqrt(r2)
139139
omega = sqrt(mass1/(r2*r))

src/main/externalforces.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ module externalforces
4646
logical, public :: extract_iextern_from_hdr = .false.
4747

4848
public :: mass1,a
49+
real, public :: charge
4950

5051
!
5152
! enumerated list of external forces

src/main/externalforces_gr.f90

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module externalforces
1919
! :Dependencies: dump_utils, infile_utils, io, metric, metric_tools, part,
2020
! units
2121
!
22-
use metric, only:mass1,a
22+
use metric, only:mass1,a,charge
2323
implicit none
2424

2525
private
@@ -36,7 +36,7 @@ module externalforces
3636
!
3737
integer, parameter, public :: iext_gr = 1
3838

39-
public :: mass1,a ! exported from metric module
39+
public :: mass1,a,charge ! exported from metric module
4040
real, public :: accradius1 = 0.
4141
real, public :: accradius1_hard = 0.
4242
real, public :: accretedmass1 = 0.
@@ -186,7 +186,7 @@ end subroutine update_externalforce
186186
!+
187187
!-----------------------------------------------------------------------
188188
subroutine accrete_particles(iexternalforce,xi,yi,zi,hi,mi,ti,accreted,i)
189-
use metric_tools, only:imet_minkowski,imet_schwarzschild,imet_kerr,imetric,imet_binarybh
189+
use metric_tools, only:imet_minkowski,imet_schwarzschild,imet_kerr,imet_rn,imetric,imet_binarybh
190190
use part, only:set_particle_type,iboundary,maxphase,maxp,igas,npartoftype
191191
use metric, only:accrete_particles_metric
192192
integer, intent(in) :: iexternalforce
@@ -202,7 +202,7 @@ subroutine accrete_particles(iexternalforce,xi,yi,zi,hi,mi,ti,accreted,i)
202202
case(imet_minkowski)
203203
if (first) print*,"WARNING: Accrete particles: but Metric = Minkowski"
204204

205-
case(imet_schwarzschild,imet_kerr)
205+
case(imet_schwarzschild,imet_kerr,imet_rn)
206206
r2 = xi*xi + yi*yi + zi*zi
207207
if (accradius1>accradius1_hard .and. r2 < accradius1**2 .and. maxphase==maxp .and. present(i)) then
208208
call set_particle_type(i,iboundary)

src/main/metric_et.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ module metric
2323
! Not used anywhere in the code - Needs a fix!
2424
real, public :: mass1 = 1. ! mass of central object
2525
real, public :: a = 0.0 ! spin of central object
26+
real, public :: charge= 0. ! charge of central object
2627

2728
contains
2829
!----------------------------------------------------------------

src/main/metric_kerr-schild.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ module metric
2525

2626
real, public :: mass1 = 1. ! mass of central object
2727
real, public :: a = 0. ! spin of central object
28+
real, public :: charge = 0. ! charge of central object
2829

2930
contains
3031

src/main/metric_kerr.f90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ module metric
2626
integer, parameter :: imetric = 3
2727

2828
real, public :: mass1 = 1. ! mass of central object
29-
real, public :: a = 0.9 ! spin of central object
29+
real, public :: a = 0.9 ! spin of central object
30+
real, public :: charge= 0. ! charge of central object
3031

3132
contains
3233

src/main/metric_minkowski.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ module metric
2222
integer, parameter :: imetric = 1
2323
real, public :: mass1 = 1. ! mass of central object
2424
real, public :: a = 0. ! spin of central object
25+
real, public :: charge= 0. ! charge of central object
2526

2627
contains
2728

0 commit comments

Comments
 (0)