Publications

Detailed Information

Development of GPU-based Adaptive Particle Refinement Algorithm for Smoothed Particle Hydrodynamics : 완화입자유체동역학을 위한 GPU 기반 입자 분할/병합 알고리즘 개발

Cited 0 time in Web of Science Cited 0 time in Scopus
Authors

김도현

Advisor
김응수
Issue Date
2021
Publisher
서울대학교 대학원
Keywords
Smoothed Particle Hydrodynamics(SPH)Adaptive Particle Refinement(APR)Multi-resolutionGPU parallelizationRace conditionAtomic operation완화입자유체동역학입자 분할/병합 방법론다중 해상도 해석GPU 병렬화경쟁 조건원자 연산
Description
학위논문(석사) -- 서울대학교대학원 : 공과대학 에너지시스템공학부, 2021.8. 김수진.
Abstract
최근 원자력 안전 관련 현안들은 열수력 현상 뿐만이 아닌 핵연료 용융, 구조, 재료, 화학반응, 다상 유동 등을 포함하는 매우 복잡한 현상들로 이루어진다. 전통적인 원자로 안전 해석은 주로 오일러리안 격자 기반의 수치해석 방법에 기반하지만, 최근에는 유체 시스템을 유한 개의 유체 입자의 집합으로 표현하는 라그랑지안 입자 기반 방법론 역시 활발하게 연구되고 있다. 대표적인 라그랑지안 기반 해석 기법인 완화입자유체동역학(Smoothed Particle Hydrodynamics : SPH)은 입자를 직접 추적하는 특성으로 인해 앞서 언급한 복잡한 물리 현상들이 포함하는 자유표면이나 다상 유동 등의 유동적인 계산 영역을 해석하는 데에 용이하다.

입자 기반의 유체 해석에서 높은 해상도는 일반적으로 높은 정확도의 결과를 보장하지만, 이는 해석 영역 내 입자 수의 증가에 따른 높은 계산 부하를 야기한다. 현존하는 대부분의 입자 기반 해석 코드는 계산 영역 전체에서 동일한 크기의 입자를 사용하는 단일 해상도(Single-resolution) 방식을 채택하고 있다. 이러한 방식은 난류 해석, 비등/응축 해석, 충격파 해석 등과 같이 유동 영역에 따라 다른 수준의 입자 해상도를 요구하는 해석의 경우 불필요한 계산 부하가 형성되거나, 오히려 계산의 정확도를 저하시킬 수 있다. 따라서 이를 개선하기 위해 계산 영역 내에서 국부적으로 입자의 크기를 조절할 수 있는 다중 해상도(Multi-resolution) 해석의 도입이 필요하다.

이에 따라 본 연구에서는 SPH 기법을 기반으로 한 입자 분할/병합 방법론(Adaptive Particle Refinement : APR)을 개발하고, 모델의 가속화를 위해 이를 GPU 병렬 계산에 적합한 형태로 구현하였다. APR 방법론의 기본 개념은 계산 중 특정 조건에서 입자를 분할하거나 병합함으로써, 계산 영역 내의 국부적인 영역에서 서로 다른 해상도로 해석을 수행하는 것이다. 입자는 특정 조건(입자의 위치, 부피, 속도 구배 등)에서 여러 개로 분할되거나, 또는 여러 개의 입자가 더 적은 수의 입자로 병합되는 과정을 통해 계산 내에서 다양한 입자 해상도를 구현할 수 있다. 하지만 기존 연구에서 사용된 방식들은 입자를 병합하는 과정에서 병합 입자의 속도가 기존 입자들의 운동량 보존식만으로 결정한다. 이러한 방식은 질량과 운동량을 잘 보존하지만 입자의 운동 에너지를 보존하지 못하기 때문에, 본 논문에서는 운동 에너지 보존을 위한 새로운 병합 모델이 제시되었다. 또한, APR 과정에서 입자의 완화 거리(Smoothing length)를 변화시키는 경우, 서로 다른 크기의 입자가 상호작용하는 해상도의 경계에서 계산의 정확도를 떨어트릴 수 있다. 이를 개선하기 위한 연속적 완화 거리 변화 모델 역시 제안되었다.

GPU 병렬 계산의 특성상, 하나의 메모리에 여러 스레드가 동시에 접근하여 연산을 수행할 경우 스레드 간 연산의 순서가 꼬여 기대하던 것과 다른 결과를 도출하는 경쟁 조건이 발생할 수 있다. APR 방법론을 병렬화 할 경우 새롭게 생성되는 입자들을 저장하는 과정에서 이러한 경쟁 조건이 발생하여 생성 입자의 메모리 주소가 충돌하는 현상이 발생한다. 이를 해결하기 위해 CUDA C 언어가 제공하는 원자 연산을 이용하여 스레드 간 계산의 간섭을 방지할 수 있는 잠금 알고리즘을 구현하였고, 과도한 직렬화로 인한 계산 속도 저하를 방지하기 위해 알고리즘을 최적화하였다.

