chtMultiRegionSimpleFoamのエラーメッセージ

954 views
Skip to first unread message

art.sugawara

unread,
Jun 22, 2016, 11:07:09 PM6/22/16
to OpenFOAM
いつもお世話になっております。
問題を早めにつぶすために重ねての投稿ご容赦ください。

L曲げ角パイプ内部の自然対流解析です。内部にheaterという
発熱設定した固体があります。添付図をご覧ください。

chtMultiRegionSimpleFoam実行で下記エラーが出ました。
------------------------------------
--> FOAM FATAL ERROR:
    patch type 'wall' not type 'mappedPatchBase'
    for patch Copy_heater_air of field T in file "/opt/OpenFOAM/me8000166-2.4.x/run/poly_cht/0/air/T"
    From function turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
(
    const fvPatch& p,
    const DimensionedField<scalar, volMesh>& iF,
    const dictionary& dict
)
    in file derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C at line 105.
FOAM exiting
------------------------------------

mappedPatchBaseとは初めて目にしました。ソースの場所も表示されて
いるのですが、ソースを読み解く力量がなく対処法が分かりません。
皆様のアドバイスを頂きたく、ケースディレクトリを添付いたしました。
メッシュデータ含めると添付容量的に厳しいので、boundaryのみ残して
メッシュデータは削除しています。
よろしくお願いいたします。

fig2.png
poly_cht_nomesh.tar

art.sugawara

unread,
Jun 24, 2016, 12:25:23 AM6/24/16
to OpenFOAM
いつもお世話になっております。また自己レスになります。

投稿後も問題究明努めておりますが、春日様のサイトに
http://www.geocities.jp/penguinitis2002/study/OpenFOAM/CHT/CHT.html
サンプルモデルsimpleCHTがアップされていたので
モデル化過程をステップごとに自分のモデルと比較して
違いが見えてきました。

下記はsimpleCHTでのsplitMeshRegionsコマンド実行ログです。
-----------------------------------------------------------
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.4.x                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 2.4.x-e713234c04f6
Exec   : splitMeshRegions -cellZones -overwrite
Date   : Jun 24 2016
Time   : 11:55:34
Host   : "dexcs2015"
PID    : 13608
Case   : /opt/OpenFOAM/me8000166-2.4.x/run/simpleCHT
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Allowing user-supplied system call operations

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

Create mesh for time = 0

Creating single patch per inter-region interface.

Trying to match regions to existing cell zones.


Number of regions:2

Writing region per cell file (for manual decomposition) to "/opt/OpenFOAM/me8000166-2.4.x/run/simpleCHT/constant/cellToRegion"

Writing region per cell as volScalarField to "/opt/OpenFOAM/me8000166-2.4.x/run/simpleCHT/0/cellToRegion"

Region Cells
------ -----
0 280
1 120

Region Zone Name
------ ---- ----
0 0 air
1 1 solid

Sizes of interfaces between regions:

Interface Region Region Faces
--------- ------ ------ -----
0  0 1 20

Reading volScalarField cellToRegion
Reading volScalarField p
Reading volScalarField T
Reading volScalarField k
Reading volScalarField epsilon
Reading volScalarField p_rgh
Reading volVectorField U


Adding patches


Adding patches

For interface between region air and solid added patches
    5 air_to_solid
    6 solid_to_air

Region 0
--------
Creating mesh for region 0 air
Testing:"/opt/OpenFOAM/me8000166-2.4.x/run/simpleCHT/system/air/fvSchemes"
Mapping fields
Mapping field cellToRegion
Mapping field k
Mapping field p_rgh
Mapping field p
Mapping field T
Mapping field epsilon
Mapping field U
Deleting empty patches
Writing new mesh
Writing addressing to base mesh
Writing map pointRegionAddressing from region0 points back to base mesh.
Writing map faceRegionAddressing from region0 faces back to base mesh.
Writing map cellRegionAddressing from region0 cells back to base mesh.
Writing map boundaryRegionAddressing from region0 boundary back to base mesh.

