numerics Module

Module containing callers to the main equation solvers HYBRD and VMCON author: P J Knight, CCFE, Culham Science Centre This module contains the primary numerics variables and the calling routines for the two equation solvers in the code.



Contents


Variables

TypeVisibility AttributesNameInitial
integer, public, parameter:: ipnvars =175

ipnvars FIX : total number of variables available for iteration

integer, public, parameter:: ipeqns =91

ipeqns FIX : number of constraint equations available

integer, public, parameter:: ipnfoms =19

ipnfoms FIX : number of available figures of merit

integer, public, parameter:: ipvlam =ipeqns+2*ipnvars+1
integer, public, parameter:: iptnt =(ipeqns*(3*ipeqns+13))/2
integer, public, parameter:: ipvp1 =ipnvars+1
integer, public :: ioptimz

ioptimz /1/ : code operation switch:

  • = -2 for no optimisation, no VMCOM or HYBRD;
  • = -1 for no optimisation, HYBRD only;
  • = 0 for HYBRD and VMCON (not recommended);
  • = 1 for optimisation, VMCON only

minmax /7/ : switch for figure-of-merit (see lablmm for descriptions) negative => maximise, positive => minimise

integer, public :: minmax
character(len=22), public, dimension(ipnfoms):: lablmm

lablmm(ipnfoms) : labels describing figures of merit:


  • ( 1) major radius
  • ( 2) not used
  • ( 3) neutron wall load
  • ( 4) P_tf + P_pf
  • ( 5) fusion gain Q
  • ( 6) cost of electricity
  • ( 7) capital cost (direct cost if ireactor=0, constructed cost otherwise)
  • ( 8) aspect ratio
  • ( 9) divertor heat load
  • (10) toroidal field
  • (11) total injected power
  • (12) hydrogen plant capital cost OBSOLETE
  • (13) hydrogen production rate OBSOLETE
  • (14) pulse length
  • (15) plant availability factor (N.B. requires iavail=1 to be set)
  • (16) linear combination of major radius (minimised) and pulse length (maximised) note: FoM should be minimised only!
  • (17) net electrical output
  • (18) Null Figure of Merit
  • (19) linear combination of big Q and pulse length (maximised) note: FoM should be minimised only!

integer, public :: ncalls

ncalls : number of function calls during solution

integer, public :: neqns

neqns /0/ : number of equality constraints to be satisfied

integer, public :: nfev1

nfev1 : number of calls to FCNHYB (HYBRD function caller) made

integer, public :: nfev2

nfev2 : number of calls to FCNVMC1 (VMCON function caller) made

integer, public :: nineqns

nineqns /0/ : number of inequality constraints VMCON must satisfy (leave at zero for now)

integer, public :: nvar

nvar /16/ : number of iteration variables to use

integer, public :: nviter

nviter : number of VMCON iterations performed

icc(ipeqns) /0/ : array defining which constraint equations to activate (see lablcc for descriptions)

integer, public, dimension(ipeqns):: icc
logical, public, dimension(ipeqns):: active_constraints

active_constraints(ipeqns) : Logical array showing which constraints are active

character(len=33), public, dimension(ipeqns):: lablcc

lablcc(ipeqns) : labels describing constraint equations (corresponding itvs)


  • ( 1) Beta (consistency equation) (itv 5)
  • ( 2) Global power balance (consistency equation) (itv 10,1,2,3,4,6,11)
  • ( 3) Ion power balance DEPRECATED (itv 10,1,2,3,4,6,11)
  • ( 4) Electron power balance DEPRECATED (itv 10,1,2,3,4,6,11)
  • ( 5) Density upper limit (itv 9,1,2,3,4,5,6)
  • ( 6) (Epsilon x beta poloidal) upper limit (itv 8,1,2,3,4,6)
  • ( 7) Beam ion density (NBI) (consistency equation) (itv 7)
  • ( 8) Neutron wall load upper limit (itv 14,1,2,3,4,6)
  • ( 9) Fusion power upper limit (itv 26,1,2,3,4,6)
  • (10) Toroidal field 1/R (consistency equation) (itv 12,1,2,3,13 )
  • (11) Radial build (consistency equation) (itv 3,1,13,16,29,42,61)
  • (12) Volt second lower limit (STEADY STATE) (itv 15,1,2,3)
  • (13) Burn time lower limit (PULSE) (itv 21,1,16,17,29,42,44,61) (itv 19,1,2,3,6)
  • (14) Neutral beam decay lengths to plasma centre (NBI) (consistency equation)
  • (15) LH power threshold limit (itv 103)
  • (16) Net electric power lower limit (itv 25,1,2,3)
  • (17) Radiation fraction upper limit (itv 28)
  • (18) Divertor heat load upper limit (itv 27)
  • (19) MVA upper limit (itv 30)
  • (20) Neutral beam tangency radius upper limit (NBI) (itv 33,31,3,13)
  • (21) Plasma minor radius lower limit (itv 32)
  • (22) Divertor collisionality upper limit (itv 34,43)
  • (23) Conducting shell to plasma minor radius ratio upper limit (itv 104,1,74)
  • (24) Beta upper limit (itv 36,1,2,3,4,6,18)
  • (25) Peak toroidal field upper limit (itv 35,3,13,29)
  • (26) Central solenoid EOF current density upper limit (ipfres=0) (itv 38,37,41,12)
  • (27) Central solenoid BOP current density upper limit (ipfres=0) (itv 39,37,41,12)
  • (28) Fusion gain Q lower limit (itv 45,47,40)
  • (29) Inboard radial build consistency (itv 3,1,13,16,29,42,61)
  • (30) Injection power upper limit (itv 46,47,11)
  • (31) TF coil case stress upper limit (SCTF) (itv 48,56,57,58,59,60,24)
  • (32) TF coil conduit stress upper limit (SCTF) (itv 49,56,57,58,59,60,24)
  • (33) I_op / I_critical (TF coil) (SCTF) (itv 50,56,57,58,59,60,24)
  • (34) Dump voltage upper limit (SCTF) (itv 51,52,56,57,58,59,60,24)
  • (35) J_winding pack/J_protection upper limit (SCTF) (itv 53,56,57,58,59,60,24)
  • (36) TF coil temperature margin lower limit (SCTF) (itv 54,55,56,57,58,59,60,24)
  • (37) Current drive gamma upper limit (itv 40,47)
  • (38) First wall coolant temperature rise upper limit (itv 62)
  • (39) First wall peak temperature upper limit (itv 63)
  • (40) Start-up injection power lower limit (PULSE) (itv 64)
  • (41) Plasma current ramp-up time lower limit (PULSE) (itv 66,65)
  • (42) Cycle time lower limit (PULSE) (itv 17,67,65)
  • (43) Average centrepost temperature (TART) (consistency equation) (itv 13,20,69,70)
  • (44) Peak centrepost temperature upper limit (TART) (itv 68,69,70)
  • (45) Edge safety factor lower limit (TART) (itv 71,1,2,3)
  • (46) Equation for Ip/Irod upper limit (TART) (itv 72,2,60)
  • (47) NOT USED
  • (48) Poloidal beta upper limit (itv 79,2,3,18)
  • (49) NOT USED
  • (50) IFE repetition rate upper limit (IFE)
  • (51) Startup volt-seconds consistency (PULSE) (itv 16,29,3,1)
  • (52) Tritium breeding ratio lower limit (itv 89,90,91)
  • (53) Neutron fluence on TF coil upper limit (itv 92,93,94)
  • (54) Peak TF coil nuclear heating upper limit (itv 95,93,94)
  • (55) Vacuum vessel helium concentration upper limit iblanket =2 (itv 96,93,94)
  • (56) Pseparatrix/Rmajor upper limit (itv 97,1,3)
  • (57) NOT USED
  • (58) NOT USED
  • (59) Neutral beam shine-through fraction upper limit (NBI) (itv 105,6,19,4 )
  • (60) Central solenoid temperature margin lower limit (SCTF) (itv 106)
  • (61) Minimum availability value (itv 107)
  • (62) taup/taueff the ratio of particle to energy confinement times (itv 110)
  • (63) The number of ITER-like vacuum pumps niterpump < tfno (itv 111)
  • (64) Zeff less than or equal to zeffmax (itv 112)
  • (65) Dump time set by VV loads (itv 56, 113)
  • (66) Limit on rate of change of energy in poloidal field (Use iteration variable 65(tohs), 115)
  • (67) Simple Radiation Wall load limit (itv 116, 4,6)
  • (68) Psep * Bt / qAR upper limit (itv 117)
  • (69) ensure separatrix power = the value from Kallenbach divertor (itv 118)
  • (70) ensure that teomp = separatrix temperature in the pedestal profile, (itv 119 (tesep))
  • (71) ensure that neomp = separatrix density (nesep) x neratio
  • (72) central solenoid shear stress limit (Tresca yield criterion) (itv 123 foh_stress)
  • (73) Psep >= Plh + Paux (itv 137 (fplhsep))
  • (74) TFC quench < tmax_croco (itv 141 (fcqt))
  • (75) TFC current/copper area < Maximum (itv 143 f_coppera_m2)
  • (76) Eich critical separatrix density
  • (77) TF coil current per turn upper limit
  • (78) Reinke criterion impurity fraction lower limit (itv 147 freinke)
  • (79) Peak CS field upper limit (itv 149 fbmaxcs)
  • (80) Divertor power lower limit pdivt (itv 153 fpdivlim)
  • (81) Ne(0) > ne(ped) constraint (itv 154 fne0)
  • (82) toroidalgap > tftort constraint (itv 171 ftoroidalgap)
  • (83) Radial build consistency for stellarators (itv 172 f_avspace)
  • (84) Lower limit for beta (itv 173 fbetatry_lower)
  • (85) Constraint for CP lifetime
  • (86) Constraint for TF coil turn dimension
  • (87) Constraint for cryogenic power
  • (88) Constraint for TF coil strain absolute value
  • (89) Constraint for CS coil quench protection
  • (90) Lower Limit on number of stress load cycles for CS (itr 167 fncycle)
  • (91) Checking if the design point is ECRH ignitable (itv 168 fecrh_ignition)