적용된 APR 방법론을 검증하고 성능을 평가하기 위해 다양한 시뮬레이션에 대한 검증 해석이 수행되었다. 정수압 형성, 관내 유동, 댐 붕괴, 그리고 칼만 와류에 대한 해석을 통해 개발된 APR 모델이 안정적으로 다중 해상도를 구현할 수 있음을 확인하였고, 높은 정확도와 계산 효율을 보이는 것을 확인하였다. 또한 제트 파쇄 해석과 공기 방울 상승 해석을 통해 다유체, 다상 유동에의 적용을 수행하였고, 실험 데이터와의 정략적으로 비교하였다. 분석 결과, 시뮬레이션이 실제 현상을 잘 모사함이 확인되었으며, 입자 수 조절을 통해 계산 효율이 크게 향상되었다.

본 연구에서는 SPH 방법론을 기반으로 한 입자 분할/병합 모델을 개발하고 GPU를 이용하여 최적화함으로써, SPH 방법론 내에 다중 해상도 해석 체계를 구축하였다. 이는 기존 단일 해상도의 입자 기반 해석 체계가 필연적으로 가지고 있었던 해상도 증가에 따른 과도한 계산 부하 문제에 대한 해결책을 제시할 수 있다는 점에서 의의를 가지며, 원자로 중대 사고 해석과 같이 현상 내에서 여러 입자 해상도를 요구하는 복잡한 유동에 대한 해석에 기여할 수 있을 것으로 예상된다.
Recent nuclear safety issues are not only limited to thermal-hydraulics, but consist of complex phenomena including fuel melt, materials, chemical reactions, and multi-phase flow. The traditional reactor safety analysis is mainly based on Computational Fluid Dynamics(CFD) with Eulerian grid-based methods. But recently, Lagrangian particle-based methods are also being actively studied, due to their well-known advantages in handling free surface, interfacial flow, and large deformation. Smoothed Particle Hydrodynamics (SPH) is one of the representative Lagrangian-based methods in which the fluid system is represented as the finite number of particles.

In particle-based CFD, high resolution generally guarantees high-accuracy results, but it causes a high computational load as the number of particles in the domain increases. Most existing particle-based analysis codes adopt a single-resolution method using particles of the same size in the entire computational domain. However, in the case that requires different levels of particle resolution depending on the flow region, such as turbulence, boiling/condensation, and shock wave analysis, this method may create unnecessary computational load or reduce the computational accuracy. Therefore, in order to improve this, it is necessary to introduce a multi-resolution analysis that can control the size of particles locally within the computational domain.

Accordingly, in this study, an adaptive particle refinement (APR) method was developed and implemented in SPH, in a form suitable for GPU parallel computation to accelerate the model. The basic concept of the APR methodology is to use different resolutions in localized regions within the computational domain by splitting or merging particles under specific conditions during simulation. Multiple particle resolutions can be implemented by splitting or merging the SPH particles under certain conditions (position, volume, velocity gradient, etc.). However, in the methods used in previous studies, the velocity of the merged particle is determined only by the momentum conservation equation in the process of merging. Since this method conserves mass and momentum well but does not conserve the kinetic energy of particles, a new merging model for kinetic energy conservation is proposed in this study. In addition, when the smoothing length of particles is changed during the APR process, the accuracy of calculation may be reduced at the interface of the resolution where particles of different sizes interact. A continuous smoothing length change model to improve this was also proposed.

Due to the nature of GPU parallel computation, when multiple threads simultaneously access and perform operations on the same memory, the order of operations between threads is twisted, resulting in a race condition that yields different results than expected. When the APR methodology is parallelized, such condition occurs in the process of storing newly generated particles, resulting in a collision of memory addresses of generated particles. To solve this problem, a locking algorithm that can prevent inter-thread computational interference was implemented using the atomic operation provided by the CUDA C language, and the algorithm was optimized to prevent computational speed degradation due to excessive serialization.

Model validation and performance evaluation were performed with the applied APR model. From the analysis results of hydrostatic pressure formation, pipe flow, dam collapse, and Karman vortex, it was confirmed that the APR model developed can stably implement multi-resolution, and showed high accuracy and computational efficiency. In addition, application to multi-fluid and multi-phase flow was performed through jet break up and air bubble rising simulation, and quantitatively compared with experimental data. As a result, it was confirmed that the model well simulates the real phenomena, and the computational efficiency was greatly improved by controlling the number of particles.

In this study, a multi-resolution analysis system was constructed within the SPH methodology by developing a particle refinement model and optimizing it using a GPU. This is significant in that it can provide a solution to the problem of excessive computational load due to the increase in resolution that the existing single-resolution particle-based analysis system inevitably had. It is expected to contribute to the analysis of complex flows that require multiple particle resolutions within the phenomenon, such as severe accidents in a nuclear reactor.
Language
eng
URI
https://hdl.handle.net/10371/177604

https://dcollection.snu.ac.kr/common/orgView/000000168432
Files in This Item:
Appears in Collections:

Altmetrics

Item View & Download Count

  • mendeley

Items in S-Space are protected by copyright, with all rights reserved, unless otherwise indicated.

Share