Region 1
--------
Creating mesh for region 1 solid
Testing:"/opt/OpenFOAM/me8000166-2.4.x/run/simpleCHT/system/solid/fvSchemes"
Mapping fields
Mapping field cellToRegion
Mapping field k
Mapping field p_rgh
Mapping field p
Mapping field T
Mapping field epsilon
Mapping field U
Deleting empty patches
Writing new mesh
Writing addressing to base mesh
Writing map pointRegionAddressing from region1 points back to base mesh.
Writing map faceRegionAddressing from region1 faces back to base mesh.
Writing map cellRegionAddressing from region1 cells back to base mesh.
Writing map boundaryRegionAddressing from region1 boundary back to base mesh.
End
-----------------------------------------------------------


注目したのは以下の箇所
Sizes of interfaces between regions:

Interface Region Region Faces
--------- ------ ------ -----
0  0 1 20

Reading volScalarField cellToRegion
Reading volScalarField p
Reading volScalarField T
Reading volScalarField k
Reading volScalarField epsilon
Reading volScalarField p_rgh
Reading volVectorField U


Adding patches


Adding patches

For interface between region air and solid added patches
    5 air_to_solid
    6 solid_to_air


対するに私のモデルでは
Sizes of interfaces between regions:

Interface Region Region Faces
--------- ------ ------ -----

Reading volScalarField alphat
Reading volScalarField p_rgh
Reading volScalarField mut
Reading volScalarField cellToRegion
Reading volScalarField p
Reading volScalarField T
Reading volScalarField k
Reading volScalarField epsilon
Reading volVectorField U


Adding patches


Adding patches


インターフェースを認識・生成していません。

その結果、constant/air/polyMesh/boundaryデータが
simpleCHTでは
    air_to_solid
    {
        type            mappedWall;
        inGroups        1(wall);
        nFaces          20;
        startFace       1134;
        sampleMode      nearestPatchFace;
        sampleRegion    solid;
        samplePatch     solid_to_air;
    }
となっていますが、私のモデルでは
    Copy_heater_air
    {
        type            wall;
        inGroups        1(wall);
        nFaces          239;
        startFace       525295;
    }
となっています。


質問したソルバのエラーメッセージ

patch type 'wall' not type 'mappedPatchBase'
というのはこの箇所を指しているようです。

なぜインターフェースが作成されないのかはちょっと置いといて
boundaryデータのみ手作業で書き換えてみました。
そうしたらソルバは走るようになりました。

ということでsplitMeshRegionsコマンドでインターフェースが
自動作成されないというのが問題のキモと思います。
splitMeshRegions実行前の私のモデルになにか足りないものが
あるのだと思います。(splitMeshRegionsが参照するもの?)

皆様からのアドバイスをお待ちしております。


2016年6月23日木曜日 12時07分09秒 UTC+9 art.sugawara:

art.sugawara

unread,
Jun 28, 2016, 12:53:15 AM6/28/16
to OpenFOAM
いつもお世話になっております。問題解決のため日々格闘していますが
自己レスです。
 

