The SNAME OpenCalc System

Transcription

The SNAME OpenCalc SystemStephen M. Hollister (M)New Wave Systems, Inc., Jamestown, Rhode IslandThe SNAME OpenCalc System is built upon an open source framework that allows for the creation of long-lastingand reusable calculations that can be combined in many ways to create completely new solutions by naval architects,not programmers. Flexible calculation tools are created by splitting traditional interactive program applications(“apps”) into three separately developed and tested objects: calculation engine (CE) batch programs, open sourceand industry standard (XML) data files, and open source user interface frameworks (UIF) that work with any CEwithout programming. A working prototype system has gone through two revisions and a third is now presented as aformal release. The SNAME OpenCalc System offers a new programming structure that returns creative control andflexibility to subject matter experts (SMEs) and users. It can create solutions not possible without access to all sourcecode and expensive custom programming. This is critically important in fields like naval architecture, where smallmarket size and demand have not created lasting, flexible, and cost-effective computer solutions and design tools.KEY WORDS: Programming; XML; CAD; design; calculations; optimization.NOMENCLATUREBatch Programs - Computer programs that do not have any userinterface. They can be run automatically.CAD - Computer Aided Design - General purpose interactiveprograms for geometry design of any object or structure.CE - Calc Engine - TSPA/OpenCalc component that isolatescalculations into separate batch programs.CFD - Computational Fluid Dynamics - A class of programs that usemeshes to perform detailed fluid flow calculations.Command File - A text batch or command file with commands that anoperating system understands and can perform. They are often calledBAT or COM files.CSV - Comma Separated Value File - A data file storage format usedby spreadsheets to transfer worksheet data to other applications.DLL - Dynamic Link Library - A method for combining separatelibrary routines with programs at run time.DOS - Disk Operating System - The operating system for IBM PCcompatible computers in the 1980s and 1990s.EXE - Executable File - A file type that defines a program that can belaunched by an operating system.FEM - Finite Element Method - A class of programs that use meshesto perform detailed structural stress, strain, and deformation analyses.GUI - Graphical User Interface - A front end to a program that offersusers interactive and graphical control, as in a CAD program.HTML - Hypertext Markup Language - Tag-based text filecommands and data for display of information on web pages.ISO - International Standards Organization - World-wideorganization that defines and promotes common standards for all.

SME - Subject Matter Expert - A person who has expertise in asubject like naval architecture, but limited expertise in computerscience.SVG - Scalable Vector Graphics - An XML standard for storingvector graphics geometry and display information.TSPA - Tri-Split Programming Architecture - Divides a programinto three separate parts: User Interface Frameworks, Calc Engines, andXML text file data for any variable or data structure. OpenCalc is builton this open architecture.UI - User Interface - Any interactive front end to a program that offersdirect user control.UIF - User Interface Framework - TSPA/OpenCalc component thatrefers to a user interface that can work with any calc engine.Spreadsheets are the main vehicle used in this work for UIFs.Unix - A multitasking, multiuser operating system developed in the1970s at Bell Labs.Unix Pipes and Filters - A technique for combining text files andbatch text processing programs in an automated process command file.VBA - Visual Basic for Applications - Programming language for theExcel spreadsheet.W3C - World Wide Web Consortium - The main internationalstandards organization for the World Wide Web.XML - Extensible Markup Language - An ISO standard for storingtagged data in text files. It also refers to the XML data portion ofTSPA/OpenCalc.INTRODUCTIONTime, changing technology, and a small market have resulted ina lack of marine design and analysis computer software fornaval architects, yacht designers, students, and hobbyists. TheSNAME OpenCalc System establishes a website, opentechnology, and a process within SNAME that will providemembers and others with a computer program design anddevelopment framework where everyone can offer pieces thatsupport compatible and flexible solutions for all areas of thedesign process. This system is more than just a way to collectand offer "lost" or basic design programs. It provides bothtechnical tools and organizational guidance that fix the issues oftime, technology, cost, and market, and is a scalable andagnostic framework that will help everyone from students tonaval architects to large shipbuilders.OpenCalc is not about completely free software, although itcomes seeded with a few reliable and validated calculationssuch as hydrostatics and stability. Instead, it is a free and openframework of tools for developing low cost, lasting, andcompatible calculations that can be combined by users to createnew solutions without programming. It can also be a valuabletool for independent software developers by lowering costs andincreasing market size. It is a simple process to isolatecalculations and insert them into one of the provided opensource programming templates for calculations (calc engines).OpenCalc provides all the file I/O routines.The key organizational glue to this system is the definition of asimple and flexible variable and geometry data file definition,especially for the conceptual and preliminary design stages.Development will be an ongoing process, but the integration ofcommon and lasting computer design and analysis programmingHollistertools from a community of independent participants rests on thistask. After more than 50 years of marine computingdevelopment, there is not even one common data definition forhull station offsets with open source I/O code that allowseveryone to easily work together to create compatible tools.The technological solution offered by this system is one thatseparates naval architecture programming knowledge from thecomplex and fast-changing world of writing modern graphicaluser interfaces (GUIs) - even spreadsheet programming. Toomany programs are lost, as in the change from DOS toWindows, or not even created because of time, cost, andexpertise. The framework provided by this SNAME systemoffers an easier way for naval architects to create their owncalculations in a general form that can be used for manypurposes. This is done using spreadsheets as the common, butnot only, User Interface Framework (UIF) interface forlaunching independent calc engines.Technology has changed over the decades to where PCs are nowmore than 10,000 times faster than the VAX 11/780 of 1978,and even the cheapest PC’s have 4 GB of memory and aterabyte of storage - and some PCs have 16 GB of fast memoryand a terabyte of SSD storage. Reading/writing from/to a file instorage has little delay. When a UIF front end transfers data to atext file and then launches an external calc engine, the delay isunnoticeable. It became apparent that there is no reason to bindcalculations and data processing routines to any user interface.There is also no reason for independent software developers todefine proprietary and binary data file definitions. They need tobe open and coordinated by industry groups to allow compatibletools to be developed by many users for all types and sizes ofvessels. The solution is not to separate and isolate all users intocompeting suites of computer programs, especially in thepreliminary design stage which requires much morecoordination and cooperation between independent navalarchitects, businesses, and approval organizations.OpenCalc defines and separates the role of subject experts tobetter match their importance in many smaller market segments.When subject experts become the customer in the developmentof large computer solutions, they end up losing a lot of controland flexibility. They become simple “users” of fixed solutions,not creators of new ones. TSPA/OpenCalc changes that.The OpenCalc initiative and process is a new and uniquesolution to difficulties in the programming world that hasenormous and far-reaching benefits for many industries. Byseparating the user interface from the calculations, one not onlyeliminates the cost and complexity of GUI programming, butopens up the possibility of creating and sharing complex usercreated combinations of calculations and optimizations. TheSNAME OpenCalc System provides open source spreadsheetcode that can launch any independent calc engine (or sequenceof calc engines) without writing custom or macro code. Thecalculations are completely separated from the spreadsheet andcan then be used for many other interactive or automated tasks.The SNAME OpenCalc System2

