constraint_eqn_002 Subroutine

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

Global plasma power balance equation

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) ptripv : input real : ion 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_density_total : input real : alpha power per volume (MW/m3) charged_power_density : input real : non-alpha charged particle fusion power per volume (MW/m3) pohmpv : input real : ohmic heating power per volume (MW/m3) pinjmw : input real : total auxiliary injected power (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

constraint derived type


Contents

Source Code


Source Code

   subroutine constraint_eqn_002(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units)
    !! author: J. Morris
    !! category: equality constraint
    !!
    !! Global plasma power balance equation
    !!
    !! \begin{equation} c_i =
    !! \end{equation}
    !!
    !! 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)
    !! ptripv : input real :  ion 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_density_total : input real : alpha power per volume (MW/m3)
    !! charged_power_density : input real : non-alpha charged particle fusion power per volume (MW/m3)
    !! pohmpv : input real : ohmic heating power per volume (MW/m3)
    !! pinjmw : input real : total auxiliary injected power (MW)
    !! plasma_volume : input real : plasma volume (m3)

    use physics_variables, only: iradloss, ignite, ptrepv, ptripv, pradpv, &
                                  pcoreradpv, f_alpha_plasma, alpha_power_density_total, charged_power_density, &
                                  pohmpv, plasma_volume
    use current_drive_variables, only: pinjmw

    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
    !! constraint derived type

    ! pscaling : Local real : total transport power per volume (MW/m3)
    real(dp) :: pscaling
    real(dp) :: pnumerator, pdenom
    pscaling = ptrepv + ptripv
    ! 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_density_total + charged_power_density + pohmpv + pinjmw/plasma_volume
    else
      ! if plasma ignited
      pdenom = f_alpha_plasma*alpha_power_density_total + charged_power_density + pohmpv
    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_002