New! View global litigation for patent families

CN103279645A - Carbon nano tube molecular dynamics simulation method based on GPU parallel computation - Google Patents

Carbon nano tube molecular dynamics simulation method based on GPU parallel computation Download PDF

Info

Publication number
CN103279645A
CN103279645A CN 201310154296 CN201310154296A CN103279645A CN 103279645 A CN103279645 A CN 103279645A CN 201310154296 CN201310154296 CN 201310154296 CN 201310154296 A CN201310154296 A CN 201310154296A CN 103279645 A CN103279645 A CN 103279645A
Authority
CN
Grant status
Application
Patent type
Prior art keywords
carbon
nano
molecules
simulation
computation
Prior art date
Application number
CN 201310154296
Other languages
Chinese (zh)
Other versions
CN103279645B (en )
Inventor
孟小华
郑冬琴
宁蓉
钟伟荣
Original Assignee
暨南大学
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

Links

Abstract

The invention discloses a carbon nano tube molecular dynamics simulation method based on GPU parallel computation. The method includes the following steps: (1) structuring a carbon nano tube system model composed of carbon nano tubes and C60 molecules through database files; (2) stressing the C60 molecules so that the C60 molecules can oscillate back and forth at an equilibrium position, wherein when the C60 molecules are in an equilibrium state, the positions and speeds of carbon particles on the walls of the carbon nano tubes and the positions and speeds of the C60 molecules are made to change; (3) dividing the carbon nano tubes into a plurality of layers of computing units on a CUDA platform, performing round robin computation by the utilization of a CPU traversal computing unit to obtain a parallel computation queue, and scheduling a stream processing unit of a GPU to perform parallel computation and processing; (4) executing the step (3) repeatedly, finally outputting the motion trajectory of the C60 molecules along with simulation time, drawing a curve chart of temperature change along with energy transmission in the carbon nano tubes, and completing the simulation process. The carbon nano tube molecular dynamics simulation method based on the GPU parallel computation promotes computing efficiency of molecular dynamics simulation.

Description

基于GPU并行运算的碳纳米管分子动力学仿真方法 Molecular dynamics simulation method of a carbon nanotube-based parallel computing GPU

技术领域 FIELD

[0001] 本发明涉及一种碳纳米管分析动力学仿真方法,尤其是一种基于GPU并行运算的碳纳米管分子动力学仿真方法,属于仿真技术领域。 [0001] The present invention relates to a carbon nanotube dynamics simulation analysis methods, especially based on carbon nanotubes GPU parallel computing molecular dynamics simulation method, simulation technical field belongs.

背景技术 Background technique

[0002] 在碳纳米管分子动力学仿真过程中,由于其运算中涉及超大规模的分子量及大量的复杂的浮点运算,使得碳纳米管分子动力学模拟需要极强的计算能力。 [0002] In the carbon nanotube molecular dynamics simulation process, since the calculation involved in a large number of ultra-large molecular weight and complex floating point operations, so that the carbon nanotubes require a very strong molecular dynamics simulation computing power. 因为碳纳米管由大量分子构成,其模拟仿真中涉及大量的浮点运算,随着分子动力学仿真规模的扩大,仿真结果的可视化也非常重要。 Because carbon nanotubes composed of a large number of molecules that mimic the simulation involves a large number of floating-point operations, along with the expansion of the molecular dynamics simulation scale, visual simulation results is also very important. 对于这些碳纳米管分子动力学模拟系统来说,提高仿真算法的浮点运算能力和并行计算能力具有重大作用。 Carbon nanotubes for molecular dynamics simulation systems, and to improve the floating point capability of parallel computing simulation methods have a significant effect.

[0003] 在新兴的纳米工程领域,建立在连续介质基础上的宏观机理很难解释纳米工程中出现的一些特殊现象,因而分子动力学方法成为重要的研究手段之一。 [0003] In the emerging field of nanotechnology project, built on the basis of macro-continuum is difficult to explain the mechanism of special phenomena occurring in nano-engineering, molecular dynamics and thus become an important research tool. 碳纳米管分子动力学仿真,主要通过牛顿力学模拟碳纳米管体系的运动,在其不同状态时的数据集合中抽取数据样本,从而计算碳纳米管体系的构型积分,并以构型积分的结果为基础进一步计算碳纳米管体系的热力学量和其他宏观性质,从而高效仿真碳纳米管系统。 Molecular dynamics simulation nanotube, mainly by the motion of Newtonian mechanics simulation system of carbon nanotubes, extracting data sample in the data set at the time of its different states, so as to calculate the carbon nanotube integral system configuration, and is integral configuration the results further calculates the thermodynamic quantities of carbon nanotubes and other systems based on macroscopic properties, so that carbon nanotubes efficient simulation system. 但碳纳米管分子动力学仿真算法受计算能力两大局限:其一是极小空间内包括极大量粒子,计算量极大;其二是为保证数值模拟稳定性,典型的分子动力学时间步长为飞秒(fs)级,对计算机性能要求高。 However, carbon nanotubes by molecular dynamics simulation algorithm computing two limitations: first, very small inner space comprises a very large number of particles, a great amount of calculation; second is to ensure stability of numerical simulation, typical molecular dynamics time step length of femtoseconds (fs) grade, high performance requirements of the computer.

[0004] 受限于计算机性能的发展,为扩大仿真算法规模,国内外许多专家学者对分子动力学仿真算法做了大量研究。 [0004] limited by the development of computer performance, to expand the scale of simulation algorithms, many experts and scholars at home and abroad a lot of research on the molecular dynamics simulation algorithm. 由最初扩大单机规模的串行算法,发展到现在通过将计算任务分配给多个CPU而扩大模拟规模的并行算法,可以模拟的规模由最初的几千个原子提高到上百万、上千万甚至到上亿个原子的规模。 Increased from the initial expansion of the scale of the scale stand-alone serial algorithm, developed by computing tasks now assigned to multiple CPU enlarged scale simulation of parallel algorithm can be simulated by the first of thousands of atoms to millions, tens of millions even on the scale of one hundred million atoms. 虽然CPU的计算能力已经非常强大,但对于具有实际意义的超大规模的模拟系统来说,其运行速度还远不能满足实际需求,而且对于其批量处理碳,单CPU的串行实现效率相对来说也比较低。 Although the computing power of the CPU has been very strong, but for very large-scale simulation system has practical significance, its speed also can not meet the actual demand, but also for its batch processing serial carbon, single-CPU implementation efficiency is relatively It is relatively low. 因此,大规模的碳纳米管分子动力学仿真算法需要进一步突破。 Therefore, large-scale carbon nanotube molecular dynamics simulation algorithm requires further breakthroughs.

