Skip to content
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

Entropy #78

Merged
merged 60 commits into from
Dec 3, 2024
Merged

Entropy #78

merged 60 commits into from
Dec 3, 2024

Conversation

MChabanov
Copy link
Collaborator

No description provided.

Michail Chabanov and others added 30 commits May 23, 2024 12:41
AsterX: Update local branch with most recent upstream main
// Construct Entropy c2p object:
c2p_1DEntropy c2p_Ent(eos_th, atmo, max_iter, c2p_tol, rho_strict,
vw_lim, B_lim, Ye_lenient, cons_error_limit, use_z,
alp_thresh, rho_BH, eps_BH, vwlim_BH);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a stylistic comment to pass all the limiting parameters together:
For eg:
c2p_1DEntropy c2p_Ent(eos_th, atmo, max_iter, c2p_tol, alp_thresh, cons_error_limit,
rho_strict, vw_lim, B_lim, rho_BH, eps_BH, vwlim_BH, Ye_lenient, use_z);

Feel free to remove rho_strict all together as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can change the interface but what do you think about keeping a separate parameter for the maximum density? E.g. there might be cases where the upper limit of the EOSX maximum density can exceed the density limit applied in the C2P

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. In my opinion, an extra parameter may not be necessary. Thinking of two applications:

(i) in BNS, rho_max should be ideally set to the max in the EOS table. In case of BH remnants, rho_BH would act as the limiting parameter inside the AH.
(ii) in single/double BH case, anything outside the AH can be capped to rho_max, if required. The important parameter in this case would be rho_BH.

Could you specify a case where you expect the upper limit of the EOSX maximum density could exceed the density limit applied in the C2P? If yes, how this parameter would function? Thanks!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, yes I would agree that only the BH interior might be a region where this upper bound is relevant and would be different from the eos maximum. But we have that already covered by rho_BH. So, ok I can remove rho_strict then.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

// velz(p.I), Bvecx(p.I), Bvecy(p.I), Bvecz(p.I),
Avec_x(p.I), Avec_y(p.I), Avec_z(p.I));
}
if ( (alp(p.I) < alp_thresh) && ( (pv_seeds.rho > rho_BH) || (pv_seeds.eps > eps_BH) ) ) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case of C2P failure within the AH, I would always apply the bh_interior_fail fix instead of setting the point to atmo. The latter can create large gradients in the fluid.
I would recommend using just: if(alp(p.I) < alp_thresh)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check on rho and eps have been kept for consistency with the main branch but I can remove them

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks


// assert(0);
if ( (alp(p.I) < alp_thresh) && ( (pv_seeds.rho > rho_BH) || (pv_seeds.eps > eps_BH) ) ) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comment above

@@ -52,7 +52,8 @@ CCTK_REAL vw_lim "Upper limit for the value of velocity * lorentz_factor " STEER
0: :: "Must be positive"
} 10.0

CCTK_REAL rho_strict "Density above which RePrimAnd c2p corrections are forbidden" STEERABLE=ALWAYS
# TODO: Change name
CCTK_REAL rho_strict "Density ceiling after C2P" STEERABLE=ALWAYS
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend to use "rho_max", and remove this

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above

EOSX/param.ccl Outdated Show resolved Hide resolved
c2p_Noble.bh_interior_fail(eos_th,pv,cv,glo);
} else {
// set to atmo
cv.dBvec(0) = dBx(p.I);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would set to atmo only when "set_atmo" is set to true for both C2Ps. For eg, if there are NaNs in magnetic field or metric determinant is negative, setting the point to atmosphere would not work

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, in these cases you would like to abort the simulation?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is correct. The aforementioned cases would mean that something is going really wrong in the simulation. And even when setting the point to atmo, the magnetic field and metric values are not touched, and will continue to give NaNs

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, but I think this would require a bigger change in the code and it would be good to have a separate PR for that

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As "set_atmo" is currently not used in this way, I think


#Initial conditions for entropy

schedule SetEntropy IN HydroBaseX_PostInitial
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this function sets initial data for the HydroBaseX variable "entropy", I would recommend scheduling within the group " HydroBaseX_InitialData"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

Copy link
Collaborator Author

@MChabanov MChabanov Nov 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just had a quick look again at this point. The entropy requires valid pressures, densities etc. So, it should be executed after a thorn which is setting these quantities. That's comparable to the ID for the vector potential in the TOV or BNS case. As it stands now, I can't really schedule it in HydroBaseX_InitialData in full generality as it should always be run after something that sets rho, press, eps ... (if I don't introduce new schedule bins)

So, if there is no obvious problem with keeping it in HydroBaseX_PostInitial, we could keep it that way. Alternatively, we could do something similar as is done for the vector potential and use ODESolvers_Initial, but I am not sure if there is an advantage

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay sounds good

@MChabanov MChabanov merged commit f1d0be5 into jaykalinani:main Dec 3, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants