Global power balance equation for ions args : output structure : residual error; constraint value; residual error in physical units; output string; units string Global power balance equation for ions This is a consistency equation (NBI) #=# physics #=#=# consistency and hence also optional here. Logic change during pre-factoring: err, symbol, units will be assigned only if present. ignite : input integer : switch for ignition assumption:
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
subroutine constraint_eqn_003(tmp_cc, tmp_con, tmp_err, tmp_symbol, tmp_units)
!! Global power balance equation for ions
!! args : output structure : residual error; constraint value;
!! residual error in physical units; output string; units string
!! Global power balance equation for ions
!! This is a consistency equation (NBI)
!! #=# physics
!! #=#=# consistency
!! and hence also optional here.
!! Logic change during pre-factoring: err, symbol, units will be assigned only if present.
!! 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>
!! ptripv : input real : ion transport power per volume (MW/m3)
!! piepv : input real : ion/electron equilibration power per volume (MW/m3)
!! falpha : input real : fraction of alpha power deposited in plasma
!! palpipv : input real : alpha power per volume to ions (MW/m3)
!! pinjimw : input real : auxiliary injected power to ions (MW)
!! vol : input real : plasma volume (m3)
use physics_variables, only: ignite, ptripv, piepv, falpha, palpipv, vol
use current_drive_variables, only: pinjimw
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
! No assume plasma ignition:
if (ignite == 0) then
tmp_cc = 1.0D0 - (ptripv + piepv) / (falpha*palpipv + pinjimw/vol)
tmp_con = (falpha*palpipv + pinjimw/vol) * (1.0D0 - tmp_cc)
tmp_err = (falpha*palpipv + pinjimw/vol) * tmp_cc
tmp_symbol = '='
tmp_units = 'MW/m3'
! Plasma ignited:
else
tmp_cc = 1.0D0 - (ptripv+piepv) / (falpha*palpipv)
tmp_con = (falpha*palpipv) * (1.0D0 - tmp_cc)
tmp_err = (falpha*palpipv) * tmp_cc
tmp_symbol = '='
tmp_units = 'MW/m3'
end if
end subroutine constraint_eqn_003