-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix a bug with rescaling the soliton density profile in the HaloMerger test problem #137
base: psidm
Are you sure you want to change the base?
Fix a bug with rescaling the soliton density profile in the HaloMerger test problem #137
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hsinhaoHHuang : the PR seems good~ What do you think @vivi235711 ?
@@ -10,6 +10,7 @@ HaloMerger_Soliton_1_VelocityY 0.5 | |||
HaloMerger_Soliton_1_VelocityZ 0.0 | |||
HaloMerger_Soliton_1_DensProf_Filename SolitonDensityProfile_Lambda0.0 # filename of the density profile table for the 1st soliton (HaloMerger_Soliton_InitMode == 1 only) | |||
HaloMerger_Soliton_1_DensProf_Rescale 1 # whether to scale the density profile table for the 1st soliton (HaloMerger_Soliton_InitMode == 1 only) [1] | |||
HaloMerger_Soliton_1_DensProf_PhyConst 1.0 # value of the dimensional constant 4*pi*G*(ELBDM_MASS/hbar)^2 in the units of density profile (HaloMerger_Soliton_InitMode == 1 only) (<=0.0=same as simulation) [-1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe "same as in simulation unit/code unit"~?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
// set the ratio of the physical constant between simulation and input table | ||
HaloMerger_Soliton_DensProf_ScaleC[index_soliton] = (4.0*M_PI*NEWTON_G*SQR(ELBDM_ETA))/HaloMerger_Soliton_DensProf_PhyConst[index_soliton]; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe can add:
"The rescaling of density profiles follows the soliton scaling relation:
, i.e. (ScaleC)*(ScaleD)*(ScaleL^4) = 1"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
@koarakawaii Thanks a lot for your review. I have updated it. |
Seems good. Just some minor comment about the "Input__TestProb_Soliton" file. |
@vivi235711 Thanks a lot for your review.
That is a good point. However, things are a bit complicated. The parameters Also, I designed the Maybe a better solution would be repurposing the file to construct a general spherically symmetric object, by analytical function or density profile table, and not calling it a soliton. Then, the current options like Let me think about this further. |
Issues
There is an option
HaloMerger_Soliton_*_DensProf_Rescale
in theHaloMerger
test problem to decide whether to rescale the input density profile.However, the current rescaling only works for density profiles like the default
SolitonDensityProfile_Lambda0.0
where4*pi*G
andm/hbar
are 1.It will be wrong to rescale the density profiles with other units like
SolitonDensityProfile
, which uses code units.Changes
Now, by specifying the value
4*pi*G*(m/hbar)^2
used in the density profiles (or set to-1
if the units are the same as simulation code units), it can also rescale the density profile with units to a given core radius or core density correctly.The rescaling of density profiles follows the soliton scaling relation:$$4\pi G(m/\hbar)^2 \rho_c r_c^4$$ = a dimensionless constant.
In the updated test problem, it means
(ScaleC)*(ScaleD)*(ScaleL^4) = 1