integer, public, dimension(ipnvars):: ixc

ixc(ipnvars) /0/ : array defining which iteration variables to activate (see lablxc for descriptions)

character(len=30), public, dimension(ipnvars):: lablxc

lablxc(ipnvars) : labels describing iteration variables


  • ( 1) aspect
  • ( 2) bt
  • ( 3) rmajor
  • ( 4) te
  • ( 5) beta
  • ( 6) dene
  • ( 7) rnbeam
  • ( 8) fbeta (f-value for equation 6)
  • ( 9) fdene (f-value for equation 5)
  • (10) hfact
  • (11) pheat
  • (12) oacdcp
  • (13) tfcth (NOT RECOMMENDED)
  • (14) fwalld (f-value for equation 8)
  • (15) fvs (f-value for equation 12)
  • (16) ohcth
  • (17) tdwell
  • (18) q
  • (19) beam_energy
  • (20) tcpav
  • (21) ftburn (f-value for equation 13)
  • (22) NOT USED
  • (23) fcoolcp
  • (24) NOT USED
  • (25) fpnetel (f-value for equation 16)
  • (26) ffuspow (f-value for equation 9)
  • (27) fhldiv (f-value for equation 18)
  • (28) fradpwr (f-value for equation 17), total radiation fraction
  • (29) bore
  • (30) fmva (f-value for equation 19)
  • (31) gapomin
  • (32) frminor (f-value for equation 21)
  • (33) fportsz (f-value for equation 20)
  • (34) fdivcol (f-value for equation 22)
  • (35) fpeakb (f-value for equation 25)
  • (36) fbetatry (f-value for equation 24)
  • (37) coheof
  • (38) fjohc (f-value for equation 26)
  • (39) fjohc0 (f-value for equation 27)
  • (40) fgamcd (f-value for equation 37)
  • (41) fcohbop
  • (42) gapoh
  • (43) NOT USED
  • (44) fvsbrnni
  • (45) fqval (f-value for equation 28)
  • (46) fpinj (f-value for equation 30)
  • (47) feffcd
  • (48) fstrcase (f-value for equation 31)
  • (49) fstrcond (f-value for equation 32)
  • (50) fiooic (f-value for equation 33)
  • (51) fvdump (f-value for equation 34)
  • (52) NOT USED
  • (53) fjprot (f-value for equation 35)
  • (54) ftmargtf (f-value for equation 36)
  • (55) NOT USED
  • (56) tdmptf
  • (57) thkcas
  • (58) thwcndut
  • (59) fcutfsu
  • (60) cpttf
  • (61) gapds
  • (62) fdtmp (f-value for equation 38)
  • (63) ftpeak (f-value for equation 39)
  • (64) fauxmn (f-value for equation 40)
  • (65) tohs
  • (66) ftohs (f-value for equation 41)
  • (67) ftcycl (f-value for equation 42)
  • (68) fptemp (f-value for equation 44)
  • (69) rcool
  • (70) vcool
  • (71) fq (f-value for equation 45)
  • (72) fipir (f-value for equation 46)
  • (73) scrapli
  • (74) scraplo
  • (75) tfootfi
  • (76) NOT USED
  • (77) NOT USED
  • (78) NOT USED
  • (79) fbetap (f-value for equation 48)
  • (80) NOT USED
  • (81) edrive
  • (82) drveff
  • (83) tgain
  • (84) chrad
  • (85) pdrive
  • (86) frrmax (f-value for equation 50)
  • (87) NOT USED
  • (88) NOT USED
  • (89) ftbr (f-value for equation 52)
  • (90) blbuith
  • (91) blbuoth
  • (92) fflutf (f-value for equation 53)
  • (93) shldith
  • (94) shldoth
  • (95) fptfnuc (f-value for equation 54)
  • (96) fvvhe (f-value for equation 55)
  • (97) fpsepr (f-value for equation 56)
  • (98) li6enrich
  • (99) NOT USED
  • (100) NOT USED
  • (101) NOT USED
  • (102) fimpvar # OBSOLETE
  • (103) flhthresh (f-value for equation 15)
  • (104) fcwr (f-value for equation 23)
  • (105) fnbshinef (f-value for equation 59)
  • (106) ftmargoh (f-value for equation 60)
  • (107) favail (f-value for equation 61)
  • (108) breeder_f: Volume of Li4SiO4 / (Volume of Be12Ti + Li4SiO4)
  • (109) ralpne: thermal alpha density / electron density
  • (110) ftaulimit: Lower limit on taup/taueff the ratio of alpha
  • (111) fniterpump: f-value for constraint that number
  • (112) fzeffmax: f-value for max Zeff (f-value for equation 64)
  • (113) ftaucq: f-value for minimum quench time (f-value for equation 65)
  • (114) fw_channel_length: Length of a single first wall channel
  • (115) fpoloidalpower: f-value for max rate of change of
  • (116) fradwall: f-value for radiation wall load limit (eq. 67)
  • (117) fpsepbqar: f-value for Psep*Bt/qar upper limit (eq. 68)
  • (118) fpsep: f-value to ensure separatrix power is less than
  • (119) tesep: separatrix temperature calculated by the Kallenbach divertor model
  • (120) ttarget: Plasma temperature adjacent to divertor sheath [eV]
  • (121) neratio: ratio of mean SOL density at OMP to separatrix density at OMP
  • (122) oh_steel_frac : streel fraction of Central Solenoid
  • (123) foh_stress : f-value for CS coil Tresca yield criterion (f-value for eq. 72)
  • (124) qtargettotal : Power density on target including surface recombination [W/m2]
  • (125) fimp(3) : Beryllium density fraction relative to electron density
  • (126) fimp(4) : Carbon density fraction relative to electron density
  • (127) fimp(5) : Nitrogen fraction relative to electron density
  • (128) fimp(6) : Oxygen density fraction relative to electron density
  • (129) fimp(7) : Neon density fraction relative to electron density
  • (130) fimp(8) : Silicon density fraction relative to electron density
  • (131) fimp(9) : Argon density fraction relative to electron density
  • (132) fimp(10) : Iron density fraction relative to electron density
  • (133) fimp(11) : Nickel density fraction relative to electron density
  • (134) fimp(12) : Krypton density fraction relative to electron density
  • (135) fimp(13) : Xenon density fraction relative to electron density
  • (136) fimp(14) : Tungsten density fraction relative to electron density
  • (137) fplhsep (f-value for equation 73)
  • (138) rebco_thickness : thickness of REBCO layer in tape (m)
  • (139) copper_thick : thickness of copper layer in tape (m)
  • (140) dr_tf_wp : radial thickness of TFC winding pack (m)
  • (141) fcqt : TF coil quench temperature < tmax_croco (f-value for equation 74)
  • (142) nesep : electron density at separatrix [m-3]
  • (143) f_copperA_m2 : TF coil current / copper area < Maximum value
  • (144) fnesep : Eich critical electron density at separatrix
  • (145) fgwped : fraction of Greenwald density to set as pedestal-top density
  • (146) fcpttf : F-value for TF coil current per turn limit (constraint equation 77)
  • (147) freinke : F-value for Reinke detachment criterion (constraint equation 78)
  • (148) fzactual : fraction of impurity at SOL with Reinke detachment criterion
  • (149) fbmaxcs : F-value for max peak CS field (con. 79, itvar 149)
  • (150) REMOVED
  • (151) REMOVED
  • (152) fgwsep : Ratio of separatrix density to Greenwald density
  • (153) fpdivlim : F-value for minimum pdivt (con. 80)
  • (154) fne0 : F-value for ne(0) > ne(ped) (con. 81)
  • (155) pfusife : IFE input fusion power (MW) (ifedrv=3 only)
  • (156) rrin : Input IFE repetition rate (Hz) (ifedrv=3 only)
  • (157) fvssu : F-value for available to required start up flux (con. 51)
  • (158) croco_thick : Thickness of CroCo copper tube (m)
  • (159) ftoroidalgap : F-value for toroidalgap > tftort constraint (con. 82)
  • (160) f_avspace (f-value for equation 83)
  • (161) fbetatry_lower (f-value for equation 84)
  • (162) r_cp_top : Top outer radius of the centropost (ST only) (m)
  • (163) f_t_turn_tf : f-value for TF coils WP trurn squared dimension constraint
  • (164) f_crypmw : f-value for cryogenic plant power
  • (165) fstr_wp : f-value for TF coil strain absolute value
  • (166) f_copperaoh_m2 : CS coil current /copper area < Maximum value
  • (167) fncycle : f-value for minimum CS coil stress load cycles
  • (168) fecrh_ignition: f-value for equation 91
  • (169) te0_ecrh_achievable: Max. achievable electron temperature at ignition point
  • (170) beta_div : field line angle wrt divertor target plate (degrees)
  • (171) casths_fraction : TF side case thickness as fraction of toridal case thickness
  • (172) casths : TF side case thickness [m]
  • (173) EMPTY : Description
  • (174) EMPTY : Description
  • (175) EMPTY : Description

