Exemple #1
0
    def plot_heat_power_density(self):
        '''
        Function for plotting the heat flux profile

        Returns
        -------
        None.

        '''
        plt.plot(self._s, self._q)
        plt.xlabel('$s$')
        plt.ylabel('$q(s)$')

        imageFile = getOption('imageFile')
        if imageFile:
            plt.savefig(imageFile)
        else:
            plt.show()
    FOOTPRINT.fx_in_out = 5.
    FOOTPRINT.calculate_heat_flux_density("lfs")

    Q_PARALLEL = np.array(FOOTPRINT._q)
    X_AFTER_LCFS = np.array(FOOTPRINT.get_global_coordinates())
    EQUILIBRIUM = {}
    plt.figure()
    for i in X_AFTER_LCFS:
        P_0 = [i, 0, 0]
        FIELD_LINE_DICT = FIELD_LINE.follow_field_in_plane(p_0=P_0, max_length=15.0)
        plt.plot(FIELD_LINE_DICT['R'], FIELD_LINE_DICT['Z'])
        EQUILIBRIUM[i] = FIELD_LINE_DICT
    # X_AFTER_LCFS = HESELDATA.hesel_params.xaxis[I_AFTER_LCFS] + MID_PLANE_LOC
    DIVERTOR_COORDS = np.array((np.array([0.375, 0.675]), np.array([-0.78, -0.885])))
    # EQUILIBRIUM = 'eq_0002'
    HEAT_FLUX_AT_OMP = np.array((X_AFTER_LCFS, Q_PARALLEL))
    MAP_DICT = project_field_lines(X_AFTER_LCFS, DIVERTOR_COORDS, FIESTA)
    R_DIV = np.array([MAP_DICT[i]["R_pos"] for i in X_AFTER_LCFS])
    F_X = np.array([MAP_DICT[i]["f_x"] for i in X_AFTER_LCFS])
    ANGLES = np.array([MAP_DICT[i]["alpha"] for i in X_AFTER_LCFS])
    FIG = plt.figure()

    plt.figure()
    plt.plot(R_DIV, Q_PARALLEL*X_AFTER_LCFS/(R_DIV*F_X/np.cos(ANGLES)))
        
    imageFile = getOption('imageFile')
    if imageFile :
        plt.savefig(imageFile)
    else :
        plt.show()