发明内容 SUMMARY

[0005] 本发明的目的是为了解决上述现有技术的缺陷,提供一种基于GPU并行运算的碳纳米管分子动力学仿真方法,该方法能大幅度提高碳纳米管的模拟规模,极大地提高分子动力学仿真的运算效率。 [0005] The object of the present invention is to solve the above-mentioned drawbacks of the prior art, there is provided a molecular dynamics simulation method of a carbon nanotube-based parallel computing GPU, which can greatly increase the size of carbon nanotubes analog, greatly improved molecular dynamics simulation of operational efficiency.

[0006] 本发明的目的可以通过采取如下技术方案达到: [0006] The object of the present invention can be attained by taking the following technical solutions:

[0007] 基于GPU并行运算的碳纳米管分子动力学仿真方法,其特征在于包括以下步骤: [0007] GPU molecular dynamics simulation method of a carbon nanotube-based parallel computing, characterized by comprising the steps of:

[0008] I)由数据库文件构造碳纳米管系统模型,该模型由碳纳米管和设置在碳纳米管内部的C60分子组成,对模型进行初始化,读取模型中所有粒子的速度和位置坐标; [0008] I) a carbon nanotube configured by the database file system model, the model is provided by the carbon nanotubes and the carbon nanotubes C60 molecules within the composition, the model is initialized, the speed and position coordinates of all the particles in the model reading;

[0009] 2)C60分子受到碳纳米管管壁上碳粒子产生的力,在平衡位置上来回振动,当C60分子处于平衡状态时,在碳纳米管的前、后两端同时分别设置不同温度的条件进行模拟,并设定模拟时间,使碳纳米管管壁上碳粒子和C60分子的速度和位置不断发生变化,进而使C60分子的受力、运动状态和能量不断发生变化; [0009] 2) C60 molecules wall carbon nanotubes subjected to a force on the particles generated, oscillate in stable position, when the C60 molecules are in equilibrium, before the carbon nanotubes, while the rear ends are respectively disposed at different temperatures the conditions simulated, and the simulation time is set, so that the speed and position of the upper wall carbon nanotubes and particles of C60 is changing, thereby enabling the force of C60, motion and energy is changing;

[0010] 3)在CUDA平台上对碳纳米管进行分割,分割成多层相互独立的计算单元,采用CPU遍历计算单元进行轮转计算得到可并行运算队列,再调度GPU的流处理单元,采用Verlet算法进行并行运算和处理,重复执行该步骤直至模拟时间结束; [0010] 3) divided in the carbon nanotubes CUDA platform divided into a multilayer independent calculation unit, using the CPU traverse calculation unit may calculate rotation parallel operation queue, then the stream processing unit GPU scheduling using Verlet parallel processing and computation algorithm, this step is repeated until the end of the simulation time;

[0011] 4)采用数据库文件记录相关数据,输出C60分子随着模拟时间的运行轨迹,并描绘碳纳米管内随着能量传递的温度变化曲线图,完成仿真过程。 [0011] 4) The database records the relevant data file, with the outputs of C60 trajectory simulation time, and depicts the temperature profile of FIG nanotubes with energy transfer complete simulation process.

[0012] 作为一种优选方案,所述碳纳米管为层状中空结构,由多个六边形碳环结构组成;所述C60分子有一个或多个。 [0012] As a preferred embodiment, the layered carbon nanotubes are a hollow structure, a plurality of hexagonal carbon ring structures; the C60 molecule has one or more.

[0013] 作为一种优选方案,所述步骤2)中,采用Gaussian热浴模拟法在碳纳米管的前、后两端分别设置不同温度的热浴条件,并设定热浴时间作为模拟时间。 [0013] As a preferred embodiment, in the step 2), using Gaussian simulation before a hot bath of carbon nanotubes, are provided at both ends of the hot bath at different temperatures, and set the time as the hot bath simulation time .

[0014] 作为一种优选方案,所述步骤3)中,采用CPU遍历计算单元进行轮转计算具体如下: [0014] As a preferred embodiment, the step 3), using the CPU traversal cycle calculation unit calculates as follows:

[0015] a)若所有粒子均已作为中心计算粒子,跳到步骤h); [0015] a) If all of the particles have particle is calculated as a center, skip to step H);

[0016] b)按次序找到第一个非竞争粒子并没有按中心计算的粒子,加入可并行运算队列; [0016] b) find the first-order particles is not a non-competitive particles calculated by the center, may be added in parallel operation queue;

[0017] c)标记该粒子的所有近邻为本并行队列一度不可并行粒子,若近邻已经是二度不可并行粒子,则提升为一度不可计算; All neighbors [0017] c) the labeled particles oriented parallel particle queue was not parallel, the second time if the neighbor is already not parallel particle, once the lift is not calculated;

[0018] d)标记该粒子所有次邻为本并行队列二度不可并行粒子,若次邻为一度不可并行粒子,则不修改其度数; [0018] d) marking all of the particles oriented parallel views o unparallelizable particles queue second degree, when the secondary particles neighbors was not parallel, which degree is not modified;

[0019] e)标记本粒子为已按中心计算粒子; [0019] e) labeled particles as calculated according to the present core particle;

[0020] f)是否已遍历到粒子队尾? Whether [0020] f) the particle has traversed the tail? 若是继续执行,若否跳到步骤a); If continue, if not go to step A);

[0021] g)下一个可并行队列开始,返回步骤b); The [0021] g) a parallel queue begins, returning to step B);

[0022] h)结束。 [0022] h) end.

[0023] 作为一种优选方案,所述步骤3)中,采用Verlet算法进行并行运算和处理具体如下: [0023] As a preferred embodiment, the step 3), using Verlet algorithm parallel computing and processing as follows:

