calculation of optical depth

General discussion of all things GYRE-related (e.g., results, talks, ideas, tips)
Post Reply
anwesha
Posts: 9
Joined: Tue Oct 04, 2022 6:31 pm

calculation of optical depth

Post by anwesha » Fri Dec 08, 2023 12:34 pm

Hi,

I would like to calculate the optical depth of the surface point of the gyre model
I am using T^4 = (Teff^4)*(2/3 + tau)*(3/4)
for T I am using (addata['T'])[-1] for the surface point, Teff I am using the Teff of the input model. Now that leads me to a tau of ~ 32, whereas the input model has a surface tau of 20. Is there a way to place the first grid point at a different tau value in gyre?
Is there a way I can increase the number of grid points near the surface of the model so that it is more well-resolved at that point?

Thank you for all the help.

User avatar
rhtownsend
Site Admin
Posts: 397
Joined: Sun Mar 31, 2013 4:22 pm

Re: calculation of optical depth

Post by rhtownsend » Fri Dec 08, 2023 12:44 pm

anwesha wrote:
Fri Dec 08, 2023 12:34 pm
Hi,

I would like to calculate the optical depth of the surface point of the gyre model
I am using T^4 = (Teff^4)*(2/3 + tau)*(3/4)
for T I am using (addata['T'])[-1] for the surface point, Teff I am using the Teff of the input model. Now that leads me to a tau of ~ 32, whereas the input model has a surface tau of 20. Is there a way to place the first grid point at a different tau value in gyre?
Is there a way I can increase the number of grid points near the surface of the model so that it is more well-resolved at that point?

Thank you for all the help.
Hi Anwesha --

Thanks for your question!

The equation you use to relate temperature to optical depth assumes that the atmosphere above the outer boundary of the input model satisfies the plane-parallel Eddington-grey T-tau relation. This may not in fact be true -- it will depend on how the input model is calculated. Where are you getting your input model from?

Also, when you ask about adding extra points near the surface of the model -- do you mean add extra points to the model (so you can better resolve the stellar structure low-tau parts of the model), or to the GYRE calculations (so you can better resolve the behavior of the oscillations in the low-tau parts of the model)?

cheers,

Rich

anwesha
Posts: 9
Joined: Tue Oct 04, 2022 6:31 pm

Re: calculation of optical depth

Post by anwesha » Fri Dec 08, 2023 12:56 pm

Hi Rich,

I am using a .GYRE model from MESA. I have calculated a running work integral and plotted it (picture attached). I have the region marked where I want more points so that it is well resolved. I don't know how to approach that.
Is there a way to do it? (I have tried playing around with wosc, wcenter, wexp parameters but this is with default values of 0)
Thank you :)
Attachments
Screenshot 2023-12-08 at 11.53.20.png
running workintegral plot
Screenshot 2023-12-08 at 11.53.20.png (54.36 KiB) Viewed 2149 times

User avatar
rhtownsend
Site Admin
Posts: 397
Joined: Sun Mar 31, 2013 4:22 pm

Re: calculation of optical depth

Post by rhtownsend » Fri Dec 08, 2023 1:44 pm

Hi Anwesha --

What model atmosphere is being used for the MESA calculations -- i.e., what is the setting for atm_option? It would help if you could post your MESA inlist file.

Also, regarding your plot, what is the x-axis?

cheers,

Rich

anwesha
Posts: 9
Joined: Tue Oct 04, 2022 6:31 pm

Re: calculation of optical depth

Post by anwesha » Fri Dec 08, 2023 3:01 pm

Hi Rich,

I have attached the main inlist which I am using for cooling the model. For the graph attached before the x-axis is the log of pressure from the center (on the left) to the surface (on the right).

Thank you for all the help :)
Attachments
inlist_cool.txt
(4.62 KiB) Downloaded 1350 times

User avatar
warrick
Posts: 84
Joined: Wed Aug 28, 2013 2:47 am

Re: calculation of optical depth

Post by warrick » Fri Dec 08, 2023 4:25 pm

Hi Anwesha,

You've chosen the option

Code: Select all

write_pulse_data_with_profile = .true.
for the GYRE output files, which should mean that the atm module reintegrates the atmospheric structure from some "small" τ to the optical depth at the outermost point of the MESA model, which is what is determined by things like tau_base and tau_factor.

The relevant parameter for where this integration begins is atm_build_tau_outer, which defaults to 1d-3. So the optical depth of the outermost point of the GYRE output (but not MESA's model) should be 0.001.

If you're interested, you can follow the function calls starting with star/private/pulse_gyre.f90, which shows how the GYRE file is written. If add_atmosphere is .true., the relevant sequence of procedure calls is
  • star/private/atm_support.f90:build_atm
  • star/private/atm_support.f90:build_T_tau
  • atm/public/atm_lib.f90:atm_build_T_tau_varying
  • etc
where each item in the list calls the next procedure. It goes deeper but you can already see the parameter s% atm_build_tau_outer being passed in.

anwesha
Posts: 9
Joined: Tue Oct 04, 2022 6:31 pm

Re: calculation of optical depth

Post by anwesha » Sun Dec 10, 2023 6:13 pm

Hi Rich,

thank you so much. Before I try them out, I just want to see if I understand it correctly.
So, the write_pulse_data_with_profile = .true. gives output of the .data.GYRE file
keep_surface_point_for_pulse_data = .true. means it keeps the point where tau=1d-3 (as default for the integration of boundary condition from there to an optical depth as set by the user using set_to_this_tau_factor) without having any in between points if the atmosphere is not written with the pulse data
so, if I intend to have more points on the area I showed before, I have to use,
keep_surface_point_for_pulse_data = .false.
add_atmosphere_to_pulse_data = .true. (which adds an atmosphere above my intended tau value up to an optical depth of 1d-3 in spacing as I would set)

for gyre input, the model is read as, xref=1 (where r=Rstar) and then outwards xatm=-1(where r>Rstar outermost grid point), so x will also have values that are more than 1 now when the atmosphere is stitched onto the base model

User avatar
warrick
Posts: 84
Joined: Wed Aug 28, 2013 2:47 am

Re: calculation of optical depth

Post by warrick » Mon Dec 11, 2023 4:51 am

Hi Anwesha,

Just to follow up, I realise now I misread your inlist. You've set

Code: Select all

add_atmosphere_to_pulse_data = .false.
but if you want the atmosphere structure in the GYRE output, you need to set that to .true.

I don't offhand know exactly what

Code: Select all

keep_surface_point_for_pulse_data = .true.
does but I'll have a look through the source this evening.

User avatar
rhtownsend
Site Admin
Posts: 397
Joined: Sun Mar 31, 2013 4:22 pm

Re: calculation of optical depth

Post by rhtownsend » Tue Dec 12, 2023 12:10 pm

I recommend using the 'keep_surface_point_for_pulse_data = .true.' option -- this will make sure that the GYRE model includes the outermost point of the MESA model, which in this case corresponds to tau=2/3.

Post Reply