SAFPWR home page

Overview of the SAFPWR safety analysis program

A fisrt accident simulation exemple

It is purposely chosen very simple in order to help the reader getting acquainted with syntax and conventions for setting up an application input file.

The first application exemple analyses (view problem configuration) an elementary water coolant transport problem over a linear string of nodes.

Input data

view input.dat file (001_a.dat)
(download 001_a.dat)

The string of nodes is represented as part of loop_1 fed by the pressu outlet O.
O needs to be represented with the only purpose of specifying the primary pressure p3.

The easiest way of explaining how the application data file is filled is by just scanning the sequence of successive keywords of the application's procedure.

In order to facilitate filling the input.dat file, a documented template rdinput.dat is also available.
Strings appended to ! are comments.
They can be freely added anywhere except within an uncompleted (FORTRAN) data record
The general structure of the input.dat file is made of:
A group of sequences command lines Sn= ... defining the application's procedure, followed by
application, which introduces the next application. (several applications may be accumulated), followed by the successive
"data groups" which are needed for the application.

Interpretation of the sequence group

S1= read, pressu, loop_1 starts reading the data. (! at least one space must be inserted after each =; optional spaces may be added for better readability after or before each data separator ,).
read data group.
The keyword read of S1 triggers reading the "general input data group". This keyword is duplicated as a title of the data group in order to set up a one-to-one correspondence between the keywords in the sequences and the corresponding data groups.
&S00gen introduces a "fortran namelist" (recognized by a leading "&") definition of the general data for primary system, which includes, in this application:
dsec= .25 : [Delta;SECond] time-step duration in sec
(!all units in International Unit System: m, kg, s, K)
(!characters are case-sensitive: type dsec but not DSEC)
[Delta;SECond] is the "decoder" expression. It explains the syntax for input fortran name.
secmax= 20 : [SEC(current time);MAXimum value of] duration of the application.
l9= 1 : [Loop;9 (max index for)]: single loop (loop_1) application.
More generally, suffix "1" stands for value at beginning of step "bos", "2" for end of step "eos", the last digit "9" is reserved for the last index value or maximum variable index.
om1, om2: time discretization relaxation factors used, in processing nodal mass, enthalpy and bore balances, for calculating the node outlet enthalpy hs as a weighted average of beginning-of-step (bos) h1 and end-of-step (eos) h2 values, according to:
hs = om1 * h1 + om2 * h2
owvp= f :[logical Option;for Volumetric floW; of primary Pump] logical option for entering pump flow is .false. (or in short f), which means that mass flow must be entered subsequently as wel= under the Lstl1 list. For owvp= t, the volumetric flow (m/s) is specified
/ terminates the last record as required for any fortran namelist type record.
Plots The general data group also includes commands for plotting output values.
The plotting group, if present, starts with the title Plots, followed by a sequence of record lines with syntax:
plotn= list_name:variable_name, list_name:variable_name,...../
See Plots.prn for complete list of plotable variables. This list can be expanded on demand.
In our application example:
plot0= gen:sec, lstl1:we, lstl1:he, lstl1:be, lstl1:hs, lstl1:bs/
will write, on a file wrt.pl0 created in the main directory, a title line + at each time-step (ts) : the elapsed time sec from the general list gen + the scalar variables we, ... of lstl1 [LiST;of Loop_1].
The plot files are straight asci comma delimited files which can be imported as such into any spreadsheet (LOTUS123, Exel) or plotting program for viewing, editing and charting the output data.
Like for any fortran direct record the plot record must be terminated by /.
plot1= shows how sections of array variables can be plotted: lstl1i(1:4):h2 will generate plots of h2l1i(1), h2l1i(2), h2l1i(3), h2l1i(4), the eos (h2) enthalpy of nodes i=1:4 of loop_1 (l1).
read, pressu keyword sequence in S1 reads the
pressu data group.
Lsto: data list for the pressu outlet o, inserted here with the only purpose of defining the primary pressure p3= 155e5 (1e5 Pa= 1 bar).
loop_1 group specifies, in the list:
Lstl1 [LiST;Loop;1]:
i9l= 4 [node Index;max 9; of current Loop] the total number of nodes and
wel= 6000 [mass floW;Entry;Loop]the mass flow at its inlet.
Itp_sec: the values of inlet enthalpy hel and the inlet boron bel will be made to vary with time by means of a polynomial "interpolator" Itp_sec where the record
sec= 0, 1, ... gives the time values and
hel= ... the corresponding dependent variable values
This application time-sequence. includes sec= 0 for initialization, sec= 1 for checking the sationarity, followed by a step increase (actually in .0000s) of inlet hel from 1.3e6 to 1.4e6 at sec=1 and a corresponding bel boron jump from 0 to 1000 ppm (1 ppm = 1e-6= 1 part per million mass-wise= 1 mg of boron per kg of water).
The application analyses how this steep front at entry propagates through the successive nodes of loop1.
Lstli1 data-list specifies the initial content of the 4 nodes li=1,4 of loop_1 (l1) by means a set of input records following the syntax convention of Fortran List-directed Input:
jqli= 4*0 : [node J of the steam generator (SG); thermally (Q) coupled to primary node LI]
If jqli=0, the node is adiabatic.
qli= 4*0 : [thermal power Q; directly injected into LI]: no heat injection. (ex= qli= 2*0, 500, 0 would inject 500 W of heat into li=3)
vli= 4*1: [Volume:LI] volume of the successive nodes
wyli= 4*0: [W;(injected)Y;into LI] no flow injection ("y" stands for "injected") into li

For the other variables, default values apply.
xxx/ !any string x except the null string: : end-of-file record terminates the application data set.

