[mesa-users] The meaning of photosphere_r

Bill Paxton paxton at kitp.ucsb.edu
Tue Oct 18 13:25:45 EDT 2016


Hi,

Thanks for the bug report complete with details for how to fix it!  

I've now fixed the mesa sources (in 9288) -- replaced tau_phot by s% tau_base in the routine you attached.

btw: in the current version the relevant routines has moved to star_utils in case you'd like to take a look.

Cheers,
Bill



On Oct 18, 2016, at 2:58 AM, Warrick Ball wrote:

> Hi,
> 
> I'm currently considering models with the atmospheric structure included in the stellar model by placing the outer boundary condition at a smaller optical depth using tau_factor in &star_job.  I had a look at the variable s% photosphere_r, which is the radius of the photosphere, and set by the function get_r_phot in star/private/star_utils.f90.
> 
> Judging by that code (appended below because it's quite short), it looks like photosphere_r is the depth at which tau=2/3.  Is that the desired behaviour?  I would personally say that the photospheric radius is where T=Teff.  For an Eddington grey atmosphere, this is tau=2/3, but it isn't for other T(tau) relations.  The T=Teff values are already in the function atm_tau_base in atm/public/atm_lib.f90, which returns the optical depth of T=Teff for the T(tau) relations: about 0.312 and 0.412 for krishna_swamy and solar_Hopf, respectively.
> 
> Now that I know what photosphere_r really means, I can (quite easily!) write my own routine for run_star_extras.f.  But I thought I'd bring this up because this definition of the photosphere isn't what I expected, so it's possible that it's not what other user expect(ed) either.
> 
> Cheers,
> Warrick
> 
> 
>      real(dp) function get_r_phot(s) ! return r where optical depth = 2/3
>         type (star_info), pointer :: s
> 
>         integer :: k
>         real(dp) :: tau00, taup1, dtau, r003, rp13, r3
> 
>         real(dp), parameter :: tau_phot = 2d0/3d0
> 
>         include 'formats'
> 
>         tau00 = 0
>         taup1 = 0
>         get_r_phot = s% r(1)
>         if (s% tau_factor >= 1) return
>         tau00 = s% tau_factor*s% tau_base
>         if (tau00 >= tau_phot) return
>         do k = 1, s% nz-1
>            dtau = s% dm(k)*s% opacity(k)/(4*pi*s% rmid(k)*s% rmid(k))
>            taup1 = tau00 + dtau
>            if (taup1 >= tau_phot .and. dtau > 0d0) then
>               r003 = s% r(k)*s% r(k)*s% r(k)
>               rp13 = s% r(k+1)*s% r(k+1)*s% r(k+1)
>               r3 = r003 + (rp13 - r003)*(tau_phot - tau00)/dtau
>               get_r_phot = pow_cr(r3,1d0/3d0)
>               return
>            end if
>            tau00 = taup1
>         end do
> 
>      end function get_r_phot
> 
> 
> 
> 
> ------------
> Warrick Ball
> Postdoc, Institut für Astrophysik Göttingen
> wball at astro.physik.uni-goettingen.de
> +49 (0) 551 39 5069------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most 
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot_______________________________________________
> mesa-users mailing list
> mesa-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mesa-users





More information about the Mesa-users mailing list