前回同様、春日様のサイトにあったsimpleCHTとの比較をしています。
(チュートリアルのmultiRegionheaterでも同様ですが)

 
simpleCHTの場合:
blockMesh; topoSet実行後のboundaryです。
解析領域の外表面のみ設定されています。
/*--------------------------------*- C++ -*----------------------------------*\

| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.4.x                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       polyBoundaryMesh;
    location    "constant/polyMesh";
    object      boundary;

}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

5
(
    top
    {
        type            wall;
        inGroups        1(wall);
        nFaces          20;
        startFace       760;
    }
    bottom
    {
        type            wall;
        inGroups        1(wall);
        nFaces          20;
        startFace       780;
    }
    left
    {
        type            patch;
        nFaces          20;
        startFace       800;
    }
    right
    {
        type            patch;
        nFaces          20;
        startFace       820;
    }
    frontAndBack
    {
        type            empty;
        inGroups        1(empty);
        nFaces          800;
        startFace       840;
    }
)

// ************************************************************************* //


topoSetで作られたcellSetとcellZoneがsetSetコマンドで確認できます。
Time:0  cells:400  faces:1640  points:882  patches:5  bb:(0 0 0) (1 1 0.1)
cellSets:
        air     size:280
        solid   size:120
cellZones:
        air     size:280
        solid   size:120


splitMeshRegions -cellZones -detectOnlyを実行すると
Interfaceが認識されています。


/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.4.x                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 2.4.x-e713234c04f6

Exec   : splitMeshRegions -cellZones -detectOnly
Date   : Jun 28 2016
Time   : 11:29:04
Host   : "dexcs2015"
PID    : 18598


splitMeshRegions -cellZonesを実行後のconstant/air/polyMesh/boundaryです。
Interface境界がmappedWallタイプとして追加定義されています。
/*--------------------------------*- C++ -*----------------------------------*\


| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.4.x                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/

FoamFile
{
    version     2.0;
    format      ascii;
    class       polyBoundaryMesh;
    location    "constant/air/polyMesh";
    object      boundary;


}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

5
(
    bottom
    {
        type            wall;
        inGroups        1(wall);
        nFaces          20;
        startFace       526;
    }
    left
    {
        type            patch;
        nFaces          14;
        startFace       546;
    }
    right
    {
        type            patch;
        nFaces          14;
        startFace       560;
    }
    frontAndBack
    {
        type            empty;
        inGroups        1(empty);
        nFaces          560;
        startFace       574;


    }
    air_to_solid
    {
        type            mappedWall;
        inGroups        1(wall);
        nFaces          20;
        startFace       1134;
        sampleMode      nearestPatchFace;
        sampleRegion    solid;
        samplePatch     solid_to_air;
    }

)

// ************************************************************************* //


私のモデルの場合:
STAR-CCM+で生成したメッシュをccm26ToFoamでOpenFOAM形式に
変換したあとのcontant/polyMesh/boundaryです。
Interfaceとすべき境界がwallとして定義されています。
 Copy_heater_air、heater_air
 Copy_pipe_air、pipe_air
 Copy_pipe_heater、pipe_heater
/*--------------------------------*- C++ -*----------------------------------*\

| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.4.x                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       polyBoundaryMesh;
    location    "constant/polyMesh";
    object      boundary;

}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

9
(


    Copy_heater_air
    {
        type            wall;
        inGroups        1(wall);
        nFaces          239;

        startFace       791738;
    }
    outlet
    {
        type            patch;
        nFaces          395;
        startFace       791977;
    }
    Copy_pipe_air
    {
        type            wall;
        inGroups        1(wall);
        nFaces          17130;
        startFace       792372;
    }
    inlet
    {
        type            patch;
        nFaces          377;
        startFace       809502;


    }
    heater_air
    {
        type            wall;
        inGroups        1(wall);
        nFaces          239;

        startFace       809879;
    }
    Copy_pipe_heater
    {
        type            wall;
        inGroups        1(wall);
        nFaces          156;
        startFace       810118;
    }
    pipe_air
    {
        type            wall;
        inGroups        1(wall);
        nFaces          17130;
        startFace       810274;
    }
    pipe_side
    {
        type            wall;
        inGroups        1(wall);
        nFaces          19512;
        startFace       827404;
    }
    pipe_heater
    {
        type            wall;
        inGroups        1(wall);
        nFaces          156;
        startFace       846916;
    }
)

// ************************************************************************* //


setSetコマンドでcellSetとcellZoneができているのが確認できます。
Time:0  cells:140902  faces:847072  points:670692  patches:9  bb:(0 -0.1 -0.1) (4.1 6 1.1)
cellSets:
        air     size:93017
        heater  size:420
        pipe    size:47465
cellZones:
        air     size:93017
        heater  size:420
        pipe    size:47465


splitMeshRegions -cellZones -detectOnlyを実行するとInterfaceがありません。
Interface境界を見つけられないのだと思います。

/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.4.x                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 2.4.x-e713234c04f6
Exec   : splitMeshRegions -cellZones -detectOnly
Date   : Jun 28 2016
Time   : 11:11:18
Host   : "dexcs2015"
PID    : 18236
Case   : /opt/OpenFOAM/me8000166-2.4.x/run/poly_cht

nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Allowing user-supplied system call operations

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

Create mesh for time = 0

Creating single patch per inter-region interface.

Trying to match regions to existing cell zones.


Number of regions:3

Writing region per cell file (for manual decomposition) to "/opt/OpenFOAM/me8000166-2.4.x/run/poly_cht/constant/cellToRegion"

Writing region per cell as volScalarField to "/opt/OpenFOAM/me8000166-2.4.x/run/poly_cht/0/cellToRegion"

 
Region  Cells
------  -----
0       93017
1       420
2       47465
 
Region  Zone    Name
------  ----    ----
0       0       air
1       1       heater
2       2       pipe
 
Sizes of interfaces between regions:
 
Interface       Region  Region  Faces
---------       ------  ------  -----
 
という状況です。
私のモデルの問題はsplitMeshRegionsかける前の段階でInterfaceと
すべき境界3組がboundaryに定義されていることではと推測しています。
STAR-CCM+が書き出したメッシュファイルをいじるのは至難と
思うので、OpenFOAM側でInterface境界のないboundaryを再定義
すればいいのではと考えるのですが、mesh manipulationツール
などでできないでしょうか?

よろしくお願いいたします。


2016年6月24日金曜日 13時25分23秒 UTC+9 art.sugawara:

art.sugawara

unread,
Jul 6, 2016, 8:52:02 PM7/6/16
to OpenFOAM
いつもお世話になっております。
なかなか解決に至らず苦心しておりますが、
少し進展があったのでコメントさせていただきます。
 
以下のサイトを見つけました。
cfMesh and Multi Region Meshing
http://www.cfd-online.com/Forums/openfoam-meshing/151557-cfmesh-multi-region-meshing.html
 
サンプルモデルが添付されていたので中身を調べたところ、
以下の手順でCHTモデル作成されていました。
 
(1)ケースディレクトリ配下に領域毎のメッシュを格納する
   caseディレクトリを作成する。
(2)cfMeshで領域毎にメッシュを作成する。
(3)作成したメッシュをconstantディレクトリにコピーする。
(4)changeDictionaryコマンドで各領域メッシュのboundaryと
   0ディレクトリの初期境界条件を修正する。
 
OpenFOAMチュートリアルでは、topoSet、splitMeshRegions、
changeDictionaryを使ってCHTモデル作成していて、どこを
どう修正されたか今ひとつ不明だったのですが、
個別メッシュを格納したディレクトリをconstantディレクトリ
にコピーしてchangeDictionaryでboundaryと境界条件を修正
すればいいんだと分かり軽く感動しました。
 
特に領域間の伝熱設定は「boundaryのなかでmappedWall
タイプを使うだけ」は私には新知見でした。
 
そこで自分のモデルをまず高温空気が強制流入する条件に変え、
changeDictionaryを以下のように変更しました。
 
system/air/changeDictionary

/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.4.0                                 |

|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      changeDictionaryDict;

}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dictionaryReplacement
{
    boundary
    {
 Copy_heater_air
 {
            type            mappedWall;
            sampleMode      nearestPatchFace;
            sampleRegion    heater;
            samplePatch     heater_air;
 }
        outlet
        {
            type            patch;
        }
 Copy_pipe_air
 {
            type            mappedWall;
            sampleMode      nearestPatchFace;
            sampleRegion    pipe;
            samplePatch     pipe_air;
 }
        inlet
        {
            type            patch;
        }
    }
       
    T
    {
        internalField   uniform 300;
        boundaryField
        {
            Copy_heater_air
            {
                type            compressible::turbulentTemperatureCoupledBaffleMixed;
                value           uniform 300;
                Tnbr            T;
                kappa           fluidThermo;
                kappaName       none;
            }
            Copy_pipe_air
            {
                type            compressible::turbulentTemperatureCoupledBaffleMixed;
                value           uniform 300;
                Tnbr            T;
                kappa           fluidThermo;
                kappaName       none;
            }
            inlet
            {
                type            fixedValue;
                value           uniform 600;
            }
            outlet
            {
                type            zeroGradient;
                ~value;
            }
        }
    }
    U
    {
        internalField   uniform (0 0 0);
        boundaryField
        {
            "Copy_.*"
            {
                type            fixedValue;
                value           uniform (0 0 0);
            }
            inlet
            {
                type            fixedValue;
                value           uniform (0.1 0 0);
            }
            outlet
            {
                type            zeroGradient;
                ~value;
            }
        }
    }
    alphat
    {
        internalField   uniform 0;
        boundaryField
        {
            "Copy_.*"
            {
                type            compressible::alphatWallFunction;
                Prt             0.85;
                value           uniform 0;
            }
            "(inlet|outlet)"
            {
                type            calculated;
                value           uniform 0;
            }
        }
    }
    epsilon
    {
        internalField   uniform 0.01;
        boundaryField
        {
            "Copy_.*"
            {
                type            compressible::epsilonWallFunction;
                value           uniform 0.01;
                Cmu             0.09;
                kappa           0.41;
                E               9.8;
            }
            "(inlet|outlet)"
            {
                type            zeroGradient;
                ~value;
            }
        }
    }
    k
    {
        internalField   uniform 0.1;
        boundaryField
        {
            "Copy_.*"
            {
                type            compressible::kqRWallFunction;
                value           uniform 0.1;
            }
            "(inlet|outlet)"
            {
                type            zeroGradient;
                ~value;
            }
        }
    }
    mut
    {
        internalField   uniform 0;
        boundaryField
        {
            "Copy_.*"
            {
                type            mutkWallFunction;
                Cmu             0.09;
                kappa           0.41;
                E               9.8;
                value           uniform 0;
            }
            "(inlet|outlet)"
            {
                type            calculated;
                value           uniform 0;
            }
        }
    }
    p
    {
        internalField   uniform 101325;
        boundaryField
        {
            ".*"
            {
                type            calculated;
                value           uniform 101325;
            }
        }
    }
    p_rgh
    {
        internalField   uniform 101325;
        boundaryField
        {
            "Copy_.*"
            {
                type            fixedFluxPressure;
                value           uniform 101325;
            }
            "(inlet|outlet)"
            {
                type            fixedValue;
                value           uniform 101325;
            }
        }
    }
}
// ************************************************************************* //
 
chtMultiRegionSimpleFoam実行したところ、添付図のように
流体から固体への伝熱がそれなりになされている結果でした。
 
次に本丸の強制流入なし、自然対流条件にするために、
system/air/changeDictionaryのTとUの一部を修正しました。
    T
    {
        internalField   uniform 300;
        boundaryField
        {
            Copy_heater_air
            {
                type            compressible::turbulentTemperatureCoupledBaffleMixed;
                Tnbr            T;
                kappa           fluidThermo;
                kappaName       none;
                heatSource      flux;
                q               uniform 1000;
            }
            Copy_pipe_air
            {
                type            compressible::turbulentTemperatureCoupledBaffleMixed;
                value           uniform 300;
                Tnbr            T;
                kappa           fluidThermo;
                kappaName       none;
            }
            inlet
            {
                type            fixedValue;
                value           uniform 300;
            }
            outlet
            {
                type            zeroGradient;
                ~value;
            }
        }
    }
    U
    {
        internalField   uniform (0 0 0);
        boundaryField
        {
            "Copy_.*"
            {
                type            fixedValue;
                value           uniform (0 0 0);
            }
            inlet
            {
                type            pressureInletOutletVelocity;
                value           uniform (0 0 0);
            }
            outlet
            {
                type            zeroGradient;
                ~value;
            }
        }
    }
 
しかしながらこれではまるで発熱しませんでした。
compressible::turbulentTemperatureCoupledBaffleMixedに
heatSourceやqを設定してもだめのようです。
 
過去にcompressible::turbulentHeatFluxTemperatureに
heatSourceやqを設定したときはちゃんと流体温度が上昇
してくれたのですが。
 
質問内容と件名が食い違ってきてしまっていますが、
CHT解析で流体と接する固体に発熱設定するにはどうすれば
いいのでしょうか?体積発熱でも面積発熱でも結構です。
よろしくお願いします

2016年6月28日火曜日 13時53分15秒 UTC+9 art.sugawara:
fig3_T_solid.png
Reply all
Reply to author
Forward
0 new messages