[0024] a)按碳纳米管系统模型所有粒子的位置,计算近邻粒子以及次邻粒子间的键关系和角度关系; [0024] a) a carbon nanotube according to the system model position of all the particles, and the relationship between the angular relationship between the key calculation neighbor particles and secondary particles o;

[0025] b)调度GPU的流处理单元,并行计算被分割在不同计算单元里的粒子,并积累计算碳纳米管管壁上每个粒子与其近邻粒子的相互作用力; [0025] b) scheduling the stream processing unit GPU, parallel computing particles are divided in different calculation units, and the interaction force is calculated for each particle accumulation on the walls of carbon nanotubes with its neighbor particles;

[0026] c)根据C60分子所在区域,计算C60分子内每个粒子与其所在碳纳米管区域中的每个粒子的相互作用力; [0026] c) The area where the C60 molecule, each particle is calculated interaction particles in the region of each carbon nanotube molecule with its C60 located in;

[0027] d)根据粒子所受到的力及其速度,更新粒子位置,再执行步骤b)和c); [0027] d) The force and speed of the particles is subjected, the particle location update, then performing steps b) and C);

[0028] e)根据粒子所受到的力,计算粒子本次速度及碳纳米管前、后两端热浴的热流值; [0028] e) The force of particles is subjected, before calculating the particle velocity, and this carbon nanotube, the heat flow at both ends of the heating bath;

[0029] f)若达到循环频数,则计算结束;否则,在CPU端间隔保存粒子的数据,返回步骤d)。 [0029] f) when the frequency reaches cycles, the end of the calculation; otherwise, the data stored at the end of the spacer particles CPU returns to step d).

[0030] 作为一种优选方案,所述步骤3)中,Verlet算法具体设计如下: [0030] As a preferred embodiment, the step) 3, Verlet algorithm specifically designed as follows:

[0031 ] a)将X (t+ A t)和X (t- A t)进行泰勒展开如下式所示:[0032] [0031] a) The X (t + A t) and X (t- A t) Taylor expansion as shown by the following formula: [0032]

Figure CN103279645AD00061

[0034] 其中,x(t+At)表示为前一时刻的位置,x(t_ A t)表示为后一时刻的位置; [0034] where, x (t + At) is represented by the position of the previous time, x (t_ A t) represents a time after a position;

[0035] b)将式(I)和式⑵相加,得到位置表达式如下: [0035] b) formula (I) and Formula ⑵ added to obtain a position expressed as follows:

[0036] [0036]

Figure CN103279645AD00062

[0037] 在已知碳纳米管系统模型粒子当前时刻t的位置和加速度,以及前一时刻tA的位置的情况下,推算出下一时刻t+At的位置; [0037] In the case of known carbon nanotube model particle system the current position and acceleration time t, and the previous time tA, calculate the position of the next time t + At;

[0038] c)将式⑴和式⑵相减,再两边同时除以2 At,获得速度的表达式如下: [0038] c) of formula and formula ⑴ ⑵ subtraction, then both sides while divided by 2 At, the expression rate is obtained as follows:

[0039] [0039]

Figure CN103279645AD00063

[0040] 在已知碳纳米管系统模型粒子前一时刻t-At的位置和后一时刻t+ A t的位置的情况下,推算出当前时刻t的速度v(t); [0040] Carbon nanotubes are known before a time system model particle position t-At and after a time t + t A case where the position of the current time t is estimated velocity V (t);

[0041] d)由式(I)〜(4),在已知粒子t-2 At时刻的位置、t-At时刻的位置和t-At时刻的加速度的情况下,启动Verlet算法进行积分:根据t_2 A t时刻的位置、t-At时刻的位置和t-At时刻的加速度,将t = t-At代入式(3),获得当前时刻t的位置;根据当前时刻t的位置,基于一定的势函数更新当前时刻t的加速度;同时,根据当前时刻t的位置和t-2 At时刻的位置,将t = t-At代入式(4),更新t-At时刻的速度;即得到粒子当前时刻t的位置、t- A t时刻的速度和t时刻的加速度,重复执行该步骤。 [0041] d) of the formula (I) (4), - the position of the particles in the known t-2 At the time, t-At the position of the acceleration and the time t-At the time, the algorithm starts integrating Verlet: the acceleration position t_2 a t the time, t-At the time, and t-At the time, the t = t-At are substituted into the formula (3), the position of the current time t; in accordance with the position of the current time t, based on certain the potential function updates the acceleration current time t; the same time, according to the position of the current time t and t-2 At the time, the t = t-At are substituted into the formula (4), the speed t-At time; i.e., to give particles the current position of the acceleration time t, velocity and time t- a t at time t, and repeat the procedure.

[0042] 本发明相对于现有技术具有如下的有益效果: [0042] The prior art relative to the present invention has the following advantages:

[0043] 1、本发明采用数据库文件构造碳纳米球C60模型和碳纳米管结构模型,从而对碳纳米管分子动力学进行仿真,不仅方便计算,也便于构造多种不同模型进行比较,可移植性较高,并利用算法可以模拟足球状结构的C60分子在碳纳米管里的运行轨迹。 [0043] 1, the present invention employs a configuration file database model and the C60 carbon nanospheres carbon nanotube structure model, thus the carbon nanotubes molecular dynamics simulation, calculation not only convenient, but also more convenient to construct different models are compared, portable high resistance, and using an algorithm to simulate football-like structure of the C60 molecules in the carbon nanotube in the running track.

[0044] 2、本发明采用由NVIDIA公司发布的基于GPU的并行运算平台CUDA进行了图像处理,CUDA平台是一个基于C语言的基础架构,具备有大量高性能计算指令和良好的编程接口,可以极大地提高碳纳米管分子动力学仿真方法的效率。 [0044] 2, the present invention employs NVIDIA Corporation issued by GPU-based parallel computing platform CUDA image-processed, a CUDA-based infrastructure platform is the C language, the instruction includes a large number of high-performance computing and good programming interface, greatly improve the efficiency of carbon nanotubes by molecular dynamics simulation method.

