.. _section-5.10:

PRIMAR-1 Option
---------------

PRIMAR-4 contains both a simple PRIMAR-1 type option and the more
detailed PRIMAR-4 treatment. The PRIMAR-1 option supplies only the
minimum quantities required to drive the subassembly coolant dynamics
module. It is often used when the more detailed treatment is not
required. The minimum information consists of the inlet and outlet
plenum pressures, the subassembly inlet temperatures, and the outlet
reentry temperatures. All of these quantities are supplied as a
function of time by PRIMAR-1 from user-supplied information,
independent of what is happening in the core or in the rest of the
primary loop.

There are two available options for determining the inlet pressure.
The first option is based on a normalized pump head and the second option
is based on a normalized flow rate through channel :sasinp:`IFLOW`.

.. _section-5.10.1:

Defined Pump Head
~~~~~~~~~~~~~~~~~

When :sasinp:`IFLOW` = 0, the inlet pressure is based on a normalized pump head.
The inlet pressure :math:`p_{\text{in}} \left( t \right)` is calculated as

.. math::
    :label: 5.10-1

	p_{\text{in}}\left( t \right) = p_{\text{x}} + p_{\text{gr}} + \Delta p_{\text{p}} \left( t \right)

where :math:`p_{\text{x}}` is the user-specified exit plenum pressure, :sasinp:`PX`,
:math:`p_{\text{gr}}` is the gravity head, and :math:`\Delta p_{\text{p}} \left( t \right)` is the
pump head. The gravity head is calculated as

.. math::
    :label: 5.10-2

	p_{\text{gr}} = \left\lbrack \rho_{\text{HOT}} \left( z_{\text{PU}} - z_{\text{IHX}} \right) + \rho_{\text{COLD}} \left( z_{\text{IHX}} - z_{\text{PL}} \right)  \right\rbrack g

where :math:`{\rho}_{\text{HOT}}` is the average steady-state outlet density,
:math:`{\rho}_{\text{COLD}}` is the average steady-state inlet density,
:math:`z_{\text{PU}}` is the reference height at which the outlet plenum
pressure is calculated, :sasinp:`ZPLENU`, :math:`z_{\text{PL}}` is the reference height at which
the inlet plenum pressure is calculated, :sasinp:`ZPLENL`, and :math:`z_{\text{IHX}}` is the
reference height of the thermal center of the intermediate heat
exchanger, :sasinp:`ZIHX`.

The pump head is calculated as

.. math::
    :label: 5.10-3

	\Delta p_{\text{p}} \left( t \right) = \Delta p_{\text{o}} f_{\text{p}}\left( t \right)

where :math:`\Delta p_{\text{o}}` is the steady-state pump head, taken as

.. math::
    :label: 5.10-4

	\Delta p_{\text{o}} = p_{\text{in}} \left( t = 0 \right) - p_{\text{gr}} - p_{\text{x}}

and :math:`f_{\text{p}} \left( t \right)` is the user-supplied time dependence of the
pump head, which should be normalized so that

.. math::
    :label: 5.10-5

	f_{\text{p}} \left( t = 0 \right) = 1.0

There are two options for specifying :math:`f_{\text{p}} \left( t \right)`. One option is
for the user to supply a table of :math:`f_{\text{p}}` as a function of time.
This table is defined in :sasinp:`PRETAB` and :sasinp:`PRETME` or a function block,
depending on the value of :sasinp:`NPRES`.
With this option, the code interpolates linearly between table
entries.

The other option is for the user to supply the three
coefficients :math:`p_{\text{d}}`, :math:`p_{\text{d}1}`,
:math:`p_{\text{d}2}` for use in the equation

.. math::
    :label: 5.10-6

	f_{\text{p}}\left( t \right) = \exp{\left\lbrack - \left( p_{\text{d}}t + p_{\text{d}1}t^{2} + p_{\text{d}2} t^{3} \right)  \right\rbrack}

where

:math:`p_{\text{d}}` is defined using :sasinp:`PDEC`,

:math:`p_{\text{d}1}` is defined using :sasinp:`PDEC1`, and

