Modeling method of importing COMSOL flow field information into PFC3D

The method of importing COMSOL flow field information into PFC3D addresses the challenge of complex seepage field modeling in PFC3D, enabling accurate simulations of deformation and damage in geological bodies by leveraging COMSOL's pre-modeling functions and Matlab conversion.

CN114638176BActive Publication Date: 2024-12-10XIAN UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210289674.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-23
Publication Date
2024-12-10
Estimated Expiration
2042-03-23

AI Technical Summary

Technical Problem

The difficulty in constructing complex flow field models and accurately calculating seepage fields using PFC3D's built-in particle fluid calculation module, which lacks a visual seepage field model establishment function, hinders the simulation of deformation and damage in geological rock and soil bodies under hydraulic action.

Method used

A method to import COMSOL flow field information into PFC3D by establishing a seepage field model in COMSOL, exporting model files, converting them using Matlab, and importing the results into PFC3D through CFD module commands, enabling particle fluid-solid coupling deformation calculations.

Benefits of technology

Enables efficient conversion of COMSOL seepage field models into PFC3D, facilitating accurate simulation of complex seepage problems in water conservancy projects, combining the strengths of both software for improved deformation and damage simulations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114638176B_ABST
    Figure CN114638176B_ABST
Patent Text Reader

Abstract

The present invention discloses a modeling method for importing COMSOL flow field information into PFC3D, specifically according to the following steps: step 1, establishing a corresponding three-dimensional seepage field geometric model in COMSOL according to requirements, and completing the calculation of the seepage field; step 2, exporting the model file and the velocity field calculation result file in COMSOL; step 3, using Matlab to convert the network model information of the COMSOL seepage field and the seepage field calculation result according to the format required by PFC3D; step 4, importing the model information and the seepage field calculation result through the CFD module command of PFC3D, that is, forming a seepage field model that can calculate the particle fluid-solid coupling deformation in PFC3D. The present invention realizes the perfect combination of the COMSOL seepage simulation advantage and the PFC3D discrete particle deformation calculation advantage, and provides a clear and reasonable modeling method for the simulation of discrete particle fluid-solid coupling problems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of hydraulic engineering modeling methods, and in particular relates to a modeling method for importing COMSOL flow field information into PFC3D. Background Art

[0002] There are a lot of deformation and damage problems of geological rock and soil bodies under hydraulic action in water conservancy projects, such as ground collapse under pipeline leakage, embankment piping damage and earth-rock dam seepage damage, etc. The core problem is the coupled deformation mechanism of rock and soil particles under the action of seepage field. The establishment of a reasonable connection between finite element seepage calculation and discrete unit particle motion calculation provides an important simulation idea for the study of such problems.

[0003] At present, although the mainstream discrete element calculation software PFC3D has a built-in particle fluid calculation module, it is often difficult to construct complex flow field models through its own Fish language. It lacks a visual seepage field model establishment function, and its calculation of complex seepage fields is not accurate enough. Therefore, it is a convenient and feasible simulation method to use other fluid calculation software to construct and calculate the seepage field model, and import the model information and calculation results (velocity field or pressure field) into PFC3D.

[0004] The COMSOL fluid calculation module can calculate various seepage models such as free and porous media seepage and pipe flow, and can be used to calculate various engineering seepage problems in water conservancy projects. How to quickly and conveniently convert the nodes, unit information, and velocity field information of the seepage field model constructed by COMSOL into model information that can be input and read by PFC3D has become a key issue that needs to be solved in the coupling calculation of COMSOL and PFC3D. Summary of the invention

[0005] The purpose of the present invention is to provide a modeling method for importing COMSOL flow field information into PFC3D, thereby solving the problem that it is difficult to import an external seepage field model when the existing PFC3D performs seepage deformation calculations on rock and soil particles.

[0006] The technical solution adopted by the present invention is to import the COMSOL flow field information into the PFC3D modeling method, specifically according to the following steps:

[0007] Step 1: Establish a corresponding three-dimensional seepage field geometric model in COMSOL according to requirements and complete the calculation of the seepage field;

[0008] Step 2, export the model file and velocity field calculation result file in COMSOL;

[0009] Step 3, using Matlab to convert the network model information of the COMSOL seepage field and the calculation results of the seepage field into the format required by PFC3D;

[0010] Step 4: Import the model information and seepage field calculation results through the CFD module command of PFC3D, so as to form a seepage field model that can calculate the particle fluid-solid coupling deformation in PFC3D.

[0011] The technical feature of the present invention is that:

