CN108846059B - OpenFOAM finite volume analysis result data format for result post-processing and conversion method thereof - Google Patents

OpenFOAM finite volume analysis result data format for result post-processing and conversion method thereof Download PDF

Info

Publication number
CN108846059B
CN108846059B CN201810558704.9A CN201810558704A CN108846059B CN 108846059 B CN108846059 B CN 108846059B CN 201810558704 A CN201810558704 A CN 201810558704A CN 108846059 B CN108846059 B CN 108846059B
Authority
CN
China
Prior art keywords
file
openfoam
data
result data
format
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810558704.9A
Other languages
Chinese (zh)
Other versions
CN108846059A (en
Inventor
任羿
夏权
孙博
杨德真
冯强
王自力
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beihang University
Original Assignee
Beihang University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beihang University filed Critical Beihang University
Priority to CN201810558704.9A priority Critical patent/CN108846059B/en
Publication of CN108846059A publication Critical patent/CN108846059A/en
Application granted granted Critical
Publication of CN108846059B publication Critical patent/CN108846059B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • G06F30/23Design optimisation, verification or simulation using finite element methods [FEM] or finite difference methods [FDM]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2111/00Details relating to CAD techniques
    • G06F2111/10Numerical modelling

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Evolutionary Computation (AREA)
  • Geometry (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Document Processing Apparatus (AREA)
  • Stored Programmes (AREA)

Abstract

The invention relates to an OpenFOAM finite volume analysis result data format for result post-processing and a conversion method thereof, and the method comprises the following steps: finding an OpenFOAM grid file and a result data file; matching the grid file and the expression containing the data information in the result data file through the regular expression; establishing and completing the mapping relation among all data files; defining a data storage form, namely the grammar, the semantics and the format of an XML file; and generating and exporting a data file containing mapping relation according to the XML file format. The invention provides a regular expression and a grammar in an XML format, realizes the automatic conversion from an OpenFOAM result data file to the XML format, and provides an interface file for post-processing and secondary development of OpenFOAM simulation calculation results. The file structure is clear and visual, reading is convenient, and data is extracted and transmitted.

Description

OpenFOAM finite volume analysis result data format for result post-processing and conversion method thereof
Technical Field
The invention relates to a Finite Volume Method (Finite Volume Method) analysis result post-processing data conversion Method, in particular to a Method for converting Finite Volume Method post-processing dataOpenFOAM finite volume analysis result data format for result post-processing and conversion method thereof
Background
OpenFOAM is an open source object-oriented Computational Fluid Dynamics (CFD) class library, similar to the commercial CFD software Fluent, ANSYS CFX. However, the business software is closed, so that the user cannot deeply understand the algorithm and the flow and customize the function according to the needs of the user. In this respect, OpenFOAM not only has the computing power of commercial software, but also has strong openness and flexibility, and its code is completely open, and a user can set any parameters such as grid division, a computing model, a solver, parallel computation and the like according to requirements and perform numerical simulation. In addition, the use of OpenFOAM does not require the payment of high fees as with commercial software.
However, the OpenFOAM post-processing section is relatively weak. If a user needs to perform post-processing on the calculation result of OpenFOAM, or extract required result data from the calculation result for secondary calculation and analysis, or needs to perform secondary development based on OpenFOAM, the result file must be manually screened, because OpenFOAM generates a large number of result data files and has relevance, for example: the grid file needs to be comprehensively determined by a plurality of files, so that the grid file is inconvenient for a user to read, extract and transfer data, and needs to spend a great deal of time and energy; or the results are also manually processed by other third-party software, the software mainly used for post-processing the OpenFOAM numerical calculation results at present is Paraview, Tecplot and the like, the deep customization work cannot be completed, and a large amount of interactive program operation needs to be completed by programmers. In view of this, it is necessary to provide an OpenFOAM simulation result data format and a conversion method, which are convenient for a user to read, extract and transfer data.
Disclosure of Invention
The invention aims to provide an OpenFOAM simulation result data format and a conversion method which are convenient for a user to read, extract and transfer data. The method provides a grammar in an XML format, realizes the conversion from the OpenFOAM result data file to the XML format, and provides an interface file for the post-processing and secondary development of the OpenFOAM simulation calculation result.
In order to achieve the above object, the present invention provides an OpenFOAM finite volume analysis result data format for result post-processing and a conversion method thereof, wherein the conversion method can be automatically completed by a computer through programming, and mainly comprises the following steps:
the first step is as follows: setting an OpenFOAM engineering path, and finding an OpenFOAM grid file and a result data file;
the second step is that: matching the OpenFOAM grid file and the result data file to an expression containing data information through a regular expression;
the third step: by analyzing the correlation between the OpenFOAM grid file and the result data file, establishing a mapping relation between the OpenFOAM grid file and the result data file, and completing the establishment of all data mapping relations;
the fourth step: defining the grammar, the semantics and the format of the XML file;
the fifth step: and writing all the data establishing the mapping relation into an XML format file according to the defined XML file grammar and format, and exporting.
In the second step, the regular expression is also called regular expression, and the code is often abbreviated as regex, regexp or RE, which is a logic formula for operating character strings and special characters, i.e. a 'regular character string' is formed by using some specific characters defined in advance and the combination of the specific characters, and is used for expressing a filtering logic for the character strings. Where a regular table is typically used to retrieve, replace, etc. text that conforms to a certain pattern or rule. In the second step, a 'rule character string' is defined according to the mesh of OpenFOAM and the format of a result data file, and data information required by a user contained in the file is screened and found through regular matching.
In the third step, the OpenFOAM mesh file and the result data file are usually stored in a plurality of files, respectively, and establishing the mapping relationship means finding associated data in the plurality of files and storing the associated data as a set. For example: and establishing a mapping relation of grid body units, surface units, point coordinates and result data, and collecting the body units which are originally and separately stored, the corresponding surface units, the point coordinates and the result data.
In the fourth step, XML refers to extensible markup language, which can be used to mark data, define data types, and allow users to define their own source language for markup language. The data information containing the mapping relation is stored by customizing the grammar, the semantics and the format of the XML file, so that the data extraction and transmission are convenient.
Through the steps, the invention provides a data format and a conversion method thereof for OpenFOAM result post-processing, and also provides an interface file and grammar corresponding to the OpenFOAM thermal analysis result.
The main advantages of the invention are: the data storage file in the XML format is provided for post-processing, secondary calculation and analysis of data of the OpenFOAM numerical simulation result, the file structure is clear and visual, reading by a user can be facilitated, all grid information in the model and result data corresponding to the grids are contained, and data extraction and transmission are facilitated. The user can quickly extract the data in the file for secondary calculation and analysis as required. Meanwhile, the result data XML format file can also be used as an interface file for OpenFOAM secondary development.
Drawings
FIG. 1A flow of a result post-processing-oriented OpenFOAM finite volume analysis result data format conversion method
FIG. 2 is a graph of mesh-surface-point-result data mapping
FIG. 3 is a flow chart of establishing data mapping relationships
Detailed Description
For a better understanding of the features and advantages of the present invention, reference is made to the following detailed description taken in conjunction with the accompanying drawings in which: FIG. 1 depicts the flow of the method.
After completing heat transfer numerical simulation based on OpenFOAM, a user needs to extract a mesh file of a model and a corresponding temperature value for post-processing, or for secondary calculation and analysis, or for secondary development, the invention provides a data format for OpenFOAM result post-processing and a conversion method thereof, which comprises the following specific implementation steps:
the first step is as follows: and finding out a grid file and a result data file of the model after the heat transfer numerical simulation is completed according to the installation path and the heat transfer numerical simulation engineering path of the OpenFOAM.
The second step is that: summarizing the formats of the mesh file and the end data file after the OpenFOAM heat transfer numerical simulation is completed, wherein the general format is as follows:
Figure GDA0003148596790000031
the mesh file and the heat transfer numerical simulation result file only differ in character strings, and data information contained in the OpenFOAM mesh file and the result data file is found and extracted in a matching way through corresponding regular expressions, wherein the regular expressions are as follows:
\n\s+version\s+\d+.\d+;
\n\s+format\s+.{1,20}
\n\s+class\s+.{1,20}
\n\s+location\s+.{1,100}
\n\s+object\s+.{1,20}
\d+\n\(
\n\)
the third step: to establish a mapping relationship between grid body units, surface units, point coordinates and temperature values of a model in a heat transfer numerical simulation, data in files cellZones, owner, neighbor, faces, points and T in an OpenFOAM calculation result needs to be extracted, the mapping relationship between the files is shown in FIG. 2, wherein the meaning of a solid line is a source of data information, and the implementation with double arrows indicates the mapping relationship between the body units, the surface units, the point numbers, the point coordinates and result data (temperature values).
Classifying and collecting the data information extracted in the second step according to the established mapping relation, and completing the establishment of all data mapping relations, wherein the flow is shown in fig. 3, i is a number, the numbering rule starts from 0, the mapping relations of grid body units, surface units, point coordinates and result data (temperature values) are established in sequence, and the maximum number is the sum of the number of units minus one.
The fourth step: defining the syntax, semantics and format of the XML file according to the mesh, calculation result data and kind obtained by the heat transfer numerical simulation, as follows:
Figure GDA0003148596790000041
Figure GDA0003148596790000051
the fifth step: writing a code program according to the flow method, writing all the data sets establishing the mapping relationship into XML format files according to the XML file grammar and format defined in the fourth step, and exporting.
The data format and the conversion method thereof for OpenFOAM result post-processing provide a data interface file in an XML format for the use of numerical simulation result data in post-processing, secondary calculation and analysis and secondary development, and the file structure is clear and intuitive, is convenient to read and is convenient for data extraction and transmission.

Claims (1)

1. A result post-processing-oriented OpenFOAM finite volume analysis result data format and a conversion method thereof are characterized in that: it comprises the following steps and features:
the first step is as follows: setting an OpenFOAM engineering path, and finding an OpenFOAM grid file and a result data file;
the second step is that: matching the OpenFOAM grid file and the result data file to an expression containing data information through a regular expression; the method specifically comprises the following steps: summarizing the formats of the mesh files and result data files after the OpenFOAM heat transfer numerical simulation is completed, and matching and extracting the data information contained in the OpenFOAM mesh files and the result data files through corresponding regular expressions;
the third step: by analyzing the correlation between the OpenFOAM grid file and the result data file, establishing a mapping relation between the OpenFOAM grid file and the result data file, and completing the establishment of all data mapping relations; the method specifically comprises the following steps: by analyzing the correlation between the OpenFOAM grid file and the result data file, establishing a mapping relation between the OpenFOAM grid file and the result data file, and completing the establishment of all data mapping relations; extracting data in files of cellZones, owner, neighbor, faces, points and T in OpenFOAM calculation results, sequentially establishing a mapping relation of grid body units, surface units, point coordinates and result data in heat transfer numerical simulation, and collecting all originally independently stored body units, corresponding surface units, point coordinates and result data;
the fourth step: defining the grammar, the semantics and the format of the XML file; the method specifically comprises the following steps: the data information containing the mapping relation is stored by customizing the grammar, the semantics and the format of the XML file, so that the data extraction and transmission are facilitated; defining the grammar, semantics and format of the XML file according to the grids obtained by the heat transfer numerical simulation, the calculation result data and the types;
the fifth step: writing all the data establishing mapping relation into XML format file according to the defined XML file grammar and format and exporting:
through the steps, a data format and a conversion method thereof for OpenFOAM result post-processing are provided.
CN201810558704.9A 2018-06-01 2018-06-01 OpenFOAM finite volume analysis result data format for result post-processing and conversion method thereof Active CN108846059B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810558704.9A CN108846059B (en) 2018-06-01 2018-06-01 OpenFOAM finite volume analysis result data format for result post-processing and conversion method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810558704.9A CN108846059B (en) 2018-06-01 2018-06-01 OpenFOAM finite volume analysis result data format for result post-processing and conversion method thereof

Publications (2)

Publication Number Publication Date
CN108846059A CN108846059A (en) 2018-11-20
CN108846059B true CN108846059B (en) 2022-04-05

Family

ID=64210199

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810558704.9A Active CN108846059B (en) 2018-06-01 2018-06-01 OpenFOAM finite volume analysis result data format for result post-processing and conversion method thereof

Country Status (1)

Country Link
CN (1) CN108846059B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113609556B (en) * 2021-07-20 2023-09-08 国网河北省电力有限公司雄安新区供电公司 GIM format and XDB format lossless conversion method based on C#
CN115618653B (en) * 2022-11-30 2023-04-07 北京云庐科技有限公司 Method, server and program product for post-processing of simulation calculation results of CAE software

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0890154A1 (en) * 1996-03-25 1999-01-13 Rolf Wadewitz Data-conversion method
CN101055578A (en) * 2006-04-12 2007-10-17 龙搜(北京)科技有限公司 File content dredger based on rule
CN104636566A (en) * 2015-03-13 2015-05-20 中国矿业大学 Dynamic mesh numerical solution method based on modified fluid motion equation
CN106294606A (en) * 2016-07-29 2017-01-04 北京蓝威技术有限公司 A kind of CAE document conversion method based on general read-write framework and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0890154A1 (en) * 1996-03-25 1999-01-13 Rolf Wadewitz Data-conversion method
CN101055578A (en) * 2006-04-12 2007-10-17 龙搜(北京)科技有限公司 File content dredger based on rule
CN101361063A (en) * 2006-04-12 2009-02-04 龙搜(北京)科技有限公司 System and method supporting document content mining based on rules
CN104636566A (en) * 2015-03-13 2015-05-20 中国矿业大学 Dynamic mesh numerical solution method based on modified fluid motion equation
CN106294606A (en) * 2016-07-29 2017-01-04 北京蓝威技术有限公司 A kind of CAE document conversion method based on general read-write framework and device

Also Published As

Publication number Publication date
CN108846059A (en) 2018-11-20

Similar Documents

Publication Publication Date Title
CN104268428B (en) A kind of visual configuration method calculated for index
CN109582647B (en) Unstructured evidence file oriented analysis method and system
CN102693317B (en) Method and device for data mining process generating
CN102103605B (en) Method and system for intelligently extracting document structure
EP2629210A1 (en) Method of providing data included in building information modeling data file, computer readable medium therefor, system using the method, and method of providing data using building information modeling server
CN108984155B (en) Data processing flow setting method and device
KR20130111211A (en) Generating text manipulation programs using input-output examples
US20140214399A1 (en) Translating natural language descriptions to programs in a domain-specific language for spreadsheets
CN103810152A (en) Visualized formula editor
US20070282866A1 (en) Application integration using xml
CN108846059B (en) OpenFOAM finite volume analysis result data format for result post-processing and conversion method thereof
CN112905624B (en) Database extension method and device of low-code development platform
CN106528896A (en) Database optimization method and apparatus
CN108446398A (en) A kind of generation method and device of database
CN109325217B (en) File conversion method, system, device and computer readable storage medium
Lyu et al. CRUD-RAG: A comprehensive chinese benchmark for retrieval-augmented generation of large language models
CN111831624A (en) Data table creating method and device, computer equipment and storage medium
CN114611714B (en) Model processing method, device, system, electronic equipment and storage medium
CN116400910A (en) Code performance optimization method based on API substitution
CN115758018A (en) Grid-based page layout method and device, computer equipment and storage medium
CN111027247B (en) Stepwise incremental dynamic analysis and data processing method based on OpenSees and MATLAB
JP7331384B2 (en) Information processing device and program
CN109828775B (en) WEB management system and method for multilingual translation text content
CN108182189B (en) Material table file generation method and device
WO2020048416A1 (en) Graphic processing method and device for domain-specific language (dsl)

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant