210 likes | 353 Views
Multi-Tier Graphical Web Service for Simulating Reflectometry in Plasma. Eliot Feibush, Gerrit Kramer, Ernest Valeo, Raffi Nazikian, Douglas McCune Princeton Plasma Physics Laboratory. Reflectometer on Fusion Experiment. Expensive, custom-made diagnostic instrument on fusion experiments.
E N D
Multi-Tier Graphical Web Service for Simulating Reflectometry in Plasma Eliot Feibush, Gerrit Kramer, Ernest Valeo, Raffi Nazikian, Douglas McCune Princeton Plasma Physics Laboratory
Reflectometer on Fusion Experiment Expensive, custom-made diagnostic instrument on fusion experiments. Limited opportunities for acquiring data from tokamaks. Emit radio frequency waves, measure reflected wave. Locate turbulence in plasma by correlating reflections from frequencies.
Goals for Software Simulation of Reflectometer Challenges Solutions Develop new Java GUI for portability. Graphical input for visual verification. Web service - Java applet GUI in web browser. Java servlet on server side inside firewall. Simulation runs on compute servers. Grid certificates, MyProxy server. Scale to 8-bit data on server. Client color-codes to original range. Transform only visible pixels for efficient image blending. Develop reusable modules for graphs, plasma cross sections, monitoring, run history, credential management. Visualize input & output with minimal changes to existing Fortran simulation code. Different computer platforms. Increase accessibility of simulation to physicists at different locations, different institutions. Distribution, installation Security Blend reflected waves with input plasma. Data size exceeds memory limits Transfer technology to other fusion codes.
Multi – Tier Architecture http Web Server Compute Cluster Firewall Experiment Data Server Acquired data Standardized Form User’s PC, Mac, Linux Internal Server Java Servlet Java Client GUI Input Plasma Parametric Model Data compression netCDF files Simulated Device Full Wave Solution Wave Propagation Simulation CorrelationGraphs
Distribute Processing to Optimize Resources 2. Web server is accessible from anywhere on Internet. Forwards requests to Java servlet running in Tomcat container behind firewall. 4. Compute servers retrieve or model input plasma and run simulation code. Compute “cut-off “ visualization. http Web Server Compute Cluster 1. Java UI runs on user’s computer for interactive graphics & display. Sends requests to web server. Firewall Experiment Data Server Acquired data Standardized Form 3.Servlet can access files on portal and run programs. User’s PC, Mac, Linux Internal Server Java Servlet Java Client GUI Input Plasma Parametric Model Data compression netCDF files 6. Extract & compress data needed by applet for display. Simulated Device Full Wave Solution CorrelationGraphs Wave Propagation Simulation 7. Compute graphs on server, send graph objects to applet. 5. Largeoutput files saved in user’s working directory on portal storage area.
Benefits of Java Client Applet Always run latest version, compatible with compute service maintained on server side. Portable. No software installation. Accessible by Internet. Read URL files over the net. GUI classes. Porter, Duff image blending methods. Elfresco – The Full Wave Reflectometer Simulation Codew3.pppl.gov/fwr
Server Functions Input plasma • Run program to generate parametric model of plasma. • Run program to retrieve standardized form of plasma from database of experiments. • Import netCDF file of electron density, temperature, magnetic field. • Compress input plasma to new file. Link to a URL. Send URL to client. Save input plasma file in working directory. Run wave propagation simulation code • Read new lines in progress file, return to client for monitoring. • Compress output to new file. Link to a URL. Send URL to client. • Create correlation graph and send to client. Run management • Create working directory for each new simulation run. • Assemble list of run history and send to client. • Send prior run parameters to client. • Schedule a run directory to be archived. • Delete a run directory. • Retrieve user’s X.509 credentials from MyProxy server.
Visualize Input Plasma Cross Sections Electron Density Temperature Magnetic Field 3. x 1019 1 keV 1 T Coils surround the vacuum vessel so magnetic field extends beyond the plasma.
Input Plasma: Experimental Shot MDS+ Database Acquired data Shot #108730 Shot #108731 Shot ... Standard Form Run 108730-A83 Run 108731-A83 Run ... Process into Standardized Form Acquired data from each shot Retrieve 2-D Profile Electron Density Temperature Magnetic Field netCDF file -Input to wave simulation National Spherical Torus Experiment Produces shots of plasma within the vacuum vessel surrounded by magnetic field coils.
Input Plasma: Parametric Model Calculate profiles when measured data from experiment is not available. Parameters Major Radius Minor Radius Maximum Electron Density Maximum Temperature Maximum Magnetic Field Ellipticity Shift Ellipticity .8 Electron density & temperature are highest at center of plasma and decrease toward edges. Ellipticity 1.3 Ellipticity 1.3 Shift 30%
Input Plasma: Simulate New Design Programatically create density, temperature, & magnetic field profiles. Cross section of ITER, the international fusion project to be constructed, is shown with 1 transmitter and 4 receivers. Transmitter sends waves toward plasma. Receivers measure reflected amplitude of reflected waves.
Wave Reflection Layer (Cut-off Location) O-mode LX-mode RX-mode Visualizing location in plasma where a radio frequency wave will be reflected. Helps the user select frequency for investigating a specific location in the plasma. Color bands preferred to grayscale for perceiving frequency range even though information is only 1 dimensional. Transmitter is outside the plasma, on the left or right side. Emits waves toward plasma. Color code indicates frequency of wave reflected at a location.
Wave Reflection Calculation Reflectometers emit radio frequency waves, typically up to 140 Ghz. Waves penetrate plasma proportional to frequency. • O-mode (ordinary emitted waves) reflection location: • X-mode (circularly polarized emitted waves) reflection location:
Interactive Graphical Input User positions transmitter and receivers. Specify frequencies. Full Wave (high density) & Paraxial (lower density) compute regions. Regions & text drawn with white shadow to increase visibility. Interactive crosshair on graph for finding reflection location (R = 1.92) of 53 Ghz wave. Visually verify input before running simulation
Multi-Tier Simulation & Graphical Output Simulation computes amplitude of reflected waves. Visualized relative to O-mode reflection locations. Graphed at upper right. User interface assembles all input. Sends as HTTP request to servlet: Run simulation. Polls for incremental updates to monitor progress of simulation. Server compresses output for display. Creates output in a URL file. Applet downloads from URL and displays results.
Visualize Solution from Simulation 53 Ghz wave reflection is displayed. Blending shows wave reaching reflection layer (R = 1.92) predicted by color-coded cut-off visualization. 45 Ghz wave can not propagate as far as 53 Ghz so it reflects at R = 2.1
Efficient Image Blending Input Plasma 600 x 900 Transform to blend buffer only the visible pixels corresponding to Display Area. r2 , z2 r2 , z2 r1 , z1 r’2 , z’2 Full Wave Paraxial r1 , z1 Blend Buffer (500 x 500 pixels)Allocated to size of Display Area. Input arrays are clipped before transforming. Display Area in Java applet (500 x 500 pixels) Computed Simulation of reflected waves - 1000 x 400. Pixels per meter is greater than input plasma. Horizontal resolution ≠ vertical resolution; Full wave > paraxial resolution. r’1 , z’1
Correlation Graphs Created on Server Correlation graphs of 4 frequencies between 2 receivers. Decreasing correlation indicates fluctuation and turbulence areas in the plasma. Graphs created on server where all data is accessible. Graphing software, written in Java, integrates data exploration and display. Graph objects containing actual data are created in Java servlet. Serialized graphs sent to Java applet as HTTP response. Graph class running in applet has methods for display and exploration. Graphs are not static images. Graphs have interactive display features.
Security Model User applies for X.509 certificate. • Requires approval by human. • Create user’s work directory within portal. • Sub-directory for each run created automatically. Globus runs jobs in protected directory on compute server. • Credential stored on MyProxy server. • Retrieved by servlet via user password. • No certificate files for user to misplace.
Reusable Software Components Develop object-oriented Java classes for applet and servlet. Scientific Graphics • Gryph.java – base class for objects, graphical glyphs, drawn in R-Z coordinate system. Extended for rectangular regions, antenna icons, wave paths. • f(x) graphs, indexed f(x, i) graphs with time-step animation. • Color-coded f(x,y) graphs & legends of plasma cross sections. Simulations • Sign on to portal. Retrieve & manage security credentials. • Submit jobs. • Monitor a run. Applet polls from a new thread so GUI can continue running. • Maintain run history.
Conclusion Successful approach for adding graphical input and output to simulation with minimal changes to original Fortran code. Web service makes simulations more accessible to user community. System architecture optimizes resources of various computers. Credential server is convenient for users and compatible with security. Browser memory limits overcome by scaling data on server. Efficient blending of zoomed images by transforming only visible pixels. Visualization guides choosing frequencies. Reusable modules enable web services for other fusion simulation codes.