[0012] Step 1 is as follows: set the corresponding boundary conditions according to the calculation parameters, then select the meshing method according to the complexity of the model, select one of the tetrahedral or hexahedral units when meshing, and finally complete the seepage field calculation in COMSOL.

[0013] Step 2 is specifically as follows: using the mesh option in COMSOL to export the geometric model information file, and using the result option in COMSOL to export the velocity field calculation results at the Gaussian point.

[0014] The geometric model information file includes the mesh node and unit information of the model, and the velocity field calculation results include velocity vectors in the x, y, and z directions.

[0015] In step 3, when using Matlab to convert node information, first determine the number of nodes, then add the node number before the x, y, and z coordinate columns, and add the node number value to the new first row and first column position, and finally output the node information as a "node-pfc.txt" file.

[0016] In step 3, when using Matlab to convert unit information, for tetrahedral meshes, first clarify the number of units, add 4 new columns of floating-point values ​​after the 4 columns of unit numbers in each row, further add 1 to all unit number values, and then add a new row before each row of unit numbers, enter the tetrahedral unit identifier 6 in the first column of the row, and add another new row after each row of unit numbers, enter the unit number end value 0 in the first column of the row, and finally add the node number value in the first column and the second column of the new first row, and finally output the node information as an "element-pfc.txt" file.

[0017] In step 3, when using Matlab to convert unit information, for hexahedral meshes, first clarify the number of units, add 4 new columns of floating-point values ​​after the 8 columns of unit numbers in each row, further add 1 to all unit number values, and swap the 3rd and 4th columns of the unit number, and swap the 7th and 8th columns, then add a new row before each row of unit numbers, enter the tetrahedral unit identifier 8 in the first column of the row, and add another row after each row of unit numbers, enter the unit number end value 0 in the first column of the row, and finally add the node number value in the first column and the second column of the new first row, and finally output the node information as an "element-pfc.txt" file.

[0018] In step 3, when using Matlab to convert the velocity field results, keep the original x, y, and z direction velocity vector formats unchanged, add the unit number value to the new first row and first column position, and finally output the velocity field results as the "vol-pfc.txt" file.

[0019] In step 4, when importing the model information and seepage field calculation results into PFC3D, the command used to import the node information is "cfd read nodes node-pfc.txt", the command used to import the element information is "cfd read elementselement-pfc.txt", and the command used to import the velocity field calculation results is "cfd read velocity vol-pfc.txt".

[0020] The beneficial effects of the present invention are:

[0021] 1) The present invention uses COMSOL as the seepage field calculation software. Its efficient and mature pre-modeling function can better make up for the defect of using FISH language to build a complex seepage field model in PFC3D, and can automatically divide tetrahedral or hexahedral grids according to the requirements of the seepage model;

[0022] 2) The present invention uses COMSOL as the seepage field calculation software, which has built-in comprehensive seepage calculation modules such as free and porous medium seepage, pipeline fluid, two-phase flow, etc., which is convenient for simulating and calculating various complex seepage problems in water conservancy projects;

[0023] 3) The present invention utilizes Matlab program to realize efficient conversion of COMSOL seepage field calculation model files, and especially proposes a conversion method of tetrahedral and hexahedral mesh type files. This method solves the problem of difficulty in importing external seepage field models when PFC3D performs seepage deformation calculation of rock and soil particles, and realizes a perfect combination of the advantages of COMSOL seepage simulation and PFC3D discrete particle deformation calculation, providing a clear and reasonable modeling method for the simulation of discrete particle fluid-solid coupling problems. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 It is a flow chart of the modeling method of the present invention for importing COMSOL flow field information into PFC3D;

[0025] Figure 2 (a) is a tetrahedral unit seepage field model established by COMSOL in the present invention; Figure 2 (b) is the tetrahedral unit seepage field model node and unit file data format extracted from COMSOL in the present invention; Figure 2 (c) is a part of the Matlab program for information processing of the tetrahedron unit model in the present invention; Figure 2 (d) is the point cloud distribution of the tetrahedron unit model drawn by the Matlab program in the present invention; Figure 2 (e) is the node file data format of the converted tetrahedron unit model in the present invention; Figure 2 (f) is the tetrahedral unit seepage field model unit file data format extracted from COMSOL in the present invention; Figure 2 (g) is the process of converting the tetrahedral unit seepage field model unit file data format of COMSOL into the tetrahedral unit seepage field model unit file data format required by PFC3D in the present invention; Figure 2 (h) is the form of seepage velocity vector data in the tetrahedral unit seepage field model required by the converted PFC3D in the present invention; Figure 2 (i) is the display of the present invention importing the converted tetrahedron unit model file into PFC3D; Figure 2 (j) is the display of the present invention when the converted tetrahedral unit velocity field file is imported into PFC3D;

