The Application Programming Interface for the · PDF fileThe Application Programming Interface...

Click here to load reader

  • date post

    18-May-2018
  • Category

    Documents

  • view

    216
  • download

    1

Embed Size (px)

Transcript of The Application Programming Interface for the · PDF fileThe Application Programming Interface...

  • The INL is a U. S. Department of Energy National Laboratory

    operated by Battelle Energy Alliance

    INL/EXT-05-00107

    The Application Programming Interface for the PVMEXEC Program and

    Associated Code Coupling System

    Walter L. Weaver III

    March 2005

  • INL/EXT-05-00107

    The Application Programming Interface for the PVMEXEC Program and Associated Code

    Coupling System

    Walter L. Weaver III

    March 2005

    Idaho National LaboratoryIdaho Falls, Idaho 83415

    Prepared Under DOE/NE Idaho Operations OfficeContract No. DE-AC07-05ID14517

  • ii

  • ABSTRACT

    This report describes the Application Programming Interface for the PVMEXEC program and thecode coupling systems that it implements. The information in the report is intended for programmerswanting to add a new code into the coupling system.

    iii

  • iv

  • CONTENTS

    1 Introduction ..................................................................................................................................... 1

    1.1 Background ......................................................................................................................... 1

    1.2 General Principles .............................................................................................................. 2

    1.3 Description of PVM ........................................................................................................... 2

    1.4 Responsibilities of the PVMEXEC Program ..................................................................... 3

    2 Taxonomy of Coupling .................................................................................................................... 3

    3 PVMEXEC Application Programming Interface ............................................................................ 4

    3.1 Initialization Phase of Coupled Simulation ........................................................................ 5

    3.1.1 Restart Control and Simulation Start Time ........................................................... 7

    3.1.2 Coupling Data Specification ................................................................................. 8

    3.1.3 Initial Data Exchanges ......................................................................................... 12

    3.2 Transient Phase of Coupled Simulation ........................................................................... 15

    3.2.1 Time Step Selection and the Production of Output ............................................. 15

    3.2.2 Data Exchanges During Time Steps .................................................................... 17

    4 Summmary ..................................................................................................................................... 21

    5 References ..................................................................................................................................... 21

    Appendix A Message Tags ...................................................................................................................A-1

    Appendix B Order of Messages ........................................................................................................... B-1

    1 Initialization Phase Messages ...................................................................................................... B-1

    2 Transient Phase Messages ........................................................................................................... B-3

    2.1 Initial Transient Messages .............................................................................................. B-3

    2.2 Messages During Time Step ........................................................................................... B-4

    2.3 Messages At End Of TIme Step .................................................................................... B-5

    2.3.1 Synchronous Coupling ...................................................................................... B-5

    2.3.2 Asynchronous Coupling. ................................................................................... B-6

    Appendix C RELAP5-3D Coupling Data Items ............................................................................. C-1

    1 Explicit Thermal-hydraulic Coupling .......................................................................................... C-1

    2 Semi-implicit Thermal-hydraulic Coupling. ............................................................................... C-4

    3 Kinetics Coupling ........................................................................................................................ C-7

    4 Control System Coupling .......................................................................................................... C-10

    v

  • vi

  • 1 Introduction

    The purpose of this report is to document the Application Programming Interface (API) of thePVMEXEC computer program. The PVMEXEC program facilitates the coupling of several differentsimulation codes for the unified analysis of a system. The current application of the PVMEXEC code is forthe simulation of nuclear reactor power plants. The PVMEXEC code is a general purpose code in the sensethat it can be used to couple any set of simulation codes for any purpose. Any code that implements thecoupling API can be used in a coupled simulation. The purpose of this report is to describe how a codemust be modified to allow it to be used in a coupled simulation being controlled by the PVMEXEC code.

    1.1 Background

    Several codes have been developed for the analysis of nuclear reactor power plants. These codesfocus on the simulation of the reactor core, the primary cooling system, and the secondary cooling systems.Other codes have been developed for the analysis of the containment systems or for the analysis of severeaccidents. These codes focus on the thermal-hydraulic behavior of the systems being simulated. Still othercodes have been developed for a detailed analysis of the neutronic behavior of the reactor code or of thepower plant control and safety systems. Depending on the primary focus of a system simulation code, e.g.,the thermal-hydraulic behavior of the system, it will usually have simple models for other aspects of thesimulation, i.e. point kineitcs for the kinetics, and trips and simple control models for the control and safetysystems.

    The PVMEXEC code and the coupling system that it implements was developed so that the mostappropriate simulation code can be used to model that part of the reactor system for which it was

    developed, e.g., a thermal-hydraulic code for the fluid behavior in the reactor core (such as COBRA1), adifferent thermal-hydraulics code to the simulation of the primary and secondary cooling systems [such as

    RELAP5-3D2, TRAC-PWR3, or TRACE(TRAC-M)4 ], a kinetics code for the simulation of the

    neutronic behavior of the reactor core (such as NESTLE5 or PARCS6), and a containment simulation code

    (such as CONTAIN7 or MELCOR8) for the simulation of the reactor containment and auxiliary systems.Each of the coupled codes needs data from the other codes in a coupled simulation. For example, the codeperforming the thermal hydraulic analysis of the reactor core needs to know the power generation rate inthe fuel rods in the core. This data is obtained from the reactor kinetics code. The kinetics code in turnneeds to know the state of the fluid in the core region of the reactor system. This data is obtained from thethermal-hydraulics code that is modeling the behavior of the coolant in the reactor core. These data areexchanged using a message passing system. If an analyst wishes to use a particular code as part of thecoupled simulation, it must be modified to implement the message passing system. This report describesthe functional requirements of the message passing (or coupling) interface. These requirements areembodied in the messages that are exchanged between the PVMEXEC program and the simulation codes.

    The Parallel Virtual Machine9 (PVM) software library is used to accomplish the physical transfer of databetween the PVMEXEC program and the simulation codes and between the simulation codes.

    1

  • 1.2 General Principles

    This section describes the general principles used in the design of the coupling system asimplemented by the PVMEXEC program. First, the coupling system as embodied by the PVMEXECprogram and the modified simulation codes is a batch simulation system. This means that once a coupledsimulation has been initiated, it should proceed to completion without user intervention, although userinteraction with the simulation codes is not precluded. The simulation is expected to terminate at the end ofthe simulation or fail gracefully if any of the simulation codes encounter difficulties from which it cannotrecover. Second, any message sent from or received by a simulation code must be acknowledged to thesender or receiver. This handshaking helps keep the simulation codes synchronized. Thirdly, each messagehas a wait time associated with it so that if a simulation code is waiting to receive a message, it will notwait indefinitely thereby never terminating gracefully. Finally, the data items (or macros that are expandedto a list of data items) that are to be exchanged between any two simulation codes are listed twice in theinput file of the PVMEXEC program, once in the specification of the message that sends the data items andonce in the specification of the message that is to be received. This is needed because a data itemrepresents data that is located in a single location in the complete system model but is represented (stored