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