constraint_eqn_004 Subroutine

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

Global power balance equation for electrons author: P B Lloyd, CCFE, Culham Science Centre args : output structure : residual error; constraint value; residual error in physical units; output string; units string Global power balance equation for electrons This is a consistency equation N.B. This constraint is currently NOT RECOMMENDED for use. #=# physics #=#=# consistency and hence also optional here. Logic change during pre-factoring: err, symbol, units will be assigned only if present. iradloss : input integer : switch for radiation loss term usage in power balance (see User Guide):

  • = 0 total power lost is scaling power plus radiation (needed for ipedestal=2,3)
  • = 1 total power lost is scaling power plus core radiation only
  • = 2 total power lost is scaling power only, with no additional allowance for radiation. This is not recommended for power plant models.
ignite : input integer : switch for ignition assumption:
  • = 0 do not assume plasma ignition;
  • = 1 assume ignited (but include auxiliary power in costs)
ptrepv : input real : electron transport power per volume (MW/m3) pradpv : input real : total radiation power per volume (MW/m3) pcoreradpv : input real : total core radiation power per volume (MW/m3) f_alpha_plasma : input real : fraction of alpha power deposited in plasma alpha_power_electron_density : input real : alpha power per volume to electrons (MW/m3) piepv : input real : ion/electron equilibration power per volume (MW/m3) pinjemw : input real : auxiliary injected power to electrons (MW) plasma_volume : input real : plasma volume (m3)

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_004(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units)
      !! Global power balance equation for electrons
      !! author: P B Lloyd, CCFE, Culham Science Centre
      !! args : output structure : residual error; constraint value;
      !! residual error in physical units; output string; units string
      !! Global power balance equation for electrons
      !! This is a consistency equation
      !! N.B. This constraint is currently NOT RECOMMENDED for use.
      !! #=# physics
      !! #=#=# consistency
      !! and hence also optional here.
      !! Logic change during pre-factoring: err, symbol, units will be assigned only if present.
      !! iradloss : input integer : switch for radiation loss term usage in power balance (see User Guide):<UL>
      !! <LI> = 0 total power lost is scaling power plus radiation (needed for ipedestal=2,3)
      !! <LI> = 1 total power lost is scaling power plus core radiation only
      !! <LI> = 2 total power lost is scaling power only, with no additional
      !! allowance for radiation. This is not recommended for power plant models.</UL>
      !! ignite : input integer : switch for ignition assumption:<UL>
      !! <LI> = 0 do not assume plasma ignition;
      !! <LI> = 1 assume ignited (but include auxiliary power in costs)</UL>
      !! ptrepv : input real : electron transport power per volume (MW/m3)
      !! pradpv : input real : total radiation power per volume (MW/m3)
      !! pcoreradpv : input real : total core radiation power per volume (MW/m3)
      !! f_alpha_plasma : input real : fraction of alpha power deposited in plasma
      !! alpha_power_electron_density : input real : alpha power per volume to electrons (MW/m3)
      !! piepv : input real : ion/electron equilibration power per volume (MW/m3)
      !! pinjemw : input real : auxiliary injected power to electrons (MW)
      !! plasma_volume : input real : plasma volume (m3)
      use physics_variables, only: iradloss, ignite, ptrepv, pcoreradpv, f_alpha_plasma, &
                                 alpha_power_electron_density, piepv, plasma_volume, pradpv
      use current_drive_variables, only: pinjemw
      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

      ! pscaling : Local real : total transport power per volume (MW/m3)
      real(dp) :: pscaling
      real(dp) :: pnumerator, pdenom
      pscaling = ptrepv
	   ! Total power lost is scaling power plus radiation:
      if (iradloss == 0) then
         pnumerator = pscaling + pradpv
      else if (iradloss == 1) then
         pnumerator = pscaling + pcoreradpv
      else
         pnumerator = pscaling
      end if

      ! if plasma not ignited include injected power
      if (ignite == 0) then
         pdenom = f_alpha_plasma*alpha_power_electron_density + piepv + pinjemw/plasma_volume
      else
      ! if plasma ignited
         pdenom = f_alpha_plasma*alpha_power_electron_density + piepv
      end if

      tmp_cc     = 1.0D0 - pnumerator / pdenom
      tmp_con    = pdenom * (1.0D0 - tmp_cc)
      tmp_err    = pdenom * tmp_cc
      tmp_symbol = '='
      tmp_units  = 'MW/m3'

   end subroutine constraint_eqn_004