.. _section-5.4.7:

RVACS/RACS Models
~~~~~~~~~~~~~~~~~

Three RVACS (*R*\ eactor *V*\ essel *A*\ uxiliary *C*\ ooling *S*\ ystem)
or RACS (*R*\ eactor *A*\ ir *C*\ ooling *S*\ ystem) Models have been
included in |SAS|: a simple model in which the user supplies
the relevant information for the outside of the reactor vessel wall, a more detailed
model in which air temperatures and flow rates are calculated by SAS,
and a coupled model where an external code provides the relevant information
for the region outside of the reactor vessel wall.
The reactor coolant treatment and the representation of the reactor
vessel wall are the same in all models. The vessel wall is represented
by a combination of compressible volume walls and the walls of pipes and
annular elements. The component-to-component heat transfer capability
described in :numref:`section-5.4.6` above is used to remove heat from the reactor
vessel walls, and the three models are used to set :math:`T_{\text{snk}}`,
:math:`H_{\text{snk}}`, and :math:`A_{\text{snk}}`, for the wall.

The input required for each of the RVACS models is described below.

.. _section-5.4.7.1:

Simple RVACS Model
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

For the simple model the representation of the RVACS stops at the
reactor vessel wall. The user supplies a single air temperature and a
table of effective heat transfer coefficient vs. vessel wall
temperature. For each axial node in the reactor vessel wall, the code
then sets the sink temperature, :math:`T_{\text{snk}}`, to the air temperature.
The sink heat transfer coefficient, :math:`h_{\text{snk}}`, is re-calculated
each time step based on the current vessel wall temperature at the node.

.. _section-5.4.7.2:

Detailed Air Side Model
^^^^^^^^^^^^^^^^^^^^^^^

:numref:`figure-rvacstemp` shows the general RVACS model and noding scheme. Wall
temperature nodes are used for the reactor vessel, guard vessel, finned
shell (inside and outside), outer wall, and a constant temperature deep
in the concrete or the ground. Air nodes are included for the down-comer
and for the up-flow section. An air inlet section and an outlet stack
are also included. Either vertical or non-vertical sections of vessel
wall can be treated.

The reactor vessel wall can be made up of a number of |SAS|
components, including a hot pool wall, a cold pool wall, a pipe wall, or
an annular flow element wall. The annular flow element is a new type of
liquid flow element that has recently been added to |SAS|,
mainly for modeling the RVACS and for modeling multi-dimensional effects
in pools.

Both radiative and convective heat transfer from the reactor vessel to
the guard vessel are modeled. Radiation from the guard vessel to the
finned shell as well as convective heat transfer to air from the guard
vessel and the finned shell are treated.

The finned shell is assumed to be insulated, but less-than-perfect
insulation can be treated. Temperatures on both sides of the insulation
are calculated. Heat transfer from the inside of the to the outside, and
from the outside of the finned shell to the incoming air, is treated.
Radiation from the finned shell to be outer wall is treated as well as
convective heat transfer from the outer wall to the incoming air. Also,
conduction from the outer wall to a constant temperature node deep in
the concrete or in the ground is handled. With perfect insulation on the
finned shell and little heat transfer into the concrete, the calculation
of air and wall temperatures on the down-comer side would be
unnecessary; the air temperature at the bottom of the up-flow side could
be set to the outside air inlet temperature. The model with heat
transfer to the incoming air allows consideration of the impact on
RVACS-RACS performance of limited insulation between the downcomer and
the up-flow side.

As indicated in :numref:`figure-rvacstemp`, one axial node is included above the liquid
level in the vessel. This node is included to account for heat transfer
through the finned shell between incoming and outgoing air. For this
node, the heat transfer coefficient between the reactor vessel and the
guard vessel is set to zero.

.. _figure-rvacstemp:

..  figure:: media/image9.png
	:align: center
	:figclass: align-center

	|SAS| Model of an RVACS/RACS System.

.. _section-5.4.7.2.1:

