Skip to content

Commit

Permalink
Includes regularisation of Omega and Shear.
Browse files Browse the repository at this point in the history
  • Loading branch information
luizfelippesr committed Jun 14, 2018
1 parent 59573ed commit 6a746b5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions galmag/B_generators/B_generator_disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def _builtin_parameter_defaults(self):
'disk_shear_function': prof.Clemens_Milky_Way_shear_rate, # S(r)
'disk_rotation_function': prof.Clemens_Milky_Way_rotation_curve, # V(r)
'disk_height_function': prof.exponential_scale_height, # h(r)
'disk_regularization_radius': 1., # kpc
'solar_radius': 8.5, # kpc
'disk_field_decay': True,
'disk_newman_boundary_condition_envelope': False
Expand Down Expand Up @@ -342,6 +343,7 @@ def _get_B_mode(self, grid_arrays, mode_number, mode_normalization,
disk_height_ref = parameters['disk_height']
dynamo_number = parameters['disk_dynamo_number']
Ralpha = parameters['disk_turbulent_induction']
rreg = parameters['disk_regularization_radius']/disk_radius

Cn = mode_normalization

Expand All @@ -364,6 +366,15 @@ def _get_B_mode(self, grid_arrays, mode_number, mode_normalization,
disk_height = height_function(r_grid,
Rsun=solar_radius,
R_d=disk_radius)

if rreg is not None:
# Finds the value of Omega at the regularization radios
# (i.e. the value that will remain constant until 0
Om_reg = rotation_function(rreg, R_d=disk_radius,
Rsun=solar_radius)/rreg
# Regularises the Omega and Shear profiles
Omega, Shear = prof.regularize(r_grid, Omega, Shear, rreg, Om_reg)

# Scaleheight in disk radius units (same units as s)
h = disk_height*disk_height_ref/disk_radius
# Local dynamo number
Expand Down

0 comments on commit 6a746b5

Please sign in to comment.