[0045] 3、本发明通过CUDA平台可以对大型的碳纳米管系统模型进行分割,分割成多层大小适宜、相互独立且GPU能承受的计算单元,使得各算法在CUDA中并行运行,极大提高了碳纳米管分子动力学仿真方法的速度。 [0045] 3, the present invention can be performed by large CUDA platform system model nanotube divides, into a multilayer suitable size, independent of each other and can withstand GPU computing unit, such that each algorithm runs in parallel CUDA, a great increasing the speed of the carbon nanotube molecular dynamics simulation method.

附图说明 BRIEF DESCRIPTION

[0046] 图1为本发明的C60分子示意图。 [0046] FIG 1 C60 molecule of the present invention. FIG.

[0047] 图2为本发明的碳纳米管示意图。 [0047] Fig 2 a schematic view of a carbon nanotube of the present invention.

[0048] 图3为本发明构造的碳纳米管系统模型的结构示意图。 [0048] FIG structural diagram of the system model of a carbon nanotube structure of the present invention.

[0049] 图4为本发明在CPU与GPU中碳纳米管分子动力学仿真的数据流框图。 [0049] FIG. 4 is a block diagram of the invention in a data stream of carbon nanotubes CPU and GPU molecular dynamics simulation.

[0050] 图5为本发明在CUDA环境下进行碳纳米管分子动力学仿真的流程示意图。 [0050] FIG. 5 is a schematic flowchart of a carbon nanotube disclosure molecular dynamics simulation is carried out at ambient CUDA.

[0051] 图6为本发明基于GPU并行运算与传统的串行运算的运行时间对比图。 [0051] FIG. 6 GPU parallel operation with the traditional serial arithmetic operation time based on comparison of the present invention FIG. 具体实施方式 detailed description

[0052] 实施例1: [0052] Example 1:

[0053] 如图1〜图5所示,本实施例基于GPU并行运算的碳纳米管分子动力学仿真方法如下: [0053] As shown in FIG. 1 ~ 5, the present embodiment the molecular dynamics simulation method of carbon nanotubes parallel operation is based on the GPU:

[0054] I)在数据库文件中读取碳纳米管系统的参数条件,如初始温度、粒子数、密度时间等,构造碳纳米管系统模型MODl及参数模型M0D2,模型M0D2可以设置各种参数在模型MODl上使用,模型MODl如图1〜图3所示,由碳纳米管和设置在碳纳米管内部的一个足球状C60分子(由60个碳原子构成的分子,形似足球,又名足球烯)组成,所述碳纳米管为层状中空结构,管身是准圆管结构,由多个六边形碳环结构单元(由碳原子构成)组成,其直径一般在一到几十个纳米之间,长度则远远大于其直径,对该模型进行初始化,读取模型中所有粒子的速度和位置坐标; [0054] I) read in the database nanotubes file system parameters, the initial temperature as the number of particles, the density of time, the carbon nanotube structure and parameters of the system model MODl M0D2 model, the model can set various parameters M0D2 MODl using the model, the model shown in FIG MODl 1 ~ 3, the carbon nanotubes and the carbon nanotubes disposed within a football-shaped C60 molecules (molecules of 60 carbon atoms resembling soccer, football alkenyl known ) composed of the carbon nanotube structure is a layered hollow tube body is a quasi-tube structure, a plurality of hexagonal rings of carbon structural unit (composed of carbon atoms), whose diameter is generally in the tens of nanometers to a between, far greater than the length of the diameter, the model is initialized, the speed and position coordinates of all the particles in the model reading;

[0055] 2)C60分子受到碳纳米管管壁上碳粒子产生的力,在平衡位置上来回振动,当C60分子处于平衡状态时,采用Gaussian热浴法(约束温度调节方法),在碳纳米管两端同时分别设置不同温度的热浴条件,并设定热浴时间,使碳纳米管管壁上碳粒子和C60分子因平衡状态被打破而发生位置和速度的变化,而这些变化是相互影响的,具有传递性的,伴随着这些粒子位置和速度的变化,能量在长管状的碳纳米管系统内发生传递,由于C60分子位于碳纳米管内,其受力会随着碳纳米管组成粒子的位置改变而改变,因此伴随这能量传递的过程,C60分子的运动状态和能量也会发生改变; [0055] 2) C60 molecules wall carbon nanotubes subjected to a force on the particles generated, oscillate in stable position, when the C60 molecules are in equilibrium, using Gaussian hot bath (temperature adjusting method constraint), the carbon nano while the tube ends are provided a hot bath at different temperatures, and hot bath set time, the upper wall carbon nanotube particles and of C60 is broken due to changes in the equilibrium state position and velocity occur, and these changes are mutually effects, transitive, along with the change in the position and velocity of the particles, the energy transfer occurs in a long tubular carbon nanotubes system, since the C60 molecule located within carbon nanotubes, which will force the particles with carbon nanotubes. the position change varies, and therefore along with the process of energy transfer, motion and energy of C60 may also change;

[0056] 采用Gaussian热浴法的基本原理是在运动方程中加入摩擦力fp并将其与粒子速度Vi联系起来,其受:力公式为: [0056] The basic principle of the Gaussian thermal bath is added to the equations of motion in friction force fp and the particle velocity Vi link, by which: the force of the formula:

[0057] fi = Hiai+ I HiVi [0057] fi = Hiai + I HiVi

[0058] 当平衡态时,系统温度不变,因此有dEk/dt = 0 [0058] When the equilibrium temperature of the system constant, so there dEk / dt = 0

[0059]即有:Z vA =O [0059] namely: Z vA = O

I I

E fivi E fivi

[0060] 由此可得4 = ~^——T [0060] Accordingly available 4 = ~ ^ - T

m Vi m Vi

I I

[0061] 3)在CUDA平台上对碳纳米管进行分割,分割成多层大小适宜、相互独立的计算单元,分割原则是在避免过多重复计算的前提上提高并行度,即分割的计算单元必须合理粗细化,因为计算单元过大,则并行不明显,计算单元过小,会导致太多不必要的重复的计算; [0061] 3) divided in the carbon nanotubes CUDA platform divided into a multilayer suitable size, independent calculation unit division principle is to increase the degree of parallelism in the premise to avoid excessive repetition calculation, the calculation means dividing i.e. must be of reasonable thickness because the calculation unit is too large, it is not obvious parallel, the calculation unit is too small, too much can lead to unnecessary duplication of the calculation;

