.. _section-5.11:

Interaction With Other SAS4A/SASSYS‑1 Models
--------------------------------------------

.. _section-5.11.1:

Information Received by PRIMAR from Other Models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

PRIMAR-1 receives no information from other routines. It is driven
entirely by the input regardless of what happens elsewhere in the code.
Three kinds of input can be supplied: a pressure drop as a function
of time, a normalized channel flow rate as a function of time,
or the parameters for an exponentially decreasing pressure drop.
These are described in :numref:`section-5.10` and mentioned in the input listing
in :numref:`Chapter %s<section-3>`.

PRIMAR-4 receives :math:`C_{0}'`, :math:`C_{1}`, :math:`C_{2}`, and
:math:`C_{3}'` and also the inlet and outlet temperatures for each core
channel from the coolant dynamics routines. These are the variables
described in :numref:`section-5.2.2`. The coolant dynamics routines also supply
PRIMAR with the net mass flow and the net mass flow times temperature
from all of the core channels to each outlet plenum, as well as the net
mass flow and the net mass flow times temperature into all of the core
channels from each inlet plenum during the last PRIMAR time step. The
PRIMAR model then adjusts the inlet and outlet plenum mass, pressure,
and cover-gas interface to account for differences between the
estimated channel flows (PRIMAR) and the computed channel flows (coolant
dynamics routines) for the last PRIMAR time step. Symbolically,

.. math::
	:label: eq-5.11-1

	\Delta m = \int{w_{\text{c}} \text{dt}} - \int{w_{\text{e}} \text{dt}}

where

:math:`\Delta m` = the mass adjustment

:math:`w_{\text{c}}` = the total calculated mass flow rate from all the core
channels

:math:`w_{\text{e}}` = the total estimated mass flow rate from all the core
channels

The integration is over the time step. Then

:math:`m_{\text{l}} = m + \Delta m`

:math:`V_{\text{l}} = m_{\text{l}}/\rho_{\text{l}}`

:math:`z_{\text{inter}} = z_{\text{ref}} + V_{\text{l}}/A_{\text{inter}}`

where

:math:`m_{\text{l}}` = the adjusted liquid mass in the plenum

:math:`m` = the liquid mass in the plenum before adjustment

:math:`V_{\text{l}}` = the liquid volume in the plenum

:math:`\rho_{\text{l}}` = the liquid density in the plenum

:math:`z_{\text{inter}}` = the liquid interface height in the plenum

:math:`z_{\text{ref}}` = the reference height input for the plenum

:math:`A_{\text{inter}}` = the area of the liquid interface input for the
plenum

The coefficients :math:`C_{0}'`, :math:`C_{1}`, :math:`C_{2}`, and
:math:`C_{3}'`, supplied to the PRIMAR model by the coolant dynamics
routines, are used to estimate the rate of change in the mass flow rate
for each channel, as indicated in Eq. :ref:`5.2-21<eq-5.2-20>` and written more simply for
a particular channel as

.. math::
	:label: eq-5.11-2

	\frac{\text{dw}}{\text{dt}} = C_{0}' + C_{1} \left( p_{in} + \theta_2 \Delta p_{in} \right) + C_{2} \left( p_{\text{x}} + \theta_2 \Delta p_{\text{x}} \right)  + 2 \theta_2 C_{3}' w \Delta w

where the symbols have the same meaning as in Eq. :ref:`5.2-21<eq-5.2-21>`. Before boiling
begins in a core channel, :math:`\text{dw}/\text{dt}` depends on :math:`p_{\text{in}} -
p_{\text{x}}`, and :math:`C_{1}` is set equal to :math:`- C_{2}`. After
boiling starts, the inlet flow is independent of :math:`p_{\text{x}}`, and
depends on :math:`p_{\text{in}} - p_{\text{b}}`, where :math:`p_{\text{b}}` is the bubble
pressure. Also after boiling starts, the outlet flow is independent of
:math:`p_{\text{in}}`, and depends on :math:`p_{\text{b}} - p_{\text{x}}`. The bubble
pressure :math:`p_{\text{b}}` is included in :math:`C_{0}'`.

.. _section-5.11.2:

Information Supplied by PRIMAR to Other Models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

PRIMAR supplies information to the pre-voiding coolant dynamics
routines, the boiling model, LEVITATE and PLUTO-2. Both PRIMAR-1 and
PRIMAR-4 supply the same information, but it is arrived at differently
by the two options. The information supplied is

:math:`p_{\text{in}}\left( t_{\text{P}1} \right)` = the inlet plenum
pressure at the beginning of the PRIMAR time step

:math:`p_{\text{out}}\left( t_{\text{P}1} \right)` = the outlet plenum
pressure at the beginning of the PRIMAR time step

:math:`\frac{\text{dp}_{\text{in}}}{\text{dt}},\ \frac{\text{dp}_{\text{out}}}{\text{dt}}` = the
time derivatives of the inlet and outlet plenum pressures

:math:`T_{\text{in}} T_{\text{out}}` = the inlet and outlet plenum
temperatures

At any time t during the PRIMAR time step, the inlet and outlet plenum
pressures are taken as

.. math::
	:label: eq-5.11-3

	p_{\text{in}}\left( t \right) = p_{\text{in}} \left( t_{\text{P}1} \right) + \left( t - t_{\text{P}1} \right) \text{dp}_{\text{in}}/\text{dt}

and

.. math::
	:label: eq-5.11-4

	p_{\text{out}}\left( t \right) = p_{\text{out}}\left( t_{\text{P}1} \right) + \left( t - t_{\text{P}1} \right) \text{dp}_{\text{out}}/\text{dt}

The plenum pressures :math:`p_{\text{in}}` and :math:`p_{\text{out}}` that PRIMAR
supplies to the coolant routines are at the plenum reference heights
:math:`z_{\text{PLENL}}` and :math:`z_{\text{PLENU}}`, and the coolant routines
compute the core channel inlet and outlet pressures from these by the
formula:

.. math::
	:label: eq-5.11-5

	p\left( z_{\text{ci}} \right) = p_{\text{in}} + \rho_{\text{in}} g\left( z_{\text{PLENL}} - z_{\text{ci}} \right)

and

.. math::
	:label: eq-5.11-6

	p\left( z_{\text{co}} \right) = p_{\text{out}} + p_{\text{out}} g\left( z_{\text{PLENU}} - z_{\text{co}} \right)

It should be noticed that in the PRIMAR-4 input (:sasinp:`ZCVL`) a reference height is entered
for each compressible volume,
including the compressible volumes that are the inlet and outlet
plenums. In addition, inlet and outlet plenum reference heights,
:math:`z_{\text{PLENL}}` and :math:`z_{\text{PLENU}}`, are also entered as input
(:sasinp:`ZPLENL` and :sasinp:`ZPLENU`, or :sasinp:`ZPLENC`). If
these two sets of reference are different, the PRIMAR-4 code calculates
the appropriate adjustments and passes the inlet and outlet plenum
pressures at :math:`z_{\text{PLENL}}` and :math:`z_{\text{PLENU}}` to the coolant
routines.

The inlet and outlet plenum temperatures are discussed in :numref:`section-3.3.6`
of :numref:`Chapter %s<section-3>`.