LoginSignup
0
0

More than 5 years have passed since last update.

waves2FoamをDEXCS 2015 for OpenFOAMにインストール

Last updated at Posted at 2016-07-04

この記事はOpenFOAMのライブラリーであるwaves2FoamをDEXCS2015にインストールする方法をまとめた記事である。waves2Foamライブラリーは造波モデルや波の減衰モデルをOpenFOAM上で扱うためのライブラリーである。

参考サイト:
waves2FoamWiki
waveDyMFoam

1. データのダウンロード

1.svnを使う場合
工事中...

2.svnを使わない場合

参考サイトにならって、gfortranを入れる

Ubuntu: sudo apt-get install libgsl0-dev gfortran
Fedora: sudo yum install gsl-devel
Suse: sudo zypper install gsl-devel

https://github.com/blueCFD/waves2Foam
上記のサイトの右上のClone or douwnloadからzip形式でダウンロードする。

次のディレクトリに保存したデータ(waves2Foam-master.zip)を配置して展開する
home/(ユーザー名)/OpenFOAM/OpenFOAM-2.4.x/applications/solvers

展開したフォルダの名前をwaves2Foam-masterからwaves2Foamに変更する

2. waveFoamのコンパイル

home/(ユーザー名)/OpenFOAM/OpenFOAM-2.4.x/applications/solvers/waves2Foam/bin

に移動し、bashcr.orgをテキストで開き、環境変数を以下のように編集する

### USER DEFINED ENVIRONMENTAL VARIABLES 
export WAVES_DIR=$WM_PROJECT_DIR/applications/solvers/waves2Foam 
export WAVES_APPBIN=$FOAM_USER_APPBIN 
export WAVES_LIBBIN=$FOAM_USER_LIBBIN
export WAVES_GSL_INCLUDE=/usr/include export WAVES_GSL_LIB=/usr/lib64

### OTHER STATIC ENVIRONMENTAL VARIABLES ## Version number

OF-terminalを起動し、次のコマンドを入力する。

cd home/(ユーザー名)/OpenFOAM/OpenFOAM-2.4.x/applications/solvers/waves2Foam
./Allwmake

これでコンパイル完了となる。
ためしに、OF-terminal上でwaveと入力したのちTabキーを押すと、waveFoamが一覧に出るはずである。

3. waveDyMFoamのコンパイル

home/(ユーザー名)/OpenFOAM/OpenFOAM-2.4.x/applications/solvers/multiphase/interFoam/

にあるwaveDyMFoamフォルダをコピーして、以下のフォルダ内に貼り付ける

home/(ユーザー名)/OpenFOAM/OpenFOAM-2.4.x/applications/solvers/waves2Foam/applications/solvers/solvers240/waveFoam

フォルダ名をinterDyMFoamからwaveDyMFoamに変更する。
bash:
waveDyMFoam/Make

に移動し、filesを開き、中身を次のように変更する

waveDyMFoam.C

EXE = $(FOAM_APPBIN)/waveDyMFoam

同様に optionsを開き

EXE_INC = \
    -I.. \
    -I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
    -I$(LIB_SRC)/transportModels \
    -I$(LIB_SRC)/transportModels/incompressible/lnInclude \
    -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
    -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
    -I$(LIB_SRC)/transportModels/immiscibleIncompressibleTwoPhaseMixture/lnInclude \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/dynamicMesh/lnInclude \
    -I$(LIB_SRC)/dynamicFvMesh/lnInclude \
     -I./../../../../../src/waves2Foam/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude \
    -I$(LIB_SRC)/fvOptions/lnInclude \
    -I$(LIB_SRC)/sampling/lnInclude

EXE_LIBS = \
    -limmiscibleIncompressibleTwoPhaseMixture \
    -lincompressibleTurbulenceModel \
    -lincompressibleRASModels \
    -lincompressibleLESModels \
    -lfiniteVolume \
    -ldynamicMesh \
    -ldynamicFvMesh \
    -ltopoChangerFvMesh \
    -lmeshTools \
    -lfvOptions \
    -lsampling \
     -L$(FOAM_LIBBIN) \
     -lwaves2Foam

と書き換える。

waveDyMFoamのフォルダに戻り、interDyMFoam.Cの名前をwaveDyMFoam.Cに変更するwaveDyMFoam.Cを開き以下のように変更する。

#include "relaxationZone.H"

を追加し、"initContinuityErrs.H" と createFields.H の間に

#include "readGravitationalAcceleration.H"
#include "readWaveProperties.H"

を加える

次に、#include "alphaEqnSubCycle.H"の下に、

relaxing.correct(); 

を追加する。
ファイルを保存後、

wmake

でコンパイルがスタートする。

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