You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/disk.jl
+29-5Lines changed: 29 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -116,6 +116,30 @@ function sech2_cdf_inv(u)
116
116
returnatanh(2*u-1)
117
117
end
118
118
119
+
"""
120
+
$(TYPEDSIGNATURES)
121
+
Rotate along the positive z-axis.
122
+
- `ratio`: rotational motion v.s. random motion. If equals `1`, only rotational component
123
+
"""
124
+
functionrotational_velocity_acc(x, y, z, a, ratio =1.0)
125
+
u =unit(x)
126
+
r =sqrt(x^2+ y^2+ z^2)
127
+
v =sqrt(a * r)
128
+
v_vec =-normalize(PVector(ustrip(u,x), ustrip(u,y), 0.0) ×PVector(0.0, 0.0, 1.0)) * v
129
+
v_vec = ratio * v_vec + (1-ratio) *randn(PVector{Float64}) * v
130
+
end
131
+
132
+
"""
133
+
$(TYPEDSIGNATURES)
134
+
Rotate along the positive z-axis.
135
+
- `ratio`: rotational motion v.s. random motion. If equals `1`, only rotational component
136
+
"""
137
+
functionrotational_velocity(x, y, v, ratio =1.0)
138
+
u =unit(x)
139
+
v_vec =-normalize(PVector(ustrip(u,x), ustrip(u,y), 0.0) ×PVector(0.0, 0.0, 1.0)) * v
140
+
v_vec = ratio * v_vec + (1-ratio) *randn(PVector{Float64}) * v
141
+
end
142
+
119
143
"""
120
144
$(TYPEDSIGNATURES)
121
145
@@ -124,9 +148,9 @@ function generate(config::ExponentialDisk, units = uAstro;
124
148
RotationCurve =nothing,
125
149
MaxRadius =5* config.ScaleRadius,
126
150
MaxHeight = MaxRadius,
127
-
k =1, # degree of rotation curve interpolation/extrapolation spline (1 = linear, 2 = quadratic, 3 = cubic, up to 5)
151
+
k =2, # degree of rotation curve interpolation/extrapolation spline (1 = linear, 2 = quadratic, 3 = cubic, up to 5)
128
152
bc ="nearest", # behavior when evaluating the spline outside the support domain, which is (minimum(x), maximum(x)). The allowed values are "nearest", "zero", "extrapolate", "error"
129
-
rotational_ratio =0,
153
+
rotational_ratio =0.9,
130
154
)
131
155
uLen =getuLength(units)
132
156
uVel =getuVel(units)
@@ -184,9 +208,9 @@ function generate(config::ExponentialDisk, units = uAstro;
0 commit comments