constraint_eqn_005 Subroutine

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

Equation for density upper limit author: P B Lloyd, CCFE, Culham Science Centre args : output structure : residual error; constraint value; residual error in physical units; output string; units string Equation for density upper limit #=# physics #=#=# fdene, dnelimt and hence also optional here. Logic change during pre-factoring: err, symbol, units will be assigned only if present. idensl : input integer : switch for density limit to enforce (constraint equation 5):

  • = 1 old ASDEX;
  • = 2 Borrass model for ITER (I);
  • = 3 Borrass model for ITER (II);
  • = 4 JET edge radiation;
  • = 5 JET simplified;
  • = 6 Hugill-Murakami Mq limit;
  • = 7 Greenwald limit
fdene : input real : f-value for density limit dene : input real : electron density (/m3) dnelimt : input real : density limit (/m3) dnla : input real : line averaged electron density (m-3)

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_005(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units)
      !! Equation for density upper limit
      !! author: P B Lloyd, CCFE, Culham Science Centre
      !! args : output structure : residual error; constraint value;
      !! residual error in physical units; output string; units string
      !! Equation for density upper limit
      !! #=# physics
      !! #=#=# fdene, dnelimt
      !! and hence also optional here.
      !! Logic change during pre-factoring: err, symbol, units will be assigned only if present.
      !! idensl : input integer : switch for density limit to enforce (constraint equation 5):<UL>
      !! <LI> = 1 old ASDEX;
      !! <LI> = 2 Borrass model for ITER (I);
      !! <LI> = 3 Borrass model for ITER (II);
      !! <LI> = 4 JET edge radiation;
      !! <LI> = 5 JET simplified;
      !! <LI> = 6 Hugill-Murakami Mq limit;
      !! <LI> = 7 Greenwald limit</UL>
      !! fdene : input real : f-value for density limit
      !! dene : input real : electron density (/m3)
      !! dnelimt : input real : density limit (/m3)
      !! dnla : input real : line averaged electron density (m-3)
      use physics_variables, only: idensl, dnelimt, dnla, dene
      use constraint_variables, only: fdene
      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

	   ! Apply Greenwald limit to line-averaged density
      if (idensl == 7) then
         tmp_cc     = 1.0D0 - fdene * dnelimt/dnla
         tmp_con    = fdene * dnelimt
         tmp_err    = fdene * dnelimt - dnla
         tmp_symbol = '<'
         tmp_units  = '/m3'
      else
         tmp_cc = 1.0D0 - fdene * dnelimt/dene
         tmp_con    = dnelimt * (1.0D0 - tmp_cc)
         tmp_err    = dene * tmp_cc
         tmp_symbol = '<'
         tmp_units  = '/m3'
      end if

   end subroutine constraint_eqn_005