constraint_eqn_068 Subroutine

public subroutine constraint_eqn_068(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units)

Upper limit on Psep scaling (PsepB/qAR) author: P B Lloyd, CCFE, Culham Science Centre args : output structure : residual error; constraint value; residual error in physical units; output string; units string New Psep scaling (PsepB/qAR) Issue #464 #=# physics #=#=# fpsepbqar, psepbqarmax and hence also optional here. Logic change during pre-factoring: err, symbol, units will be assigned only if present. fpsepbqar : input real : f-value for upper limit on psepbqar, maximum PsepBt/qAR limit psepbqarmax : input real : maximum permitted value of ratio of PsepBt/qAR (MWT/m) pdivt : input real : Power to conducted to the divertor region (MW) bt : input real : toroidal field on axis (T) (iteration variable 2) q95 : input real : safety factor q at 95% flux surface aspect : input real : aspect ratio (iteration variable 1) rmajor : input real : plasma major radius (m) (iteration variable 3) i_q95_fixed : input int : Switch that allows for fixing q95 only in this constraint. q95_fixed : input real : fixed safety factor q at 95% flux surface

Arguments

Type IntentOptional AttributesName
real(kind=dp), intent(out) :: tmp_cc
real(kind=dp), intent(out) :: tmp_con
real(kind=dp), intent(out) :: tmp_err
character(len=1), intent(out) :: tmp_symbol
character(len=10), intent(out) :: tmp_units

Contents

Source Code


Source Code

   subroutine constraint_eqn_068(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units)
      !! Upper limit on Psep scaling (PsepB/qAR)
      !! author: P B Lloyd, CCFE, Culham Science Centre
      !! args : output structure : residual error; constraint value;
      !! residual error in physical units; output string; units string
      !! New Psep scaling (PsepB/qAR)
      !! Issue #464
      !! #=# physics
      !! #=#=# fpsepbqar, psepbqarmax
      !! and hence also optional here.
      !! Logic change during pre-factoring: err, symbol, units will be assigned only if present.
      !! fpsepbqar : input real : f-value for upper limit on psepbqar, maximum Psep*Bt/qAR limit
      !! psepbqarmax : input real : maximum permitted value of ratio of Psep*Bt/qAR (MWT/m)
      !! pdivt : input real : Power to conducted to the divertor region (MW)
      !! bt : input real : toroidal field on axis (T) (iteration variable 2)
      !! q95 : input real : safety factor q at 95% flux surface
      !! aspect : input real : aspect ratio (iteration variable 1)
      !! rmajor : input real : plasma major radius (m) (iteration variable 3)
      !! i_q95_fixed : input int : Switch that allows for fixing q95 only in this constraint.
      !! q95_fixed : input real : fixed safety factor q at 95% flux surface
      use constraint_variables, only: fpsepbqar, psepbqarmax, i_q95_fixed, q95_fixed
      use physics_variables, only: pdivt, bt, q95, aspect, rmajor
      implicit none
            real(dp), intent(out) :: tmp_cc
      real(dp), intent(out) :: tmp_con
      real(dp), intent(out) :: tmp_err
      character(len=1), intent(out) :: tmp_symbol
      character(len=10), intent(out) :: tmp_units

      if (i_q95_fixed == 1) then
         tmp_cc = ((pdivt*bt)/(q95_fixed*aspect*rmajor)) / psepbqarmax - 1.0d0 * fpsepbqar
         tmp_err = (pdivt*bt)/(q95_fixed*aspect*rmajor) - psepbqarmax
      else
         tmp_cc = ((pdivt*bt)/(q95*aspect*rmajor)) / psepbqarmax - 1.0d0 * fpsepbqar
         tmp_err = (pdivt*bt)/(q95*aspect*rmajor) - psepbqarmax
      end if
      tmp_con = psepbqarmax
      tmp_symbol = '<'
      tmp_units = 'MWT/m'

   end subroutine constraint_eqn_068