Python 가상 환경을 이용한 설치 (Linux)

지원 OS

  • Ubuntu 22.04 or newer

BARAM 설치에 필요한 소프트웨어:

  • Python 3.9.x
  • OpenMPI 4.x or newer (Linux)
  • gcc-9

BARAM, NextFOAM, OpenMPI 설치

  • OpenMPI is installed in the /opt/openmpi-4.0.5 with --prefix option at configure command
sudo apt-get -y update 
sudo apt-get -y install build-essential flex zlib1g-dev libgmp-dev libmpfr-dev
wget https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.5.tar.gz 
tar zxf openmpi-4.0.5.tar.gz 
rm openmpi-4.0.5.tar.gz 
cd openmpi-4.0.5 
./configure --prefix=/opt/openmpi-4.0.5 
make -j all 
sudo make install 
echo 'export PATH=/opt/openmpi-4.0.5/bin:$PATH' | sudo tee -a /etc/bash.bashrc
  • GUI를 위한 필요 패키지 설치
sudo apt install -y  qtbase5-dev
sudo apt-get install -y '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev texinfo
  • Python 가상 환경을 이용한 BARAM 설치
sudo apt install -y  qtbase5-dev
pip install --upgrade pip
cd /opt
sudo git clone https://github.com/nextfoam/baram.git
cd baram
sudo apt-get install python3.9-venv
source ./venv/bin/activate
sudo pip install --ignore-installed -r requirements.txt
sudo pip install https://d3c6e16xufx1gb.cloudfront.net/wheels/PySide6_QtAds-4.2.1.2.dev0-cp38-abi3-linux_x86_64.whl
sudo pip install https://d3c6e16xufx1gb.cloudfront.net/wheels/pyqtgraph-0.13.5-py3-none-any.whl
  • NextFOAM 실행 파일 복사
  • 실행 파일 다운로드 후, 압축해제 하여 최상단 폴더에 복사
  • 이 가이드에서는, /opt/baram 이 최상단 폴더

/opt/baram
+-- requirements.txt
+-- ...
+-- solvers/
|   |
|   +-- openfoam/
|       |
|       +-- bin/
|       +-- etc/
|       +-- ...
+-- ...
  • wget 이나 curl을 이용하여 다운로드 가능

wget https://d3c6e16xufx1gb.cloudfront.net/solvers_linux_25.1.0_20250131.tar.xz

curl -L https://d3c6e16xufx1gb.cloudfront.net/solvers_linux_25.1.0_20250131.tar.xz -o solvers_linux_25.1.0_20250131.tar.xz

(Option) NextFOAM-2501 빌드

  • 실행 파일들을 다운로드 하는 대신 NextFOAM-2501를 직접 빌드 가능
  • NextFOAM-2501 솔버 빌드 후, 컴파일 된 솔버와 라이브러리들을 /opt/baram/solvers/openfoam 경로로 복사
export BARAM_DIR="/opt/baram"

sudo mkdir -p $BARAM_DIR/solvers/openfoam
sudo cp -a $WM_PROJECT_DIR/platforms/linux64GccDPInt32Opt/bin $BARAM_DIR/solvers/openfoam/
sudo cp -a $WM_PROJECT_DIR/platforms/linux64GccDPInt32Opt/lib $BARAM_DIR/solvers/openfoam/
sudo cp -a $WM_PROJECT_DIR/etc $BARAM_DIR/solvers/openfoam/

sudo mkdir -p $BARAM_DIR/solvers/openfoam/tlib

sudo cp -a $WM_THIRD_PARTY_DIR/platforms/linux64GccDPInt32/lib/* $BARAM_DIR/solvers/openfoam/tlib/
sudo cp -a $WM_THIRD_PARTY_DIR/platforms/linux64GccDPInt32/lib/libscotch* $BARAM_DIR/solvers/openfoam/tlib/
sudo cp -a $WM_THIRD_PARTY_DIR/platforms/linux64GccDPInt32/lib/sys-openmpi/libptscotch* $BARAM_DIR/solvers/openfoam/tlib/
sudo cp -a $WM_THIRD_PARTY_DIR/platforms/linux64Gcc/fftw-3.3.10/lib/libfftw3* $BARAM_DIR/solvers/openfoam/tlib/
sudo cp -a $WM_THIRD_PARTY_DIR/platforms/linux64Gcc/kahip-3.15/lib/libkahip_static.a $BARAM_DIR/solvers/openfoam/tlib/
  • Daemonizer와 resource 컴파일
cd /opt/baram
sudo gcc -o solvers/openfoam/bin/baramd misc/baramd.c
sudo python3 convertUi.py
  • Run baramMesh or baramFlow

. baramMesh.sh
. barmaFlow.sh