22$(TYPEDEF)
33$(TYPEDFIELDS)
44"""
5- mutable struct ExponentialDisk {I, Len, MASS} <: InitialConditionConfig
5+ mutable struct ExponentialDisc {I, Len, MASS} <: InitialConditionConfig
66 collection:: Collection
77 NumSamples:: I
88
@@ -19,18 +19,18 @@ $(TYPEDSIGNATURES)
1919- `collection` particle type
2020- `NumSamples` amount of particles
2121"""
22- function ExponentialDisk (;
22+ function ExponentialDisc (;
2323 collection:: Collection = STAR,
2424 NumSamples:: Int64 = 1000 ,
2525 TotalMass:: Number = 1.0e10 u " Msun" ,
2626 ScaleRadius:: Number = 2.0 u " kpc" ,
2727 ScaleHeight:: Number = 0.02 u " kpc" ,
2828 HoleRadius:: Number = 0.0 u " kpc" ,
2929 )
30- return ExponentialDisk (collection, NumSamples, TotalMass, ScaleRadius, ScaleHeight, HoleRadius)
30+ return ExponentialDisc (collection, NumSamples, TotalMass, ScaleRadius, ScaleHeight, HoleRadius)
3131end
3232
33- function Base. show (io:: IO , config:: ExponentialDisk )
33+ function Base. show (io:: IO , config:: ExponentialDisc )
3434 print (io,
3535 " Config of Exponential Disk Initial Conditions:" ,
3636 " \n Particle Collection: " , config. collection,
144144$(TYPEDSIGNATURES)
145145
146146"""
147- function generate (config:: ExponentialDisk , units = uAstro;
147+ function generate (config:: ExponentialDisc , units = uAstro;
148148 RotationCurve = nothing ,
149149 MaxRadius = 5 * config. ScaleRadius,
150150 MaxHeight = MaxRadius,
@@ -211,6 +211,12 @@ function generate(config::ExponentialDisk, units = uAstro;
211211 spl = Spline1D (ustrip .(uLen, xc), ustrip .(uVel, vc); k, bc)
212212 v = spl (ustrip .(uLen, R)) * uVel
213213 vel = rotational_velocity .(pos. x, pos. y, v, rotational_ratio)
214+
215+ # Cancel out shifting
216+ v0 = mean (vel)
217+ vel = vel .- v0
218+ uVel = getuVel (units)
219+ vel = uconvert .(uVel, vel)
214220 end
215221
216222 # Packing
0 commit comments