BET Disk#
This script demonstrates the setup and execution of a simulation involving a Blade Element Theory (BET) disk using the Flow360 Python API.
It covers loading geometry, defining mesh refinements including axisymmetric refinement for the rotor region,
specifying operating conditions using AerospaceCondition.from_mach()
, loading BET disk parameters from an external file,
and submitting the case through the Project
interface.
1import json
2
3import flow360 as fl
4from flow360.examples import TutorialBETDisk
5
6TutorialBETDisk.get_files()
7
8project = fl.Project.from_geometry(TutorialBETDisk.geometry, name="Tutorial BETDisk from Python")
9geometry = project.geometry
10
11# show face and edge groupings
12geometry.show_available_groupings(verbose_mode=True)
13geometry.group_faces_by_tag("faceName")
14geometry.group_edges_by_tag("edgeName")
15
16
17bet = fl.BETDisk.from_file(TutorialBETDisk.extra["disk0"])
18
19with fl.SI_unit_system:
20 cylinder1 = fl.Cylinder(
21 name="cylinder1",
22 axis=[1, 0, 0],
23 center=[-2.0, 5.0, 0],
24 outer_radius=4.0,
25 inner_radius=0,
26 height=0.6,
27 )
28 cylinder2 = fl.Cylinder(
29 name="cylinder2",
30 axis=[1, 0, 0],
31 center=[0, 5, 0],
32 outer_radius=4.1,
33 inner_radius=0,
34 height=5,
35 )
36 farfield = fl.AutomatedFarfield()
37 params = fl.SimulationParams(
38 meshing=fl.MeshingParams(
39 defaults=fl.MeshingDefaults(
40 surface_edge_growth_rate=1.2,
41 surface_max_edge_length=0.5,
42 curvature_resolution_angle=30 * fl.u.deg,
43 boundary_layer_growth_rate=1.15,
44 boundary_layer_first_layer_thickness=1e-06,
45 ),
46 volume_zones=[farfield],
47 refinements=[
48 fl.AxisymmetricRefinement(
49 name="BET_Disk",
50 spacing_axial=0.02,
51 spacing_radial=0.03,
52 spacing_circumferential=0.06,
53 entities=cylinder1,
54 ),
55 fl.UniformRefinement(name="cylinder_refinement", spacing=0.1, entities=[cylinder2]),
56 fl.SurfaceRefinement(
57 name="tip",
58 max_edge_length=0.01,
59 faces=[
60 geometry["tip"],
61 ],
62 ),
63 fl.SurfaceEdgeRefinement(
64 name="aniso",
65 method=fl.HeightBasedRefinement(value=0.0003),
66 edges=[
67 geometry["wingTrailingEdge"],
68 geometry["wingLeadingEdge"],
69 ],
70 ),
71 fl.SurfaceEdgeRefinement(
72 name="projectAnisoSpacing",
73 method=fl.ProjectAnisoSpacing(),
74 edges=[
75 geometry["rootAirfoilEdge"],
76 geometry["tipAirfoilEdge"],
77 ],
78 ),
79 ],
80 ),
81 reference_geometry=fl.ReferenceGeometry(
82 moment_center=[0.375, 0, 0],
83 moment_length=[1.26666666, 1.26666666, 1.26666666],
84 area=12.5,
85 ),
86 operating_condition=fl.AerospaceCondition.from_mach(
87 mach=0.182,
88 alpha=5 * fl.u.deg,
89 reference_mach=0.54,
90 ),
91 time_stepping=fl.Steady(
92 max_steps=10000, CFL=fl.RampCFL(initial=1, final=100, ramp_steps=2000)
93 ),
94 outputs=[
95 fl.VolumeOutput(
96 output_fields=[
97 "primitiveVars",
98 "betMetrics",
99 "qcriterion",
100 ],
101 ),
102 fl.SurfaceOutput(
103 surfaces=geometry["*"],
104 output_fields=[
105 "primitiveVars",
106 "Cp",
107 "Cf",
108 "CfVec",
109 ],
110 ),
111 ],
112 models=[
113 fl.Wall(
114 surfaces=[
115 geometry["wing"],
116 geometry["tip"],
117 ],
118 ),
119 fl.Freestream(surfaces=farfield.farfield),
120 fl.SlipWall(surfaces=farfield.symmetry_planes),
121 fl.Fluid(
122 navier_stokes_solver=fl.NavierStokesSolver(
123 absolute_tolerance=1e-12,
124 ),
125 turbulence_model_solver=fl.SpalartAllmaras(
126 absolute_tolerance=1e-10,
127 update_jacobian_frequency=1,
128 equation_evaluation_frequency=1,
129 ),
130 ),
131 bet,
132 ],
133 )
134
135
136project.run_case(params=params, name="Case of tutorial BETDisk from Python")
Notes#
BET disk parameters, including sectional polars and geometric definitions, are loaded from an external JSON file.
AxisymmetricRefinement
is utilized to control mesh resolution specifically within the cylindrical region encompassing the BET disk.