-
Notifications
You must be signed in to change notification settings - Fork 18
Mesh Generation
Once the STL File Processing has completed, the simulation domain can be configured. The domain extents are generated from the base geometry. The dimensions of the geometry of the aircraft are known from the evaluation of the STL file, so the domain is a multiple of these values. For the Y and Z directions, the dimensions of the bounding box are multiplied by 4. The X dimension of the domain is set to be 12 times longer than the aircraft. Additionally, if any dimension is smaller than 4 meters, it is forced to 4 meters.
The base mesh is generated by selecting a base mesh block size. This block size represents the dimensions of the cubes in the base mesh. dcRun simplifies this choice with three options:
--resolution {high,medium,low} Resolution of the CFD evaluation. The default value is medium.
This value gets mapped to a default block size in the dcRun script, located at droneCFD/scripts/dcRun:
bcs = {'high':0.15, 'medium':0.3001, 'low':0.45}
mesh = Meshing.mesher(case.dir, model, baseCellSize=bcs[args.resolution], parserArgs=args)
The block size is used to form the basic block mesh using OpenFOAM's blockmesh tool. A representation of the blockmesh is illusrated below:
At this point, the geometry is 'added' to our simulation domain with snappyHexMesh. For more information on how snappyHexMesh works, please refer to the official OpenFOAM documentation. Refinement around the geometry occurs in three ways: geometry surface refinement, distance refiment and fixed refiment regions. The controls for these refiments are fixed and are set in the snappyHexMeshDict file that lives at droneCFD/data/template/system/snappyHexMeshDict. First, a surface refinement level is set for the aircraft geometry. Additionally, refinement levels are set based on the distance away from the nearest geometry surfaces. Finally, based on the information gather from the STL file analysis, two cylindrical refinement regions are places at the wing tips and a general box refinement is set around the aircraft. These fixed refinement regions are shown below:
The execution of snappyHexMesh is done in parallel by default. The Python code will evaluate the number of processors available and will use all available resources. Once snappyHexMesh has finished, the domain is ready for simulation.