HISTORY OF OPENCALCThe SNAME OpenCalc System started in 2014 as "Project 114"to try to save or restructure old code for boat and ship design tocreate more compatible, flexible and lasting tools. This has beenan on-going problem since the beginning of the computerindustry. Mainframe computers gave way to minicomputers,workstations, and PCs, and operating systems changed fromDOS to Windows (and Apple OS to MacOS) to web-basedsystems. Each time, applications had to change and be rebuilt athigh cost. The maritime industry can’t support those changes.Calculations might stay the same, but the cost of rebuilding anew application with a new user interface was and is tooexpensive, thereby losing much good software. The author, forinstance, has old DOS-based code, such as a Wageningenpropeller optimization program and a Velocity PredictionProgram for sailboats, that never justified conversion toWindows-based user interfaces.Excel and other spreadsheet programs are not a full solutioneven if one imposes format and data standards. Calculations aremixed in directly with the user interface, difficult to change andtest, poorly supported, and cannot be easily used for otherpurposes. There is now a desire to be able to combine andsequence different calculations automatically to searchthousands or millions of iterations for an optimum solution.While it may be possible to write a custom program to do this,it’s extraordinarily expensive and one needs all the source code.For example, in a SNAME New England Section paper(Hollister 1996), this author combined hull variation,hydrostatics, and Holtrop resistance calculations into one DOSprogram to search for an optimum shape starting from a parenthull. This required all the source code and a custom userinterface front end that needed a lot of development and testing.That this could be done was of no real benefit since the marketwould not support the cost. Also, that was when DOS wasreplaced by Windows and the recoding cost was no longerviable for the new technology and size of market.Twenty years later, the author completed another attempt at thetask using the separate component framework of OpenCalc.That paper was presented at the 2016 SNAME MaritimeConvention in Seattle (Hollister 2016). Each calculation: hullvariation, hydrostatics, and Holtrop resistance became aseparately developed and tested stand-alone EXE batch (no userinterface) calc engine program that read and wrote a standardtext file of data using open source I/O code. These separateprograms were then “wrapped” in an automatic command fileand launched by the open source spreadsheet (UIF) that canexecute any separate calculation program or sequence ofprograms. The spreadsheet macro code launches thesecalculations automatically and produces displayed, printed, andplotted output with no extra programming. The spreadsheetlaunches the calc engines hidden in the background and itappears to the user that those calculations are done inside of thespreadsheet. There is no delay.HollisterWith OpenCalc, one can write and test a separate program (calcengine) for a set of calculations in any programming languagethat can have a long life and be used for many different and newsolutions by users, not programmers. In most cases, there is noneed to write a standard user interface because the open sourceExcel spreadsheet Visual Basic for Applications (VBA) codewill do the job. The calc engines can be located anywhere on theweb and be copy protected and fee-based if desired. SpreadsheetVBA code and formulas are difficult or impossible to hide orprotect, but calc engines offer a way to separate and protectproprietary methods.Several years ago, the author received a call from a navalarchitect who wrote hull generation code for the Pro/E CADprogram and wanted to automate the connection to a meshingprogram and then to a computational fluid dynamics (CFD)program in the hopes of searching for an optimal hull shape. Intheory, this is technically possible, but the custom programmingcost could not be justified even if one could get access to all thesource code or automated batch calculations. TSPA/OpenCalcnow makes that solution possible technically and financially.The designer would create a stand-alone calc engine of his hullshape generator and combine it with a meshing calc enginefollowed by a CFD calc engine. They could be launched by anopen source front end that searched for an optimal solution.OpenCalc is based on the idea that many interactive userinterfaces are standardized and can be written to work with anynumber of independent and automated batch calculationswithout writing any custom code. The user interface for thesequence of separate hull variation, hydrostatics, and Holtropresistance calculation engines was provided by an open sourceExcel front end that launched the three independent calculationprograms without having the source code or writing new code.This cannot be done in any way us

text file of data using open source I/O code. These separate programs were then “wrapped” in an automatic command file and launched by the open source spreadsheet (UIF) that can execute any separate calculation program or sequence of programs. The spreadsheet macro code launches these