Core-Edge Workflow
Overview
The diagram below shows the FACETS workflow. The left column shows the computational part of the workflow, and the right shows the visualization part of the workflow.
The computations now typically begin from (fixed form) EQDSK files that contain magnetic data, such as the toroidal and poloidal fluxes, and profile information, such as temperatures and pressures. The fluxgrid code fits a precise equilibrium to this data and outputs flux-surface averaged values for the profiles along with the geometric data needed for solving the profile evolution equations. These are in the form of pre-file fragments, which can be assembled with other run definition data by the txpp preprocessors into the main FACETS input file. The framework reads this file, which contains information on the run, including which components are to be instantiated, and what input files they should read. The output of the simulation are self-describing HDF5 files from the FACETS framework, some of those files having been output by the components.
To visualize the data, the profile data is combined with 2D geometry data by core2vsh5 to get the contours of the profiles in 2D. Edge data is already output in 2D on an unstructured mesh. All of the data is accompanied by VizSchema metadata, so that it is easily interpreted for visualization. For quick line plots, we use matplotlib (with Python). For high-quality visualizations we use VisIt.
How to run core-edge simulation
Setup
In the examples below, we assume that the environment variables CONTRIB_DIR and FACETS_DIR are defined. Please see PreliminarySetup? for discussions on preparing for running the tests.
Note: FACETS Testing Instructions might also be useful to understand as gives an understanding of how the nightly regression tests run FACETS and can be useful for a user to rerun. This explains how to run a simulation "by hand".
Running a core edge simulation
The example core-edge simulation uses a combination of GLF23 fluxes and constant diffusion flux in the core. The contribution to the fluxes from GLF23 is gradually reduced to zero as the core-edge boundary is approached. Uedge is used as the edge model. The coupling scheme is explicit. However, each of the components (core and edge) are run implicitly. The electron and deuterium temperatures are advanced. Number densities are not advanced. The simulation is run to 10 millisecond of experimental time for DIII-D shot 118898.03400. The coupling time-step is set to 10 microseconds.
These instructions assume that you have built facets and all its dependencies. We are starting from the facetsall directory.
cd fctests/tests/core-edge
This should have the following files:
ls a118898.03400 ehr2.dat g118898.03400 rdfcase8-multstep.py coupled-glf23-uedge.pre fg_g118898.03400.in rdfcase8_in.h5 transport_model.nml
Quick guide to running the example simulation
Step 1: Run fluxgrid to create core profiles and geometry
The core solver needs the initial profiles and metric coefficients for the magnetic geometry. For this run fluxgrid.:
$FACETS_DIR/fluxgrid/bin/fluxgrid fg_g118898.03400.in
This will produce several files:
ls fg*.pre fgCEinfo_g118898.03400.pre fgInitProfs_g118898.03400.pre fgMagGeom_g118898.03400.pre ls fg*.h5 fgCoreGrid_g118898.03400.h5 fgInitProfs_g118898.03400.h5
These files have the core grid, core initial profiles for density, electron and ion temperatures and the metric coefficients describing the core geometry. These are used in the facets core solver.
Step 2: Run the preprocessor to prepare the facets input file
The facets input file now needs to be preprocessed before running the simulation.::
$FACETS_DIR/facets/bin/txpp.py core-edge-explicit.pre
This will produce the input file which needs to be fed into facets::
ls core-edge-explicit.in core-edge-explicit.in
Step 3: Run the coupled simulation
To run the coupled core-edge simulation in parallel do::
mpirun -np 2 $FACETS_DIR/facets/bin/facetsst -i core-edge-explicit.in
If all goes well you should see messages on the screen indicating progress. It takes about 2 to 3 minutes minutes to run the example core-edge simulation.
Visualizing core-edge results
Visualizing lineouts of core-edge solution along midplane and X-point
To make lineouts of the coupled core-edge solution at dump 1 along the midplane and the X-point and one can use the following command::
$FACETS_DIR/facets/bin/genplot.py -i core-edge-explicit -d 1 -g fgCoreGrid_g118898.03400.h5 -l $CONTRIB_DIR/transpnumeric/lib This will create two png files.
Attachments
-
FacetsWorkflow30Sep08.png
(408.5 KB) - added by cary
3 years ago.

