【期刊信息】

Message

刊名:水动力学研究与进展
主办:中国船舶科学研究中心
ISSN:1001-6058
CN:31-1563/T
语言:中文
周期:双月刊
被引频次:9745
数据库收录:
CSCD中国科学引文库(2017-2018);期刊分类:水利建筑

现在的位置:主页 > 期刊导读 >

Navigable flow condition simulation based o(3)

来源:水动力学研究与进展 【在线投稿】 栏目:期刊导读 时间:2021-01-14

作者:网站采编

关键词:

【摘要】OpenMP is a shared memory programming model rather than an independent parallel language. It can be used in Fortran77/90/95 and C/C++. Guidance notes are added to the source code, and the compiler aut

OpenMP is a shared memory programming model rather than an independent parallel language. It can be used in Fortran77/90/95 and C/C++. Guidance notes are added to the source code, and the compiler automatically enables the program to be executed in parallel. Thus OpenMP has the advantages of simplicity, portability, and scalability. The execution model of OpenMP takes a fork-join form, where forks create a new thread or wake up existing threads and joins represent the merging of multiple threads. Initially,only the main thread is executed. This main thread enlists subthreads to perform tasks in parallel if it encounters a part of the code that allows parallel computing. After the parallel computing, the subthreads are blocked or terminated, and the model returns to the main thread.

Fig. 4 Flowchart of the numerical simulation in the model

2.2.2 Openmp parallel implementation

Because there is no correlation between the numerical calculations for each mesh unit in the same time step, the OpenMP parallel computing method can be used to implement parallel computation in the model. The calculation of different mesh units is allocated to different threads; i.e., the total mesh calculation is decomposed into several small groups,each group can be executed as one thread. Because all the threads can be run at the same time, this parallel architecture realizes considerable acceleration,reducing the total calculation time. The model was coded in Fortran, and the partial codes of the OpenMP parallel calculations are shown in Fig. 5.

In Fig. 5:

Fig. 5 Schematic diagram of partial OpenMP parallel computing codes in the model

(1) !$OMP is an OpenMP directive statement identifier.

(2) !$OMP PARALLEL and !$OMP END PARALLEL determine the parallel region, i.e., the part between these two statements is the parallel domain.

(3) NUM_THREADS (number) creates threads in the parallel domain. Generally, the number of threads that can be accommodated by the parallel domain is equal to the number of physical cores. For example, NUM_THREADS (8) calls eight threads.

(4) DEFAULT (PRIVATE) and SHARED (variables) define the variable properties in the parallel region. In a multithreaded environment, the variable properties can be shared or private. To ensure normal access to variables and the correctness of the model,the variable properties must be defined correctly, and this definition can significantly affect the acceleration of the model. In this paper, the definition of the variable properties in the parallel domain is divided into two steps. The first step uses DEFAULT(PRIVATE) to define all the variables in the parallel domain as private so that each thread has a private copy of the variable. The second step picks up variables that are accessible by all threads in a parallel computation and are not affected by the threads, and uses SHARED (variables) to define them as shared variables.

(5) !$OMP DO and !$OMP END DO are executable statements, i.e., the content within the DO loop is executed in a parallel computing method.

3. Navigable flow condition simulation

According to the upstream hydrological monito-ring data, the navigable flow condition simulation system should output real-time flow condition though the speed of the 2-D parallel model meets the system requirements, the computer performing the calculations should run at full load all the time. Considering that most of the flow discharge cases can be calculated in advance, a flow schemes database for flow simulation results is established to store simulation results for different flow flow scheme database uses an interpolation method to obtain the current flow field distribution according to the current inflow data and the inflow schemes in the database. Because the time required for interpolation is much less than the 2-D parallel model calculation time, the real-time performance of the water flow simulation is further improved.

The system first searches the simulation results in the flow scheme database according to the current inflow conditions, i.e., the discharge of upstream section and the water level of downstream section. If no result can be found in the database, the 2-D parallel model simulates the new flow scheme, and the result is added to the flow scheme database. Thus, the real-time simulation of water flow is ensured by the combination of the flow scheme database and the 2-D parallel model.

4. Results

4.1 Model verification

To test the accuracy of the hydrodynamic model,we compared three discharge levels with the corresponding measured water levels and velocity at nine different points (shown in Fig. 1). The verification results are presented in Table 1. In the table, QYangtzeis the inflow to the Yangtze River and QJialingis the inflow to the Jialing River. The three discharge levels represent small, medium, and large flow levels of the river reach. Table 1 indicates that the deviation in water depth is between -0.08 m and 0.08 m, the deviation in flow velocity is between -0.07 m/s and 0.06 m/s, and the relative deviation is between -3.2%and 4.3%. The simulation results are in good agreement with the measured data.


文章来源:《水动力学研究与进展》 网址: http://www.sdlxyjyjzzz.cn/qikandaodu/2021/0114/463.html


上一篇:“2018流固耦合力学在船舶与海洋新能源中的应
下一篇:Fundamental problems in hydrodynamics of el