-
Notifications
You must be signed in to change notification settings - Fork 0
/
voxelFoam.py
33 lines (26 loc) · 872 Bytes
/
voxelFoam.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import meshiofoam as meshio
import openfoam as of
import writers as w
def voxelFoam(argv):
# Reading arguments
file_in = argv[1]
file_out = argv[2]
# Reading the mesh
mesh = meshio.read(file_in)
# Adjusting mesh object according to mesh origin
poly = of.polyMesh(mesh, file_in.split(".")[-1])
poly = of.cellRepetition(poly, 5, 5, 3)
# Creating folder structure
of.createFolderStructure(file_out)
# Writing files
w.writePointsFile(poly, file_out)
# writeCellsFile(poly, file_out)
w.writeFacesFile(poly, file_out)
w.writeOwnerFile(poly, file_out)
w.writeNeighbourFile(poly, file_out)
w.writeBoundaryFile(poly, file_out)
w.writeSets(poly, file_out)
# w.writePointZones(poly, file_out)
# w.writeFaceZones(poly, file_out)
w.writeCellZones(poly, file_out)
w.createFoamFile(file_out)