[0026] Figure 3 (a) is a hexahedral unit seepage field model established by COMSOL in the present invention; Figure 3 (b) is the hexahedral unit seepage field model node and unit file data format extracted from COMSOL in the present invention; Figure 3 (c) is a part of the Matlab program for information processing of the hexahedral unit model in the present invention; Figure 3 (d) is the point cloud distribution of the hexahedral unit model drawn by the Matlab program in the present invention; Figure 3 (e) is the converted hexahedral unit model node file data format of the present invention; Figure 3 (f) is the data form of the hexahedral unit seepage field model unit file extracted from COMSOL in the present invention; Figure 3 (g) is the hexahedral unit seepage field model unit file data format of COMSOL in the present invention converted into the hexahedral unit seepage field model unit file data format required by PFC3D; Figure 3(h) is the form of seepage velocity vector data in the hexahedral unit seepage field model required by the converted PFC3D in the present invention; Figure 3 (i) is the display of the present invention importing the converted hexahedral unit model file into PFC3D; Figure 3 (j) is the display of the present invention when the converted hexahedral unit velocity field file is imported into PFC3D. DETAILED DESCRIPTION

[0027] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments, but the present invention is not limited to the specific embodiments.

[0028] The present invention imports COMSOL flow field information into the modeling method of PFC3D, such as Figure 1 As shown, the specific implementation steps are as follows:

[0029] Step 1: Establish a corresponding three-dimensional seepage field geometric model in COMSOL according to requirements and complete the calculation of the seepage field;

[0030] Step 1 is as follows: set the corresponding boundary conditions according to the calculation parameters, then select the meshing method according to the complexity of the model, select one of the tetrahedral or hexahedral units when meshing, and finally complete the seepage field calculation in COMSOL.

[0031] Step 2, export the model file and velocity field calculation result file in COMSOL;

[0032] Step 2 is as follows: use the mesh option in COMSOL to export the geometry model information file (.mphtxt format), and use the result option in COMSOL to export the velocity field calculation results at the Gaussian point (.txt format);

[0033] The geometric model information file includes the mesh node and unit information of the model, and the velocity field calculation results include velocity vectors in the x, y, and z directions.

[0034] Step 3, using Matlab to convert the network model information of the COMSOL seepage field and the calculation results of the seepage field into the format required by PFC3D;

[0035] In step 3, when using Matlab to convert node information, first determine the number of nodes, then add the node number before the x, y, and z coordinate columns, and add the node number value to the first row and first column of the new column, and finally output the node information as a "node-pfc.txt" file;

[0036] In step 3, when using Matlab to convert unit information, for tetrahedral meshes, first clarify the number of units, add 4 columns of floating-point values ​​after the 4 columns of unit numbers in each row, further add 1 to all unit number values, then add a new row before each row of unit numbers, enter the tetrahedral unit identifier 6 in the first column of the row, and add another row after each row of unit numbers, enter the unit number end value 0 in the first column of the row, and finally add the node number value in the first column and the second column of the first row, and finally output the node information as an "element-pfc.txt" file;

[0037] In step 3, when using Matlab to convert unit information, for hexahedral meshes, first clarify the number of units, add 4 new columns of floating-point values ​​after the 8 columns of unit numbers in each row, further add 1 to all unit number values, and swap the 3rd and 4th columns of the unit numbers, and swap the 7th and 8th columns, then add a new row before each row of unit numbers, enter the tetrahedral unit identifier 8 in the first column of the row, and add another new row after each row of unit numbers, enter the unit number end value 0 in the first column of the row, and finally add the node number value in the first column of the new first row and the second column of the first row, and finally output the node information as an "element-pfc.txt" file;

[0038] In step 3, when using Matlab to convert the velocity field results, keep the original x, y, and z direction velocity vector formats unchanged, add the unit number value to the new first row and first column position, and finally output the velocity field results as the "vol-pfc.txt" file.

[0039] Step 4: Import the model information and seepage field calculation results through the CFD module command of PFC3D, so as to form a seepage field model that can calculate the particle fluid-solid coupling deformation in PFC3D.

[0040] When importing model information and seepage field calculation results into PFC3D, the command used to import node information is "cfdread nodes node-pfc.txt", the command used to import unit information is "cfd read elements element-pfc.txt", and the command used to import velocity field calculation results is "cfd read velocity vol-pfc.txt". Finally, the "Element CFD" view tool in PFC3D is used to display the imported seepage field model nodes, units, and velocity field information.

[0041] Example 1