The reading process of input.dat is now completed

In the second line of S1=, ini, loop_1, initializes the 4 nodes of loop1.
Namely, as qli=0, this should result, at sec= 0, with h2li(1:4)= hel(0)= 1.3e6, b2li(1:4)=0.

Next, call:3 branches to the plotting sequence S3= for writing, on wrt.pl0 and wrt.pl1 files, 3 first line with titles of the plot files and a 4th line with the initial values (at sec=0) of the plotted variables;
Next, call:2 "calls" or branches to the main time-stepping sequence S2.
step advances the time-step (sec = sec+dsec, h1 =h2,..) and assigns the logical ctrl to
ctrl = sec <= secmax, which means that
ctrl= t if sec < secmax and f if not.
step, loop_1 steps (updates) loop_1 variables (m2li = m1li, ....)
do, loop_1 "does" loop_1 i.e. processes the balances equations (for mass, enthalpy, boron, kinetic momentum) for li = 1,i9l and computes loop outlet [Sortie] values wsl, hsl, bsl, as well as some other variables needed for later pressure and flow updating (not used in this application).
call:3 calls again S3 for writing a line in the wrt.pln files with the values available at time sec, the end of the current time step
S2 terminates with call:0, which means "start again the current sequence"
The ctrl keyword must be inserted somewhere in the sequence to avoid its indefinite looping.
When ctrl becomes true, at application's end, when sec > secmax, it causes branching back after the calling keyword (here call:2) of the calling sequence (here S1).
Then S1 reaches its end-of record (/) and the current applications terminates.

It is possible to accumulate several applications on a single input.dat file.

Procedure for executing the application :

-Create a host directory (ex: \SAFPWR) for the safpwr.exe program.
-Make \SAFPWR your current directory.
-Download the archive from the downloading center.
This archive contains the executable safpwr.exe itself as well as a sample of the input.dat test file and of the files safpwr.lis, wrt.pl0, ... generated program execution.
-Unpack this archive into the host directory.

Program execution requires, in addition, the presence, in same derectory, of a valid sample of an "authorization file" safpwr.fig which allows the program to check the individual licensing conditions before letting execution proceed.
Refer to the support page for obtaining your personal sample of safpwr.fig and copy it in the same directory

Ensure that the "generic" input.dat file of the current application is present in that directory
-At the command line enter the program name safpwr in order to "run" the executable file safpwr.exe of the SAFPWR program with the data provided in the text file input.dat
With the command "SHIFT safpwr" execution progress is shown on the screen.
safpwr > safpwr.lis redirects the output to safpwr.lis file
An utility such as TotalCommander is convenient for managing the operations.
For managing the data files, I founded it convenient to collect the individual "application" data files inpu1.dat, input2.dat inside their own directory, and to create in TotalCommander a dedicated button for a variant of the dos copy command:
/c copy with special parameters
? %p%n %t%m
with name "replace file content"
This command substitutes the content of a any source file selected (of simply marked) in the source (active) directory to the content of a target file marked in the target directory. This command does not rename the target file but just updates it.
After possible editing of the "generic" iinput.dat, its content is, in turn saved, into its original application data file by executing the reverse command from the generic input.dat
See total commander help "change button bar" for details.

Monitoring the execution

Output messages appearing on the screen or redirected into the output listing safpwr.lis help following execution progress and tracing possible input syntax errors.
The first lines inform about the processing of the authorization file.
After successful authorization, the console messages generated at execution should include:

read/&S00gen: group/list under reading
read/Plots: idem
exit: pressu: exit reading read group , read loop_1 group
no Lstx: no Lstx group in the application
loop_1group under reading
Lstl1: reading list Lstl1
exit: Itp_sec: at exit, find Itp_sec to read
Lstl1/Itp_sec: reading Itp_sec list
>exit: Lstli1: candidate list
Lstli1: reading it
exit: xxx: exit reading application data records
secmax, sec 20.0000000 21.0000000: secmax and sec reached at application's end.

Interpretation of the application results

The results are collected in the plot files wrt.pl0, wrt.pl1 created in \SAFPWR

To make the case simple, we have selected a volumetric input flow wve=1, dsec=1, vli=4*1 so that the node crossing duration is 1 s.
As vm(h=1.3e6, p=130e5)=1.354522e-3, the corresponding mass flow wel = 1 (m/s) / (1.35e-3 m/kg) = 738.27 kg/s and the hot water front should normally reach, for a piston-like progression, the end of loop_1 at sec = 1+4=5.

The totally implicit eulerian scheme solution(vli=4*1, om2=1) depicts instead (chart 01) the typical unrealistic forward diffusion effect characteristic of the eulerian integration scheme. The legend names of the variables (bel, bsl, hsl) plotted against the right y axis are marked by a >> sign pointing towards the right.

Note that the chart does not reflect well the true evolution of plotted variables.
hel(2)= 1.4e6 is actually active and constant over the whole (1 s, 2 s) time interval and h2li1(2) [entHalpy; at eos 2; of Loop; node I=1; at time sec= 2] is a eos value for the same time interval.
The confusion comes from the plotting feature, which simply connects the plotted points by linear segments, which does not imply that the variable changes linearly.
Plotting the true evolution would require a finer time sampling (dsec < 1).

Is the forward diffusion numerical deformation effect a safety concern?
The following applications investigate whether and how it can be corrected. On the other hand, a step perturbation of an inlet variable, such as boron or enthalpy is totally unrealistic.
In the present problem, with the assumed transit time, the diffusion effect is sensible over a 10 s period, so that the numerical deformation is expected to be of concern if the perturbation time scale is of the same order.