Beispiel #1
0
def temperature(r):
  MP_OVER_KB = 121.148
  HYDROGEN_MASSFRAC = 0.76
  meanweight_n = 4.0 / (1 + 3*HYDROGEN_MASSFRAC)
  meanweight_i = 4.0 / (3 + 5*HYDROGEN_MASSFRAC)

  integral = integrate.quad(opt.T_integrand, r, np.inf,
    args=(M_gas, a_gas, M_dm, a_dm, gamma_gas, gamma_dm),
    full_output=-1)
  result = integral[0] / opt.dehnen_density(r, M_gas, a_gas, gamma_gas)

  temp_i = MP_OVER_KB * meanweight_i * result
  temp_n = MP_OVER_KB * meanweight_n * result

  if(temp_i > 1.0e4):
    return temp_to_internal_energy(temp_i)
  else:
    return temp_to_internal_energy(temp_n)
Beispiel #2
0
def temperature(r):
    MP_OVER_KB = 121.148
    HYDROGEN_MASSFRAC = 0.76
    meanweight_n = 4.0 / (1 + 3 * HYDROGEN_MASSFRAC)
    meanweight_i = 4.0 / (3 + 5 * HYDROGEN_MASSFRAC)

    integral = integrate.quad(opt.T_integrand,
                              r,
                              np.inf,
                              args=(M_gas, a_gas, M_dm, a_dm, gamma_gas,
                                    gamma_dm),
                              full_output=-1)
    result = integral[0] / opt.dehnen_density(r, M_gas, a_gas, gamma_gas)

    temp_i = MP_OVER_KB * meanweight_i * result
    temp_n = MP_OVER_KB * meanweight_n * result

    if (temp_i > 1.0e4):
        return temp_to_internal_energy(temp_i)
    else:
        return temp_to_internal_energy(temp_n)
Beispiel #3
0
def set_temperatures(coords_gas):
  U_grid = np.zeros((N_rho, Nz))
  U = np.zeros(N_gas)
  # Constantless temperature, will be used in the circular
  # velocity determination for the gas.
  T_cl_grid = np.zeros((N_rho, Nz)) 
  MP_OVER_KB = 121.148
  HYDROGEN_MASSFRAC = 0.76
  meanweight_n = 4.0 / (1 + 3 * HYDROGEN_MASSFRAC)
  meanweight_i = 4.0 / (3 + 5 * HYDROGEN_MASSFRAC)
  disk_temp = 10000
  U.fill(temp_to_internal_energy(disk_temp))
  if(disk_temp >= 1.0e4):
    T_cl_grid.fill(disk_temp / MP_OVER_KB / meanweight_i)
  else:
    T_cl_grid.fill(disk_temp / MP_OVER_KB / meanweight_n)
  return U, T_cl_grid