ASCOT5
Loading...
Searching...
No Matches
plasma_1D.c File Reference

1D linearly interpolated plasma More...

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "../ascot5.h"
#include "../error.h"
#include "../consts.h"
#include "../print.h"
#include "plasma_1D.h"

Go to the source code of this file.

Functions

int plasma_1D_init (plasma_1D_data *data, int nrho, int nion, real *rho, int *anum, int *znum, real *mass, real *charge, real *Te, real *Ti, real *ne, real *ni)
 Initialize 1D plasma data and check inputs.
 
void plasma_1D_free (plasma_1D_data *data)
 Free allocated resources.
 
void plasma_1D_offload (plasma_1D_data *data)
 Offload data to the accelerator.
 
a5err plasma_1D_eval_temp (real *temp, real rho, int species, plasma_1D_data *pls_data)
 Evaluate plasma temperature.
 
a5err plasma_1D_eval_dens (real *dens, real rho, int species, plasma_1D_data *pls_data)
 Evaluate plasma density.
 
a5err plasma_1D_eval_densandtemp (real *dens, real *temp, real rho, plasma_1D_data *pls_data)
 Evaluate plasma density and temperature for all species.
 

Detailed Description

1D linearly interpolated plasma

Plasma data which is defined in a 1D uniform grid from which the values are interpolated linearly. The coordinate is the normalized poloidal flux.

Definition in file plasma_1D.c.

Function Documentation

◆ plasma_1D_init()

int plasma_1D_init ( plasma_1D_data * data,
int nrho,
int nion,
real * rho,
int * anum,
int * znum,
real * mass,
real * charge,
real * Te,
real * Ti,
real * ne,
real * ni )

Initialize 1D plasma data and check inputs.

Parameters
datapointer to the data struct
Returns
zero if initialization succes

Definition at line 25 of file plasma_1D.c.

◆ plasma_1D_free()

void plasma_1D_free ( plasma_1D_data * data)

Free allocated resources.

Parameters
datapointer to the data struct

Definition at line 102 of file plasma_1D.c.

◆ plasma_1D_offload()

void plasma_1D_offload ( plasma_1D_data * data)

Offload data to the accelerator.

Parameters
datapointer to the data struct

Definition at line 117 of file plasma_1D.c.

◆ plasma_1D_eval_temp()

a5err plasma_1D_eval_temp ( real * temp,
real rho,
int species,
plasma_1D_data * pls_data )

Evaluate plasma temperature.

This function evaluates the temperature of a plasma species at the given radial coordinate using linear interpolation.

Parameters
temppointer to where evaluated temperature [J] is stored
rhoradial coordinate
speciesindex of plasma species
pls_datapointer to plasma data struct
Returns
zero if evaluation succeeded

Definition at line 139 of file plasma_1D.c.

◆ plasma_1D_eval_dens()

a5err plasma_1D_eval_dens ( real * dens,
real rho,
int species,
plasma_1D_data * pls_data )

Evaluate plasma density.

This function evaluates the density of a plasma species at the given radial coordinate using linear interpolation.

Parameters
denspointer to where evaluated density [m^-3] is stored
rhoradial coordinate
speciesindex of plasma species
pls_datapointer to plasma data struct
Returns
zero if evaluation succeeded

Definition at line 179 of file plasma_1D.c.

◆ plasma_1D_eval_densandtemp()

a5err plasma_1D_eval_densandtemp ( real * dens,
real * temp,
real rho,
plasma_1D_data * pls_data )

Evaluate plasma density and temperature for all species.

This function evaluates the density and temperature of all plasma species at the given radial coordinate using linear interpolation.

Parameters
denspointer to where interpolated densities [m^-3] are stored
temppointer to where interpolated temperatures [J] are stored
rhoradial coordinate
pls_datapointer to plasma data struct
Returns
zero if evaluation succeeded

Definition at line 219 of file plasma_1D.c.