[0062] 如图4所示,采用CPU遍历计算单元进行轮转计算得到n个可并行运算队列,如下: [0062] 4, using the CPU traversal cycle calculation unit may calculate the n parallel operation queues as follows:

[0063] a)若所有粒子均已作为中心计算粒子,跳到步骤h); [0063] a) If all of the particles have particle is calculated as a center, skip to step H);

[0064] b)按次序找到第一个非竞争粒子并没有按中心计算的粒子,加入可并行运算队列; [0064] b) find the first-order particles is not a non-competitive particles calculated by the center, may be added in parallel operation queue;

[0065] c)标记该粒子的所有近邻为本并行队列一度不可并行粒子,若近邻已经是二度不可并行粒子,则提升为一度不可计算; All neighbors [0065] c) the labeled particles oriented parallel particle queue was not parallel, the second time if the neighbor is already not parallel particle, once the lift is not calculated;

[0066] d)标记该粒子所有次邻为本并行队列二度不可并行粒子,若次邻为一度不可并行粒子,则不修改其度数; [0066] d) marking all of the particles oriented parallel views o unparallelizable particles queue second degree, when the secondary particles neighbors was not parallel, which degree is not modified;

[0067] e)标记本粒子为已按中心计算粒子; [0067] e) marking particles of the present particles are calculated by the center;

[0068] f)是否已遍历到粒子队尾? Whether [0068] f) the particle has traversed the tail? 若是继续执行,若否跳到步骤a); If continue, if not go to step A);

[0069] g)下一个可并行队列开始,返回步骤b); The [0069] g) a parallel queue begins, returning to step B);

[0070] h)结束; [0070] h) end;

[0071] 如图4和图5所示,调度GPU的流处理单元,采用Verlet算法进行并行运算和处理,如下: [0071] FIGS. 4 and 5, the stream scheduling processing unit GPU, using Verlet algorithm parallel computing and processing, as follows:

[0072] a)按碳纳米管系统模型所有粒子的位置,计算近邻粒子以及次邻粒子间的键关系和角度关系; [0072] a) a carbon nanotube according to the system model position of all the particles, and the relationship between the angular relationship between the key calculation neighbor particles and secondary particles o;

[0073] b)调度GPU的流处理单元,并行计算被分割在不同计算单元里的粒子,并积累计算碳纳米管管壁上每个粒子与其近邻粒子的相互作用力; [0073] b) scheduling the stream processing unit GPU, parallel computing particles are divided in different calculation units, and the interaction force is calculated for each particle accumulation on the walls of carbon nanotubes with its neighbor particles;

[0074] c)根据C60分子所在区域,计算C60分子内每个粒子与其所在碳纳米管区域中的每个粒子的相互作用力(范德华力); [0074] c) The area where the C60 molecule, each particle is calculated interaction of C60 with its location within the region of each of the carbon nanotube particles (van der Waals force);

[0075] d)根据粒子所受到的力及其速度,更新粒子位置,再执行步骤b)和c); [0075] d) The force and speed of the particles is subjected, the particle location update, then performing steps b) and C);

[0076] e)根据粒子所受到的力,计算粒子本次速度及碳纳米管前、后两端热浴的热流值; [0076] e) The force of particles is subjected, before calculating the particle velocity, and this carbon nanotube, the heat flow at both ends of the heating bath;

[0077] f)若达到循环频数,则计算结束;否则,在CPU端间隔保存粒子的数据,返回步骤d)。 [0077] f) when the frequency reaches cycles, the end of the calculation; otherwise, the data stored at the end of the spacer particles CPU returns to step d).

[0078] 4)重复执行步骤3),直至热浴时间结束,采用数据库文件记录相关数据,输出C60分子随着模拟时间的运行轨迹,并描绘碳纳米管内随着能量传递的温度变化曲线图,完成仿真过程。 [0078] 4) Repeat step 3), the heating bath until the end of time, using a database record associated data file, with the outputs of C60 trajectory simulation time, and depicts the temperature profile of FIG nanotubes with energy transfer, complete simulation process.

[0079] 所述步骤3)中,由于粒子间的作用力间距影响较大,必须设定一个距离临界值,以判断其位置关系,当粒子间的间距小于距离临界值,为近邻粒子,当粒子间的间距大于距离临界值,为次邻粒子,则认为其相互间的分子作用力可以忽略不计。 3) [0079] step, since the impact force greater spacing between particles, the distance must be set to a threshold value to determine its positional relationship, when the pitch is smaller than the distance between the particles is a critical value for the neighbor particles, when the spacing between the particles is greater than the distance threshold value, for the second o-particle, the force between molecules that their mutual negligible.

[0080] 所述步骤3)中,Verlet算法具体设计如下: [0080] step 3), Verlet algorithm specifically designed as follows:

[0081 ] a)将X (t+ A t)和X (t- A t)进行泰勒展开如下式所示: [0081] a) The X (t + A t) and X (t- A t) Taylor expansion the following formula:

Figure CN103279645AD00081

[0084] 其中,x(t+At)表示为前一时刻的位置,x(t_ A t)表示为后一时刻的位置; [0084] where, x (t + At) is represented by the position of the previous time, x (t_ A t) represents a time after a position;

[0085] b)将式(I)和式⑵相加,得到位置表达式如下: [0085] b) formula (I) and Formula ⑵ added to obtain a position expressed as follows:

[0086] [0086]

Figure CN103279645AD00082

[0087] 在已知碳纳米管系统模型粒子当前时刻t的位置和加速度,以及前一时刻tA的位置的情况下,推算出下一时刻t+At的位置; [0087] In the case of known carbon nanotube model particle system the current position and acceleration time t, and the previous time tA, calculate the position of the next time t + At;

[0088] c)将式⑴和式⑵相减,再两边同时除以2 At,获得速度的表达式如下: [0088] c) of formula and formula ⑴ ⑵ subtraction, then both sides while divided by 2 At, the expression rate is obtained as follows:

Figure CN103279645AD00083

[0090] 在已知碳纳米管系统模型粒子前一时刻t-At的位置和后一时刻t+ A t的位置的情况下,推算出当前时刻t的速度v(t); [0090] Carbon nanotubes are known before a time system model particle position t-At and after a time t + t A case where the position of the current time t is estimated velocity V (t);

