260 likes | 404 Views
Doug Barber Lance Larsen Information Systems Laboratories, Inc. RELAP5-3D Fluid Properties Modifications. Information Systems Laboratories, Inc. Outline. Changes to Fluid Property Files Inclusion of Transport Properties XDR Format Description of Property Bug Fixes
E N D
Doug Barber Lance Larsen Information Systems Laboratories, Inc. RELAP5-3D Fluid Properties Modifications Information Systems Laboratories, Inc.
Outline • Changes to Fluid Property Files • Inclusion of Transport Properties • XDR Format • Description of Property Bug Fixes • New Time Step Logging Feature 2011 RELAP5 International User’s Group Seminar and Meeting
TPF File Format Updated TPF file format in RELAP5-3D has been modified in two distinct ways: • TPF files are stored as platform independent binary files in eXternal Data Representation (XDR) format. • All TPF files will include thermodynamic properties, transport properties, and surface tension. 2011 RELAP5 International User’s Group Seminar and Meeting
Transport Property Modification TPFs (Thermodynamic Properties Files) store the fluid properties for fluids supported by RELAP5-3D. • Old TPFs included thermodynamic properties, but equations for transport properties and surface tension were computed by RELAP5-3D during the steady-state or transient event. • New TPFs include thermodynamic properties, transport properties and surface tension in the TPF file. • Transport properties are now obtained via interpolation of table values, similar to thermodynamic properties. 2011 RELAP5 International User’s Group Seminar and Meeting
Transport Property Modification The code to calculate transport properties and surface tension was retained, and is used to calculate these properties by default for older fluids. To enable interpolation of these properties based on values in the TPF file for all fluids, card 1 option 46 will be available. 2011 RELAP5 International User’s Group Seminar and Meeting
Transport Property Modification The property generators can now create gnuplot scripts for plotting properties. A pdf containing the plots for most fluids supported by RELAP5-3D is included with this presentation. 2011 RELAP5 International User’s Group Seminar and Meeting
Transport Mods Assessment • The modification of the TPF files to include transport properties was fully assessed using the Developmental Assessment test cases. • Most cases showed negligible differences. • Results from three cases shown here • Water Over Steam 3D (Phenomenological) • Edward’s Pipe (Separate Effects) • LOBI A1-04R (Integral Effects) • The Edward’s Pipe model was also adapted for several different fluids and comparisons were made to previous results • The comparison for each fluid was nearly identical 2011 RELAP5 International User’s Group Seminar and Meeting
Transport Mods Assessment • Water Over Steam 3D 2011 RELAP5 International User’s Group Seminar and Meeting
Transport Mods Assessment • Edward’s Pipe 2011 RELAP5 International User’s Group Seminar and Meeting
Transport Mods Assessment • LOBI A1-04R 2011 RELAP5 International User’s Group Seminar and Meeting
Transport Mods Assessment • Since the new transport property interpolation scheme can lead to differences in results for the updated fluids, it was decided that the R5 user would be given the option of using the R5 built-in transport properties subroutines, or interpolation of transport properties. • By default, the built-in subroutines are used. If card 1 option 46 is included, then transport properties are interpolated based on values in the TPF file. • After a period of further testing and evaluation, the new interpolation scheme should be made permanent. 2011 RELAP5 International User’s Group Seminar and Meeting
Bug Fix – Transport Properties • Viscosity and thermal conductivity are primarily functions of the fluid temperature below the critical point. In RELAP5-3D, superheated fluids showed strong pressure dependence. The code was changed to correct this. • The transport properties bug fix applies to volumes with the following conditions: • The volume contains no noncondensibles. • The fluid in the volume is superheated liquid. • This issue may also exist with subcooled vapor, but no input models have yet to demonstrate a problem. • The fix ensures that the transport properties are being computed based on the current fluid temperature. 2011 RELAP5 International User’s Group Seminar and Meeting
Bug Fix – Transport Properties Edward’s Pipe Oscillating Pressure Constant Temperature Therm. Cond. Before and After Bugfix 2011 RELAP5 International User’s Group Seminar and Meeting
Bug Fix – Property Index Errors In this Edward’s pipe simulation, the base code (without index fixes) becomes unstable and fails, while the code with indexes fixed runs to completion. 2011 RELAP5 International User’s Group Seminar and Meeting During debugging some property index errors were discovered in the interpolator for fluids with transport properties. These caused instabilities in some cases.
XDR-Formatted TPF • RELAP5 T/H properties traditionally stored in unformatted binary files • Unable to port property files across different platforms • Big Endian to/from Little Endian • 32-bit to/from 64-bit • Purpose to Produce Platform-Independent Binary (PIB) • eXternal Data Representation (XDR) format • Modify existing PIB library used for plot files • Modifications made to property generators for all fluids • Work based on a modified version of 3.0.0b • Includes transport property modifications 2011 RELAP5 International User’s Group Seminar and Meeting
TPF/XDR: Code Modifications • PIB Library • PibTool from APT, Inc. was utilized • XML definition file used to define three record types • tpfhdr: writes TPF title information • tpfi4: writes 32-bit integer data (i.e. table sizes & indices) • tpfr8: writes 64-bit real data (i.e. table values) • PibTool generated Fortran & c code added to the PIB library • tFileAccessM.f90, tpfhdrM.f90, tpfi4M.f90, tpfr8M.f90 • t.c & t.h 2011 RELAP5 International User’s Group Seminar and Meeting
TPF/XDR : Code Modifications (cont’d) • Fluid Property Generators • New module, tpfmod.f90, added to each fluid property generator • tpfOpen(): Opens the XDR-formatted TPF file for writing • tpfWriteHdr(): Writes the title information to TPF file • tpfWriteStcom(): Writes table integer data to TPF file • tpfWriteTable(): Writes steam table data to TPF file • Data written in same order as previously • New logic activated with “tpfxdr” pre-processor define • tableshandler.f90 (previously gentpf.f90) modified • sta2b.f90 modified for co2, h2o95, h2on, hen, henxen, r134an, xen 2011 RELAP5 International User’s Group Seminar and Meeting
TPF/XDR : Code Modifications (cont’d) • RELAP5 Source • New module, tpfmod.f90, added to each fluid property generator • tpfOpen(): Opens the XDR-formatted TPF file for reading • tpfReadHdr(): Reads the title information from TPF file • tpfReadStcom(): Reads table integer data from TPF file • tpfReadTable(): Reads steam table data from TPF file • New subroutine, streadxdr.F • Based on stread.F • Driver for reading XDR-formatted TPF files • Called from icmpn1.F • New logic activated with “tpfxdr” pre-processor define 2011 RELAP5 International User’s Group Seminar and Meeting
TPF/XDR : Code Modifications (cont’d) • Modifications to Plot File Routines • Conflict when using PIB library for both plot & TPF files • Can’t have both open at same time • Move logic for opening/initializing plot file to a subroutine called after TPF files have been processed • Logic from rrstd.F and rrestf.F was collected into new subroutine, iplot.F. • iplot.F called from rnewp.F after the XDR-formatted TPF files are read into memory. • Modules & subroutines impacted: • cctlmod.F, gnrlmod.F, plotmod.F • rnewp.F, rrestf.F, rrstd.F, rstrec.F, stripplot.F 2011 RELAP5 International User’s Group Seminar and Meeting
TPF/XDR : Code Verification • Athena test suite was utilized for verification testing • Modified suite to include cases to give full coverage • Each fluid type is tested • Two sets of comparisons • Big Endian vs. Little Endian • 32-bit vs. 64-bit • Big Endian vs. Little Endian • TPF files generated on Mac Mini, PowerPC (big endian) • TPF files read on WindowsXP, Intel (little endian) • Comparison of output files showed minor differences • Differences attributed to numerical differences in compilers used to build property generators 2011 RELAP5 International User’s Group Seminar and Meeting
TPF/XDR : Code Verification (cont’d) • 32-bit vs. 64-bit • Variation 1 • TPF files generated on 32-bit Linux, IFC 11.1 • TPF files read on 64-bit Linux RELAP5-3D executable • Variation 2 • TPF files generated on 64-bit Linux, IFC 11.1 • TPF files read on 32-bit Linux RELAP5-3D executable • Comparison of output files showed minor differences • Round-off errors were negigible • Attributed to numerical differences between 32-bit and 64-bit property generators 2011 RELAP5 International User’s Group Seminar and Meeting
TPF/XDR : Summary • Fluid property generators now produce PIB property files in XDR format • Changes made to PIB library, property generators, and RELAP source • Addressed conflict with XDR-formatted plot files • New logic is activated with “tpfxdr” preprocessor define • Changes made to modified version of 3.0.0b • Includes transport property modifications • Platform testing was performed for verification • All fluids were tested with a modified Athena test suite • Big/Little Endian comparison showed negligible diff. • 32/64-bit comparison showed negligible diff. 2011 RELAP5 International User’s Group Seminar and Meeting
Time Step Reason Logging 2011 RELAP5 International User’s Group Seminar and Meeting Some system models may have deficiencies that lead to the following issues: • Slow execution due to time step size reduction. • Excessive mass error that can reduce the time step size and impact accuracy. Often such problems can be isolated to specific parts of the model, which can be modified to improve performance or accuracy. Time step reason logging assists modelers in understanding and fixing the root cause of a models poor performance.
The Log Files 2011 RELAP5 International User’s Group Seminar and Meeting Time step logging is enabled using card 1 option 59. Two log files are generated: • dtReasonLogSummary.csv – A log file that summarizes time step reduction reasons. • dtLogReasonDetails.txt – A detailed log of time step reduction reasons with context information. The summary log can be examined in a text editor, or in a spreadsheet application such as excel or openoffice calc.
The Details Log Files 2011 RELAP5 International User’s Group Seminar and Meeting The detailed log file (dtLogReasonDetails.txt) is formatted as YAML. This is a structured file format like XML. However it is designed to be: • Human readable (in a text editor) and easy to interpret. • Structured so that it is parse-able via scripts. YAML parsers exist for many programming languages (c, c++, java, PERL, Python, etc.). Because YAML has parsers readily available, it is relatively easy to write scripts that extract specific information that is of interest.
The Details Log Files 2011 RELAP5 International User’s Group Seminar and Meeting For each time step where the time step size was reduced, the following information is given in the detailed log file: • CPU time, simulation time, time step size • The courant limit with the volume number where this occurred as well as the void fraction and pressure. • A list of ALL the specific reasons that a time step reduction occurred (there can be several) along with context information for the specific logic performed that triggered a time step reduction. • The volumeand junction state at the location where the time step reduction was triggered.