Skip to content

Commit

Permalink
Remove InflationGrader (temporarily)
Browse files Browse the repository at this point in the history
  • Loading branch information
FranzBangar committed Feb 16, 2025
1 parent b0fd44b commit 848dbd3
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 895 deletions.
42 changes: 0 additions & 42 deletions examples/advanced/grader_test.py

This file was deleted.

45 changes: 0 additions & 45 deletions examples/advanced/inflation_grader.py

This file was deleted.

61 changes: 33 additions & 28 deletions examples/chaining/helmholtz_nozzle.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,53 +5,67 @@
# A nozzle with a chamber that produces self-induced oscillations.
# See helmholtz_nozzle.svg for geometry explanation.

# Also a good example how inapproproate blocking leads to bad mesh
# when boundary layers are required.

# Also a good example how InflationGrader isn't finished yet.
# TODO: finish InflationGrader

# geometry data (all dimensions in milimeters):
# geometry data (all dimensions in meters):
# inlet pipe
r_inlet = 10
l_inlet = 50
r_inlet = 10e-3
l_inlet = 50e-3

# nozzle
r_nozzle = 6
l_nozzle = 20
r_nozzle = 6e-3
l_nozzle = 20e-3

# chamber
l_chamber_inner = 100
l_chamber_outer = 105
r_chamber_outer = 20
l_chamber_inner = 100e-3
l_chamber_outer = 105e-3
r_chamber_outer = 20e-3

# outlet
l_outlet = 80
l_outlet = 80e-3

# cell sizing
first_cell_size = 0.02
bulk_cell_size = 1.2
cell_size = 1.5e-3
bl_size = 0.15e-3
c2c_expansion = 1.1
axial_expansion = 2 # make cells in non-interesting places longer to save on count

mesh = cb.Mesh()

# inlet
inlet = cb.Cylinder([0, 0, 0], [l_inlet, 0, 0], [0, 0, r_inlet])
inlet.chop_axial(start_size=cell_size * axial_expansion, end_size=cell_size)
inlet.chop_tangential(start_size=cell_size)

inlet.set_start_patch("inlet")
inlet.set_outer_patch("wall")
mesh.add(inlet)

# nozzle
nozzle = cb.Frustum.chain(inlet, l_nozzle, r_nozzle)
# cell sizing: make sure bl_size is correct here
nozzle.chop_axial(length_ratio=0.5, start_size=cell_size * axial_expansion, end_size=cell_size)
nozzle.chop_axial(length_ratio=0.5, start_size=cell_size, end_size=bl_size)
nozzle.chop_radial(end_size=bl_size, c2c_expansion=1 / c2c_expansion)
nozzle.set_outer_patch("wall")
mesh.add(nozzle)

# chamber: inner cylinder
chamber_inner = cb.Cylinder.chain(nozzle, l_chamber_inner)
# create smaller cells at inlet and outlet but leave them bigger in the middle;
chamber_inner.chop_axial(length_ratio=0.25, start_size=bl_size, end_size=cell_size)
chamber_inner.chop_axial(length_ratio=0.25, start_size=cell_size, end_size=cell_size * axial_expansion)

chamber_inner.chop_axial(length_ratio=0.25, start_size=cell_size * axial_expansion, end_size=cell_size)
chamber_inner.chop_axial(length_ratio=0.25, start_size=cell_size, end_size=bl_size)
mesh.add(chamber_inner)

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

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

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

chamber_outer.set_start_patch("wall")
chamber_outer.set_end_patch("wall")
chamber_outer.set_outer_patch("wall")
mesh.add(chamber_outer)

# outlet pipe
outlet = cb.Cylinder.chain(chamber_inner, l_outlet)
outlet.chop_axial(length_ratio=0.5, start_size=bl_size, end_size=cell_size)
outlet.chop_axial(length_ratio=0.5, start_size=cell_size, end_size=cell_size * axial_expansion)
outlet.set_outer_patch("wall")
outlet.set_end_patch("outlet")
mesh.add(outlet)

mesh.modify_patch("wall", "wall")

grader = cb.InflationGrader(mesh, first_cell_size, bulk_cell_size)
grader.grade()

mesh.settings["scale"] = 0.001
mesh.write(os.path.join("..", "case", "system", "blockMeshDict"), debug_path="debug.vtk")
3 changes: 1 addition & 2 deletions examples/shape/cylinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
mesh.modify_patch("walls", "wall")

# automatic grading
# grader = cb.SmoothGrader(mesh, 0.1)
grader = cb.InflationGrader(mesh, bl_thickness, core_size)
grader = cb.SmoothGrader(mesh, 0.1)
grader.grade()

mesh.write(os.path.join("..", "case", "system", "blockMeshDict"), debug_path="debug.vtk")
Empty file.
57 changes: 0 additions & 57 deletions src/classy_blocks/grading/autograding/inflation/distributor.py

This file was deleted.

50 changes: 0 additions & 50 deletions src/classy_blocks/grading/autograding/inflation/grader.py

This file was deleted.

Loading

0 comments on commit 848dbd3

Please sign in to comment.