[0091] d)由式(I)〜(4),在已知粒子t-2 At时刻的位置、t-At时刻的位置和t-At时刻的加速度的情况下,启动Verlet算法进行积分:根据t_2 A t时刻的位置、t-At时刻的位置和t-At时刻的加速度,将t = t-At代入式(3),获得当前时刻t的位置;根据当前时刻t的位置,基于一定的势函数更新当前时刻t的加速度,从而得到其受力;同时,根据当前时刻t的位置和t-2 A t时刻的位置,将t = t- A t代入式⑷,更新t- A t时刻的速度;即得到粒子当前时刻t的位置、t-At时刻的速度和t时刻的加速度(受力),重复执行该步骤。 [0091] d) of the formula (I) (4), - the position of the particles in the known t-2 At the time, t-At the position of the acceleration and the time t-At the time, the algorithm starts integrating Verlet: the acceleration position t_2 a t the time, t-At the time, and t-At the time, the t = t-At are substituted into the formula (3), the position of the current time t; in accordance with the position of the current time t, based on certain the acceleration potential function updates the current time t, whereby its force; Meanwhile, according to the position of the current time t and time t-2 a t, and the t = t- a t into equation ⑷, update t- a t time speed; i.e., the position of the particle to obtain the current time t, velocity and acceleration at time t time t-At (force), repeat the procedure.

[0092] 如图6所示,可以看到本发明采用的GPU并行运算,其执行时间要远远小于传统的串行运算,因此,其仿真效率较之传统的串行运算有很大的提高。 [0092] As shown in FIG 6, can be seen that the present invention is employed in GPU parallel operation, the execution time is much smaller than traditional serial arithmetic, therefore, the simulation efficiency than traditional serial arithmetic greatly improved .

[0093] 实施例2: [0093] Example 2:

[0094] 本实施例的主要特点是:所述步骤I)中,设置在碳纳米管内部的C60分子可以为多个,其余同实施例1。 The main features of [0094] the present embodiment is that: the step I), the carbon nanotubes disposed within the plurality of C60 may be, remaining the same as in Example 1.

[0095] 以上所述,仅为本发明优选的实施例,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明所公开的范围内,根据本发明的技术方案及其发明构思加以等同替换或改变,都属于本发明的保护范围。 [0095] The above are only preferred embodiments of the invention, but the scope of the present invention is not limited thereto, within the scope of any skilled in the art in the art disclosed in the present invention, techniques according to the invention its embodiment the inventive concept to be altered or equivalents fall within the scope of the present invention.

Claims (6)