:math:`p_{\text{d}2}` is defined using :sasinp:`PDEC2`.

This option is selected by setting :sasinp:`NPRES` = 0.

For both normalized pump head options, the time derivatives of the inlet and exit plenum pressures
are calculated as

.. math::
    :label: 5.10-7

	\frac{\text{dp}_{\text{x}}}{\text{dt}} = 0.0

and

.. math::
    :label: 5.10-8

	\frac{\text{dp}_{\text{in}}}{\text{dt}} = \frac{p_{2} - p_{1}}{\Delta t}

where :math:`p_{1}` and :math:`p_{2}` are the pump head values at the
beginning and end of the time interval :math:`\Delta t`.


.. _section-5.10.2:

Defined Flow Rate
~~~~~~~~~~~~~~~~~

When :sasinp:`IFLOW` :math:`\ne 0`, the inlet pressure is based on flow rate through channel :sasinp:`IFLOW`.
The inlet pressure :math:`p_{\text{in}} \left( t \right)` is calculated as

.. math::
    :label: 5.10-9a

	p_{\text{in}}\left( t \right) = p_{\text{x}} + I_1 \frac{dw}{dt} + g \left( I_5 +
	\left\lbrack \rho_{\text{HOT}} \left( z_{\text{PU}} - z_{\text{MZC}} \right) + \rho_{\text{COLD}} \left( z_{\text{1}} - z_{\text{PL}} \right)  \right\rbrack \right)
	+ \Delta P_w

where

.. math::
    :label: 5.10-9b

    \Delta P_w = w_1^{2}I_{2} + A_{\text{fr}}w_1 \left| w_1 \right|^{1 + b_{\text{fr}}}I_{3} + w_1\left| w_1 \right| I_{4}

:math:`I_1`, :math:`I_2`, :math:`I_3`, :math:`I_4`, :math:`I_5`, :math:`A_{\text{fr}}`, and :math:`b_{\text{fr}}` are the momentum equation contributions, defined in :numref:`section-3.9.2`, for channel :sasinp:`IFLOW`,

:math:`z_{\text{1}}`, and :math:`z_{\text{MZC}}` are the elevations at the bottom and top of the fuel channel, and

:math:`\rho_{\text{HOT}}`, and :math:`\rho_{\text{COLD}}` are the coolant density in the upper and lower plenum at time :math:`t`.

The channel flow rate and its derivative are calculated as

.. math::
    :label: 5.10-10

    w_1 = w_0 f(t)

and

.. math::
    :label: 5.10-11

    \frac{dw}{dt} = w_0 \frac{f\left( t + \Delta t \right) - f\left( t \right)}{\Delta t}

where :math:`w_0` is the flow rate through channel :sasinp:`IFLOW` at time :math:`t=0`,
and :math:`f\left( t \right)` is the user-supplied time dependence of the normalized flow rate.
:math:`f\left( t \right)` is defined in :sasinp:`PRETAB` and :sasinp:`PRETME` or a function block,
depending on the value of :sasinp:`NPRES`.


The time derivatives of the inlet and exit plenum pressures are calculated as

.. math::
    :label: 5.10-12

	\frac{\text{dp}_{\text{x}}}{\text{dt}} = 0.0

and

.. math::
    :label: 5.10-13

	\frac{\text{dp}_{\text{in}}}{\text{dt}} = \frac{\Delta P_w}{\Delta t} \left( \frac{f(t+\Delta t)}{f(t)}\left|\frac{f(t+\Delta t)}{f(t)}\right|^{F_{w2}} - 1 \right)

where

.. math::
    :label: 5.10-13-b

    F_{w2} = \frac{\partial \Delta P_w}{\partial w}\frac{w_1}{\Delta P_w} - 1

.. math::
    :label: 5.10-13-c

    \frac{\partial \Delta P_w}{\partial w} = 2 w_1 I_{2} + A_{\text{fr}} \left( 2 + b_{\text{fr}} \right) \left| w_1 \right|^{1 + b_{\text{fr}}}I_{3} + 2\left| w_1 \right| I_{4}