From: Warrick B. <wb...@bi...> - 2017-04-26 10:35:19
|
Hi again all, Continuing my tinkering with atmospheric structure, I've come across what looks like some coding of Teff as the temperature of a model's outermost meshpoint. Since I'm working on incorporating the stellar atmosphere into the stellar model, the outermost meshpoint is *not* the photosphere, which causes issues. As a simple example, I've attached an inlist for r9575 that extends the outermost meshpoint of the model to an optical depth of 0.001*(2/3). It's possible to show that by solving the usual structure equations above the photosphere, you recover an Eddington grey atmosphere. When run, you'll get a profile for the last model (final.profile). In the header data, I find Teff = 5778.56 K, as is displayed to the terminal during the evolution. But if I compute the effective temperature using the black body law with photosphere_L and photosphere_r from the same profile, I get Teff = 5780.28 K. What's going on? I did some digging into the code and found that Teff is set by the atmosphere module. Following the function calls, I eventually got to line 215 of atm/private/integrate_atm.f90: Teff4 = L/(4d0*pi*R*R*boltz_sigma) which, on first sight, looks fine. But what are R and L here? Turns out that these come from line 1372+ in star/private/hydro_vars.f90: call atm_get_int_T_tau( & s% atm_int_errtol, s% cgrav(1), M, r_surf, L_surf, & ... As the name suggests, r_surf and L_surf are defined on lines 809-810 as r_surf = s% r(1) L_surf = s% L(1) So Teff is indeed being defined by the outermost meshpoints, rather than the actual photosphere. Two notes here. First, this doesn't matter if, like in most cases I expect, the outermost meshpoint *is* the photosphere. Second, I noticed that elsewhere (and for what purpose I'm not sure) the star_info structure has a variable called photosphere_black_body_T. This is computed e.g. on lines 93-94 of star/private/report.f90: s% photosphere_black_body_T = & atm_black_body_T(s% photosphere_L, s% photosphere_r) where atm_black_body_T is on lines 656-661 in atm/public/atm_lib.f90: real(dp) function atm_black_body_T(L, R) use crlibm_lib, only: pow_cr use const_def, only: pi, boltz_sigma real(dp), intent(in) :: L, R atm_black_body_T = pow_cr(L / (4d0*pi*R*R*boltz_sigma), 0.25d0) end function atm_black_body_T and is therefore what I would expect Teff to be. Anyway, I'm not sure what the "fix" is. In my own work in progress, I use the star_info pointer to get the photospheric information inside the routine for the atmospheric BC, so that Teff is returned correctly. It works for me but I have no idea if that a universal or optimal solution. Cheers, Warrick ------------ Warrick Ball Postdoc, School of Physics and Astronomy University of Birmingham, Edgbaston, Birmingham B15 2TT wb...@bi... +44 (0)121 414 4552 |