LoginSignup
0
0

More than 1 year has passed since last update.

OpenFOAM10 を LXD 環境にインストール

Last updated at Posted at 2021-06-15

OpenFOAM10 を LXD 環境の Ubuntu 22.04 にインストールする方法です。
参考ページ
Download v8 | Ubuntu
LXD で Ubuntu を使う

LXD 環境の構築

lxc launch ubuntu:22.04 ubuntu

インストールが完了するとホストから次のように見えます。

$ lxc list
| ubuntu  | RUNNING | 10.64.227.206 (eth0) | fd42:c9bf:2e1c:6d4f:216:3eff:fe41:e63f (eth0) | 
CONTAINER | 0         |

インストールした ubuntu 22.04 にログインします。

$ lxc console ubuntu
To detach from the console, press: <ctrl>+a q

ubuntu login: 

OpenFOAM10 のインストール

sudo sh -c "wget -O - https://dl.openfoam.org/gpg.key | apt-key add -"
sudo add-apt-repository http://dl.openfoam.org/ubuntu

次はかなり時間がかかります。

sudo apt -y install openfoam10

更新

sudo apt update
sudo apt upgrade

インストールできたことの確認

.bashrc に次の一行を加えます。

~/.bashrc
(省略)
#
. /opt/openfoam10/etc/bashrc
$ simpleFoam -help

Usage: simpleFoam [OPTIONS]
options:
  -case <dir>       specify alternate case directory, default is the cwd
  -fileHandler <handler>
                    override the fileHandler
  -hostRoots <(((host1 dir1) .. (hostN dirN))>
                    slave root directories (per host) for distributed running
  -libs <(lib1 .. libN)>
                    pre-load libraries
  -listFunctionObjects
                    List functionObjects
  -listFvOptions    List fvOptions

リモートデスクトップ x2go を使う

サーバー側 (インストールした ubuntu 20.04)
GNome もインストール

sudo apt -y install x2goserver x2goserver-fmbindings x2goclient
sudo apt -y install gnome-panel gnome-flashback gnome-session-flashback indicator-applet-appmenu

クライアント側  (ホストOS)

sudo apt install x2goclient

クライアント(ホストOS)で

x2goclient

GNOME を使います。
gnome_aa.png

gnome_bb.png

gnome_cc.png

ターミナルで次の操作を行う
$FOAM_RUN が設定されていることを確認

$ echo $FOAM_RUN
/home/uchida/OpenFOAM/uchida-8/run
mkdir -p $FOAM_RUN
cd $FOAM_RUN
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .
cd pitzDaily
blockMesh
simpleFoam
paraFoam

gnome_dd.png

サンプル
gnome_ee.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0