[0042] A three-dimensional model of the soil around the pipeline leakage was established in COMSOL, and the meshing was completed. The mesh unit type is tetrahedron, such as Figure 2 (a) as shown;

[0043] The model node file is exported through the "Mesh" option in COMSOL. This file is a fixed output format of COMSOL. The number of nodes is 1785, located in the first column of the 15th row of the data file, and the node coordinates start from "5 0 0" in the 19th row. The number of the ending row is the number of the starting row plus the number of nodes minus 1, such as Figure 2 (b) as shown;

[0044] Using Matlab program Figure 2 The node file shown in (b) has been converted, mainly in the following aspects: adding node numbers before the three node coordinate columns x, y, and z, starting from 1 and ending at 1785 (number of nodes), and adding the node number value 1785 in the first column of the first row and the second column of the first row, and further drawing the node coordinates into a point cloud, as shown below: Figure 2 The point cloud shown in (d) is convenient for comparison with the model grid nodes. After confirmation, the output is as follows Figure 2 (e) shows the node information file, some of the procedures used are as follows Figure 2 (c) shown.

[0045] The model unit file is exported through the "Grid" option in COMSOL. This file is a fixed output format of COMSOL. The number of units is 8409, and the number of rows is the number of the end row of the node coordinate plus 10. The unit number is 4 columns, the starting row is "5 6 0 4", and the number of the end row is the number of the start row plus the number of units minus 1, such as Figure 2 (f) as shown;

[0046] Using Matlab program Figure 2 The unit file shown in (f) has been converted, mainly in the following aspects: adding 1 to the values ​​of the unit numbers in the four columns, and then adding four columns of floating-point data after the four columns of unit numbers, all of which are "0.0010040.0001428998.23 0.000118". Add unit indexes before the four columns of unit numbers, with index values ​​ranging from 1 to the number of units 8409. Then add the tetrahedral unit identifier 6 in the first column of each row before the unit number, and add the unit number end value 0 in the first column of each row after the unit number. Finally, add the unit number 8409 in the first and second columns of the first row. The final converted unit file format is as follows: Figure 2 (g);

[0047] The velocity field result file was modeled using the Matlab program. The main features are: based on the original velocity component data in the x, y, and z directions, the unit number 8409 was added to the first row and first column of the new file. The number of rows of velocity components in the three directions is consistent with the number of units, such as Figure 2 (h);

[0048] In PFC3D, the node information of the COMSOL seepage field model is imported through the "cfd read nodes node-pfc.txt" command, the unit information of the COMSOL seepage field model is imported through the "cfd read elements element-pfc.txt" command, and the velocity field results calculated by the COMSOL seepage field model are imported through the "cfd read velocity vol-pfc.txt" command. Finally, the following is obtained in PFC3D: Figure 2 (i) The model shown and Figure 2 From the velocity field distribution shown in (j), it can be seen that the model nodes and units shown in COMSOL and PFC3D in Example 1 are consistent, indicating that the import is successful.

[0049] Example 2

[0050] A three-dimensional model of seepage inside the pipeline was established in COMSOL, and the mesh generation was completed. The mesh unit type is hexahedron, such as Figure 3 (a) as shown;

[0051] The model node file is exported through the "Mesh" option in COMSOL. This file is a fixed output format of COMSOL. The number of nodes is 2613, which is also located in the first column of the 15th row of the data file. The node coordinates start from "2.28696640864375221 1.287200867824132" in the 19th row, and the number of ending rows is the number of starting rows plus the number of nodes minus 1, such as Figure 3 (b) as shown;

[0052] Using Matlab program Figure 3 The node file shown in (b) has been converted, mainly in the following aspects: adding node numbers before the three node coordinate columns x, y, and z, starting from 1 and ending at 2613 (number of nodes), and adding the node number value 2613 in the first column of the first row and the second column of the first row, and further drawing the node coordinates into a point cloud, as shown below: Figure 3 The point cloud shown in (d) is convenient for comparison with the model grid nodes. After confirmation, the output is as follows Figure 3 (e) shows the node information file, some of the procedures used are as follows Figure 3 (c) shown.

[0053] The model unit file is exported through the "Grid" option in COMSOL. This file is a fixed output format of COMSOL. The number of units is 2160, and the number of rows is the number of the end row of the node coordinate plus 10. The unit number is 8 columns, the starting row is "3 0 13 4 7 1 17 5", and the number of the end row is the number of the start row plus the number of units minus 1, such as Figure 3 (f) as shown;