Basic Equations
'''''''''''''''

A. Wall Temperatures

1. Reactor Vessel

The basic equation for the reactor vessel wall temperature is

.. math::
   :label: eq-5.4-85

    m_{\text{w}1} C_{\text{w}1} \frac{\text{dT}_{\text{w}1}}{\text{dt}} = h_{\text{Nw}1} A_{\text{Nw}1} \left( T_{\text{N}} - T_{\text{w}1} \right) + h_{\text{w}12} A_{\text{w}12} \left( T_{\text{w}2} - T_{\text{w}1} \right)

where

:math:`m_{\text{w}1}` = reactor vessel wall mass per unit length

:math:`C_{\text{w}1}` = reactor vessel specific heat

:math:`T_{\text{w}1}` = reactor vessel wall temperature

:math:`t` = time

:math:`h_{\text{Nw}1}` = heat transfer coefficient between the sodium
inside the vessel and the vessel wall

:math:`A_{\text{Nw}1}` = inner perimeter, or heat transfer area per
unit length, of the vessel wall

:math:`T_{\text{N}}` = sodium temperature

:math:`h_{\text{w}12}` = heat transfer coefficient between the
reactor vessel and the guard vessel, including both radiation and
convection terms

:math:`A_{\text{w}12}` = outer perimeter of the reactor vessel, :sasinp:`PERVAC`

:math:`T_{\text{w}12}` = guard vessel temperature

2. Guard Vessel

.. math::
   :label: eq-5.4-86

    \frac{(mC)_{\text{w}2}}{F_{\text{NT}}} \frac{\text{dT}_{\text{w}2}}{\text{dt}} = h_{\text{w}12} A_{\text{w}12} \left( T_{\text{w}1} - T_{\text{w}2} \right)  \\
    + h_{\text{w}23} A_{\text{w}23} \left( T_{\text{w}3} - T_{\text{w}2} \right) + h_{\text{w}2\text{a}} A_{\text{w}2\text{a}} \left( T_{\text{a}1} - T_{\text{w}2} \right)

where

:math:`(mC)_{\text{w}2}` = heat capacity per unit length of the guard vessel, :sasinp:`GVMC`

:math:`F_{\text{NT}}` = thermal inertia inverse scaling factor

:math:`h_{\text{w}23}` = radiation heat transfer coefficient between
the guard vessel and the finned shell

:math:`A_{\text{w}23}` = outer perimeter of the guard vessel, :sasinp:`PERGVO`

:math:`T_{\text{w}3}` = temperature of the finned shell inner node

:math:`T_{\text{a}1}` = air temperature in the up-flow section

:math:`h_{\text{w}2\text{a}}` = heat transfer coefficient between the
guard vessel and air

:math:`A_{\text{w}2\text{a}}` = perimeter between the guard vessel and
the air, :sasinp:`PERGV`

:math:`F_{\text{NT}}` varies depending on the stage of the simulation

.. math::
   :label: eq-F-NT

    F_{\text{NT}}= \begin{cases}
    FINVNT & \text{if } \text{Null Transient}  \\
    1 & \text{if } \text{Transient}
    \end{cases}

where :math:`FINVNT` is the user provided inverse scaling factor, :sasinp:`FINVNT`. The thermal inertia inverse scaling factor allows the detailed RVACS component to
approach a steady state faster during the null transient simulation.


3. Finned shell, Inner Node

.. math::
   :label: eq-5.4-87

    \frac{(mC)_{\text{w}3}}{F_{\text{NT}}} \frac{\text{dT}_{\text{w}3}}{\text{dt}} = h_{\text{w}34} A_{\text{w}34} \left( T_{\text{w}4} - T_{\text{w}3} \right) + h_{\text{w}23} A_{\text{w}23} \left( T_{\text{w}2} - T_{\text{w}3} \right)  \\
    + h_{\text{w}3\text{a}} A_{\text{w}3\text{a}} \left( T_{\text{a}1} - T_{\text{w}3} \right)


:math:`(mC)_{\text{w}3}` = heat capacity per unit length of the inside of the finned
shell, :sasinp:`FSMCI`

:math:`T_{\text{w}3}` = finned shell inner node temperature

:math:`h_{\text{w}34}` = heat transfer coefficient between the inside
and outside of the finned shell, :sasinp:`HFSRV`

:math:`A_{\text{w}34}` = perimeter of the finned shell, :sasinp:`PERFSO`

:math:`h_{\text{w}3\text{a}}` = heat transfer coefficient between the
finned shell and the upflowing air

:math:`A_{\text{w}3\text{a}}` = perimeter between the finned shell and the upflowing
air, :sasinp:`PERFS`

:math:`T_{\text{w}4}` = finned shell outer node temperature

4. Finned Shell, Outer Node

.. math::
   :label: eq-5.4-88

    \frac{(mC)_{\text{w}4}}{F_{\text{NT}}} \frac{\text{dT}_{\text{w}4}}{\text{dt}} = h_{\text{w}45} A_{\text{w}45} \left( T_{\text{w}5} - T_{\text{w}4} \right) + h_{\text{w}34} A_{\text{w}34} \left( T_{\text{w}3} - T_{\text{w}4} \right) \\
    + h_{\text{w}4\text{a}} A_{\text{w}4\text{a}} \left( T_{\text{a}2} - T_{\text{w}4} \right)

:math:`(mC)_{\text{w}4}` = heat capacity per unit length of the outside of the finned
shell, :sasinp:`FSMCO`

:math:`T_{\text{w}5}` = concrete wall inner node temperature

:math:`h_{\text{w}45}` = heat transfer coefficient between the finned
shell and the concrete

:math:`A_{\text{w}45}` = finned shell outer perimeter, :sasinp:`PERFSO`

:math:`T_{\text{a}2}` = temperature of the down-flowing air

:math:`h_{\text{w}4\text{a}}` = heat transfer coefficient between the
finned shell outer surface and the down-flowing air

:math:`A_{\text{w}4\text{a}}` = perimeter between the finned shell outer
surface and the down-flowing air, :sasinp:`PERFSO`

5. Cavity Wall, Inner Node

.. math::
   :label: eq-5.4-89

    \frac{(mC)_{\text{w}5}}{F_{\text{NT}}} \frac{\text{dT}_{\text{w}5}}{\text{dt}} = h_{\text{w}56} A_{\text{w}56} \left( T_{\text{w}6} - T_{\text{w}5} \right) + h_{\text{w}45} A_{\text{w}45} \left( T_{\text{w}4} - T_{\text{w}5} \right)  \\
    + h_{\text{w}5\text{a}} A_{\text{w}5\text{a}} \left( T_{\text{a}2} - T_{\text{w}5} \right)

:math:`(mC)_{\text{w}5}` = heat capacity per unit length of the inside of the cavity
wall, :sasinp:`CRMCI`

:math:`T_{\text{w}6}` = constant temperature deep in the concrete or
ground

:math:`h_{\text{w}56}` = heat transfer coefficient between the cavity
wall surface node and the constant temperature heat sink

:math:`A_{\text{w}56}` = cavity wall perimeter, :sasinp:`PERFSO`

:math:`h_{\text{w}5\text{a}}` = heat transfer coefficient from the
cavity wall to the down-flowing air

B. Air Temperature

The air is treated with a quasi-static approximation, neglecting the
time derivative of the air temperature and density.

    1. Up-Flowing Air Between the Guard Vessel and the Finned Shell

.. math::
   :label: eq-5.4-90

    w_{\text{a}} C_{\text{a}} \frac{\text{dT}_{\text{a}1}}{\text{dz}} = h_{\text{wa}2} A_{\text{wa}2} \left( T_{\text{w}2} \left( z \right) - T_{\text{a}1} \left( z \right) \right) + h_{\text{wa}3} A_{\text{wa}3} \left\lbrack T_{\text{w}3} \left( z \right) - T_{\text{a}1} \left( z \right) \right\rbrack

where

:math:`w_{\text{a}}` = air mass flow rate, kg/sec.

:math:`C_{\text{a}}` = air specific heat

    2. Down-Flowing Air Between the Finned Shell and the Concrete Wall

.. math::
   :label: eq-5.4-91

    w_{\text{a}} C_{\text{a}} \frac{\text{dT}_{\text{a}2}}{\text{dz}} = h_{\text{wa}4} A_{\text{wa}4} \left( T_{\text{w}4} \left( z \right) - T_{\text{a}2} \left( z \right) \right) + h_{\text{wa}5} A_{\text{wa}5} \left\lbrack T_{\text{w}5} \left( z \right) - T_{\text{a}2} \left( z \right) \right\rbrack

C. Air Flow Rate

As shown in :numref:`figure-rvacstemp`, the air flow path is modeled as an inlet
section, a down-flow section between the outer surface of the finned
shell and the cavity wall, an up-flow section between the guard vessel
and the inner surface of the finned shell, and an outlet stack. The air
temperature in the inlet section is assumed to be equal to the external air temperature,
which the user can define as either constant or varying with time. In the stack, the
air temperature is assumed to equal the value at the outlet from the guard vessel-finned
shell region. Between the inlet section and the stack, the air
temperature is calculated on a node-by-node basis.

The inertia of the air is ignored, and the air flow rate is calculated
by balancing the air gravity head with the loss terms.

.. math::
   :label: eq-5.4-92

    \Delta p_{\text{gr}} = \Delta p_{\text{loss}}

The gravity head, :math:`\Delta p_{\text{gr}}`, is calculated as

.. math::
   :label: eq-5.4-93

    \Delta p_{\text{gr}} = \int{\rho \text{gdz}} = g \left\{ - \rho_{\text{in}} \Delta z_{\text{in}} + \rho_{\text{stack}} \Delta z_{\text{stack}} - \sum_{\text{j}}{{\overline{\rho}}_{\text{a}2} \left( j \right) \Delta z_{\text{j}}} \right. \\ \left.
    + \sum_{\text{j}}{{\overline{\rho}}_{\text{a}1} \left( j \right) \Delta z_{\text{j}} - \rho_{\text{in}} \left( z_{\text{st}} - z_{\text{in}} \right) } \right\}

where

:math:`g` = acceleration of gravity, :sasinp:`GRAVITY`

:math:`\rho_{\text{in}}` = air density in the inlet section

:math:`\rho_{\text{stack}}` = air density in the stack

:math:`{\overline{\rho}}_{\text{a}1}\left( j \right)` = average
air density in node :math:`j` for upflow air

:math:`\Delta z_{\text{j}}` = height of node :math:`j`

:math:`\Delta z_{\text{in}}` = elevation gain in the inlet, :sasinp:`XLAIRV`

:math:`\Delta z_{\text{stack}}` = elevation gain if the stack, :sasinp:`XLAORV`

:math:`z_{\text{st}}` = elevation of the stack outlet

and

:math:`z_{\text{in}}` = inlet elevation

The loss term, :math:`\Delta p_{\text{loss}}`, is calculated as

.. math::
   :label: eq-5.4-94

	\Delta p_{\text{loss}} = \frac{w_{\text{a}}^{2}}{2\rho_{\text{a},1} A_{\text{a},1}^{2}} k_{\text{or}} + \sum_i\frac{w_{\text{a}}^{2}}{2\rho_{\text{a},i} A_{\text{a},i}^{2}} f \frac{L_i}{D_{\text{h},i}}

where

:math:`w_{\text{a}}` = air flow rate

:math:`A_{\text{a},i}` = air flow area in node i

:math:`\rho_{\text{a},i}` = air density in node i

:math:`f` = friction factor

:math:`k_{\text{or}}` = inlet orifice coefficient

:math:`L_i` = length of the node i

:math:`D_{\text{h,i}}` = hydraulic diameter of node i

The summation is over the inlet section (i=1), the stack, and each of the
nodes between.

The friction factor is calculated as

.. math::
   :label: eq-5.4-95

    f = \begin{cases}
    A_{\text{fr}}\text{Re}^{b} & \text{if } \text{Re} \geq  \text{Re}_{\text{t}} \\
    \frac{A_{\text{fl}}}{\text{Re}} & \text{if } \text{Re} < \text{Re}_{\text{t}}
    \end{cases}

where

.. math::
   :label: eq-5.4-96

    \text{Re} = \text{ Reynolds number } = \frac{D_{\text{h}} w_{\text{a}}}{\mu_{\text{a}} A_{\text{a}}}

:math:`\mu_{\text{a}}` = viscosity

:math:`A_{\text{fr}}` = user-supplied turbulent friction factor coefficient, :sasinp:`AFRTRV`,

:math:`b` = user-supplied turbulent friction factor exponent, :sasinp:`BFRTRV`, and

:math:`A_{\text{fl}}` = user-supplied laminar friction factor coefficient, :sasinp:`AFRLRV`

The value of :math:`\text{Re}_{\text{t}}`, the Reynolds number for the transition from
turbulent to laminar, :sasinp:`REYTRV`, is calculated by the code to make the friction
factor continuous at the transition point.

.. math::
   :label: eq-5.4-97

	A_{\text{fr}}\text{Re}_{\text{t}}^{b} = \frac{A_{\text{fl}}}{\text{Re}_{\text{t}}}

Or

.. math::
   :label: eq-5.4-98

	\text{Re}_{\text{t}} = \left( \frac{A_{\text{fl}}}{A_{\text{fr}}} \right)^{\frac{1}{1+b}}

D. Heat Transfer Coefficients

    1. Reactor Vessel (RV) to Guard Vessel (GV)

.. math::
   :label: eq-5.4-99

	\frac{1}{h_{\text{w}12}} = \frac{R_{\text{w}1}}{2} + \frac{1}{h_{\text{cv}12} + \varepsilon_{12} \sigma \left( T_{\text{w}1} + T_{\text{w}2} \right) \left( T_{\text{w}1}^{2} + T_{\text{w}2}^{2} \right)} + \frac{R_{\text{w}2}}{2}

The approximation is made that :math:`R_{\text{w}1}` and
:math:`R_{\text{w}2}` are lumped in with :math:`h_{\text{cv}12}`, so

.. math::
   :label: eq-5.4-100

	h_{\text{w}12} = h_{\text{cv}12} + \mathbf{\varepsilon}_{12} \sigma \left( T_{\text{w}1} + T_{\text{w}2} \right) \left( T_{\text{w}1}^{2} + T_{\text{w}2}^{2} \right)

where

.. math::
   :label: eq-5.4-101

	\varepsilon_{12} = \frac{1}{\frac{1}{\varepsilon_{\text{RV}} } + \frac{1}{\varepsilon_{\text{GVI}} } - 1}

and

:math:`h_{\text{cv}12}` = user-supplied convective heat transfer
coefficient, RV to GV, :sasinp:`HGASRV`

:math:`\varepsilon_{\text{RV}}` = emissivity of the reactor vessel wall, :sasinp:`EPSRV`

:math:`\varepsilon_{\text{GVI}}` = emissivity of the guard vessel inner surface, :sasinp:`EPSGV`

:math:`\sigma` = Stefan-Boltzmann Constant, :sasinp:`SIGSTB`

.. math::
   :label: eq-5.4-102

	R_{\text{w}1} = G_{\text{RV}}/k_{\text{RV}}

.. math::
   :label: eq-5.4-103

	R_{\text{w}2} = G_{\text{GV}}/k_{\text{GV}}

:math:`G_{\text{RV}}` = thickness of the reactor vessel

:math:`G_{\text{GV}}` = thickness of the guard vessel

:math:`k_{\text{GV}}` = thermal conductivity of guard vessel

:math:`k_{\text{RV}}` = thermal conductivity of the reactor vessel

    2. GV to Finned Shell (FS)

.. math::
   :label: eq-5.4-104

	\frac{1}{h_{\text{w}23}} = \frac{R_{\text{w}2}}{2} + \frac{1}{\varepsilon_{23} \sigma \left( T_{\text{w}2} + T_{\text{w}3} \right) \left( T_{\text{w}2}^{2} + T_{\text{w}3}^{2} \right)}

:math:`R_{\text{w}2}` is neglected, so

.. math::
   :label: eq-5.4-105

	h_{\text{w}23} = \varepsilon_{23} \sigma \left( T_{\text{w}2} + T_{\text{w}3} \right) \left( T_{\text{w}2}^{2} + T_{\text{w}3}^{2} \right)

.. math::
   :label: eq-5.4-106

	\varepsilon_{23} = \frac{1}{\frac{1}{\varepsilon_{\text{GVO}} } + \frac{1}{\varepsilon_{\text{FSI}} } - 1}

:math:`\varepsilon_{\text{GVO}}` = emissivity of the guard vessel outer surface, :sasinp:`EPSGVO`

:math:`\varepsilon_{\text{FSI}}` = emissivity of the finned shell inner surface, :sasinp:`EPSFSI`

    3. Finned Shell

:math:`h_{\text{w}34}` = a constant, user-supplied, conduction
coefficient, :sasinp:`HFSRV`

    4. Outer Wall

.. math::
   :label: eq-5.4-107

	\frac{1}{h_{\text{w}45}} = R_{\text{w}5} + \frac{1}{\varepsilon_{45} \sigma \left( T_{\text{w}4} + T_{\text{w}5} \right) \left( T_{\text{w}4}^{2} + T_{\text{w}5}^{2} \right)}

or

.. math::
   :label: eq-5.4-108

	h_{\text{w}45} = \frac{\varepsilon_{45} \sigma \left( T_{\text{w}4} + T_{\text{w}5} \right) \left( T_{\text{w}4}^{2} + T_{\text{w}5}^{2} \right)}{1 + R_{\text{w}5} \varepsilon_{45} \sigma \left( T_{\text{w}4} + T_{\text{w}5} \right) \left( T_{\text{w}4}^{2} + T_{\text{w}5}^{2} \right)}

where

.. math::
   :label: eq-5.4-109

	\varepsilon_{45} = \frac{1}{\frac{1}{\varepsilon_{\text{FSO}}} + \frac{1}{\varepsilon_{\text{OW}}} - 1}

:math:`R_{\text{w}5}` = thermal resistance in the outer wall to the
location of :math:`T_{\text{w}5}`, :sasinp:`RW5RV`

:math:`h_{\text{w}56}` = a constant, user supplied, conduction
coefficient, :sasinp:`HCONRV`

:math:`\varepsilon_{\text{FSO}}` = emissivity of the finned shell outer surface, :sasinp:`EPSFS`

:math:`\varepsilon_{\text{OW}}` = emissivity of the outer wall, :sasinp:`EPSOW`

    5. Air

.. math::
   :label: eq-5.4-110

	\frac{1}{h_{\text{w}2\text{a}}} = \frac{R_{\text{w}2}}{2} + \frac{1}{h_{\text{a}1}}

again :math:`R_{\text{w}2\text{a}}` is neglected, so

.. math::
   :label: eq-5.4-111

	h_{\text{w}2\text{a}} = h_{\text{a}1}

where the air heat transfer coefficient is

.. math::
   :label: eq-5.4-112

	h_{\text{a}} = \frac{k_{\text{a}}}{D_{\text{ha}}} N\text{u}

:math:`k_{\text{a}}` = air thermal conductivity

:math:`D_{\text{ha}}` = hydraulic diameter between the guard vessel
and the finned shell or between the finned shell and the outer wall

:math:`N_{\text{u}}` = Nusselt number

.. math::
   :label: eq-5.4-113

	\text{Nu} = \begin{cases}
    C_{1} {\text{Re}}^{C_{2}} {\text{Pr}}^{0.4} & \text{if } \text{Re} \geq \text{Re}_{\text{t}} \\
    C_{3} & \text{if } \text{Re} < \text{Re}_{\text{t}}
    \end{cases}

.. math::
   :label: eq-5.4-114

	\text{Re} = \frac{D_{\text{ha}} w_{\text{a}}}{A_{\text{a}}\mu_{\text{a}}}

:math:`w_{\text{a}}` = air flow rate

:math:`A_{\text{a}}` = air flow area, :sasinp:`AIRARV` or :sasinp:`AIRAR2`

:math:`\mu_{\text{a}}` = air viscosity

:math:`P_{\text{r}}` = Prandtl number

:math:`C_{1}`, :math:`C_{2}`, :math:`C_{3}` = user supplied correlation
coefficients, :sasinp:`C1RV`, :sasinp:`C2RV`, :sasinp:`C3RV`

:math:`C_{1} \sim .023`

:math:`C_{2} \sim 0.8`

:math:`C_{3} \sim 3-8`

:math:`\text{Re}_{\text{t}}` = Reynolds number for transition from turbulent to
laminar heat transfer

Also,

.. math::
   :label: eq-5.4-115

	h_{\text{w}3\text{a}} = h_{\text{a}1}

.. math::
   :label: eq-5.4-116

	h_{\text{w}4\text{a}} = h_{\text{a}2}

.. math::
   :label: eq-5.4-117

	\frac{1}{h_{\text{w}5\text{a}}} = R_{\text{w}5} + \frac{1}{h_{\text{a}2}}

or

.. math::
   :label: eq-5.4-118

	h_{\text{w}5\text{a}} = \frac{h_{\text{a}2}}{1 + R_{\text{w}5} h_{\text{a}2}}

.. math::
   :label: eq-5.4-119

	h_{\text{w}5\text{a}} = \frac{k_{\text{a}2}}{D_{\text{haz}}} N_{\text{u}2}

E. Air Properties

Correlations used for air thermal properties are:

Density

.. math::
   :label: eq-5.4-120

	\rho_{\text{a}} = .0003985 + \frac{352.25}{T} + \frac{207.89}{T^{2}}\ \left( \text{kg}/\text{m}^{3} \right)

where

:math:`T` = air temperature (K)

Specific Heat

.. math::
   :label: eq-5.4-121

	C_{\text{pa}} = 972.93 + .086802T + 7.8654 x 10^{- 5} T^{2}\ \left( \text{J}/\text{kg-K} \right)

Prandtl Number:

.. math::
   :label: eq-5.4-122

	{\text{Pr}}^{0.4} = 0.89887 - 1.1906 \times 10^{-4} T + 8.6681 \times 10^{-8} T^{2}

Viscosity

.. math::
   :label: eq-5.4-123

	\mu = 3.872 \times 10^{-6} + 5.332 \times 10^{-8} T - 1.531 \times 10^{-11} T^{2}\ \left( \text{kg}/\text{m-s} \right)

.. math::
   :label: eq-5.4-124

	\mu^{0.2} = .09628 + 6.358 \times 10^{-5} T - 2.633 \times 10^{-8} T^{2}

Thermal Conductivity:

.. math::
   :label: eq-5.4-125

	k = 2.085 \times 10^{-3} + 8.820 \times 10^{-5} T - 2.304 \times 10^{-8} T^{2}\ \left( \text{W}/\text{m-K} \right)

These correlations agree with the tables of dry air properties on page
522 of Ref. 5-6 over the range from 255.4 K (0°F) to 1088.7 K (1500°F)
to within .2% for :math:`\rho_{\text{a}}`, .34% for :Math:`C_{\text{pa}}`, .03% for
:math:`{\text{Pr}}^{0.4}`, 1% for :math:`\mu`, .4% for :math:`{\mu}^{0.2}`, and 2.7%
for :math:`k`.

.. _section-5.4.7.2.2:

Finite Difference Solution
''''''''''''''''''''''''''

A. Finite Difference Equations

1. Reactor Vessel

The coupling between the RVACS/RACS model and the rest of |SAS|
takes place at the reactor vessel wall. Heat transfer from the vessel
wall to the guard vessel is treated using the component-to-component
heat transfer capability of the code. :eq:`eq-5.4-85` becomes

.. math::
   :label: eq-5.4-126

	m_{\text{w}1} C_{\text{w}1} \frac{\text{dT}_{\text{w}1}}{\text{dt}} = h_{\text{Nw}1} A_{\text{Nw}1} \left( T_{\text{N}} - T_{\text{w}1} \right) + h_{\text{snk}} A_{\text{snk}} \left( T_{\text{snk}} - T_{\text{w}1} \right)

where :math:`h_{\text{snk}}`, :math:`A_{\text{snk}}`, and :math:`T_{\text{snk}}` are the sink
heat transfer coefficient, area, and temperature used in the
component-to-component heat transfer treatment. At the beginning of each
time step these values are re-set as

.. math::
   :label: eq-5.4-127

	h_{\text{snk}} = h_{\text{w}12}  \frac{P_{RV_{j}}}{P_{component_{j}}}

.. math::
   :label: eq-5.4-128

	A_{\text{snk}} = A_{\text{w}12} \Delta z_{\text{j}}


.. math::
   :label: eq-5.4-129

	T_{\text{snk}} = T_{\text{w}2}

where :math:`P_{RV_{j}}` is the user-defined RV perimeter and :math:`P_{component_{j}}`
is the perimeter of the primary system component (element or CV) which RVACS is coupled to,
for node :math:`j`. The vessel wall is modeled as a combination of
compressible volume walls, pipe walls, and annular element walls. The thermal treatments for
these components solve :eq:`eq-5.4-126`.

Determination of :math:`P_{component_{j}}` in :eq:`eq-5.4-127` is described
by :numref:`table-5.4-1`, below. It should be noted that all parameters used to
calculate :math:`P_{component_{j}}` are obtained directly from user input.

.. _table-5.4-1:

.. list-table:: Specification of :math:`P_{component_{j}}`
    :header-rows: 1
    :align: center
    :widths: auto

    * - Coupled Component
      - :math:`P_{component_{j}}`
    * - CV
      - :math:`P_{RV_{j}}`
    * - Pipe
      - :math:`\frac{4A}{D_h}`
    * - Annular Element
      - :math:`P_{second wall}`

2. Air Temperature

A treatment similar to the log-mean temperature difference treatment is
used for the air. Fully implicit time differencing is used in the sense
that the values used for :math:`T_{\text{w}2}` and :math:`T_{\text{w}3}` in :eq:`eq-5.4-90` are
the values at the end of the time step. Also, it is assumed that
:math:`T_{\text{w}2}` and :math:`T_{\text{w}3}` are constant across a node. For node :math:`j`,
which extends from :math:`z_{\text{j}}` to :math:`z_{\text{j}}+1`, the solution of :eq:`eq-5.4-90`
then becomes

.. math::
   :label: eq-5.4-130

	T_{\text{a}1} \left( z' \right) = {T'}_{\text{a}1} + \left( T_{\text{a}1} \left( 0 \right) - {T'}_{\text{a}1} \right) \varepsilon^{- \lambda_{1}z'}

where

.. math::
   :label: eq-5.4-131

	z' = z - z_{\text{j}}

.. math::
   :label: eq-5.4-132

	{T'}_{\text{a}1} = f_{2} T_{\text{w}3\text{j}} + f_{3} T_{\text{w}3\text{j}}

.. math::
   :label: eq-5.4-133

	f_{2} = \frac{h_{\text{w}2\text{a}} A_{\text{w}2\text{a}}}{h_{\text{w}2\text{a}} A_{\text{w}2\text{a}} + h_{\text{w}3\text{a}} A_{\text{w}3\text{a}}}

.. math::
   :label: eq-5.4-134

	f_{3} = 1 - f_{2}

and

.. math::
   :label: eq-5.4-135

	\lambda_{1} = \frac{h_{\text{w}2\text{a}} A_{\text{w}2\text{a}} + h_{\text{w}3\text{a}} A_{\text{w}3\text{a}}}{w_{\text{a}} C_{\text{a}}}

The heat flow from the guard vessel to the air in node *j* is then

.. math::
   :label: eq-5.4-136

	q_{2\text{aj}} = \int_{\text{z}' = 0}^{\Delta z_{\text{j}}}h_{\text{w}2\text{a}} A_{\text{w}2\text{a}} \left\lbrack T_{\text{w}2\text{j}} - T_{\text{a}} \left( z' \right)  \right\rbrack \text{dz}'

where

.. math::
   :label: eq-5.4-137

	\Delta z_{\text{j}} = z_{\text{j} + 1} - Z_{\text{j}}

Combining :eq:`eq-5.4-130` and :eq:`eq-5.4-136` gives

.. math::
   :label: eq-5.4-138

	q_{2\text{aj}} = h_{\text{w}2\text{a}} A_{\text{w}2\text{a}} \left\{ \Delta z_{\text{j}} \left( T_{\text{w}2\text{j}} - {T'}_{\text{a}1} \right) + \frac{\left\lbrack {T'}_{\text{a}1} - T_{\text{a}1} \left( 0 \right) \right\rbrack \left( 1 - e^{- \lambda \Delta z_{\text{j}}} \right)}{\lambda_{1}} \right\}

The wall temperatures are solved for simultaneously with the air
temperatures, so one uses

.. math::
   :label: eq-5.4-139

	T_{\text{w}2\text{j}} \left( t + \Delta t \right) = T_{\text{w}2\text{j}}\left( t \right) + \Delta T_{\text{w}2\text{j}}

and

.. math::
   :label: eq-5.4-140

	T_{\text{w}3\text{j}} \left( t + \Delta t \right) = T_{\text{w}3\text{j}}\left( t \right) + \Delta T_{\text{w}3\text{j}}

where the time step size is :math:`\Delta t`. Then :eq:`eq-5.4-138` has the form

.. math::
   :label: eq-5.4-141

	q_{2\text{aj}} = b_{\text{o}} + b_{2} \Delta T_{\text{w}2\text{j}} + b_{3} \Delta T_{\text{w}3\text{j}}

where

.. math::
   :label: eq-5.4-142

	b_{0} = h_{\text{w}2\text{a}} A_{\text{w}2\text{a}} \left\{ \Delta z_{\text{j}} \left\lbrack T_{\text{w}2\text{j}}\left( t \right) - {T'}_{\text{a}1} \left( t \right) \right\rbrack + \frac{\left\lbrack {T'}_{\text{a}1}\left( t \right)
	- T_{\text{a}1} \left( 0 \right) \right\rbrack}{\lambda_{1}} \left( 1 - e^{- \lambda_{1}\Delta z_{\text{j}}} \right) \right\}

.. math::
   :label: eq-5.4-143

	b_{2} = h_{\text{w}2\text{a}} A_{\text{w}2\text{a}} \left\{ \Delta z_{\text{j}} \left( 1 - f_{2} \right) + \frac{f_{2}}{\lambda_{1}} \left( 1 - e^{- \lambda_{1}\Delta z_{\text{j}}} \right) \right\}

and

.. math::
   :label: eq-5.4-144

	b_{3} = h_{\text{w}2\text{a}} A_{\text{w}2\text{a}} \left\{ -\Delta z_{\text{j}}  f_{3}  - \frac{f_{3}}{\lambda_{1}} \left( 1 - e^{- \lambda_{1}\Delta z_{\text{j}}} \right) \right\}

Similarly,

.. math::
   :label: eq-5.4-145

	q_{3\text{aj}} = C_{\text{0}} + C_{2} \Delta T_{\text{w}2\text{j}} + C_{3} \Delta T_{\text{w}3\text{j}}

.. math::
   :label: eq-5.4-146

	q_{4\text{aj}} = d_{\text{o}} + d_{4} \Delta T_{\text{w}4\text{j}} + d_{5} \Delta T_{\text{w}5\text{j}}

and

.. math::
   :label: eq-5.4-147

	q_{5\text{aj}} = e_{\text{o}} + e_{4} \Delta T_{\text{w}4\text{j}} + e_{5} \Delta T_{\text{w}5\text{j}}

where

.. math::
   :label: eq-5.4-148

	C_{0} = h_{\text{w}3\text{a}} A_{\text{w}3\text{a}} \left\{ \Delta z_{\text{j}} \left\lbrack T_{\text{w}3\text{j}}\left( t \right) - {T'}_{\text{a}1}\left( t \right) \right\rbrack + \frac{{T'}_{\text{a}1}\left( t \right) - T_{\text{a}1}\left( 0 \right)}{\lambda_{1}} \left( 1 - e^{- \lambda_{1} \Delta z_{\text{j}}} \right) \right\}

.. math::
   :label: eq-5.4-149

	C_{2} =  - h_{\text{w}3\text{a}} A_{\text{w}3\text{a}} \left\{ \Delta z_{\text{j}}f_{2} - \frac{f_{2}}{\lambda_{1}} \left( 1 - e^{- \lambda_{1}\Delta z_{\text{j}}} \right) \right\}

.. math::
   :label: eq-5.4-150

	C_{3} =   h_{\text{w}3\text{a}} A_{\text{w}3\text{a}} \left\{ \Delta z_{\text{j}} \left( 1 - f_{3} \right) + \frac{f_{3}}{\lambda_{1}} \left( 1 - e^{- \lambda_{1}\Delta z_{\text{j}}} \right) \right\}

.. math::
   :label: eq-5.4-151

	d_{\text{o}} = h_{\text{w}4\text{a}} A_{\text{w}4\text{a}} \left\{ \Delta z_{\text{j}} \left\lbrack T_{\text{w}4\text{j}}\left( t \right) - {T'}_{\text{a}2}\left( t \right) \right\rbrack + \frac{\left\lbrack {T'}_{\text{a}2}\left( t \right)
	- T_{\text{a}2}\left( \Delta z \right) \right\rbrack \left( 1 - e^{- \lambda_{2} \Delta z_{\text{j}}} \right)}{\lambda_{2}}  \right\}

.. math::
   :label: eq-5.4-152

	d_{4} = h_{\text{w}4\text{a}} A_{\text{w}4\text{a}} \left\{ \Delta z_{\text{j}}\left( 1 - f_{4} \right) + \frac{f_{4}}{\lambda_{2}} \left( 1 - e^{- \lambda_{2}\Delta z_{\text{j}}} \right) \right\}

.. math::
   :label: eq-5.4-153

	d_{5} =  - h_{\text{w}4\text{a}} A_{\text{w}4\text{a}} \left\{ \Delta z_{\text{j}} f_{5} - \frac{f_{5}}{\lambda_{2}} \left( 1 - e^{- \lambda_{2}\Delta z_{\text{j}}} \right) \right\}

.. math::
   :label: eq-5.4-154

	e_{0} = h_{\text{w}5\text{a}} A_{\text{w}5\text{a}} \left\{ \Delta z_{\text{j}} \left\lbrack T_{\text{w}5\text{j}}\left( t \right) - {T'}_{\text{a}2}\left( t \right) \right\rbrack + \frac{\left\lbrack {T'}_{\text{a}2}\left( t \right)
	- T_{\text{a}2}\left( \Delta z \right) \right\rbrack \left( 1 - e^{- \lambda_{2} \Delta z_{\text{j}}} \right)}{\lambda_{2}}  \right\}

.. math::
   :label: eq-5.4-155

	e_{4} =  - h_{\text{w}5\text{a}} A_{\text{w}5\text{a}} \left\{ \Delta z_{\text{j}} f_{4} - \frac{f_{4}}{\lambda_{2}} \left( 1 - e^{- \lambda_{2}\Delta z} \right) \right\}

.. math::
   :label: eq-5.4-156

	e_{5} = h_{\text{w}5\text{a}} A_{\text{w}5\text{a}} \left\{ \Delta z_{\text{j}} \left( 1 - f_{5} \right) + \frac{f_{5}}{\lambda_{2}} \left( 1 - e^{- \lambda_{2}\Delta z} \right) \right\}

.. math::
   :label: eq-5.4-157

	{T'}_{\text{a}2} = f_{4} T_{\text{w}4\text{j}} + f_{5} T_{\text{w}5\text{j}}

.. math::
   :label: eq-5.4-158

	f_{4} = \frac{h_{\text{w}4\text{a}} A_{\text{w}4\text{a}}}{h_{\text{w}4\text{a}} A_{\text{w}4\text{a}} + h_{\text{w}5\text{a}} A_{\text{w}5\text{a}}}

and

.. math::
   :label: eq-5.4-159

	f_{5} = 1 - f_{4}

3. Guard Vessel

Fully implicit time differencing is used for the wall temperature.
:eq:`eq-5.4-86` becomes

.. math::
   :label: eq-5.4-160

	\Delta z_{\text{j}}m_{\text{w}2} C_{\text{w}2}  \frac{\Delta T_{\text{w}2}}{F_{\text{NT}}\Delta t} = h_{\text{w}12} A_{\text{w}12} \left\lbrack T_{\text{w}1} \left( t + \Delta t \right) - T_{\text{w}2}\left( t \right) - \Delta T_{\text{w}2} \right\rbrack \Delta z_{\text{j}} \\
    + h_{\text{w}23} A_{\text{w}23} \left\lbrack T_{\text{w}3} \left( t \right) + \Delta T_{\text{w}3} - T_{\text{w}2}\left( t \right) - \Delta T_{\text{w}2} \right\rbrack \Delta z_{\text{j}} - q_{2\text{aj}}

or

.. math::
   :label: eq-5.4-161

	\alpha_{2} \Delta T_{\text{w}2} + \alpha_{3} \Delta T_{\text{w}3} = \alpha_{0}

where

.. math::
   :label: eq-5.4-162

	\alpha_{2} = 1 + \frac{h_{\text{w}12} A_{\text{w}12}\Delta tF_{\text{NT}}}{m_{\text{w}2} C_{\text{w}2}} + \frac{h_{\text{h}23} A_{\text{w}23} \Delta t F_{\text{NT}}}{m_{\text{w}2} C_{\text{w}2}} + \frac{b_{2}}{\Delta z_{\text{j}}} \frac{\Delta t F_{\text{NT}}}{m_{\text{w}2} C_{\text{w}2}}

.. math::
   :label: eq-5.4-163

	\alpha_{3} =  - \frac{h_{\text{w}23} A_{\text{w}23}\Delta t F_{\text{NT}}}{m_{\text{w}2} C_{\text{w}2}} + \frac{b_{3} \Delta t F_{\text{NT}}}{\Delta z_{\text{j}} m_{\text{w}2} C_{\text{w}2}}

and

.. math::
   :label: eq-5.4-164

	\alpha_{0} = \frac{\Delta t F_{\text{NT}}}{m_{\text{w}2} C_{\text{w}2}}\left\{ h_{\text{w}12} A_{\text{w}12} \left\lbrack T_{\text{w}1}\left( t + \Delta t \right)  - T_{\text{w}2}\left( t \right) \right\rbrack \right. \\ \left.
    + h_{\text{w}23} A_{\text{w}23} \left\lbrack T_{\text{w}3}\left( t \right)  - T_{\text{w}2}\left( t \right) \right\rbrack - \frac{b_{\text{o}}}{\Delta z_{\text{j}}} \right\}

4. Finned Shell, Inner Node

:eq:`eq-5.4-87` becomes

.. math::
   :label: eq-5.4-165

	\beta_{2} \Delta T_{\text{w}2} + \beta_{3} \Delta T_{\text{w}3} + \beta_{4} \Delta T_{\text{w}4} = \beta_{0}

where

.. math::
   :label: eq-5.4-166

	\beta_{0} = \frac{\Delta t F_{\text{NT}}}{m_{\text{w}3} C_{\text{w}3}}\left\{ h_{\text{w}34} A_{\text{w}34} \left\lbrack T_{\text{w}4}\left( t \right)  - T_{\text{w}3}\left( t \right) \right\rbrack \right. \\ \left.
    + h_{\text{w}23} A_{\text{w}23} \left\lbrack T_{\text{w}2}\left( t \right)  - T_{\text{w}3}\left( t \right) \right\rbrack - \frac{C_{\text{o}}}{\Delta z_{\text{j}}} \right\}

.. math::
   :label: eq-5.4-167

	\beta_{2} = \frac{\Delta t F_{\text{NT}}}{m_{\text{w}3} C_{\text{w}3}} \left( \frac{C_{2}}{\Delta z_{\text{j}}} - h_{\text{w}23} A_{\text{w}23} \right)

.. math::
   :label: eq-5.4-168

	\beta_{3} = 1 + \frac{\Delta t F_{\text{NT}}}{m_{\text{w}3} C_{\text{w}3}} \left( h_{\text{w}34} A_{\text{w}34} + h_{\text{w}23} A_{\text{w}23} + \frac{C_{3}}{\Delta z_{\text{j}}} \right)

.. math::
   :label: eq-5.4-169

	\beta_{4} =  - \frac{\Delta t h_{\text{w}34} A_{\text{w}34} F_{\text{NT}}}{m_{\text{w}3} C_{\text{w}3}}

5. Finned Shell, Outer Node

:eq:`eq-5.4-88` becomes

.. math::
   :label: eq-5.4-170

	\gamma_{3}\Delta T_{\text{w}3} + \gamma_{4}\Delta T_{\text{w}4} + \gamma_{5}\Delta T_{\text{w}5} = \gamma_{0}

where

.. math::
   :label: eq-5.4-171

	\gamma_{0} = \frac{\Delta t F_{\text{NT}}}{m_{\text{w}4} C_{\text{w}4}}\left\{ h_{\text{w}45} A_{\text{w}45} \left\lbrack T_{\text{w}5}\left( t \right)  - T_{\text{w}4}\left( t \right) \right\rbrack \right. \\ \left.
    + h_{\text{m}34} A_{\text{w}34} \left\lbrack T_{\text{w}3}\left( t \right) - T_{\text{w}4}\left( t \right) \right\rbrack - \frac{d_{\text{o}}}{\Delta z_{\text{j}}} \right\}

.. math::
   :label: eq-5.4-172

	\gamma_{3} = - \frac{\Delta t F_{\text{NT}}}{m_{\text{w}4} C_{\text{w}4}} h_{\text{w}34} A_{\text{w}34}

.. math::
   :label: eq-5.4-173

	\gamma_{4} = 1 + \frac{\Delta t F_{\text{NT}}}{m_{\text{w}4} C_{\text{w}4}} \left( \frac{d_{4}}{\Delta z_{\text{j}}} + h_{\text{w}34}  A_{\text{w}34} + h_{\text{w}45} A_{\text{w}45} \right)

and

.. math::
   :label: eq-5.4-174

	\gamma_{5} =  \frac{\Delta t F_{\text{NT}}}{m_{\text{w}4} C_{\text{w}4}} \left( \frac{d_{5}}{\Delta z_{\text{j}}} - h_{\text{w}45} A_{\text{w}45} \right)

6. Cavity Wall, Inner Node

:eq:`eq-5.4-89` becomes

.. math::
   :label: eq-5.4-175

	\xi_{4}\Delta T_{\text{w}4} + \xi_{5}\Delta T_{\text{w}5} = \xi_{0}

where

.. math::
   :label: eq-5.4-176

	\xi_{0} = \frac{\Delta t F_{\text{NT}}}{m_{\text{w}5} C_{\text{w}5}} \left\{ h_{\text{w}45} A_{\text{w}45} \left\lbrack T_{\text{w}4}\left( t \right) - T_{\text{w}5}\left( t \right) \right\rbrack \right. \\ \left.
    + h_{\text{w}56} A_{\text{w}56} \left\lbrack T_{\text{w}6}\left( t \right) - T_{\text{w}5}\left( t \right) \right\rbrack - \frac{e_{\text{o}}}{\Delta z_{\text{j}}} \right\}

.. math::
   :label: eq-5.4-177

	\xi_{4} = \frac{\Delta t F_{\text{NT}}}{m_{\text{w}5}C_{\text{w}5}}\left( \frac{e_{4}}{\Delta z_{\text{j}}} - h_{\text{w}45}A_{\text{w}45} \right)

and

.. math::
   :label: eq-5.4-178

	\xi_{5} = 1 + \frac{\Delta t F_{\text{NT}}}{m_{\text{w}5} C_{\text{w}5}} \left( \frac{e_{5}}{\Delta z_{\text{j}}} + h_{\text{w}45} A_{\text{w}45} + h_{\text{w}56} A_{\text{w}56} \right)

7. Cavity Wall, Outer Node

The sink temperature is assumed to be constant:

:math:`T_{\text{w}6}` = constant

Solution of Finite Difference Equations

1. Simultaneous Solution of Equations

a. Down-Flowing Air, Transient Solution

The finned shell outer node and cavity wall inner node temperatures are
solved for simultaneously, assuming the finned shell inner node temperature
is constant. Solving :eq:`eq-5.4-170` and :eq:`eq-5.4-175` simultaneously
gives

.. math::
   :label: eq-5.4-179

	\Delta T_{\text{w}4} = \frac{\gamma_{\text{0}} \xi_{5} - \gamma_{5} \xi_{\text{0}}}{\gamma_{4} \xi_{5} - \gamma_{5} \xi_{4}}

Then :eq:`eq-5.4-175` can be solved for :math:`\Delta T_{\text{w}5}`.

b. Up-Flowing Air, Transient Solution

The guard vessel and finned shell inner node temperatures are solved for
simultaneously, assuming the finned shell outer node temperature
is constant. Solving :eq:`eq-5.4-161` and :eq:`eq-5.4-165` simultaneously gives

.. math::
   :label: eq-5.4-180

	\Delta T_{\text{w}2} = \frac{\alpha_{3} \beta_{\text{0}} - \alpha_{\text{0}} \beta_{\text{3}}}{\alpha_{3} \beta_{2} - \alpha_{2} \beta_{3}}

Then :eq:`eq-5.4-161` is solved for :math:`\Delta T_{\text{w}3}`.

2. Solution Method

No steady-state solution for the RVACS/RACS has been coded; the initial
steady-state results are obtained by running a null transient. First the
air and wall temperatures are set to the air inlet temperature. Then the
null transient is run to set the initial steady-state temperatures and
flow rate. Finally the regular transient is run. During the null
transient the core channel calculations are bypassed, the sodium flow
rates are held constant, the inlet and outlet plenum temperatures are
held constant, and temperatures and air flow rates are calculated for
the rest of the sodium and the RVACS/RACS. The routines used in the null
transient are the same as those used in the regular transient.

An iteration on air flow rate is used in the transient solution. An air
flow rate is assumed, temperatures are calculated for this air flow
rate, the air gravity head is calculated, and the air pressure loss is
calculated. Then the gravity head is compared with the pressure loss;
and if the two do not balance, another air flow rate is tried. The
iteration on air flow rate continues until a balance is achieved. The
temperature calculation starts at the inlet and works down the inlet
side then back up the air up-flow side. The heat transfer coefficients
and the heat transfer across the finned shell are calculated based on
conditions at the beginning of the time step. The rest of the
calculation is fully implicit in its time differencing.

.. _section-5.4.7.3:

.. _CoupledRVACSModel:

Coupled RVACS Model
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

For the coupled model, the representation of the RVACS stops at the
Reactor Vessel (RV) wall.
At the end of each PRIMAR-4 time step, |SAS| transfers the temperate
of each axial node in the RV wall to an external code.
The external code is expected to provide a sink temperature, :math:`T_{\text{snk}}`, and a heat
transfer coefficient, :math:`h_{\text{snk}}` for each node. :math:`T_{\text{snk}}`
and :math:`h_{\text{snk}}` are assumed to remain constant during the subsequent
PRIMAR-4 time step, after which it will be updated again.

Due to the uniqueness of the |SAS| null transient, the coupled
RVACS model has been developed such that it can:

    - Participate in the null transient, :sasinp:`IRVOPT` = -1,
    - Not participate in the null transient, :sasinp:`IRVOPT` = -1000,
    - Call the simple RVACS model during the null transient, :sasinp:`IRVOPT` < -1000.

If a user selects for the coupled RVACS model to participate in the null transient, the external
code must be capable of handling the reset of the simulation elapsed time. The simulation elapsed time will reset when |SAS|
transitions from a null transient to the first transient calculation step.

.. note::

    When :sasinp:`IRVOPT` < -1000, input for the simple RVACS model must be provided to support the null transient calculation.

The coupled RVACS model relies on ZMQ for data transfer between |SAS| and
the external code. ZMQ is a C++ asynchronous messaging library that allows for
data transfer interfaces that are simple to create and flexible :ref:`[5-9]<section-5.14>`.
At the beginning of a |SAS| calculation containing a coupled RVACS model,
SAS will create a ``ZMQ_PAIR`` socket bound to a random (ephemeral) TCP port.
If the binding is successful, the RVACS coupling service is established, and a message is written to the |SAS| log file.
If the binding fails, an error is reported in the |SAS| output file.

To determine the RVACS service port, an external code must first connect to the SAS ''Harbor Master'' on port 60439
using a ``ZMQ_REQ`` socket and send a lookup request to determine which port the RVACS service is bound to.
This process typically occurs at the start of the null transient, or in the case of a restart,
at the start of the first transient calculation. Once the port is identified, the external
code must connect to that port using a ``ZMQ_PAIR`` socket for RVACS communications.

At the end of each PRIMAR-4 time step |SAS| will send a multi-part ZMQ message containing the following:

.. _table-5.4-2:

.. list-table::  ZMQ Message Parts Sent to the External Code.
    :header-rows: 1
    :align: center
    :widths: 1,3,1

    * - Variable
      - Description
      - Type
    * - ``nMesh``
      - The number of nodes representing the RV wall.
      - ``c_int``
    * - ``isNull``
      -  A flag indicating if |SAS| is computing a null transient step, ``isNull = 1`` or a regular transient, ``isNull = 0``.
      - ``c_int``
    * - ``isSaved``
      -  A flag indicating if |SAS| saved a restart after the previous time step.
      - ``c_int``
    * - ``t``
      -  The time at the start of the PRIMAR-4 time step (seconds).
      - ``c_double``
    * - ``dt``
      -  The size of the PRIMAR4 time step (seconds).
      - ``c_double``
    * - ``dz(nMesh)``
      -  An array of size ``nMesh`` containing the height of each RV wall node (m).
      - ``c_double``
    * - ``T1(nMesh)``
      -  An array of size ``nMesh`` containing the temperature of each RV wall node (K).
      - ``c_double``

|SAS| then reads in a data package containing:

.. _table-5.4-3:

.. list-table:: ZMQ Message Parts Received from the External Code.
    :header-rows: 1
    :align: center
    :widths: 1,3,1

    * - Variable
      - Description
      - Type
    * - ``nMesh``
      - The number of nodes representing the RV wall.
      - ``c_int``
    * - ``T2(nMesh)``
      -  An array of size ``nMesh`` containing :math:`T_{\text{snk}}` for each RV wall node (K).
      - ``c_double``
    * - ``H12(nMesh)``
      -  An array of size ``nMesh`` containing :math:`h_{\text{snk}}` for each RV wall node (W/m^2-K).
      - ``c_double``

|SAS| will wait at the read stage until the external code has sent a response.
If the external code provides data of the wrong shape, i.e. the values of ``nMesh`` are not consistent, or sends an incomplete response,
|SAS| will print an error message and exit.

An example Coupled RVACS routine is shown below.
The example returns a constant heat sink temperature and heat transfer coefficient for each
RV node until the time reaches 100 seconds.

.. literalinclude:: CoupledRVACS.cc
	:language: c++

.. _section-5.4.7.4:

.. include::    input-RVACS.rst