def run_midplane_to_div_power(midplane_model, plasma, equilibrium,
                              divertor_coord):
    '''
    .
    '''
    fiesta = Fiesta(equilibrium)
    mid_plane_power = run_midplane_power(midplane_model, plasma)
    pos_from_strikepoint = mid_plane_power.get_local_coordinates(
    ) + fiesta.get_midplane_lcfs()[1]

    psi_map = map_psi(fiesta, divertor_coord)

    interp_heatload = np.interp(psi_map['R_omp'],\
                                pos_from_strikepoint,\
                                mid_plane_power._HeatLoad__q)

    print(np.sin(psi_map['theta_inc']))
    div_heatload = psi_map['R_omp'] / psi_map['R_div'] * interp_heatload / (
        psi_map['f_x'] / np.sin(psi_map['theta_inc'][0]))
    plt.plot(psi_map['R_div'], div_heatload)
예제 #2
0
from vita.utility import get_resource
from vita.modules.projection.projection2D.field_line.field_line_projection import project_field_lines
from vita.modules.projection.projection2D.field_line.field_line import FieldLine
from vita.modules.equilibrium.fiesta.fiesta_interface import Fiesta
from vita.modules.sol_heat_flux.eich.eich import Eich
from vita.modules.utils.getOption import getOption


if __name__ == '__main__':
    #HESEL_FILE_PATH = '/media/jmbols/Data/jmbols/ST40/Programme 3/Te(i)_grad_scan/ST40.00003.20.h5'
    #HESELDATA = HESELdata(HESEL_FILE_PATH)
    #HESELDATA.evaluate_parallel_heat_fluxes()

    FILEPATH = get_resource("ST40-IVC1", "equilibrium", "eq_006_2T_export")

    FIESTA = Fiesta(FILEPATH)

    FIELD_LINE = FieldLine(FIESTA)
    MID_PLANE_LOC = FIESTA.get_midplane_lcfs()[1]

    #I_AFTER_LCFS = np.linspace(-1, 10, 100)*1e-3
    #I_AFTER_LCFS = np.where(HESELDATA.hesel_params.xaxis >= 0)[0]
    # specify and load heatflux profile
    FOOTPRINT = Eich(0.0025, 0.0005, r0_lfs=MID_PLANE_LOC)  # lambda_q=2.5, S=0.5

    X_OMP = np.linspace(0, 10, 100)*1e-3
    FOOTPRINT.set_coordinates(X_OMP)
    FOOTPRINT.s_disconnected_dn_max = 2.1
    FOOTPRINT.fx_in_out = 5.
    FOOTPRINT.calculate_heat_flux_density("lfs")
"""
Created on Mon Mar 23 09:04:48 2020

@author: jmbols
"""

import numpy as np
import matplotlib.pyplot as plt
from scipy.constants import m_p, m_n, e
from vita.utility import get_resource
from vita.modules.projection.projection2D.particle_path_projection import ParticlePath
from vita.modules.equilibrium.fiesta.fiesta_interface import Fiesta

if __name__ == '__main__':
    FILEPATH = get_resource("ST40-IVC1", "equilibrium", "eq_006_2T_export")
    FIESTA = Fiesta(FILEPATH)
    #    DATA = sio.loadmat(FILEPATH)

    PARTICLE_MASS = m_n + m_p

    ZE_M = e / PARTICLE_MASS

    PATH_OBJ = ParticlePath(ZE_M, FIESTA, charge=e)

    # %%
    INITIAL_POS = np.array([0.728, 0, 0])

    B_HERE = np.array([
        float(PATH_OBJ.interp_b_r(INITIAL_POS[0], INITIAL_POS[2])),
        float(PATH_OBJ.exact_b_phi(INITIAL_POS[0])),
        float(PATH_OBJ.interp_b_z(INITIAL_POS[0], INITIAL_POS[2]))