character(len=14), public, dimension(:), allocatable:: name_xc
real(kind=dp), public :: sqsumsq

sqsumsq : sqrt of the sum of the square of the constraint residuals

character(len=40), public :: objf_name

Description of the objective function

real(kind=dp), public :: norm_objf

Normalised objective function (figure of merit)

real(kind=dp), public :: epsfcn

epsfcn /1.0e-3/ : finite difference step length for HYBRD/VMCON derivatives

real(kind=dp), public :: epsvmc

epsvmc /1.0e-6/ : error tolerance for VMCON

real(kind=dp), public :: factor

factor /0.1/ : used in HYBRD for first step size

real(kind=dp), public :: ftol

ftol /1.0e-4/ : error tolerance for HYBRD

real(kind=dp), public, dimension(ipnvars):: boundl

boundl(ipnvars) /../ : lower bounds used on ixc variables during VMCON optimisation runs

real(kind=dp), public, dimension(ipnvars):: boundu
real(kind=dp), public, dimension(ipnvars):: bondl
real(kind=dp), public, dimension(ipnvars):: bondu
real(kind=dp), public, dimension(ipnvars):: rcm
real(kind=dp), public, dimension(ipnvars):: resdl
real(kind=dp), public, dimension(ipnvars):: scafc
real(kind=dp), public, dimension(ipnvars):: scale
real(kind=dp), public, dimension(ipnvars):: xcm
real(kind=dp), public, dimension(ipnvars):: xcs
real(kind=dp), public, dimension(ipvlam):: vlam

Subroutines

public subroutine init_numerics()

Arguments

None