-
Notifications
You must be signed in to change notification settings - Fork 0
/
planewave_2d_3.geo
84 lines (62 loc) · 2.35 KB
/
planewave_2d_3.geo
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
// ----------------------------------------------------------------------------
//
// Gmsh GEO file
//
// Homogenous domain for 2D planewave problem
// - unstructured quadrilateral mesh
// - sponge layer
//
// ----------------------------------------------------------------------------
// Copyright (C) 2022 Adeeb Arif Kor
// ------------------------------------------------------------------------- //
// Geometry and mesh parameters
// ------------------------------------------------------------------------- //
speedOfSound = 1500.0;
sourceFrequency = 500000.0;
wavelength = speedOfSound / sourceFrequency;
numElementPerWavelength = 3.0;
domainLength = 0.12;
domainRadius = 0.035;
hmin = 0.005; // placeholder for the mesh size
spongeLength = domainLength + 5 * wavelength;
// ------------------------------------------------------------------------- //
// Domain //
// ------------------------------------------------------------------------- //
Point(1) = {0., -domainRadius, 0., hmin};
Point(2) = {domainLength, -domainRadius, 0., hmin};
Point(3) = {domainLength, domainRadius, 0., hmin};
Point(4) = {0., domainRadius, 0., hmin};
Line(1) = {1, 2};
Line(2) = {2, 3};
Line(3) = {3, 4};
Line(4) = {4, 1};
Line Loop(1) = {1, 2, 3, 4};
Ruled Surface(2) = {1};
// ------------------------------------------------------------------------- //
// Sponge layer //
// ------------------------------------------------------------------------- //
Point(5) = {spongeLength, -domainRadius, 0., hmin};
Point(6) = {spongeLength, domainRadius, 0., hmin};
Line(5) = {2, 5};
Line(6) = {5, 6};
Line(7) = {6, 3};
Line Loop(3) = {5, 6, 7, -2};
Ruled Surface(4) = {3};
// ----------------------- //
// Tag curves and surfaces //
// ----------------------- //
Physical Curve(1) = {4};
Physical Curve(2) = {6};
Physical Curve(3) = {1, 3, 5, 7};
Physical Surface(1) = {2};
Physical Surface(2) = {4};
// =============== //
// Set transfinite //
// =============== //
Transfinite Line {1, 3} = numElementPerWavelength * domainLength /
wavelength + 1;
Transfinite Line {5, 7} = numElementPerWavelength *
(spongeLength - domainLength) / wavelength + 1;
Transfinite Line {2, 4, 6} = numElementPerWavelength * (2 * domainRadius)
/ wavelength + 1;
Recombine Surface "*";