Plasma State Representation
Download
Report
Transcript Plasma State Representation
Plasma State Representation
XPLASMA vsn. 2 – Tool for
Representation of Equilibrium,
Fields and Profiles
Available at: http://w3.pppl.gov/NTCC
1
D. McCune
Definition of Plasma State
• A plasma geometry and field configuration
represented over “standard” coordinates
• A collection of profiles (such as plasma
temperatures and densities) defined over
the same coordinates.
• XPLASMA is a tool for gathering and
sharing such a collection of data.
• XPLASMA created for purpose of intermodule communication in NTCC project.
2
D. McCune
Mathematical Description
Coordinates:
rho – normalized radial magnetic flux coordinate (sqrt(phi/philim))
0 at magnetic axis, 1 at plasma boundary.
theta – poloidal angle coordinate.
phi – toroidal angle coordinate.
R – major radius coordinate.
Z
Z – vertical coordinate.
[Rmin,Rmax]
vpll/v – pitch (velocity space)
x
rho
Energy grids (user defined).
phi
[Zmin,Zmax]
Rectangle
Grids:
theta
R
encloses
Specific discretizations of coordinates.
plasma.
Profiles:
Gridded functions of up to 3 coordinates.
Each item has: {unique name, units, label, owner, unique integer ID}
Lookup map M:name => integer – tool for finding ID of named items.
3
D. McCune
Math Description (2).
A Profile Object consists of:
• Reference to grid or grids covering a prescribed range AND
• An interpolation method (see NTCC PSPLINE module):
• Zonal step function;
• C0 – piecewise linear;
• C1 – Hermite spline with boundary conditions.
• C2 – Cubic spline with boundary conditions.
Grids are strict ascending sequences that refers to a Coordinate:
rho grids from 0 to 1
theta grids from –pi to pi (or 0 to 2pi).
R grids from Rmin to Rmax
Z grids from Zmin to Zmax
There can be multiple grids for each coordinate; for non-periodic
coordinates all grids must cover exactly the same range.
4
D. McCune
Math Description (3)
Axisymmetric MHD equilibrium, “direct” representation:
B_phi = [sign]*g(rho)/R – toroidal magnetic field.
[B_R,B_Z] = [sign]*grad(Psi(R,Z))/R – poloidal magnetic field.
Psi(R,Z) profile and g(rho) are given;
Axisymmetric MHD equilibrium, “inverse” representation:
B_phi = [sign]*g(rho)/R – toroidal magnetic field.
{R(rho,theta),Z(rho,theta)} (bicubic splines) describe flux surface locations.
[B_R,B_Z] = [sign]*grad(Psi(rho))/R – poloidal magnetic field.
g(rho), R(rho,theta), Z(rho,theta), Psi(rho) are given.
A direct MHD equilibrium representation defines an inverse representation
via interpolation.
Extrapolation can “extend” an inverse representation to cover an [R,Z] region
(mimic a direct equilibrium) but the extrapolation is not physical!
5
D. McCune
Essential Interfaces
• Define coordinates, grids, profiles.
• Load equilibria from common tokamak
experimental data sources:
– EFIT (file or MDS+) (equilibrium only):
• call eqm_fromgeqdsk(<data path>,options…)
– TRANSP (file or MDS+) (equilibrium and
profiles):
• TRXPLIB NTCC module.
• Load odds and ends…
6
D. McCune
Essential Interfaces
•
•
•
•
Coordinate mappings (x,theta) (R,Z).
Interpolate magnetic field values.
Locate profiles; interpolate profile values.
Geometrical information:
– Distance (R,Z) to plasma flux surface.
– Distance (R,Z) to limiter or vacuum vessel.
– Flux surface averages; surface areas,
volumes enclosed in flux surfaces.
• http://w3.pppl.gov/~pshare/help/xplasma.htm
7
D. McCune
Additional Interfaces
• XPLASMA supports an “irregular” (x,theta)
mesh for NUBEAM outputs:
– Neutron emissivity profiles Sn(x,theta).
– Neutral sources and sink rate profiles.
– Fast ion distribution functions f(x,theta,E,vpll/v).
• Number of theta “bins” varies radially;
increases linearly with x.
• Other specialized structures could easily be
added to XPLASMA.
8
D. McCune
New in 2006: XPLASMA vsn 2
• Lists as named data objects:
– Species lists, time steps, …
• Black boxes – opaque, user defined
storage, added to xplasma file.
– Irregular grids implemented as black boxes.
– Integrator caches (internal to xplama)
implemented as black boxes
• Major Fortran-95 upgrade…
9
D. McCune
Fortran-95 Upgrade
• Xplasma object pointer “s”, “s1”,...: multiple
instantiation.
– Call xplasma_eval_prof(s,id_f,rho_targ,f,ierr)
– Call xplasma_eval_prof(s1,id_f,rho_targ,f1,ierr)
– E.g. to time interpolate between f & f1.
• Complete new interface to support object
pointers.
10
D. McCune
Internal Storage Reorganization
• Xplasma objects can be time evolved:
– Update equilibrium:
• Equilibrium derived quantities regenerated.
• All other profiles preserved.
– Update profiles at any time.
• Redefine grids (e.g. change resolution):
– Multiple instantiation makes this possible, but
all affected profiles must be re-interpolated.
– Call xplasma_copy(s,s2,ierr); remap s2=>s…
11
D. McCune
Use of XPLASMA
Integrated
Plasma
Simulator
XPLASMA:
• Equilibrium
• Profiles
RF or Neutral
Beams
Module
Notice that:
• Each code sends data on its own grids.
• Each code receives data on its own grids.
12
D. McCune
Distributed Computing
• Entire XPLASMA contents can be saved
or reloaded to/from NetCDF:
– Call xplasma_read(s,<filename>,<status>)
– Call xplasma_write(s,<filename>,<status>)
• So far these files are reasonably small:
– <~ 100MB
– Read/write times ~ a few seconds.
• Usable for process-to-process data
transfer– if a few seconds is affordable…
13
D. McCune
MPI-Parallel Module Server
Serial TRANSP
Run (Client #1)
Serial TRANSP
Run (Client #2)
Serial TRANSP
Run (Client #3)
…
Serial TRANSP
Run (Client #N)
network
Input File*
Package, e.g.
XPLASMA**
NetCDF state.
Output File*
Package, e.g.
XPLASMA**
NetCDF state.
*viability of method
depends on keeping
files small.
Server Queue
MPI-Parallel TRANSP
Module Server(s):
•NUBEAM monte carlo
•TORIC5 full wave
•GenRAY ray tracing
•CQL3D fokker planck
•GCNM transp. solver
• ... … …
**NTCC container module for equilibrium, profiles,
distribution functions, etc. (http://w3.pppl.gov/NTCC)
to be used for Fusion Simulation Project prototype
and tested in TRANSP deployment.
14
D. McCune
Detailed Coupling to IPS
• XPLASMA to implement a component– no
direct calls to xplasma from IPS!
• Generic “Plasma State” (PS) component
“mid level” interface must be defined.
– This interface may be influenced by xplasma
capabilities.
– Future non-xplasma PS implementation will
be required to match capabilities implied by
the PS interface.
15
D. McCune
IPS and Plasma State
• High Level:
– PS_GET_PLASMA_STATE(filename,ierr)
– PS_PUT_PLASMA_STATE(filename,ierr)
– PS_COMMIT_PLASMA_STATE(ierr)
• Mid Level:
– Access to state data items with interpolation;
– Access to equilibrium-derived quantities:
• Flux surface averages
• Coordinate transformations
16
D. McCune
Hazards of Interpolation
• Example: represent Prf(rho) as a power
density step function on fine grid.
– If power is deposited in a narrow range
(rho1,rho2), and…
– A consuming code interpolates by sampling
on a coarse grid…
– It might miss the RF power entirely, or,…
– It might wildly over-estimate total power by
assigning peak power to a large rho zone.
17
D. McCune
IPS Plasma State Specification
• This is incomplete!
• Relationship of state elements (profile
arrays) to grids must be defined.
• Interpolation requirements must be
defined in detail.
• Prototype under development:
– Python code generator.
– Making assumptions re: interpolation scheme.
18
D. McCune
Proposed IPS Interpolation
Scheme
• Profile arrays treated as zonal step
functions.
– Boundary-oriented rho and theta grids given.
– REAL(KIND=rspec) :: rho(nrho),th(ntheta)
– REAL(KIND=rspec) :: profile(nrho-1,ntheta-1)
• Leverage XPLASMA zone integration
capability to map between grids.
• Is this sufficient?
19
D. McCune
Assessment
• XPLASMA was developed for intermodule
communication in the NTCC project.
• Fusion Simulation Project use is feasible.
• Upgrade to support Fusion Simulation
Project has been carried out.
• Coupling to IPS state in progress:
– Python code generator prototype under
development.
– There are some design issues.
20
D. McCune