> For the complete documentation index, see [llms.txt](https://docs-ksc.gitbook.io/blog/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-ksc.gitbook.io/blog/install/nurion/openfoam/nurion-openfoam-v1912-install.md).

# OpenFOAM-v1912 설치 소개

이  문서에서는 OpenFOAM-v1912 을 컴파일 하여 설치 하는 방법에 대해 예시로 소개합니다.

## **가. 설치 환경**

| 구분                      | 내용                     |
| ----------------------- | ---------------------- |
| 대상 시스템                  | 누리온                    |
| OS Version              | 리눅스 / CentOS 7.9       |
| CPU                     | <p>Intel Xeon Phi 7250 |
| <br>Intel Xeon 6148</p> |                        |
| 컴파일러                    | Intel 2018.3           |
| MPI                     | IntelMPI 2018.3        |
| 기타                      |                        |

## **나. 설치 전 환경 설정**

OpenFOAM-v1912 버전 설치에 필요한 gmp, mpfr, mpc, boost, CGAL 는 누리온 시스템에 미리 설치된 /apps/common 라이브러리들을 사용합니다.\
만약 다른 버전의 gmp, mpfr, mpc, boost, CGAL 가 필요한 경우는 사용자의 홈 디렉터리(/home01/$USER)나 scratch 디렉터리(/scratch/$USER)에 설치 후 환경 설정을 해서 사용하시면 됩니다.

\[ 환경 설정 ]

<pre class="language-shell-session"><code class="lang-shell-session"><strong>$ module purge
</strong><strong>$ module load cmake/3.12.3 
</strong><strong>$ module load intel/18.0.3 impi/18.0.3
</strong></code></pre>

## **다. OpenFOAM-v1912 버전 설치 과정**

설치 과정 소개는 tar 를 이용한 압축 해제 방법과 설정 방법등 진행 절차를 위주로 설명하고,\
소스 파일 다운로드 등은 생략합니다. 설치 소개 시 사용된 경로 <mark style="color:blue;">**/scratch/$USER**</mark> 는 설치 안내를 위한 경로 이므로 설치를 희망하는 경로로 작성하시기 바랍니다.

\[설치과정]

```shell-session
$ cd /scratch/$USER
$ mkdir OpenFOAM
$ cd OpenFOAM
$ tar -xzf OpenFOAM-v1912.tgz
$ tar -xzf ThirdParty-v1912.tgz
$ sed -i -e 's/\(boost_version=\)boost_1_64_0/\1boost-system/' OpenFOAM-v1912/etc/config.sh/CGAL
$ sed -i -e 's/\(cgal_version=\)CGAL-4.9.1/\1cgal-system/' OpenFOAM-v1912/etc/config.sh/CGAL
$ vi OpenFOAM-v1912/etc/bashrc
- - - [bashrc 수정 사항] 참고 - - -
$ mkdir -p OpenFOAM-v1912/platforms/linux64IccDPInt64Opt/bin
$ source /scratch/{USER_ID}/OpenFOAM/OpenFOAM-v1912/etc/bashrc
$ mkdir -p $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER
$ ln -s /apps/common/gmp/6.1.2 $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/gmp-system
$ ln -s /apps/common/mpfr/4.0.1 $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/mpfr-system
$ ln -s /apps/common/mpc/1.1.0 $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/mpc-system
$ ln -s /apps/common/boost/1.68.0 $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/boost-system
$ ln -s /apps/common/CGAL/4.9.1 $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/cgal-system
$ ln -s /apps/applications/cmake/3.12.3 $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/cmake-system
$ cd $WM_PROJECT_DIR
$ ./Allwmake
```

**\[bashrc 수정 사항]**

```bash
61line : export WM_COMPILER=Icc
69line : export WM_LABEL_SIZE=64
80line : export WM_MPLIB=INTELMPI
```

## **라. 테스트**

```shell-session
$ module purge
$ module load intel/18.0.3 impi/18.0.3
$ source /scratch/$USER/OpenFOAM/OpenFOAM-v1912/etc/bashrc
$ mkdir -p $FOAM_RUN
$ run
$ cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .
$ cd pitzDaily
$ blockMesh
$ simpleFoam
```

<mark style="color:blue;">※ 위 예제에서</mark> <mark style="color:blue;">**/scratch/$USER**</mark> <mark style="color:blue;"></mark><mark style="color:blue;">경로는 설치 테스트 시 사용된 경로이므로 변경</mark>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-ksc.gitbook.io/blog/install/nurion/openfoam/nurion-openfoam-v1912-install.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
