LoginSignup
3
2

More than 3 years have passed since last update.

OpenFOAMのStarCCM+コンバーターのインストール

Last updated at Posted at 2019-10-31

はじめに

こちらの記事を参考にccmToFoamを利用しようとしたところ,リンクが変わっており,探すのに苦労したので,こちらで記事にしておきます.

環境: Ubuntu 18.04.3 LTS (Mac(Catalina)上のParallesDesktop14環境)
バージョン:OpenFOAM v1906

ビルド

libccmio-2.6.1の場所が,かなり変わっており,苦労しました.
以下のリンクにあるようです.
http://visit.ilight.com/svn/visit/trunk/third_party/

cd ThirdParty-v1906/
wget http://visit.ilight.com/svn/visit/trunk/third_party/libccmio-2.6.1.tar.gz
tar zxvf  libccmio-2.6.1.tar.gz 
./makeCCMIO 

実際は,OpenFOAM-v1906/applications/utilities/mesh/conversion/ccmのAllwmakeを叩けばいいのですが,共有ライブラリが見えなかったりで面倒な場合は,以下のようにした方が確実です.

cd ../OpenFOAM-v1906/
./Allwmake

以下のようなlogが途中出力されていきます.

wmake foamToCcm
make[3]: Entering directory '/home/parallels/OpenFOAM/OpenFOAM-v1906/applications/utilities/mesh/conversion/ccm/foamToCcm'
Making dependency list for source file foamToCcm.C

動作確認

問題なくビルドできたら,以下のコマンドで動作確認をします.

ccmToFoamのテスト

$ ccmToFoam -help
Usage: ccmToFoam [OPTIONS] <ccm-file>
Arguments:
  <ccm-file>        The input .ccm or .ccmg file
Options:
  -ascii            Write in ASCII format instead of binary
  -case <dir>       Specify case directory to use (instead of the cwd)
  -export           Re-export mesh in CCM format for post-processing
  -list             List some information about the geometry
  -merge            Merge in-place interfaces
  -name <name>      Provide alternative base name when re-exporting (implies
                    -export). Default is <meshExport>.
  -noBaffles        Remove any baffles by merging the faces
  -numbered         Use numbered names (eg, patch_0, zone_0) only
  -remap <name>     Use specified remapping dictionary instead of
                    <constant/remapping>
  -scale <scale>    Geometry scaling factor - default is 1 (ie, no scaling)
  -solids           Treat any solid cells present just like fluid cells. The
                    default is to remove them.
  -doc              Display documentation in browser
  -help             Display short help and exit
  -help-compat      Display compatibility options and exit
  -help-full        Display full help and exit

Reads CCM files as written by PROSTAR/STARCCM and writes an OPENFOAM  polyMesh.
Multi-region support for PROSTAR meshes should be stable. Multi-region merging
for STARCCM meshes will not always be successful.

Using: OpenFOAM-v1906 (1906) (see www.OpenFOAM.com)
Build: v1906
Arch:  LSB;label=32;scalar=64

foamToCcmの動作テスト

$ foamToCcm -help
Usage: foamToCcm [OPTIONS]
Options:
  -case <dir>       Specify case directory to use (instead of the cwd)
  -constant         Include the 'constant/' dir in the times list
  -latestTime       Select the latest time
  -mesh             Convert mesh only
  -name <name>      Provide alternative base name. Default is <meshExport>.
  -noZero           Exclude the '0/' dir from the times list
  -overwrite        No backup of existing output files
  -remap <name>     Use specified remapping dictionary instead of
                    <constant/remapping>
  -results          Convert results only
  -time <ranges>    List of ranges. Eg, ':10,20 40:70 1000:', 'none', etc
  -doc              Display documentation in browser
  -help             Display short help and exit
  -help-compat      Display compatibility options and exit
  -help-full        Display full help and exit

Translate OPENFOAM data to CCM format

Using: OpenFOAM-v1906 (1906) (see www.OpenFOAM.com)
Build: v1906
Arch:  LSB;label=32;scalar=64

念のため,tutorialのpitzDailyに対して動作確認

foamToCcm -mesh
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1906                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : v1906 OPENFOAM=1906
Arch   : "LSB;label=32;scalar=64"
Exec   : foamToCcm -mesh
Date   : Oct 31 2019
Time   : 21:46:30
Host   : ubuntu
PID    : 16183
I/O    : uncollated
Case   : /home/user/Desktop/pitzDaily
nProcs : 1
trapFpe: Floating point exception trapping enabled (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

--> FOAM Warning : 
    From function static Foam::instantList Foam::timeSelector::select0(Foam::Time&, const Foam::argList&)
    in file db/Time/timeSelector.C at line 257
    No time specified or available, selecting 'constant'
Create polyMesh for time = constant


Time [0] = constant
no constant/boundaryRegion information available
no constant/cellTable information available
moved existing file -> "meshExport.ccmg.bak*"
writing points: 25012
writing internalFaces: 24170
writing boundaryFaces: 30 57 223 250 24450
writing cells: 12225
created cellTable from cellZones
matching cellZones to cellTable

End

ケースディレクトリにmeshExport.ccmgというファイルが生成された.

最後に

もし利用された方は,動作確認して問題なく動作したStar-CCM+のバージョンを教えてもらえると,記事の作者は喜びます.(もちろん動作しなかったバージョンも)

3
2
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
3
2