[0054] Using Matlab program Figure 3 The unit file shown in (f) has been converted, mainly in the following aspects: first, the values ​​of the unit numbers in the eight columns are all increased by 1, and the 3rd and 4th columns of the unit numbers are swapped, and the 7th and 8th columns are swapped. Then, four columns of floating-point data are added after the eight columns of unit numbers, all of which are "0.001004 0.0001428998.23 0.000118". Unit indexes are added before the four columns of unit numbers, and the index values ​​range from 1 to the number of units 2160. Then, the hexahedral unit identifier 8 is added to the first column of the row before each row of unit numbers, and the unit number end value 0 is added to the first column of the row after each row of unit numbers. Finally, the unit number 2160 is added to the first and second columns of the first row. The final format of the converted unit file is as follows: Figure 3 (g);

[0055] The velocity field result file was modeled using the Matlab program. The main features are: based on the original velocity component data in the x, y, and z directions, the number of cells 2160 was added to the first row and first column of the new file. The number of rows of velocity components in the three directions is consistent with the number of cells, such as Figure 3 (h);

[0056] In PFC3D, the node information of the COMSOL seepage field model is imported through the "cfd read nodes node-pfc.txt" command, the unit information of the COMSOL seepage field model is imported through the "cfd read elements element-pfc.txt" command, and the velocity field results calculated by the COMSOL seepage field model are imported through the "cfd read velocity vol-pfc.txt" command. The following is obtained: Figure 3 (i) The model shown and Figure 3 From the velocity field distribution shown in (j), it can be seen that the model nodes and units shown in COMSOL and PFC3D in Example 2 are consistent, indicating that the import is successful.

Claims

1. Modeling method of importing COMSOL flow field information into PFC3D, It is characterized in that Follow the steps below to implement it: Step 1: Establish a corresponding three-dimensional seepage field geometric model in COMSOL according to requirements and complete the calculation of the seepage field; Step 2, export the model file and velocity field calculation result file in COMSOL; Step 3, using Matlab to convert the network model information of the COMSOL seepage field and the calculation results of the seepage field into the format required by PFC3D; Step 4, importing the model information and seepage field calculation results through the CFD module command of PFC3D, that is, forming a seepage field model that can calculate the particle fluid-solid coupling deformation in PFC3D; The step 1 specifically includes: setting corresponding boundary conditions according to calculation parameters, then selecting a meshing method according to the complexity of the model, selecting one of tetrahedral or hexahedral units during meshing, and finally completing the seepage field calculation in COMSOL; The step 2 specifically includes: using the mesh option in COMSOL to export the geometric model information file, and using the result option in COMSOL to export the velocity field calculation result at the Gauss point; The geometric model information file includes the mesh nodes and unit information of the model, and the velocity field calculation result includes velocity vectors in three directions: x, y, and z; In step 3, when converting node information using Matlab, first determine the number of nodes, then add the node number before the x, y, and z coordinate columns, and add the node number value to the first row and first column of the new column, and finally output the node information as a "node-pfc.txt" file; When using Matlab to convert unit information in step 3, for a tetrahedral mesh, first clarify the number of units, add 4 columns of floating-point values ​​after the 4 columns of unit numbers in each row, further add 1 to all unit number values, then add a new row before each row of unit numbers, enter the tetrahedral unit identifier 6 in the first column of the row, and add another new row after each row of unit numbers, enter the unit number end value 0 in the first column of the row, and finally add the node number value in the first column and the second column of the first row, and finally output the node information as an "element-pfc.txt" file; When using Matlab to convert unit information in step 3, for a hexahedral mesh, first clarify the number of units, add 4 new columns of floating-point values ​​after the 8 columns of unit numbers in each row, further add 1 to all unit number values, and swap the 3rd and 4th columns of the unit numbers, and swap the 7th and 8th columns, then add a new row before each row of unit numbers, enter the tetrahedral unit identifier 8 in the first column of the row, and add another new row after each row of unit numbers, enter the unit number end value 0 in the first column of the row, and finally add the node number value in the first column of the new first row and the second column of the first row, and finally output the node information as an "element-pfc.txt" file; In step 3, when using Matlab to convert the velocity field results, the original x, y, and z direction velocity vector formats are kept unchanged, and the unit number value is added to the new first row and first column position. The final velocity field result is output as a "vol-pfc.txt" file.

2. The modeling method of importing COMSOL flow field information into PFC3D according to claim 1, It is characterized in that In step 4, when the model information and the seepage field calculation results are imported into PFC3D, the command used to import the node information is "cfdread nodes node-pfc.txt", the command used to import the unit information is "cfd read elements element-pfc.txt", and the command used to import the velocity field calculation results is "cfd read velocity vol-pfc.txt".