cellZoneを作成する
次にtopoSetでcellZoneを作成して、作成したcellZoneを元にsplitMultiRegionで領域分割を行います。
ここではtopoSetのみを行い、後ほどsplitMultiRegionで領域分割を行います。
system/topoSetDict
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | actions (     // Heater     {         name    heaterCellSet;         type    cellSet;         action  new;         source  boxToCell;         box     (-0.01001 0 -100) (0.01001 0.00999 100);     }     {         name    heaterCellSet;         type    cellSet;         action  add;         source  boxToCell;         box     (-0.01001 -100 -0.01001) (0.01001 0.00999 0.01001);     }     {         name    heater;         type    cellZoneSet;         action  new;         source  setToCellZone;         set     heaterCellSet;     }     // leftSolid     {         name    leftSolidCellSet;         type    cellSet;         action  new;         source  boxToCell;         box     (-100 0 -100) (-0.01001 0.00999 100);     }     {         name    leftSolid;         type    cellZoneSet;         action  new;         source  setToCellZone;         set     leftSolidCellSet;     }     // rightSolid     {         name    rightSolidCellSet;         type    cellSet;         action  new;         source  boxToCell;         box     (0.01001 0 -100) (100 0.00999 100);     }     {         name    rightSolid;         type    cellZoneSet;         action  new;         source  setToCellZone;         set     rightSolidCellSet;     }     // topAir     {         name    topAirCellSet;         type    cellSet;         action  new;         source  boxToCell;         box     (-100 0.00999 -100) (100 100 100);     }     {         name    topAir;         type    cellZoneSet;         action  new;         source  setToCellZone;         set     topAirCellSet;     }     // bottomWater is all the other cells     {         name    bottomWaterCellSet;         type    cellSet;         action  new;         source  cellToCell;         set     heaterCellSet;     }     {         name    bottomWaterCellSet;         type    cellSet;         action  add;         source  cellToCell;         set     leftSolidCellSet;     }     {         name    bottomWaterCellSet;         type    cellSet;         action  add;         source  cellToCell;         set     rightSolidCellSet;     }     {         name    bottomWaterCellSet;         type    cellSet;         action  add;         source  cellToCell;         set     topAirCellSet;     }     {         name    bottomWaterCellSet;         type    cellSet;         action  invert;     }     {         name    bottomWater;         type    cellZoneSet;         action  new;         source  setToCellZone;         set     bottomWaterCellSet;     } ); | 
以下のコマンドでcellZoneを作成します。
| 1 | topoSet | 
例えばHeater部分のみ見ていくと、
- 黄色の丸の座標値を対角線にした直方体でcellSetを新規で作成
- 緑色の丸の座標値を対角線にした直方体でcellSetを追加
- 上記で作成したcellSetをcellZoneとして作成します。
これをParaViewで確認することができます。

 
0.origのコピー
次に0.origを0フォルダとしてコピーします。
| 1 | cp -r 0.orig 0 | 
Allrun.preスクリプト内では以下の記述で同様のことができます。
| 1 | restore0Dir | 
Allrun.preの冒頭に「${WM_PROJECT_DIR:?}/bin/tools/RunFunctions」という記述があるので、また別のスクリプトを使用していることがわかります。
このスクリプトの中に「restore0Dir」関数があります。
気になる方は、vimなどで調べてみてください。
| 1 | vi ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions | 
領域に分割
この状態だとまだ領域を分割できていないので、splitMeshRegionsコマンドを使ってcellZoneで分割を行います。
複数回計算させながら分割を行うのですが、分割した最終状態だけがほしいのでoverwriteをオプションで付けておきます。
| 1 | splitMeshRegions -cellZones -overwrite | 
これにより物理量を設定する0フォルダも領域ごとに設定が分かれれます。
 
メッシュ情報として「constant/bottomWater/polyMesh/boundary」は境界条件のtypeにも関わるので確認しておきます。
constant/bottomWater/polyMesh/boundary
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | 8 (     minX     {         type            patch;         nFaces          50;         startFace       3858;     }     maxX     {         type            patch;         nFaces          50;         startFace       3908;     }     minY     {         type            wall;         inGroups        1(wall);         nFaces          292;         startFace       3958;     }     minZ     {         type            wall;         inGroups        1(wall);         nFaces          150;         startFace       4250;     }     maxZ     {         type            wall;         inGroups        1(wall);         nFaces          150;         startFace       4400;     }     bottomWater_to_rightSolid     {         type            mappedWall;         inGroups        1(wall);         nFaces          130;         startFace       4550;         sampleMode      nearestPatchFace;         sampleRegion    rightSolid;         samplePatch     rightSolid_to_bottomWater;     }     bottomWater_to_leftSolid     {         type            mappedWall;         inGroups        1(wall);         nFaces          130;         startFace       4680;         sampleMode      nearestPatchFace;         sampleRegion    leftSolid;         samplePatch     leftSolid_to_bottomWater;     }     bottomWater_to_heater     {         type            mappedWall;         inGroups        1(wall);         nFaces          92;         startFace       4810;         sampleMode      nearestPatchFace;         sampleRegion    heater;         samplePatch     heater_to_bottomWater;     } ) | 
以下のような構造になっています。
| 1 2 3 4 5 6 7 8 9 10 |     regionA_to_regionB     {         type            mappedWall;         inGroups        1(wall);         nFaces          130;         startFace       4550;         sampleMode      nearestPatchFace;         sampleRegion    regionA;         samplePatch     regionB_to_regionA;     } | 
typeはmappedWallとしておく必要があります。
splitMeshRegionsの実行は必ず0.origをコピーして0フォルダを作成した後にしてください。
 
											
 
							
							
							
															 
							
							
							
															 
							
							
							
															 
							
							
							
															 
							
							
							
															 
							
							
							
															 
							
							
							
															 
							
							
							
															 
							
							
							
															 
							
							
							
															 
							
							
							
															 
							
							
							
															 
							
							
							
															 
							
							
							
															 
							
							
							
															 
							
							
							
															 
							
							
							
															 
							
							
							
															 
							
							
							
															 
							
							
							
															 
										
					 
									 
			 
 


 Follow @t_kun_kamakiri
Follow @t_kun_kamakiri


