Skip to content

Commit 848dbd3

Browse files
committed
Remove InflationGrader (temporarily)
1 parent b0fd44b commit 848dbd3

File tree

12 files changed

+34
-895
lines changed

12 files changed

+34
-895
lines changed

examples/advanced/grader_test.py

Lines changed: 0 additions & 42 deletions
This file was deleted.

examples/advanced/inflation_grader.py

Lines changed: 0 additions & 45 deletions
This file was deleted.

examples/chaining/helmholtz_nozzle.py

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,53 +5,67 @@
55
# A nozzle with a chamber that produces self-induced oscillations.
66
# See helmholtz_nozzle.svg for geometry explanation.
77

8-
# Also a good example how inapproproate blocking leads to bad mesh
9-
# when boundary layers are required.
10-
11-
# Also a good example how InflationGrader isn't finished yet.
12-
# TODO: finish InflationGrader
13-
14-
# geometry data (all dimensions in milimeters):
8+
# geometry data (all dimensions in meters):
159
# inlet pipe
16-
r_inlet = 10
17-
l_inlet = 50
10+
r_inlet = 10e-3
11+
l_inlet = 50e-3
1812

1913
# nozzle
20-
r_nozzle = 6
21-
l_nozzle = 20
14+
r_nozzle = 6e-3
15+
l_nozzle = 20e-3
2216

2317
# chamber
24-
l_chamber_inner = 100
25-
l_chamber_outer = 105
26-
r_chamber_outer = 20
18+
l_chamber_inner = 100e-3
19+
l_chamber_outer = 105e-3
20+
r_chamber_outer = 20e-3
2721

2822
# outlet
29-
l_outlet = 80
23+
l_outlet = 80e-3
3024

3125
# cell sizing
32-
first_cell_size = 0.02
33-
bulk_cell_size = 1.2
26+
cell_size = 1.5e-3
27+
bl_size = 0.15e-3
28+
c2c_expansion = 1.1
29+
axial_expansion = 2 # make cells in non-interesting places longer to save on count
3430

3531
mesh = cb.Mesh()
3632

3733
# inlet
3834
inlet = cb.Cylinder([0, 0, 0], [l_inlet, 0, 0], [0, 0, r_inlet])
35+
inlet.chop_axial(start_size=cell_size * axial_expansion, end_size=cell_size)
36+
inlet.chop_tangential(start_size=cell_size)
3937

4038
inlet.set_start_patch("inlet")
4139
inlet.set_outer_patch("wall")
4240
mesh.add(inlet)
4341

4442
# nozzle
4543
nozzle = cb.Frustum.chain(inlet, l_nozzle, r_nozzle)
44+
# cell sizing: make sure bl_size is correct here
45+
nozzle.chop_axial(length_ratio=0.5, start_size=cell_size * axial_expansion, end_size=cell_size)
46+
nozzle.chop_axial(length_ratio=0.5, start_size=cell_size, end_size=bl_size)
47+
nozzle.chop_radial(end_size=bl_size, c2c_expansion=1 / c2c_expansion)
4648
nozzle.set_outer_patch("wall")
4749
mesh.add(nozzle)
4850

4951
# chamber: inner cylinder
5052
chamber_inner = cb.Cylinder.chain(nozzle, l_chamber_inner)
53+
# create smaller cells at inlet and outlet but leave them bigger in the middle;
54+
chamber_inner.chop_axial(length_ratio=0.25, start_size=bl_size, end_size=cell_size)
55+
chamber_inner.chop_axial(length_ratio=0.25, start_size=cell_size, end_size=cell_size * axial_expansion)
56+
57+
chamber_inner.chop_axial(length_ratio=0.25, start_size=cell_size * axial_expansion, end_size=cell_size)
58+
chamber_inner.chop_axial(length_ratio=0.25, start_size=cell_size, end_size=bl_size)
5159
mesh.add(chamber_inner)
5260

5361
# chamber outer: expanded ring; the end face will be moved when the mesh is assembled
5462
chamber_outer = cb.ExtrudedRing.expand(chamber_inner, r_chamber_outer - r_inlet)
63+
chamber_outer.chop_radial(length_ratio=0.5, start_size=bl_size, c2c_expansion=c2c_expansion)
64+
chamber_outer.chop_radial(length_ratio=0.5, end_size=bl_size, c2c_expansion=1 / c2c_expansion)
65+
chamber_outer.set_start_patch("wall")
66+
chamber_outer.set_end_patch("wall")
67+
chamber_outer.set_outer_patch("wall")
68+
mesh.add(chamber_outer)
5569

5670
# translate outer points of outer chamber (and edges) to get
5771
# that inverted cone at the end;
@@ -62,21 +76,12 @@
6276

6377
face.add_edge(1, cb.Origin([l_inlet + l_nozzle + l_chamber_outer, 0, 0]))
6478

65-
chamber_outer.set_start_patch("wall")
66-
chamber_outer.set_end_patch("wall")
67-
chamber_outer.set_outer_patch("wall")
68-
mesh.add(chamber_outer)
69-
7079
# outlet pipe
7180
outlet = cb.Cylinder.chain(chamber_inner, l_outlet)
81+
outlet.chop_axial(length_ratio=0.5, start_size=bl_size, end_size=cell_size)
82+
outlet.chop_axial(length_ratio=0.5, start_size=cell_size, end_size=cell_size * axial_expansion)
7283
outlet.set_outer_patch("wall")
7384
outlet.set_end_patch("outlet")
7485
mesh.add(outlet)
7586

76-
mesh.modify_patch("wall", "wall")
77-
78-
grader = cb.InflationGrader(mesh, first_cell_size, bulk_cell_size)
79-
grader.grade()
80-
81-
mesh.settings["scale"] = 0.001
8287
mesh.write(os.path.join("..", "case", "system", "blockMeshDict"), debug_path="debug.vtk")

examples/shape/cylinder.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@
3333
mesh.modify_patch("walls", "wall")
3434

3535
# automatic grading
36-
# grader = cb.SmoothGrader(mesh, 0.1)
37-
grader = cb.InflationGrader(mesh, bl_thickness, core_size)
36+
grader = cb.SmoothGrader(mesh, 0.1)
3837
grader.grade()
3938

4039
mesh.write(os.path.join("..", "case", "system", "blockMeshDict"), debug_path="debug.vtk")

src/classy_blocks/grading/autograding/inflation/__init__.py

Whitespace-only changes.

src/classy_blocks/grading/autograding/inflation/distributor.py

Lines changed: 0 additions & 57 deletions
This file was deleted.

src/classy_blocks/grading/autograding/inflation/grader.py

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)