Add code for modeling a radiation pressure dominated disk#14
Add code for modeling a radiation pressure dominated disk#14soumide1102 wants to merge 14 commits into
Conversation
| #if ELECTRONS && EOS == EOS_TYPE_GAMMA_GASPRESS | ||
| // Reset entropy after floors | ||
| pv[KTOT] = EOS_Gamma_entropy_rho0_u(pv[RHO], pv[UU]); | ||
| pv[KTOT] = EOS_Gamma_Gaspress_entropy_rho0_u(pv[RHO], pv[UU]); |
There was a problem hiding this comment.
I also wanted to check with you what this piece of code is doing. In the current modifications, I changed the name of the functions to the updated names specifying gas pressure. If this is going into evolving the simulation, should there also be another if statement for the radiation pressure dominated case as well?
There was a problem hiding this comment.
This does go into evolving the simulation, yes. But this code path will never be reached. The ELECTRONS machinery is backwards compatibility with ebhlight's two-temperature gas for AGN disks. I would add another if case, but it's never going to come up.
There was a problem hiding this comment.
With EOS_TYPE_GAMMA having two sub-cases, this can go to EOS_entropy_rho0_u or something
Yurlungur
left a comment
There was a problem hiding this comment.
Overall I like the strategy here... But something seems off as far as the code paths. You only replaced the entropy equation for the ideal gas equation of state, but you're treating it as an entirely different equation of state everywhere in the code. I think this is only working because you set all 3 macros to resolve to the same integer.
I would suggest a new structure. Something like:
- The ideal gas eqation of state is triggered for
EOS == EOS_TYPE_GAMMA - The gamma EOS has two new options
GAMMA_GASPRESSandGAMMA_RADPRESSor something. - Those new macros are set as a new
cparmin the build fie. We probably also need to set a new default value inscript/configure.py
| #define EOS_TYPE_GAMMA_GASPRESS (0) | ||
| #define EOS_TYPE_GAMMA_RADPRESS (0) |
There was a problem hiding this comment.
These all can't be zero. That means EOS_TYPE_GAMMA_GASPRESS and EOS_TYPEGAMMA_RADPRESS will resolve to the same number. That's probably not your intent. Each EOS type needs to resolve to a different number in the macro.
| fprintf(stdout, " * IDEAL GAS EOS *\n"); | ||
| #endif | ||
| #if EOS == EOS_TYPE_GAMMA_GASPRESS | ||
| fprintf(stdout, " * GAS-PRESSURE DOMINATED EOS *\n"); |
There was a problem hiding this comment.
GAS-PRESSURE DOMINATED IDEAL GAS EOS
| fprintf(stdout, " * GAS-PRESSURE DOMINATED EOS *\n"); | ||
| #endif | ||
| #if EOS == EOS_TYPE_GAMMA_RADPRESS | ||
| fprintf(stdout, " * RADIATION-PRESSURE DOMINATED EOS *\n"); |
There was a problem hiding this comment.
RADIATION-PRESSURE DOMINATED IDEAL GAS EOS
| Rout_vis = Rout | ||
| GAMMA = 13./9. | ||
| KAPPA = 1.e-3 | ||
| GAMMA = 4./3. |
There was a problem hiding this comment.
This should be if-cased on whether you're radiation or gas pressure dominated. 4./3. is appropriate for radiation pressure, not gas pressure.
| elif DO_GAMMA_RADPRESS: | ||
| EOS_TYPE = "EOS_TYPE_GAMMA_RADPRESS" | ||
| elif DO_GAMMA_GASPRESS: | ||
| EOS_TYPE = "EOS_TYPE_GAMMA_GASPRESS" |
There was a problem hiding this comment.
now there should be a throw if it's not one a valid EOS type. Let's catch that in case someone somehow doesn't set one.
|
@Yurlungur Does this look like what you were suggesting? I will then update the other scripts accordingly. |
|
|
||
| # EOS | ||
| bhl.config.set_cparm("EOS_TYPE", EOS_TYPE) | ||
| bhl.config.set_cparm("EOS", EOS_TYPE) |
There was a problem hiding this comment.
So one small change I was thinking of: Here the name of the parameter is EOS which saves which type of EoS is going to be used. Also, around line 100, there is
if RELTABLE:
bhl.report_var('EOS','RELTABLE')
elif GAMTABLE:
bhl.report_var('EOS','GAMTABLE')
else:
bhl.report_var('EOS','GAMMA')
where the parameter name is EOS. I was wondering whether the latter parameter can be changed to something like EOS_VAL to keep the two parameter names different?
There was a problem hiding this comment.
no those should be the same. report_var doesn't do anything internal in the code. It prints a choice of variable to the build output.
| #define GASPRESS (1) | ||
| #define RADPRESS (2) | ||
| #elif EOS == EOS_TYPE_POLYTROPE |
There was a problem hiding this comment.
Yes. This is what I was thinking. :)
| #if EOS == EOS_TYPE_GAMMA_GASPRESS | ||
| ent = EOS_Gamma_Gaspress_entropy_rho0_u(rho, u); | ||
| #elif EOS == EOS_TYPE_GAMMA_RADPRESS | ||
| ent = EOS_Gamma_Radpress_entropy_rho0_u(rho, u); |
There was a problem hiding this comment.
Should now be sub-cases of EOS_TYPEGAMMA
| #if ELECTRONS && EOS == EOS_TYPE_GAMMA_GASPRESS | ||
| // Reset entropy after floors | ||
| pv[KTOT] = EOS_Gamma_entropy_rho0_u(pv[RHO], pv[UU]); | ||
| pv[KTOT] = EOS_Gamma_Gaspress_entropy_rho0_u(pv[RHO], pv[UU]); |
There was a problem hiding this comment.
With EOS_TYPE_GAMMA having two sub-cases, this can go to EOS_entropy_rho0_u or something
| #endif // METRIC | ||
|
|
||
| #if EOS == EOS_TYPE_GAMMA || GAMMA_FALLBACK | ||
| #if EOS == EOS_TYPE_GAMMA || EOS_TYPE_GAMMA_GASPRESS || EOS_TYPE_GAMMA_RADPRESS || GAMMA_FALLBACK |
There was a problem hiding this comment.
can go back to just EOS == EOS_TYPE_GAMMA
|
|
||
| // EOS | ||
| #if EOS == EOS_TYPE_GAMMA || GAMMA_FALLBACK | ||
| #if EOS == EOS_TYPE_GAMMA || EOS_TYPE_GAMMA_GASPRESS || EOS_TYPE_GAMMA_RADPRESS || GAMMA_FALLBACK |
There was a problem hiding this comment.
can go back to just EOS == EOS_TYPE_GAMMA
| READ_HDR(cour, TYPE_DBL); | ||
|
|
||
| #if EOS == EOS_TYPE_GAMMA || GAMMA_FALLBACK | ||
| #if EOS == EOS_TYPE_GAMMA || EOS_TYPE_GAMMA_GASPRESS || EOS_TYPE_GAMMA_RADPRESS || GAMMA_FALLBACK |
There was a problem hiding this comment.
can go back to just EOS == EOS_TYPE_GAMMA
|
@soumide1102 this is looking like it's moving along... although I see tests are failing. How close are you to being ready for another review? |
860cd19 to
d136659
Compare
…in EOS_Gamma_temp
… of globally + experimenting with entropy CU
This PR adds code for setting up a radiation pressure dominated disk.
gammadisk, the code now can either set up a radiation pressure dominated or a gas pressure dominated case. For doing that the user can input-gammagaspressorgammaradpress.-gammagaspresswill follow the old code path forgamma.-gammaradpresswill follow the radiation pressure code path added in this PR.kappaparameter saved in build.py is now corrected tokappa_eosIn calculating rho for the radiation pressure dominated case, there is a multiplication factor
athat is currently not included in problem.c . Should hdf5_to_dict be the place to factor that in when loading the results and converting to the desired units?