0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

メッシュの作成

Last updated at Posted at 2025-02-13
scale 0.001;
// Divisions in x/y/z directions.
nx 15;
ny 15;
nz 100;
// radius
r 10;
pi 3.1415926;
theta0 0.0;
theta45 45.0;
theta90 90.0;
theta135 135.0;
theta180 180.0;
theta225 225.0;
theta270 270.0;
theta315 315.0;
ratio 2.5;
ratioMid 0.75;
Xin1 #eval {$r/$ratio * cos($theta45 * $pi /180)};
Yin1 #eval {$r/$ratio * sin($theta45 * $pi /180)};
Xin2 #eval {$r/$ratio * cos($theta135 * $pi /180)};
Yin2 #eval {$r/$ratio * sin($theta135 * $pi /180)};
Xin3 #eval {$r/$ratio * cos($theta225 * $pi /180)};
Yin3 #eval {$r/$ratio * sin($theta225 * $pi /180)};
Xin4 #eval {$r/$ratio * cos($theta315 * $pi /180)};
Yin4 #eval {$r/$ratio * sin($theta315 * $pi /180)};
Xout1 #eval {$r * cos($theta45 * $pi /180)};
Yout1 #eval {$r * sin($theta45 * $pi /180)};
Xout2 #eval {$r * cos($theta135 * $pi /180)};
Yout2 #eval {$r * sin($theta135 * $pi /180)};
Xout3 #eval {$r * cos($theta225 * $pi /180)};
Yout3 #eval {$r * sin($theta225 * $pi /180)};
Xout4 #eval {$r * cos($theta315 * $pi /180)};
Yout4 #eval {$r * sin($theta315 * $pi /180)};
InYmin #eval {$r/$ratio*$ratioMid * sin($theta270 * $pi /180)};
InXmax #eval {$r/$ratio*$ratioMid * cos($theta0 * $pi /180)};
InYmax #eval {$r/$ratio*$ratioMid * sin($theta90 * $pi /180)};
InXmin #eval {$r/$ratio*$ratioMid * cos($theta180 * $pi /180)};
OutYmin #eval {$r * sin($theta270 * $pi /180)};
OutXmax #eval {$r * cos($theta0 * $pi /180)};
OutYmax #eval {$r * sin($theta90 * $pi /180)};
OutXmin #eval {$r * cos($theta180 * $pi /180)};
Zmin 0.0;
Zmax 1200;

geometry
{
}
vertices
(
//circle radius in
($Xin3 $Yin3 $Zmin) //0
($Xin4 $Yin4 $Zmin) //1
($Xin1 $Yin1 $Zmin) //2
($Xin2 $Yin2 $Zmin) //3
//circle radius out
($Xout3 $Yout3 $Zmin) //4
($Xout4 $Yout4 $Zmin) //5
($Xout1 $Yout1 $Zmin) //6
($Xout2 $Yout2 $Zmin) //7
//circle radius in
($Xin3 $Yin3 $Zmax) //8
($Xin4 $Yin4 $Zmax) //9
($Xin1 $Yin1 $Zmax) //10
($Xin2 $Yin2 $Zmax) //11
//circle radius out
($Xout3 $Yout3 $Zmax) //12
($Xout4 $Yout4 $Zmax) //13
($Xout1 $Yout1 $Zmax) //14
($Xout2 $Yout2 $Zmax) //15
);

blocks
(
//center(block0)
hex (0 1 2 3 8 9 10 11) ($nx $ny $nz) simpleGrading (1 1 1)
//Ymin(block1)
hex (1 0 4 5 9 8 12 13) ($nx $ny $nz) simpleGrading (1 1 1)›
›
//Xmax(block2)
hex (2 1 5 6 10 9 13 14) ($nx $ny $nz) simpleGrading (1 1 1›
›)
//Ymax(block3)
hex (3 2 6 7 11 10 14 15) ($nx $ny $nz) simpleGrading (1 1 ›
›1)

// Xmin(block4)
hex (0 3 7 4 8 11 15 12) ($nx $ny $nz) simpleGrading (1 1 1›
›)
);
edges
(
//circle radius out
arc 4 5 (0 $OutYmin $Zmin)
arc 5 6 ($OutXmax 0 $Zmin)
arc 6 7 (0 $OutYmax $Zmin)
arc 7 4 ($OutXmin 0 $Zmin)
arc 12 13 (0 $OutYmin $Zmax)
arc 13 14 ($OutXmax 0 $Zmax)
arc 14 15 (0 $OutYmax $Zmax)
arc 15 12 ($OutXmin 0 $Zmax)
//circle radius in
arc 0 1 (0 $InYmin $Zmin)
arc 1 2 ($InXmax 0 $Zmin)
arc 2 3 (0 $InYmax $Zmin)
arc 3 0 ($InXmin 0 $Zmin)
arc 8 9 (0 $InYmin $Zmax)
arc 9 10 ($InXmax 0 $Zmax)
arc 10 11 (0 $InYmax $Zmax)
arc 11 8 ($InXmin 0 $Zmax)
);

faces
(
);
boundary
(
walls
{
type wall;
faces
(
(5 13 14 6)
(6 14 15 7)
(7 15 12 4)
(4 12 13 5)
);
}
inlet
{
type patch;
faces
(
(0 1 2 3)
(0 4 5 1)
(1 5 6 2)
(2 6 7 3)
(7 4 0 3)
);
}
outlet
{
type patch;
faces
(
(8 9 10 11)
(8 12 13 9)
(9 13 14 10)
(10 14 15 11)
(11 15 12 8)
);
}
);
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?