1.基于GPU并行运算的碳纳米管分子动力学仿真方法,其特征在于包括以下步骤: 1)由数据库文件构造碳纳米管系统模型,该模型由碳纳米管和设置在碳纳米管内部的C60分子组成,对模型进行初始化,读取模型中所有粒子的速度和位置坐标; 2)C60分子受到碳纳米管管壁上碳粒子产生的力,在平衡位置上来回振动,当C60分子处于平衡状态时,在碳纳米管的前、后两端同时分别设置不同温度的条件进行模拟,并设定模拟时间,使碳纳米管管壁上碳粒子和C60分子的速度和位置不断发生变化,进而使C60分子的受力、运动状态和能量不断发生变化; 3)在CUDA平台上对碳纳米管进行分割,分割成多层相互独立的计算单元,采用CPU遍历计算单元进行轮转计算得到可并行运算队列,再调度GPU的流处理单元,采用Verlet算法进行并行运算和处理; 4)重复执行步骤3),直至模拟 1. The molecular dynamics simulation method of a carbon nanotube-based GPU parallel operation, comprising the steps of: 1) a configuration of the file system model database carbon nanotubes, the carbon nanotubes and the model provided in the interior of the carbon nanotubes C60 molecules, the model is initialized, the speed and position coordinates of all the particles in the model reading; 2) of C60 wall carbon nanotubes subjected to a force on the particles generated, oscillate in stable position, when the state of equilibrium of C60 when, before the carbon nanotubes, while the rear ends are respectively provided to simulate different temperature conditions, and the simulation time is set, so that the speed and position of the carbon particles and the walls of carbon nanotubes of C60 is changing, thereby enabling force of C60, motion and energy constantly changing; 3) is divided carbon nanotubes on the CUDA platform divided into a multilayer independent calculation unit, using the CPU traverse calculation unit may calculate rotation parallel operation queue , rescheduling of stream processing unit GPU, Verlet algorithm using parallel computing and processing; 4) repeating step 3) until the analog 间结束,采用数据库文件记录相关数据,输出C60分子随着模拟时间的运行轨迹,并描绘碳纳米管内随着能量传递的温度变化曲线图,完成仿真过程。 Between the end of file records data using a database, with the output of C60 trajectory simulation time and temperature graph depicting energy transfer with the carbon nanotubes, to complete the simulation.
2.根据权利要求1所述的基于GPU并行运算的碳纳米管分子动力学仿真方法,其特征在于:所述碳纳米管为层状中空结构,由多个六边形碳环结构组成;所述C60分子有一个或多个。 The molecular dynamics simulation method based on the carbon nanotube GPU parallel computing according to claim 1, wherein: the carbon nanotubes are layered hollow structure, a plurality of hexagonal ring structures composed of carbon; the said one or more of C60.
3.根据权利要求1或2所述的基于GPU并行运算的碳纳米管分子动力学仿真方法,其特征在于:所述步骤2)中,采用Gaussian热浴模拟法在碳纳米管的前、后两端分别设置不同温度的热浴条件,并设定热浴时间作为模拟时间。 The molecular dynamics simulation method based on the carbon nanotube GPU parallel computing of claim 1 or claim 2, wherein: in the step 2), using Gaussian simulation before a hot bath of carbon nanotubes, after are provided at both ends of a hot bath at different temperatures, and set the time as the hot bath simulation time.
4.根据权利要求3所述的基于GPU并行运算的碳纳米管分子动力学仿真方法,其特征在于:所述步骤3)中,采用CPU遍历计算单元进行轮转计算具体如下: a)若所有粒子均已作为中心计算粒子,跳到步骤h); b)按次序找到第一个非竞争粒子并没有按中心计算的粒子,加入可并行运算队列; c)标记该粒子的所有近邻为本并行队列一度不可并行粒子,若近邻已经是二度不可并行粒子,则提升为一度不可计算; d)标记该粒子所有次邻为本并行队列二度不可并行粒子,若次邻为一度不可并行粒子,则不修改其度数; e)标记本粒子为已按中心计算粒子; f)是否已遍历到粒子队尾? 4. The molecular dynamics simulation method of a carbon nanotube according to GPU parallel computing based according to claim 3, wherein: in the step 3), using the CPU traversal cycle calculation unit calculates as follows: a) If all of the particles have calculated the particle as a center, go to step h); b) in order, find the first non-competitive particles and no particle is calculated according to the center, may be added parallel operation queue; all neighbors c) the particles oriented parallel marks queue particles was not parallel, the second time if the neighbor is already not parallel particle, once the lift is not calculated; D) mark all times the particle parallel o the present second degree non-parallel particle queue, if not parallel secondary particles was neighbors, then does not modify its degree; E) labeled particles are present according to the calculated particle centers; if f) the particles have traversed the tail? 若是继续执行,若否跳到步骤a); g)下一个可并行队列开始,返回步骤b); h)结束。 If continue, if not go to step A); next g) starts a parallel queue, returning to step b); h) the end.
5.根据权利要求4所述的基于GPU并行运算的碳纳米管分子动力学仿真方法,其特征在于:所述步骤3)中,采用Verlet算法进行并行运算和处理具体如下: a)按碳纳米管系统模型所有粒子的位置,计算近邻粒子以及次邻粒子间的键关系和角度关系; b)调度GPU的流处理单元,并行计算被分割在不同计算单元里的粒子,并积累计算碳纳米管管壁上内每个粒子与其近邻粒子的相互作用力; c)根据C60分子所在区域,计算C60分子内每个粒子与其所在碳纳米管区域中的每个粒子的相互作用力;d)根据粒子所受到的力及其速度,更新粒子位置,再执行步骤b)和c); e)根据粒子所受到的力,计算粒子本次速度及碳纳米管前、后两端热浴的热流值; f)若达到循环频数,则计算结束;否则,在CPU端间隔保存粒子的数据,返回步骤d)。 According to claim molecular dynamics simulation method of a carbon nanotube-based GPU parallel operation, wherein the 4: in the step 3), using Verlet algorithm parallel computing and processing as follows: a) by carbon nano position of the tube system model of all the particles, and calculating the relationship between the angular relationship between the key neighbor particles and secondary particles o; b) scheduling of the stream processing unit GPU, parallel computing divided particles are different in the calculating unit, and calculates the accumulation of carbon nanotubes each particle interaction forces its neighbors particles in the wall; c) according to the region where the C60 molecule, each particle within the computing interaction of C60 with its region where the carbon nanotubes each particle; D) according to the particle by force and speed, to update the position of the particle, and then performing steps b) and c); e) the force of particles is subjected, before calculating the particle velocity, and this carbon nanotube, the heat flow at both ends of the heating bath; f) when the cycle frequency reaches, the end of the calculation; otherwise, the data stored at the end of the spacer particles CPU returns to step d).
6.根据权利要求5所述的基于GPU并行运算的碳纳米管分子动力学仿真方法,其特征在于:所述步骤3)中,Verlet算法具体设计如下: a)将x(t+At)和x(t-At)进行泰勒展开如下式所示: 6. The molecular dynamics simulation method of a carbon nanotube-based GPU parallel operation, wherein according to claim 5, wherein: in the step 3), Verlet algorithm specifically designed as follows: a) the x (t + At) and x (t-At) Taylor expansion shown in the following formula:
Figure CN103279645AC00031
其中,x(t+At)表示为前一时刻的位置,x(t-At)表示为后一时刻的位置; b)将式(I)和式(2)相加,得到位置表达式如下: Wherein, x (t + At) is represented by the position of the previous time, x (t-At) is represented by a time point after position; b) adding the formula (I) and Formula (2), the following expression obtain the position :
Figure CN103279645AC00032
在已知碳纳米管系统模型粒子当前时刻t的位置和加速度,以及前一时刻t_A的位置的情况下,推算出下一时刻t+At的位置; c)将式(I)和式(2)相减,再两边同时除以2 At,获得速度的表达式如下: In the case of known carbon nanotube model particle system the current position and acceleration time t, and the previous time t_A, calculate the position of the next time t + At; c) of the formula (I) and formula (2 ) subtraction, then both sides while divided by 2 At, the expression rate is obtained as follows:
Figure CN103279645AC00033
在已知碳纳米管系统模型粒子前一时刻t- A t的位置和后一时刻t+ A t的位置的情况下,推算出当前时刻t的速度V (t); d)由式(I)〜(4),在已知粒子t-2 At时刻的位置、t-At时刻的位置和t-At时刻的加速度的情况下,启动Verlet算法进行积分:根据t_2 A t时刻的位置、t_ A t时刻的位置和t- A t时刻的加速度,将t = t- A t代入式(3),获得当前时刻t的位置;根据当前时刻t的位置,基于一定的势函数更新当前时刻t的加速度;同时,根据当前时刻t的位置和t-2 A t时刻的位置,将t = t- A t代入式⑷,更新t- A t时刻的速度;即得到粒子当前时刻t的位置、t-At时刻的速度和t时刻的加速度,重复执行该步骤。 In the case where the position A + t known system model particles carrying carbon nanotubes before a time position t- A t and after a time t, the current time t is estimated velocity V (t); d) represented by formula (I) ~ (4), the position of the particle in the known t-2 at the time, the position of the acceleration and t-at the time t-at the time, the algorithm starts integrating Verlet: the position t_2 a t the time, t_ a position at time t and t- a t acceleration time, t = t- a t will be substituted into the formula (3), the position of the current time t; according to the position of the current time t, based on certain potential function updates the current time t acceleration; Meanwhile, according to the position of the current time t and time t-2 a t, and the t = t- a t into equation ⑷, update rate t- a t the time; i.e., the position of the particle to obtain the current time t, t speed and acceleration time t -At time, repeat the procedure.
CN 201310154296 2013-04-28 2013-04-28 Molecular dynamics simulation method of a carbon nanotube-based parallel computing gpu CN103279645B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201310154296 CN103279645B (en) 2013-04-28 2013-04-28 Molecular dynamics simulation method of a carbon nanotube-based parallel computing gpu

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201310154296 CN103279645B (en) 2013-04-28 2013-04-28 Molecular dynamics simulation method of a carbon nanotube-based parallel computing gpu

