Overview

The C++ interface to the transport models in FMCFM is through a set of classes. These classes are (indentation represents inheritance):

  FmTransportModel
    FmAnomTransportModel
      FmGlf23TransportModel
      FmMmm95TransportModel
    FmNeoClassTransportModel
    FmPaleoClassTransportModel

Each class represents data at a single flux surface. To use the interface one needs to initialize the most derived class. The constructor takes a single parameter, the number of ionic species in the system:

  FmGlf23TransportModel glfModel(1);

This will create a GLF23 model which handles a single ionic species. Once parameters at the flux surface of interest are set one can use the calcFluxes() method to compute the fluxes. The various fluxes can be then obtained. For example:

  // set magnetic geometry

  // set species variables

  // set anomalous-transport surface variables

  // set variables specific to GLF23

  // compute fluxes
  glfModel.calcFluxes();

  // get fluxes
  double ionPtclFlux = glfModel.getFluxVar("ion_particle", 1);
  double elcPtclFlux = glfModel.getFluxVar("electron_particle");

For all quantities, except temperature, SI units are used. Temperature is represented using eV. However, thermal fluxes still use SI units. The variables names supported by the various set/get methods in each class are documented below.

Class FmTransportModel?

This class stores information about the magentic geometry for the flux surface. It also stores information about each species in the model, including electrons, ionic species and average impurites.

Setting magnetic geometry variables

The magentic geometry variables are set using the setMagGeomVar method:

  FmTransportModel. setMagGeomVar(const std::string& nm, double val)

The names supported by this method are listed below:

  rho
  coulombLog
  BSq
  gradRhoSq
  deltaMiller
  gradRhoSqInvRmajSq
  invBsq
  Bt
  rmin
  DdeltaMillerDrho
  RBtor
  invBSqGradRhoSq
  gradRho
  Rmaj
  DlnQDlnRho
  DdeltaDrho
  rminor
  invRmajSq
  DrDrho
  fluxAvgB
  kappa
  volumePrime
  DRmajDrho
  q
  localInvAspect
  delta
  Rmajor
  arho
  DkappaDrho

For example:

  glfModel.setMagGeomVar("rmin", 3.547E-01);
  glfModel.setMagGeomVar("Rmaj", 1.7275);
  glfModel.setMagGeomVar("kappa", 1.3065);

Setting species variables

The species variables are set using the setAllSpeciesVar methods. The species variables can be set for electrons, each ion species, average impurities and average fast-ions.

In general one does not need to set the average impurities or fast-ions variables as all ionic species are treated uniformly. The individual ionic species can be tagged using "ion_speciesType" variable:

  glfModel.setAllSpeciesVar("ion_speciesType", "impurity");

The ionic-type names classfied as fast-ions are:

  beamion
  fusionion

The other ionic-type names are:

  impurity

Scalar double variables

To set scalar variables of type double:

  FmTransportModel. setAllSpeciesVar(const std::string& nm, double val)

The names supported by this method are listed below. For electons:

  electron_vpara
  electron_gradTemp
  electron_temperature
  electron_gradDen
  electron_density
  electron_nprotons
  electron_charge
  electron_vperp
  electron_vphi
  electron_speciesType
  electron_amu

For average fast ions:

  AvgFastIon_vpara
  AvgFastIon_gradTemp
  AvgFastIon_temperature
  AvgFastIon_gradDen
  AvgFastIon_density
  AvgFastIon_nprotons
  AvgFastIon_charge
  AvgFastIon_vperp
  AvgFastIon_vphi
  AvgFastIon_speciesType
  AvgFastIon_amu

For average hyrodgenic species:

  AvgHydrogenic_vpara
  AvgHydrogenic_gradTemp
  AvgHydrogenic_temperature
  AvgHydrogenic_gradDen
  AvgHydrogenic_density
  AvgHydrogenic_nprotons
  AvgHydrogenic_charge
  AvgHydrogenic_vperp
  AvgHydrogenic_vphi
  AvgHydrogenic_speciesType
  AvgHydrogenic_amu

For average impurities:

  AvgImpurity_vpara
  AvgImpurity_gradTemp
  AvgImpurity_temperature
  AvgImpurity_gradDen
  AvgImpurity_density
  AvgImpurity_nprotons
  AvgImpurity_charge
  AvgImpurity_vperp
  AvgImpurity_vphi
  AvgImpurity_speciesType
  AvgImpurity_amu

Other varables:

  Zeff

Vector double variables

To set vector variables of type double:

  FmTransportModel. setAllSpeciesVar(const std::string& nm, 
    size_t idx, double val)

The names supported by this method are listed below:

  ion_vpara
  ion_gradTemp
  ion_temperature
  ion_gradDen
  ion_density
  ion_nprotons
  ion_charge
  ion_vperp
  ion_vphi
  ion_speciesType
  ion_amu

For example:

  glfModel.setAllSpeciesVar("ion_temperature", 1, 2.8806E3);
  glfModel.setAllSpeciesVar("ion_gradTemp", 1, -5.045394614447046847E3);
  glfModel.setAllSpeciesVar("ion_density", 1, 4.5427E19);
  glfModel.setAllSpeciesVar("ion_gradDen", 1, -5.53522138647110897E19);

Vector int variables

To set vector variables of type int:

  FmTransportModel. setAllSpeciesVar(const std::string& nm, 
    size_t idx, int val)

The names supported by this method are listed below:

  ion_nprotons

For example, to set the first ionic species to have two protons:

  glfModel.setAllSpeciesVar("ion_nprotons", 1, 2);

Class FmAnomTransportModel?

This class stores information about the surface variables for use in all anomalous transport models.

Setting anomalous-transport surface variables

The anomalous-transport variables are set using the setSurfVar method:

  FmTransportModel. setSurfVar(const std::string& nm, double val)

The names supported by this method are listed below:

  alphaMhd
  wExbDia
  wExb
  velAng
  wPara

For example:

  glfModel.setSurfVar("alphaMhd", 4.62719E-01);
  glfModel.setSurfVar("wExbDia", 0.0);
  glfModel.setSurfVar("wExb", 3.71168E-02);
  glfModel.setSurfVar("velAng", 6.54766E04);
  glfModel.setSurfVar("wPara", 0.0);

Class FmGlf?23TransportModel

This class stores information which is specific to the GLF23 model. Users should create an instance of this method if they wish to compute fluxes using the GLF23 model.

Setting GLF23 specific variables

There are two sets of flags which can be set. The first set is the basic flags and the other is the set of extra flags. The extra flags provide expert control on GLF23 settings. The basic methods for setting these variables is:

  FmGlf23TransportModel. setFlagsVar(const std::string& name, double value)
  FmGlf23TransportModel. setFlagsVar(const std::string& name, 
    size_t idx, double value)

The names of the basic flags supported by this methods are listed below:

  basic_ifElec
  basic_tranFlags
  basic_iglf
  basic_cExB
  basic_rotationFlag
  basic_UnitNum
  basic_ifETG
  basic_nroot
  basic_calpha
  basic_BtFlag
  basic_eigen
  extra_alphaP
  extra_xky0
  extra_xparam
  extra_adamp
  extra_xkymax
  extra_park
  extra_iflagin
  extra_xkymin
  extra_cnu
  extra_ikymax
  extra_cbetae
  extra_cnorm