Publications (2)

Publication Number Publication Date
CN103279645A true true CN103279645A (en) 2013-09-04
CN103279645B CN103279645B (en) 2016-05-25

Family

ID=49062160

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201310154296 CN103279645B (en) 2013-04-28 2013-04-28 Molecular dynamics simulation method of a carbon nanotube-based parallel computing gpu

Country Status (1)

Country Link
CN (1) CN103279645B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104535859A (en) * 2014-12-19 2015-04-22 桂林电子科技大学 Method for testing temperature characteristic of carbon nanometer pipe
WO2017071315A1 (en) * 2015-10-26 2017-05-04 百度在线网络技术(北京)有限公司 Related content display method and apparatus

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102411658A (en) * 2011-11-25 2012-04-11 中国人民解放军国防科学技术大学 Molecular dynamics accelerating method based on CUP (Central Processing Unit) and GPU (Graphics Processing Unit) cooperation
US20120120077A1 (en) * 2010-09-30 2012-05-17 Greg Scantlen Recruiting additional resource for hpc simulation

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120120077A1 (en) * 2010-09-30 2012-05-17 Greg Scantlen Recruiting additional resource for hpc simulation
CN102411658A (en) * 2011-11-25 2012-04-11 中国人民解放军国防科学技术大学 Molecular dynamics accelerating method based on CUP (Central Processing Unit) and GPU (Graphics Processing Unit) cooperation

Non-Patent Citations (6)

* Cited by examiner, † Cited by third party
Title
120024264: "GPU加速计算分子模拟", 《小木虫学术科研第一站》, 3 March 2011 (2011-03-03), pages 1 - 2 *
EVA GONZALEZ NOYA ET AL.: "Thermal conductivity of carbon nanotube peapods", 《PHYSICAL REVIEW》, vol. 70, no. 11, 30 November 2004 (2004-11-30), XP080325933, DOI: doi:10.1080/00268970902784926 *
JOSHUA A.ANDERSON ET AL.: "General purpose molecular dynamics simulations fully implemented on graphics processing units", 《JOURNAL OF COMPUTATIONAL PHYSICS》, no. 10, 31 October 2008 (2008-10-31), pages 5342 - 5359, XP022577514 *
刘文志等: "分子动力学模拟中基于GPU的范德华非键作用计算", 《计算机与应用化学》, vol. 27, no. 12, 28 December 2010 (2010-12-28), pages 1607 - 1612 *
陈慧: "单壁碳纳米管导热系数的分子动力学仿真", 《中国优秀博硕士学位论文全文数据库(硕士)工程科技I辑》, no. 4, 15 April 2007 (2007-04-15) *
陈飞国等: "复杂多相流动分子动力学模拟在GPU上的实现", 《中国科学》, vol. 38, no. 12, 31 December 2008 (2008-12-31), pages 1120 - 1128 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104535859A (en) * 2014-12-19 2015-04-22 桂林电子科技大学 Method for testing temperature characteristic of carbon nanometer pipe
CN104535859B (en) * 2014-12-19 2017-09-01 桂林电子科技大学 The method of testing the temperature characteristics of carbon nanotubes
WO2017071315A1 (en) * 2015-10-26 2017-05-04 百度在线网络技术(北京)有限公司 Related content display method and apparatus

Also Published As

Publication number Publication date Type
CN103279645B (en) 2016-05-25 grant

Similar Documents

Publication Publication Date Title
Haitao et al. Simulation of thermal behavior of a CNC machine tool spindle
Jiang et al. A finite-temperature continuum theory based on interatomic potentials
Xu et al. Vibrations of double-walled carbon nanotubes with different boundary conditions between inner and outer tubes
Gomez-Iradi et al. Development and Validation of a CFD Technique for the Aerodynamic Analysis of HAWT
Li et al. Lattice Boltzmann modeling of boiling heat transfer: The boiling curve and the effects of wettability
Shamsoddin et al. Large eddy simulation of vertical axis wind turbine wakes
Nithiarasu et al. An artificial compressibility based characteristic based split (CBS) scheme for steady and unsteady turbulent incompressible flows
Shen et al. Computational nano-mechanics and multi-scale simulation
Maheri et al. WTAB, a computer program for predicting the performance of horizontal axis wind turbines with adaptive blades
Ma et al. Multiscale simulation using generalized interpolation material point (GIMP) method and molecular dynamics (MD)
He et al. Multiscale simulations of heat transfer and fluid flow problems
Mitchell et al. An accurate numerical solution for the transient heating of an evaporating spherical droplet
Bapat et al. A new adaptive algorithm for the fast multipole boundary element method
Chaudhri et al. Multicomponent energy conserving dissipative particle dynamics: a general framework for mesoscopic heat transfer applications
Huang et al. Lattice Boltzmann method simulation gas slip flow in long microtubes
Fu et al. A lattice Boltzmann method based numerical scheme for microchannel flows
YANG et al. A V-graph based global path planning algorithm for mobile robot [J]
Delbosc et al. Optimized implementation of the Lattice Boltzmann Method on a graphics processing unit towards real-time fluid simulation
Duvigneau et al. Optimal location of a synthetic jet on an airfoil for stall control
Yan et al. A higher-order gradient theory for modeling of the vibration behavior of single-wall carbon nanocones
Chen et al. Elastic theory of nanomaterials based on surface-energy density
Allison et al. On the impact of coupling strength on complex system optimization for single-level formulations
Shi et al. Accuracy of the lattice Boltzmann method for low-speed noncontinuum flows
Obrecht et al. Multi-GPU implementation of a hybrid thermal lattice Boltzmann solver using the TheLMA framework
Kulkarni et al. Pantograph/catenary contact formulations

Legal Events

Date Code Title Description
C06 Publication
C10 Entry into substantive examination
C14 Grant of patent or utility model