fiqus 2024.6.0__py3-none-any.whl → 2024.12.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fiqus/MainFiQuS.py +290 -134
- fiqus/data/DataConductor.py +301 -301
- fiqus/data/DataFiQuS.py +128 -84
- fiqus/data/DataFiQuSCCT.py +150 -150
- fiqus/data/DataFiQuSConductor.py +84 -84
- fiqus/data/DataFiQuSConductorAC_Strand.py +565 -565
- fiqus/data/DataFiQuSMultipole.py +716 -42
- fiqus/data/DataFiQuSPancake3D.py +737 -278
- fiqus/data/DataMultipole.py +180 -15
- fiqus/data/DataRoxieParser.py +90 -51
- fiqus/data/DataSettings.py +121 -0
- fiqus/data/DataWindingsCCT.py +37 -37
- fiqus/data/RegionsModelFiQuS.py +18 -6
- fiqus/geom_generators/GeometryCCT.py +905 -905
- fiqus/geom_generators/GeometryConductorAC_Strand.py +1391 -1391
- fiqus/geom_generators/GeometryMultipole.py +1827 -227
- fiqus/geom_generators/GeometryPancake3D.py +316 -117
- fiqus/geom_generators/GeometryPancake3DUtils.py +549 -0
- fiqus/getdp_runners/RunGetdpCCT.py +4 -4
- fiqus/getdp_runners/RunGetdpConductorAC_Strand.py +201 -201
- fiqus/getdp_runners/RunGetdpMultipole.py +115 -42
- fiqus/getdp_runners/RunGetdpPancake3D.py +28 -6
- fiqus/mains/MainCCT.py +2 -2
- fiqus/mains/MainConductorAC_Strand.py +132 -132
- fiqus/mains/MainMultipole.py +113 -62
- fiqus/mains/MainPancake3D.py +63 -23
- fiqus/mesh_generators/MeshCCT.py +209 -209
- fiqus/mesh_generators/MeshConductorAC_Strand.py +656 -656
- fiqus/mesh_generators/MeshMultipole.py +1243 -181
- fiqus/mesh_generators/MeshPancake3D.py +275 -192
- fiqus/parsers/ParserCOND.py +825 -0
- fiqus/parsers/ParserDAT.py +16 -16
- fiqus/parsers/ParserGetDPOnSection.py +212 -212
- fiqus/parsers/ParserGetDPTimeTable.py +134 -134
- fiqus/parsers/ParserMSH.py +53 -53
- fiqus/parsers/ParserPOS.py +214 -214
- fiqus/parsers/ParserRES.py +142 -142
- fiqus/plotters/PlotPythonCCT.py +133 -133
- fiqus/plotters/PlotPythonConductorAC.py +855 -840
- fiqus/plotters/PlotPythonMultipole.py +18 -18
- fiqus/post_processors/PostProcessCCT.py +440 -440
- fiqus/post_processors/PostProcessConductorAC.py +49 -49
- fiqus/post_processors/PostProcessMultipole.py +353 -229
- fiqus/post_processors/PostProcessPancake3D.py +8 -13
- fiqus/pre_processors/PreProcessCCT.py +175 -175
- fiqus/pro_assemblers/ProAssembler.py +14 -6
- fiqus/pro_material_functions/ironBHcurves.pro +246 -246
- fiqus/pro_templates/combined/CCT_template.pro +274 -274
- fiqus/pro_templates/combined/ConductorAC_template.pro +1025 -1025
- fiqus/pro_templates/combined/Multipole_template.pro +1694 -126
- fiqus/pro_templates/combined/Pancake3D_template.pro +2294 -1103
- fiqus/pro_templates/combined/TSA_materials.pro +162 -0
- fiqus/pro_templates/combined/materials.pro +36 -18
- fiqus/utils/Utils.py +508 -110
- fiqus/utils/update_data_settings.py +33 -0
- fiqus-2024.12.0.dist-info/METADATA +130 -0
- fiqus-2024.12.0.dist-info/RECORD +84 -0
- {fiqus-2024.6.0.dist-info → fiqus-2024.12.0.dist-info}/WHEEL +1 -1
- tests/test_FiQuS.py +1 -1
- tests/test_geometry_generators.py +101 -2
- tests/test_mesh_generators.py +154 -1
- tests/test_solvers.py +115 -21
- tests/utils/fiqus_test_classes.py +85 -21
- tests/utils/generate_reference_files_ConductorAC.py +57 -57
- tests/utils/generate_reference_files_Pancake3D.py +4 -5
- tests/utils/helpers.py +97 -97
- fiqus-2024.6.0.dist-info/METADATA +0 -103
- fiqus-2024.6.0.dist-info/RECORD +0 -79
- {fiqus-2024.6.0.dist-info → fiqus-2024.12.0.dist-info}/top_level.txt +0 -0
|
@@ -5,6 +5,7 @@ from inspect import currentframe, getframeinfo
|
|
|
5
5
|
from typing import List, Tuple, Dict
|
|
6
6
|
import operator
|
|
7
7
|
|
|
8
|
+
import os
|
|
8
9
|
import json
|
|
9
10
|
import timeit
|
|
10
11
|
import numpy as np
|
|
@@ -17,6 +18,7 @@ from fiqus.data.DataFiQuSPancake3D import Pancake3DGeometry
|
|
|
17
18
|
|
|
18
19
|
logger = logging.getLogger(__name__)
|
|
19
20
|
|
|
21
|
+
# coordinateList = []
|
|
20
22
|
|
|
21
23
|
def findSurfacesWithNormalsOnXYPlane(dimTags):
|
|
22
24
|
result = []
|
|
@@ -103,7 +105,7 @@ class dimTags:
|
|
|
103
105
|
If parentName is specified, during the volume information file generation, another
|
|
104
106
|
key that is equal to parentName is created, and all the dimTags are also added
|
|
105
107
|
there. For example, air consists of many parts such as gap, outer tube, inner
|
|
106
|
-
cylinder parts, and their dimTags object all have the parentName of self.geo.
|
|
108
|
+
cylinder parts, and their dimTags object all have the parentName of self.geo.air.name
|
|
107
109
|
(user input of the air name) so that in the volume information file, they are all
|
|
108
110
|
combined under the air name as well.
|
|
109
111
|
|
|
@@ -463,6 +465,27 @@ class dimTagsStorage:
|
|
|
463
465
|
else:
|
|
464
466
|
cls.__dimTagsDict[dimTagsObject.name] = dimTagsObject
|
|
465
467
|
|
|
468
|
+
# @classmethod
|
|
469
|
+
# def updateDimTagsFromDict(cls, name: str, dimTagsList: List[Tuple[int, int]]):
|
|
470
|
+
# """
|
|
471
|
+
# Updates or adds dimTags from a list of (dim, tag) tuples.
|
|
472
|
+
#
|
|
473
|
+
# :param name: Name of the dimTags entry to update or add.
|
|
474
|
+
# :type name: str
|
|
475
|
+
# :param dimTagsList: List of (dim, tag) tuples to be associated with the name.
|
|
476
|
+
# :type dimTagsList: List[Tuple[int, int]]
|
|
477
|
+
# """
|
|
478
|
+
# # Check if the entry exists; if so, update it, otherwise add a new entry
|
|
479
|
+
# if name in cls.__dimTagsDict:
|
|
480
|
+
# existingDimTags = cls.__dimTagsDict[
|
|
481
|
+
# name].dimTags # Assuming dimTags object has a dimTags attribute storing the list of tuples
|
|
482
|
+
# updatedDimTags = existingDimTags + dimTagsList
|
|
483
|
+
# cls.__dimTagsDict[name].dimTags = updatedDimTags # Update the list of tuples
|
|
484
|
+
# else:
|
|
485
|
+
# # Create a new dimTags object (this step depends on how your dimTags class is structured)
|
|
486
|
+
# newDimTagsObject = dimTags(name=name, dimTags=dimTagsList) # Assuming such a constructor exists
|
|
487
|
+
# cls.__dimTagsDict[name] = newDimTagsObject
|
|
488
|
+
|
|
466
489
|
@classmethod
|
|
467
490
|
def getDimTagsObject(cls, names: List[str]):
|
|
468
491
|
"""
|
|
@@ -633,6 +656,9 @@ class point:
|
|
|
633
656
|
"""
|
|
634
657
|
|
|
635
658
|
def __init__(self, r0=0.0, r1=0.0, r2=0.0, type=coordinate.rectangular) -> None:
|
|
659
|
+
|
|
660
|
+
self.type = type # Store 'type' as an instance attribute
|
|
661
|
+
|
|
636
662
|
if type is coordinate.rectangular:
|
|
637
663
|
self.x = r0
|
|
638
664
|
self.y = r1
|
|
@@ -702,7 +728,7 @@ class point:
|
|
|
702
728
|
)
|
|
703
729
|
|
|
704
730
|
|
|
705
|
-
class spiralCurve:
|
|
731
|
+
class spiralCurve():
|
|
706
732
|
"""
|
|
707
733
|
A class to create a spiral curves parallel to XY plane in GMSH. The curve is defined
|
|
708
734
|
by a spline and it is divided into sub-curves. Sub-curves are used because it makes
|
|
@@ -828,9 +854,13 @@ class spiralCurve:
|
|
|
828
854
|
pointTagsWithoutBreakPoints = [] # only used if cutPlaneNormal is not None
|
|
829
855
|
breakPointObjectsDueToTransition = []
|
|
830
856
|
breakPointTagsDueToTransition = []
|
|
857
|
+
coordinateList = []
|
|
831
858
|
|
|
832
859
|
for j in range(len(theta)):
|
|
833
860
|
pointObject = point(r[j], theta[j], z[j], coordinate.cylindrical)
|
|
861
|
+
[x_c, y_c, z_c] = [r[j], theta[j], z[j]]
|
|
862
|
+
#print([x_c, y_c, z_c])
|
|
863
|
+
coordinateList.append([x_c, y_c, z_c])
|
|
834
864
|
points.append(pointObject)
|
|
835
865
|
pointTags.append(pointObject.tag)
|
|
836
866
|
if cutPlaneNormal is not None:
|
|
@@ -853,6 +883,169 @@ class spiralCurve:
|
|
|
853
883
|
breakPointObjectsDueToTransition.append(pointObject)
|
|
854
884
|
breakPointTagsDueToTransition.append(pointObject.tag)
|
|
855
885
|
|
|
886
|
+
# Plotter
|
|
887
|
+
# x_coords = [coord[0] for coord in coordinateList]
|
|
888
|
+
# y_coords = [coord[1] for coord in coordinateList]
|
|
889
|
+
# z_coords = [coord[2] for coord in coordinateList]
|
|
890
|
+
|
|
891
|
+
# print(f'number of divisions {self.Pancake3DMeshWinding.ane}')
|
|
892
|
+
# print(self.wi.ane)
|
|
893
|
+
# Creating the 3D plot
|
|
894
|
+
# fig = plt.figure()
|
|
895
|
+
# ax = fig.add_subplot(111, projection='3d')
|
|
896
|
+
|
|
897
|
+
# Plotting the coordinates
|
|
898
|
+
# ax.scatter(x_coords, y_coords, z_coords, c='r', marker='o')
|
|
899
|
+
#
|
|
900
|
+
# # Setting labels
|
|
901
|
+
# ax.set_xlabel('X Label')
|
|
902
|
+
# ax.set_ylabel('Y Label')
|
|
903
|
+
# ax.set_zlabel('Z Label')
|
|
904
|
+
#
|
|
905
|
+
# plt.show()
|
|
906
|
+
|
|
907
|
+
# Logic to break the points up into relevant geom coordinates
|
|
908
|
+
# Brick points structure (for X-Y plane only for now):
|
|
909
|
+
# [[[x1, y1, z1], [x2, y2, z2], [x3, y3, z3], [x4, y4, z4]], ...]
|
|
910
|
+
# Theoretically, very easy to extend to 8 points knowing the height of the
|
|
911
|
+
|
|
912
|
+
# Defining the coordinate lists to which the points are to be added
|
|
913
|
+
|
|
914
|
+
# winding one covers the list of points in the domain of theta [k, pi*k], where k is an integer number
|
|
915
|
+
winding_1 = []
|
|
916
|
+
# winding one covers the list of points in the domain of theta [pi*k, 2pi*k], where k is an integer number
|
|
917
|
+
winding_2 = []
|
|
918
|
+
# winding one covers the list of points in the domain of theta [k, pi*k], where k is an integer number
|
|
919
|
+
winding_3 = []
|
|
920
|
+
# winding one covers the list of points in the domain of theta [pi*k, 2pi*k], where k is an integer number
|
|
921
|
+
winding_4 = []
|
|
922
|
+
#print(theta[10])
|
|
923
|
+
# heightPancake = self.geo.winding.height
|
|
924
|
+
# print(heightPancake)
|
|
925
|
+
for i in range(len(theta)-1): # range is reduced as no brick can be created starting at the last point
|
|
926
|
+
# Assuming theta is a numpy array and you're looking for the index of a value close to pi
|
|
927
|
+
value_to_find = theta[i]+np.pi
|
|
928
|
+
tolerance = 1e-10 # Define a small tolerance
|
|
929
|
+
# Find indices where the condition is true
|
|
930
|
+
indices = np.where(np.abs(theta - value_to_find) < tolerance)[0]
|
|
931
|
+
if len(indices) > 0:
|
|
932
|
+
windingUpIndex = indices[0] # Take the first index if there are multiple matches
|
|
933
|
+
try:
|
|
934
|
+
x_1 = r[i] * np.cos(theta[i])
|
|
935
|
+
y_1 = r[i] * np.sin(theta[i])
|
|
936
|
+
z_g = z[i]
|
|
937
|
+
x_2 = r[i+1] * np.cos(theta[i+1])
|
|
938
|
+
y_2 = r[i+1] * np.sin(theta[i+1])
|
|
939
|
+
x_3 = r[windingUpIndex] * np.cos(theta[windingUpIndex])
|
|
940
|
+
y_3 = r[windingUpIndex] * np.sin(theta[windingUpIndex])
|
|
941
|
+
x_4 = r[windingUpIndex+1] * np.cos(theta[windingUpIndex+1])
|
|
942
|
+
y_4 = r[windingUpIndex+1] * np.sin(theta[windingUpIndex+1])
|
|
943
|
+
addPoints = [[x_1, y_1, z_g], [x_2, y_2, z_g], [x_3, y_3, z_g], [x_4, y_4, z_g]]
|
|
944
|
+
k = theta[i]//(2*np.pi)
|
|
945
|
+
if (theta[i] <= np.pi*(k+1)):
|
|
946
|
+
# print('winding 1 or 3')
|
|
947
|
+
if (k%2 == 0):
|
|
948
|
+
# print('winding 1')
|
|
949
|
+
winding_1.append(addPoints)
|
|
950
|
+
else:
|
|
951
|
+
# print('winding 3')
|
|
952
|
+
winding_3.append(addPoints)
|
|
953
|
+
|
|
954
|
+
if (theta[i] >= np.pi*(k+1)):
|
|
955
|
+
# print('winding 2 or 4')
|
|
956
|
+
if (k%2 == 0):
|
|
957
|
+
# print('winding 2')
|
|
958
|
+
winding_2.append(addPoints)
|
|
959
|
+
else:
|
|
960
|
+
# print('winding 4')
|
|
961
|
+
winding_4.append(addPoints)
|
|
962
|
+
except IndexError:
|
|
963
|
+
print('All of the winding conductor points have been found')
|
|
964
|
+
|
|
965
|
+
# print(winding_1)
|
|
966
|
+
# print(winding_2)
|
|
967
|
+
# print(winding_3)
|
|
968
|
+
# print(winding_4)
|
|
969
|
+
|
|
970
|
+
# Plotter
|
|
971
|
+
# x_coords = [coord[0] for coord in winding_1]
|
|
972
|
+
# y_coords = [coord[1] for coord in winding_1]
|
|
973
|
+
# z_coords = [coord[2] for coord in winding_1]
|
|
974
|
+
#
|
|
975
|
+
# # Creating the 3D plot
|
|
976
|
+
# fig = plt.figure()
|
|
977
|
+
# ax = fig.add_subplot(111, projection='3d')
|
|
978
|
+
#
|
|
979
|
+
# # Plotting the coordinates
|
|
980
|
+
# ax.scatter(x_coords, y_coords, z_coords, c='r', marker='o')
|
|
981
|
+
#
|
|
982
|
+
# # Setting labels
|
|
983
|
+
# ax.set_xlabel('X Label')
|
|
984
|
+
# ax.set_ylabel('Y Label')
|
|
985
|
+
# ax.set_zlabel('Z Label')
|
|
986
|
+
#
|
|
987
|
+
# plt.show()
|
|
988
|
+
|
|
989
|
+
# if True:
|
|
990
|
+
# indexPoint = 1
|
|
991
|
+
# rangeUpdated = 0
|
|
992
|
+
# dict_cond = {0: {'SHAPE': 'BR8', 'XCENTRE': '0.0', 'YCENTRE': '0.0', 'ZCENTRE': '0.0', 'PHI1': '0.0', 'THETA1': '0.0', 'PSI1': '0.0', 'XCEN2': '0.0', 'YCEN2': '0.0', 'ZCEN2': '0.0', 'THETA2': '0.0', 'PHI2': '0.0', 'PSI2': '0.0', 'XP1': '-0.879570', 'YP1': '-0.002940', 'ZP1': '-1.131209', 'XP2': '-0.879570', 'YP2': '0.002940', 'ZP2': '-1.131209', 'XP3': '-0.881381', 'YP3': '0.002940', 'ZP3': '-1.114205', 'XP4': '-0.881381', 'YP4': '-0.002940', 'ZP4': '-1.114205', 'XP5': '-0.861227', 'YP5': '-0.002972', 'ZP5': '-1.129183', 'XP6': '-0.861208', 'YP6': '0.002908', 'ZP6': '-1.129182', 'XP7': '-0.863294', 'YP7': '0.002912', 'ZP7': '-1.112210', 'XP8': '-0.863313', 'YP8': '-0.002968', 'ZP8': '-1.112211', 'CURD': '201264967.975494', 'SYMMETRY': '1', 'DRIVELABEL': 'drive 0', 'IRXY': '0', 'IRYZ': '0', 'IRZX': '0', 'TOLERANCE': '1e-6'}, 1: {'SHAPE': 'BR8', 'XCENTRE': '0.0', 'YCENTRE': '0.0', 'ZCENTRE': '0.0', 'PHI1': '0.0', 'THETA1': '0.0', 'PSI1': '0.0', 'XCEN2': '0.0', 'YCEN2': '0.0', 'ZCEN2': '0.0', 'THETA2': '0.0', 'PHI2': '0.0', 'PSI2': '0.0', 'XP1': '-0.861227', 'YP1': '-0.002972', 'ZP1': '-1.129183', 'XP2': '-0.861208', 'YP2': '0.002908', 'ZP2': '-1.129182', 'XP3': '-0.863294', 'YP3': '0.002912', 'ZP3': '-1.112210', 'XP4': '-0.863313', 'YP4': '-0.002968', 'ZP4': '-1.112211', 'XP5': '-0.842917', 'YP5': '-0.003066', 'ZP5': '-1.126858', 'XP6': '-0.842880', 'YP6': '0.002814', 'ZP6': '-1.126858', 'XP7': '-0.845242', 'YP7': '0.002830', 'ZP7': '-1.109922', 'XP8': '-0.845278', 'YP8': '-0.003050', 'ZP8': '-1.109922', 'CURD': '201264967.975494', 'SYMMETRY': '1', 'DRIVELABEL': 'drive 0', 'IRXY': '0', 'IRYZ': '0', 'IRZX': '0', 'TOLERANCE': '1e-6'}, 2: {'SHAPE': 'BR8', 'XCENTRE': '0.0', 'YCENTRE': '0.0', 'ZCENTRE': '0.0', 'PHI1': '0.0', 'THETA1': '0.0', 'PSI1': '0.0', 'XCEN2': '0.0', 'YCEN2': '0.0', 'ZCEN2': '0.0', 'THETA2': '0.0', 'PHI2': '0.0', 'PSI2': '0.0', 'XP1': '-0.842917', 'YP1': '-0.003066', 'ZP1': '-1.126858', 'XP2': '-0.842880', 'YP2': '0.002814', 'ZP2': '-1.126858', 'XP3': '-0.845242', 'YP3': '0.002830', 'ZP3': '-1.109922', 'XP4': '-0.845278', 'YP4': '-0.003050', 'ZP4': '-1.109922', 'XP5': '-0.824646', 'YP5': '-0.003216', 'ZP5': '-1.124235', 'XP6': '-0.824593', 'YP6': '0.002664', 'ZP6': '-1.124239', 'XP7': '-0.827229', 'YP7': '0.002698', 'ZP7': '-1.107343', 'XP8': '-0.827282', 'YP8': '-0.003181', 'ZP8': '-1.107339', 'CURD': '201264967.975494', 'SYMMETRY': '1', 'DRIVELABEL': 'drive 0', 'IRXY': '0', 'IRYZ': '0', 'IRZX': '0', 'TOLERANCE': '1e-6'}}
|
|
993
|
+
# # print(dict_cond)
|
|
994
|
+
# for brick in dict_cond:
|
|
995
|
+
# for pointIndex in range (rangeUpdated, rangeUpdated+7):
|
|
996
|
+
# dict_cond[brick][f'XP{indexPoint}'] = str(coordinateList[pointIndex][0])
|
|
997
|
+
# dict_cond[brick][f'YP{indexPoint}'] = str(coordinateList[pointIndex][1])
|
|
998
|
+
# dict_cond[brick][f'ZP{indexPoint}'] = str(coordinateList[pointIndex][2])
|
|
999
|
+
# indexPoint+=1
|
|
1000
|
+
# indexPoint = 1
|
|
1001
|
+
# rangeUpdated = rangeUpdated + 8
|
|
1002
|
+
|
|
1003
|
+
# writing COND.json file
|
|
1004
|
+
# Define the path for the JSON file, one directory up from the current script
|
|
1005
|
+
# json_file_path = os.path.join(os.path.dirname(os.getcwd()), "BR8.json")
|
|
1006
|
+
|
|
1007
|
+
# Function to print the contents of a JSON file
|
|
1008
|
+
# def print_json_contents(path):
|
|
1009
|
+
# try:
|
|
1010
|
+
# with open(path, 'r') as file:
|
|
1011
|
+
# data = json.load(file)
|
|
1012
|
+
# print(json.dumps(data, indent=4))
|
|
1013
|
+
# except FileNotFoundError:
|
|
1014
|
+
# print("File not found.")
|
|
1015
|
+
# except json.JSONDecodeError:
|
|
1016
|
+
# print("File is empty or contains non-JSON conforming data.")
|
|
1017
|
+
#
|
|
1018
|
+
# # Print current contents
|
|
1019
|
+
# print("Current contents of BR8.json:")
|
|
1020
|
+
# print_json_contents(json_file_path)
|
|
1021
|
+
|
|
1022
|
+
# Overwrite the JSON file
|
|
1023
|
+
# with open(json_file_path, 'w') as file:
|
|
1024
|
+
# json.dump(dict_cond, file, indent=4)
|
|
1025
|
+
#
|
|
1026
|
+
# print("\nContents of BR8.json after overwriting:")
|
|
1027
|
+
# print_json_contents(json_file_path)
|
|
1028
|
+
# writing the .cond file
|
|
1029
|
+
|
|
1030
|
+
# p = tuh.Paths('tests/parsers', '')
|
|
1031
|
+
# FilesAndFolders.prep_folder(p.model_folder)
|
|
1032
|
+
|
|
1033
|
+
# Specify the target directory relative to the current working directory
|
|
1034
|
+
target_dir = os.path.join(os.getcwd(), 'tests', '_outputs', 'parsers')
|
|
1035
|
+
|
|
1036
|
+
# Ensure the target directory exists
|
|
1037
|
+
os.makedirs(target_dir, exist_ok=True)
|
|
1038
|
+
|
|
1039
|
+
# Define the output file path
|
|
1040
|
+
# out_file = os.path.join(target_dir, 'BR8.cond')
|
|
1041
|
+
# list_of_shapes = ['BR8']
|
|
1042
|
+
# for shape in list_of_shapes:
|
|
1043
|
+
# pc = ParserCOND()
|
|
1044
|
+
# input_dict = dict_cond
|
|
1045
|
+
# pc.write_cond(input_dict, out_file)
|
|
1046
|
+
# print('path')
|
|
1047
|
+
# print(out_file)
|
|
1048
|
+
# print('hello world')
|
|
856
1049
|
# =============================================================================
|
|
857
1050
|
# GENERATING POINTS ENDS ======================================================
|
|
858
1051
|
# =============================================================================
|
|
@@ -873,6 +1066,7 @@ class spiralCurve:
|
|
|
873
1066
|
# number of turns. It is best to visually look at the divisions with
|
|
874
1067
|
# gmsh.fltk.run() to understand why the split points are chosen the way they are
|
|
875
1068
|
# selected.
|
|
1069
|
+
|
|
876
1070
|
if cutPlaneNormal is None:
|
|
877
1071
|
pointObjectsWithoutBreakPoints = points
|
|
878
1072
|
pointTagsWithoutBreakPoints = pointTags
|
|
@@ -2930,49 +3124,49 @@ class pancakeCoilsWithAir:
|
|
|
2930
3124
|
# ==============================================================================
|
|
2931
3125
|
# Air shell (they will be empty if shellTransformation == False):
|
|
2932
3126
|
# For cylinder type:
|
|
2933
|
-
self.airShellVolume = dimTags(name=self.geo.
|
|
3127
|
+
self.airShellVolume = dimTags(name=self.geo.air.shellVolumeName, save=True)
|
|
2934
3128
|
|
|
2935
3129
|
# For cuboid type:
|
|
2936
3130
|
self.airShellVolumePart1 = dimTags(
|
|
2937
|
-
name=self.geo.
|
|
3131
|
+
name=self.geo.air.shellVolumeName + "-Part1", save=True
|
|
2938
3132
|
)
|
|
2939
3133
|
self.airShellVolumePart2 = dimTags(
|
|
2940
|
-
name=self.geo.
|
|
3134
|
+
name=self.geo.air.shellVolumeName + "-Part2", save=True
|
|
2941
3135
|
)
|
|
2942
3136
|
self.airShellVolumePart3 = dimTags(
|
|
2943
|
-
name=self.geo.
|
|
3137
|
+
name=self.geo.air.shellVolumeName + "-Part3", save=True
|
|
2944
3138
|
)
|
|
2945
3139
|
self.airShellVolumePart4 = dimTags(
|
|
2946
|
-
name=self.geo.
|
|
3140
|
+
name=self.geo.air.shellVolumeName + "-Part4", save=True
|
|
2947
3141
|
)
|
|
2948
3142
|
|
|
2949
3143
|
# Outer air tube volume (actually it is not a tube if the air type is cuboid):
|
|
2950
3144
|
self.outerAirTubeVolume = dimTags(
|
|
2951
|
-
name=self.geo.
|
|
3145
|
+
name=self.geo.air.name + "-OuterTube", save=True, parentName=self.geo.air.name
|
|
2952
3146
|
)
|
|
2953
3147
|
|
|
2954
3148
|
# Outer terminal's outer tube part:
|
|
2955
3149
|
self.outerTerminalTubeVolume = dimTags(
|
|
2956
|
-
name=self.geo.
|
|
3150
|
+
name=self.geo.terminals.outer.name + "-Tube", save=True, parentName=self.geo.terminals.outer.name
|
|
2957
3151
|
)
|
|
2958
3152
|
|
|
2959
3153
|
# Outer terminal's volume that touches the winding:
|
|
2960
3154
|
self.outerTerminalTouchingVolume = dimTags(
|
|
2961
|
-
name=self.geo.
|
|
3155
|
+
name=self.geo.terminals.outer.name + "-Touching",
|
|
2962
3156
|
save=True,
|
|
2963
|
-
parentName=self.geo.
|
|
3157
|
+
parentName=self.geo.terminals.outer.name,
|
|
2964
3158
|
)
|
|
2965
3159
|
|
|
2966
3160
|
# Inner terminal's volume that touches the winding:
|
|
2967
3161
|
self.innerTerminalTouchingVolume = dimTags(
|
|
2968
|
-
name=self.geo.
|
|
3162
|
+
name=self.geo.terminals.inner.name + "-Touching",
|
|
2969
3163
|
save=True,
|
|
2970
|
-
parentName=self.geo.
|
|
3164
|
+
parentName=self.geo.terminals.inner.name,
|
|
2971
3165
|
)
|
|
2972
3166
|
|
|
2973
3167
|
# Inner terminal's inner tube part:
|
|
2974
3168
|
self.innerTerminalTubeVolume = dimTags(
|
|
2975
|
-
name=self.geo.
|
|
3169
|
+
name=self.geo.terminals.inner.name + "-Tube", save=True, parentName=self.geo.terminals.inner.name
|
|
2976
3170
|
)
|
|
2977
3171
|
|
|
2978
3172
|
# Transition layers:
|
|
@@ -2987,63 +3181,63 @@ class pancakeCoilsWithAir:
|
|
|
2987
3181
|
|
|
2988
3182
|
# Inner air cylinder volume:
|
|
2989
3183
|
self.centerAirCylinderVolume = dimTags(
|
|
2990
|
-
name=self.geo.
|
|
3184
|
+
name=self.geo.air.name + "-InnerCylinder",
|
|
2991
3185
|
save=True,
|
|
2992
|
-
parentName=self.geo.
|
|
3186
|
+
parentName=self.geo.air.name,
|
|
2993
3187
|
)
|
|
2994
3188
|
|
|
2995
3189
|
# Top and bottom parts of the air volume:
|
|
2996
3190
|
self.topAirPancakeWindingExtursionVolume = dimTags(
|
|
2997
|
-
name=self.geo.
|
|
3191
|
+
name=self.geo.air.name + "-TopPancakeWindingExtursion",
|
|
2998
3192
|
save=True,
|
|
2999
|
-
parentName=self.geo.
|
|
3193
|
+
parentName=self.geo.air.name,
|
|
3000
3194
|
)
|
|
3001
3195
|
self.topAirPancakeContactLayerExtursionVolume = dimTags(
|
|
3002
|
-
name=self.geo.
|
|
3196
|
+
name=self.geo.air.name + "-TopPancakeContactLayerExtursion",
|
|
3003
3197
|
save=True,
|
|
3004
|
-
parentName=self.geo.
|
|
3198
|
+
parentName=self.geo.air.name,
|
|
3005
3199
|
)
|
|
3006
3200
|
self.topAirTerminalsExtrusionVolume = dimTags(
|
|
3007
|
-
name=self.geo.
|
|
3201
|
+
name=self.geo.air.name + "-TopTerminalsExtrusion",
|
|
3008
3202
|
save=True,
|
|
3009
|
-
parentName=self.geo.
|
|
3203
|
+
parentName=self.geo.air.name,
|
|
3010
3204
|
)
|
|
3011
3205
|
self.topAirTubeTerminalsExtrusionVolume = dimTags(
|
|
3012
|
-
name=self.geo.
|
|
3206
|
+
name=self.geo.air.name + "-TopTubeTerminalsExtrusion",
|
|
3013
3207
|
save=True,
|
|
3014
|
-
parentName=self.geo.
|
|
3208
|
+
parentName=self.geo.air.name,
|
|
3015
3209
|
)
|
|
3016
3210
|
|
|
3017
3211
|
self.bottomAirPancakeWindingExtursionVolume = dimTags(
|
|
3018
|
-
name=self.geo.
|
|
3212
|
+
name=self.geo.air.name + "-BottomPancakeWindingExtursion",
|
|
3019
3213
|
save=True,
|
|
3020
|
-
parentName=self.geo.
|
|
3214
|
+
parentName=self.geo.air.name,
|
|
3021
3215
|
)
|
|
3022
3216
|
self.bottomAirPancakeContactLayerExtursionVolume = dimTags(
|
|
3023
|
-
name=self.geo.
|
|
3217
|
+
name=self.geo.air.name + "-BottomPancakeContactLayerExtursion",
|
|
3024
3218
|
save=True,
|
|
3025
|
-
parentName=self.geo.
|
|
3219
|
+
parentName=self.geo.air.name,
|
|
3026
3220
|
)
|
|
3027
3221
|
self.bottomAirTerminalsExtrusionVolume = dimTags(
|
|
3028
|
-
name=self.geo.
|
|
3222
|
+
name=self.geo.air.name + "-BottomTerminalsExtrusion",
|
|
3029
3223
|
save=True,
|
|
3030
|
-
parentName=self.geo.
|
|
3224
|
+
parentName=self.geo.air.name,
|
|
3031
3225
|
)
|
|
3032
3226
|
self.bottomAirTubeTerminalsExtrusionVolume = dimTags(
|
|
3033
|
-
name=self.geo.
|
|
3227
|
+
name=self.geo.air.name + "-BottomTubeTerminalsExtrusion",
|
|
3034
3228
|
save=True,
|
|
3035
|
-
parentName=self.geo.
|
|
3229
|
+
parentName=self.geo.air.name,
|
|
3036
3230
|
)
|
|
3037
3231
|
|
|
3038
3232
|
# Gap air:
|
|
3039
3233
|
self.gapAirVolume = dimTags(
|
|
3040
|
-
name=self.geo.
|
|
3234
|
+
name=self.geo.air.name + "-Gap", save=True, parentName=self.geo.air.name
|
|
3041
3235
|
)
|
|
3042
3236
|
|
|
3043
3237
|
# Create additional/optional volume storages (they might be used in the meshing
|
|
3044
3238
|
# process):
|
|
3045
|
-
self.firstTerminalVolume = dimTags(name=self.geo.
|
|
3046
|
-
self.lastTerminalVolume = dimTags(name=self.geo.
|
|
3239
|
+
self.firstTerminalVolume = dimTags(name=self.geo.terminals.firstName, save=True)
|
|
3240
|
+
self.lastTerminalVolume = dimTags(name=self.geo.terminals.lastName, save=True)
|
|
3047
3241
|
|
|
3048
3242
|
# ==============================================================================
|
|
3049
3243
|
# CREATING VOLUME STORAGES ENDS ================================================
|
|
@@ -3072,20 +3266,20 @@ class pancakeCoilsWithAir:
|
|
|
3072
3266
|
|
|
3073
3267
|
self.gapAirSurfacesDimTags = []
|
|
3074
3268
|
|
|
3075
|
-
for i in range(self.geo.
|
|
3269
|
+
for i in range(self.geo.numberOfPancakes):
|
|
3076
3270
|
# Itterate over the number of pancake coils:
|
|
3077
3271
|
self.individualWinding.append(
|
|
3078
3272
|
dimTags(
|
|
3079
|
-
name=self.geo.
|
|
3273
|
+
name=self.geo.winding.name + str(self.pancakeIndex + 1),
|
|
3080
3274
|
save=True,
|
|
3081
|
-
parentName=self.geo.
|
|
3275
|
+
parentName=self.geo.winding.name,
|
|
3082
3276
|
)
|
|
3083
3277
|
)
|
|
3084
3278
|
self.individualContactLayer.append(
|
|
3085
3279
|
dimTags(
|
|
3086
|
-
name=self.geo.
|
|
3280
|
+
name=self.geo.contactLayer.name + str(self.pancakeIndex + 1),
|
|
3087
3281
|
save=True,
|
|
3088
|
-
parentName=self.geo.
|
|
3282
|
+
parentName=self.geo.contactLayer.name,
|
|
3089
3283
|
)
|
|
3090
3284
|
)
|
|
3091
3285
|
|
|
@@ -3128,7 +3322,7 @@ class pancakeCoilsWithAir:
|
|
|
3128
3322
|
self.fundamentalSurfaces[self.outerTerminalTubeVolume]
|
|
3129
3323
|
)
|
|
3130
3324
|
|
|
3131
|
-
if self.mesh.
|
|
3325
|
+
if self.mesh.terminals.structured:
|
|
3132
3326
|
lastItTubeVolDimTags = self.innerTerminalTubeVolume.getDimTags(
|
|
3133
3327
|
3
|
|
3134
3328
|
)[-4:]
|
|
@@ -3147,7 +3341,7 @@ class pancakeCoilsWithAir:
|
|
|
3147
3341
|
findOuterOnes(lastItTubeSideSurfsDimTags)
|
|
3148
3342
|
)
|
|
3149
3343
|
|
|
3150
|
-
if self.mesh.
|
|
3344
|
+
if self.mesh.air.structured:
|
|
3151
3345
|
lastAirTubeVolDimTags = self.outerAirTubeVolume.getDimTags(3)[
|
|
3152
3346
|
-4:
|
|
3153
3347
|
]
|
|
@@ -3173,7 +3367,7 @@ class pancakeCoilsWithAir:
|
|
|
3173
3367
|
topSurfacesDimTags.extend(
|
|
3174
3368
|
self.fundamentalSurfaces[self.innerTerminalTubeVolume]
|
|
3175
3369
|
)
|
|
3176
|
-
if self.mesh.
|
|
3370
|
+
if self.mesh.terminals.structured:
|
|
3177
3371
|
lastOtTubeVolDimTags = self.outerTerminalTubeVolume.getDimTags(
|
|
3178
3372
|
3
|
|
3179
3373
|
)[-4:]
|
|
@@ -3192,7 +3386,7 @@ class pancakeCoilsWithAir:
|
|
|
3192
3386
|
findOuterOnes(lastOtTubeSurfsDimTags, findInnerOnes=True)
|
|
3193
3387
|
)
|
|
3194
3388
|
|
|
3195
|
-
if self.mesh.
|
|
3389
|
+
if self.mesh.air.structured:
|
|
3196
3390
|
lastAirCylinderVolDimTags = (
|
|
3197
3391
|
self.centerAirCylinderVolume.getDimTags(3)[-4:]
|
|
3198
3392
|
)
|
|
@@ -3240,7 +3434,7 @@ class pancakeCoilsWithAir:
|
|
|
3240
3434
|
# funny about the geometry, the gap air can be created with fragment
|
|
3241
3435
|
# operations as well.
|
|
3242
3436
|
|
|
3243
|
-
if not self.geo.
|
|
3437
|
+
if not self.geo.air.generateGapAirWithFragment:
|
|
3244
3438
|
allGapAirSurfacesTags = [
|
|
3245
3439
|
dimTag[1] for dimTag in allGapAirSurfacesDimTags
|
|
3246
3440
|
]
|
|
@@ -3263,12 +3457,12 @@ class pancakeCoilsWithAir:
|
|
|
3263
3457
|
# downwards to create the bottom air volume and terminal volume.
|
|
3264
3458
|
_ = self.extrudeGapPart(
|
|
3265
3459
|
self.fundamentalSurfaces,
|
|
3266
|
-
-self.geo.
|
|
3460
|
+
-self.geo.air.axialMargin,
|
|
3267
3461
|
terminalDimTagsObject=self.outerTerminalTubeVolume,
|
|
3268
3462
|
firstTerminal=True,
|
|
3269
3463
|
)
|
|
3270
3464
|
|
|
3271
|
-
if not i == self.geo.
|
|
3465
|
+
if not i == self.geo.numberOfPancakes - 1:
|
|
3272
3466
|
# If it is not the last pancake coil, extrude the terminal surface to
|
|
3273
3467
|
# create the next contactTerminalSurface and store the new volume in the
|
|
3274
3468
|
# corresponding dimTags object.
|
|
@@ -3280,13 +3474,13 @@ class pancakeCoilsWithAir:
|
|
|
3280
3474
|
# dimTags object.
|
|
3281
3475
|
_ = self.extrudeGapPart(
|
|
3282
3476
|
topSurfaces,
|
|
3283
|
-
self.geo.
|
|
3477
|
+
self.geo.air.axialMargin,
|
|
3284
3478
|
lastTerminal=True,
|
|
3285
3479
|
)
|
|
3286
3480
|
self.pancakeIndex = self.pancakeIndex + 1
|
|
3287
3481
|
|
|
3288
3482
|
# Create the gap air volume:
|
|
3289
|
-
if self.geo.
|
|
3483
|
+
if self.geo.air.generateGapAirWithFragment and self.geo.numberOfPancakes > 1:
|
|
3290
3484
|
self.generateGapAirWithFragment(self.gapAirSurfacesDimTags)
|
|
3291
3485
|
|
|
3292
3486
|
logger.info(
|
|
@@ -3313,24 +3507,25 @@ class pancakeCoilsWithAir:
|
|
|
3313
3507
|
|
|
3314
3508
|
# Calculate the z coordinate of the surfaces:
|
|
3315
3509
|
z = (
|
|
3316
|
-
-self.geo.
|
|
3317
|
-
+ self.geo.
|
|
3318
|
-
+ self.pancakeIndex * (self.geo.
|
|
3510
|
+
-self.geo.air.h / 2
|
|
3511
|
+
+ self.geo.air.axialMargin
|
|
3512
|
+
+ self.pancakeIndex * (self.geo.winding.height + self.geo.gapBetweenPancakes)
|
|
3319
3513
|
)
|
|
3320
3514
|
|
|
3321
3515
|
# Create the winding and contact layer surface:
|
|
3322
3516
|
surface = spiralSurface(
|
|
3323
|
-
self.geo.
|
|
3324
|
-
self.geo.
|
|
3325
|
-
self.geo.
|
|
3326
|
-
self.geo.
|
|
3517
|
+
self.geo.winding.innerRadius,
|
|
3518
|
+
self.geo.winding.thickness,
|
|
3519
|
+
self.geo.contactLayer.thickness,
|
|
3520
|
+
self.geo.winding.numberOfTurns,
|
|
3327
3521
|
z,
|
|
3328
|
-
self.geo.
|
|
3329
|
-
self.geo.
|
|
3522
|
+
self.geo.winding.theta_i,
|
|
3523
|
+
self.geo.terminals.transitionNotchAngle,
|
|
3330
3524
|
spiralDirection,
|
|
3331
|
-
thinShellApproximation=self.geo.
|
|
3525
|
+
thinShellApproximation=self.geo.contactLayer.thinShellApproximation,
|
|
3332
3526
|
)
|
|
3333
|
-
|
|
3527
|
+
#print("this is the surface")
|
|
3528
|
+
#print(surface)
|
|
3334
3529
|
# Save the surface tags (if TSA, contactLayerSurfaceTags will be empty):
|
|
3335
3530
|
fundamentalSurfaces[self.individualWinding[self.pancakeIndex]] = [
|
|
3336
3531
|
(2, tag) for tag in surface.surfaceTags
|
|
@@ -3339,37 +3534,37 @@ class pancakeCoilsWithAir:
|
|
|
3339
3534
|
(2, tag) for tag in surface.contactLayerSurfaceTags
|
|
3340
3535
|
]
|
|
3341
3536
|
|
|
3342
|
-
if self.geo.
|
|
3537
|
+
if self.geo.air.type == "cylinder":
|
|
3343
3538
|
outerAirSurf = outerAirSurface(
|
|
3344
|
-
self.geo.
|
|
3345
|
-
self.geo.
|
|
3539
|
+
self.geo.air.radius,
|
|
3540
|
+
self.geo.terminals.outer.r,
|
|
3346
3541
|
type="cylinder",
|
|
3347
|
-
divideIntoFourParts=self.mesh.
|
|
3348
|
-
divideTerminalPartIntoFourParts=self.mesh.
|
|
3542
|
+
divideIntoFourParts=self.mesh.air.structured,
|
|
3543
|
+
divideTerminalPartIntoFourParts=self.mesh.terminals.structured,
|
|
3349
3544
|
)
|
|
3350
|
-
elif self.geo.
|
|
3545
|
+
elif self.geo.air.type == "cuboid":
|
|
3351
3546
|
outerAirSurf = outerAirSurface(
|
|
3352
|
-
self.geo.
|
|
3353
|
-
self.geo.
|
|
3547
|
+
self.geo.air.sideLength / 2,
|
|
3548
|
+
self.geo.terminals.outer.r,
|
|
3354
3549
|
type="cuboid",
|
|
3355
|
-
divideIntoFourParts=self.mesh.
|
|
3356
|
-
divideTerminalPartIntoFourParts=self.mesh.
|
|
3550
|
+
divideIntoFourParts=self.mesh.air.structured,
|
|
3551
|
+
divideTerminalPartIntoFourParts=self.mesh.terminals.structured,
|
|
3357
3552
|
)
|
|
3358
3553
|
|
|
3359
3554
|
outerTerminalSurf = outerTerminalSurface(
|
|
3360
|
-
self.geo.
|
|
3361
|
-
self.geo.
|
|
3362
|
-
divideIntoFourParts=self.mesh.
|
|
3555
|
+
self.geo.terminals.outer.r,
|
|
3556
|
+
self.geo.terminals.outer.thickness,
|
|
3557
|
+
divideIntoFourParts=self.mesh.terminals.structured,
|
|
3363
3558
|
)
|
|
3364
3559
|
innerTerminalSurf = innerTerminalSurface(
|
|
3365
|
-
self.geo.
|
|
3366
|
-
self.geo.
|
|
3367
|
-
divideIntoFourParts=self.mesh.
|
|
3560
|
+
self.geo.terminals.inner.r,
|
|
3561
|
+
self.geo.terminals.inner.thickness,
|
|
3562
|
+
divideIntoFourParts=self.mesh.terminals.structured,
|
|
3368
3563
|
)
|
|
3369
3564
|
innerAirSurf = innerAirSurface(
|
|
3370
|
-
self.geo.
|
|
3371
|
-
divideIntoFourParts=self.mesh.
|
|
3372
|
-
divideTerminalPartIntoFourParts=self.mesh.
|
|
3565
|
+
self.geo.terminals.inner.r,
|
|
3566
|
+
divideIntoFourParts=self.mesh.air.structured,
|
|
3567
|
+
divideTerminalPartIntoFourParts=self.mesh.terminals.structured,
|
|
3373
3568
|
)
|
|
3374
3569
|
|
|
3375
3570
|
if self.contactSurfaces:
|
|
@@ -3380,8 +3575,8 @@ class pancakeCoilsWithAir:
|
|
|
3380
3575
|
# Create outer air:
|
|
3381
3576
|
outerAirPSDimTags = self.contactSurfaces[self.outerAirTubeVolume]
|
|
3382
3577
|
outerAirPSTags = [dimTag[1] for dimTag in outerAirPSDimTags]
|
|
3383
|
-
if self.geo.
|
|
3384
|
-
if self.geo.
|
|
3578
|
+
if self.geo.air.shellTransformation:
|
|
3579
|
+
if self.geo.air.type == "cuboid":
|
|
3385
3580
|
cuboidShellDimTags1 = self.contactSurfaces[self.airShellVolumePart1]
|
|
3386
3581
|
cuboidShellTags1 = [dimTag[1] for dimTag in cuboidShellDimTags1]
|
|
3387
3582
|
cuboidShellDimTags2 = self.contactSurfaces[self.airShellVolumePart2]
|
|
@@ -3397,7 +3592,7 @@ class pancakeCoilsWithAir:
|
|
|
3397
3592
|
cuboidShellTags3=cuboidShellTags3,
|
|
3398
3593
|
cuboidShellTags4=cuboidShellTags4,
|
|
3399
3594
|
)
|
|
3400
|
-
elif self.geo.
|
|
3595
|
+
elif self.geo.air.type == "cylinder":
|
|
3401
3596
|
cylinderShellDimTags = self.contactSurfaces[self.airShellVolume]
|
|
3402
3597
|
cylinderShellTags = [dimTag[1] for dimTag in cylinderShellDimTags]
|
|
3403
3598
|
outerAirSurf.setPrecreatedSurfaceTags(
|
|
@@ -3462,18 +3657,18 @@ class pancakeCoilsWithAir:
|
|
|
3462
3657
|
# If self.contactSurfaces is empty, it means that it is the first pancake
|
|
3463
3658
|
# coil. In that case, the surfaces should be created from scratch.
|
|
3464
3659
|
|
|
3465
|
-
if self.geo.
|
|
3466
|
-
if self.geo.
|
|
3660
|
+
if self.geo.air.shellTransformation:
|
|
3661
|
+
if self.geo.air.type == "cuboid":
|
|
3467
3662
|
outerAirSurf.createFromScratch(
|
|
3468
3663
|
z,
|
|
3469
3664
|
shellTransformation=True,
|
|
3470
|
-
shellRadius=self.geo.
|
|
3665
|
+
shellRadius=self.geo.air.shellSideLength / 2,
|
|
3471
3666
|
)
|
|
3472
3667
|
else:
|
|
3473
3668
|
outerAirSurf.createFromScratch(
|
|
3474
3669
|
z,
|
|
3475
3670
|
shellTransformation=True,
|
|
3476
|
-
shellRadius=self.geo.
|
|
3671
|
+
shellRadius=self.geo.air.shellOuterRadius,
|
|
3477
3672
|
)
|
|
3478
3673
|
else:
|
|
3479
3674
|
outerAirSurf.createFromScratch(z)
|
|
@@ -3488,35 +3683,35 @@ class pancakeCoilsWithAir:
|
|
|
3488
3683
|
|
|
3489
3684
|
# Save the surface tags:
|
|
3490
3685
|
fundamentalSurfaces[self.outerAirTubeVolume] = [
|
|
3491
|
-
|
|
3686
|
+
(2, tag) for tag in outerAirSurf.surfaceTags
|
|
3492
3687
|
]
|
|
3493
3688
|
|
|
3494
3689
|
fundamentalSurfaces[self.centerAirCylinderVolume] = [
|
|
3495
|
-
|
|
3690
|
+
(2, tag) for tag in innerAirSurf.surfaceTags
|
|
3496
3691
|
]
|
|
3497
3692
|
|
|
3498
3693
|
fundamentalSurfaces[self.outerTerminalTubeVolume] = [
|
|
3499
|
-
|
|
3694
|
+
(2, tag) for tag in outerTerminalSurf.tubeSurfaceTags
|
|
3500
3695
|
]
|
|
3501
3696
|
fundamentalSurfaces[self.outerTerminalTouchingVolume] = [
|
|
3502
|
-
|
|
3697
|
+
(2, tag) for tag in outerTerminalSurf.nontubeSurfaceTags
|
|
3503
3698
|
]
|
|
3504
3699
|
|
|
3505
3700
|
fundamentalSurfaces[self.innerTerminalTubeVolume] = [
|
|
3506
|
-
|
|
3701
|
+
(2, tag) for tag in innerTerminalSurf.tubeSurfaceTags
|
|
3507
3702
|
]
|
|
3508
3703
|
fundamentalSurfaces[self.innerTerminalTouchingVolume] = [
|
|
3509
|
-
|
|
3704
|
+
(2, tag) for tag in innerTerminalSurf.nontubeSurfaceTags
|
|
3510
3705
|
]
|
|
3511
3706
|
fundamentalSurfaces[self.innerTransitionNotchVolume] = [
|
|
3512
|
-
|
|
3707
|
+
(2, tag) for tag in surface.innerNotchSurfaceTags
|
|
3513
3708
|
]
|
|
3514
3709
|
fundamentalSurfaces[self.outerTransitionNotchVolume] = [
|
|
3515
|
-
|
|
3710
|
+
(2, tag) for tag in surface.outerNotchSurfaceTags
|
|
3516
3711
|
]
|
|
3517
3712
|
|
|
3518
|
-
if self.geo.
|
|
3519
|
-
if self.geo.
|
|
3713
|
+
if self.geo.air.shellTransformation:
|
|
3714
|
+
if self.geo.air.type == "cuboid":
|
|
3520
3715
|
fundamentalSurfaces[self.airShellVolumePart1] = [
|
|
3521
3716
|
(2, tag) for tag in outerAirSurf.shellTagsPart1
|
|
3522
3717
|
]
|
|
@@ -3529,10 +3724,17 @@ class pancakeCoilsWithAir:
|
|
|
3529
3724
|
fundamentalSurfaces[self.airShellVolumePart4] = [
|
|
3530
3725
|
(2, tag) for tag in outerAirSurf.shellTagsPart4
|
|
3531
3726
|
]
|
|
3532
|
-
elif self.geo.
|
|
3727
|
+
elif self.geo.air.type == "cylinder":
|
|
3533
3728
|
fundamentalSurfaces[self.airShellVolume] = [
|
|
3534
3729
|
(2, tag) for tag in outerAirSurf.shellTags
|
|
3535
3730
|
]
|
|
3731
|
+
# windingSurfaces = {}
|
|
3732
|
+
# # Save only the winding surface tags:
|
|
3733
|
+
# windingSurfaces[self.individualWinding[self.pancakeIndex]] = [
|
|
3734
|
+
# (2, tag) for tag in surface.surfaceTags
|
|
3735
|
+
# ]
|
|
3736
|
+
# fundamentalSurfaces = windingSurfaces
|
|
3737
|
+
# print(fundamentalSurfaces)
|
|
3536
3738
|
|
|
3537
3739
|
return fundamentalSurfaces
|
|
3538
3740
|
|
|
@@ -3550,7 +3752,7 @@ class pancakeCoilsWithAir:
|
|
|
3550
3752
|
returns the extrusion's top surfaces as a dictionary again, where the keys are
|
|
3551
3753
|
the corresponding dimTagsObjects and the values are the dimTags of the surfaces.
|
|
3552
3754
|
|
|
3553
|
-
If tZ is not given, then it is set to the gap height (self.geo.
|
|
3755
|
+
If tZ is not given, then it is set to the gap height (self.geo.gapBetweenPancakes). This is the
|
|
3554
3756
|
default value used for connecting the pancake coils. Only for the creation of
|
|
3555
3757
|
the first and the last pancake coils different tZ values are used.
|
|
3556
3758
|
|
|
@@ -3577,7 +3779,7 @@ class pancakeCoilsWithAir:
|
|
|
3577
3779
|
bottomPart = False
|
|
3578
3780
|
topPart = False
|
|
3579
3781
|
if tZ is None:
|
|
3580
|
-
tZ = self.geo.
|
|
3782
|
+
tZ = self.geo.gapBetweenPancakes
|
|
3581
3783
|
elif tZ < 0:
|
|
3582
3784
|
bottomPart = True
|
|
3583
3785
|
elif tZ > 0:
|
|
@@ -3730,7 +3932,7 @@ class pancakeCoilsWithAir:
|
|
|
3730
3932
|
|
|
3731
3933
|
def extrudeWindingPart(self):
|
|
3732
3934
|
"""
|
|
3733
|
-
Extrudes all the fundamental surfaces of the pancake coil by self.geo.
|
|
3935
|
+
Extrudes all the fundamental surfaces of the pancake coil by self.geo.winding.height and
|
|
3734
3936
|
returns the next connection terminal's top surface dimTag, and other air dimTags
|
|
3735
3937
|
in a dictionary so that they can be further extruded.
|
|
3736
3938
|
|
|
@@ -3749,7 +3951,7 @@ class pancakeCoilsWithAir:
|
|
|
3749
3951
|
|
|
3750
3952
|
# Extrude the fundamental surfaces:
|
|
3751
3953
|
extrusionResult = dimTags()
|
|
3752
|
-
extrusionResult.add(gmsh.model.occ.extrude(listOfDimTags, 0, 0, self.geo.
|
|
3954
|
+
extrusionResult.add(gmsh.model.occ.extrude(listOfDimTags, 0, 0, self.geo.winding.height))
|
|
3753
3955
|
|
|
3754
3956
|
# Add the created volumes to the corresponding dimTags objects:
|
|
3755
3957
|
volumes = extrusionResult.getDimTags(3)
|
|
@@ -3760,23 +3962,23 @@ class pancakeCoilsWithAir:
|
|
|
3760
3962
|
# Note the first pancake (sometimes useful for creating regions in the
|
|
3761
3963
|
# meshing part):
|
|
3762
3964
|
for i, volumeDimTag in enumerate(volumes):
|
|
3763
|
-
if listOfDimTagsObjects[i].parentName == self.geo.
|
|
3965
|
+
if listOfDimTagsObjects[i].parentName == self.geo.terminals.outer.name:
|
|
3764
3966
|
self.firstTerminalVolume.add(volumeDimTag)
|
|
3765
3967
|
|
|
3766
3968
|
# Not elif! Because the first pancake coil is also the last pancake coil if
|
|
3767
3969
|
# there is only one pancake coil.
|
|
3768
|
-
if self.pancakeIndex == self.geo.
|
|
3970
|
+
if self.pancakeIndex == self.geo.numberOfPancakes - 1:
|
|
3769
3971
|
# Note the last pancake (sometimes useful for creating regions in the
|
|
3770
3972
|
# meshing part):
|
|
3771
3973
|
for i, volumeDimTag in enumerate(volumes):
|
|
3772
3974
|
if (
|
|
3773
3975
|
self.pancakeIndex % 2 == 1
|
|
3774
|
-
and listOfDimTagsObjects[i].parentName == self.geo.
|
|
3976
|
+
and listOfDimTagsObjects[i].parentName == self.geo.terminals.outer.name
|
|
3775
3977
|
):
|
|
3776
3978
|
self.lastTerminalVolume.add(volumeDimTag)
|
|
3777
3979
|
elif (
|
|
3778
3980
|
self.pancakeIndex % 2 == 0
|
|
3779
|
-
and listOfDimTagsObjects[i].parentName == self.geo.
|
|
3981
|
+
and listOfDimTagsObjects[i].parentName == self.geo.terminals.inner.name
|
|
3780
3982
|
):
|
|
3781
3983
|
self.lastTerminalVolume.add(volumeDimTag)
|
|
3782
3984
|
|
|
@@ -3819,11 +4021,11 @@ class pancakeCoilsWithAir:
|
|
|
3819
4021
|
dummyAir = gmsh.model.occ.addCylinder(
|
|
3820
4022
|
0,
|
|
3821
4023
|
0,
|
|
3822
|
-
-self.geo.
|
|
4024
|
+
-self.geo.air.h / 2,
|
|
3823
4025
|
0,
|
|
3824
4026
|
0,
|
|
3825
|
-
self.geo.
|
|
3826
|
-
self.geo.
|
|
4027
|
+
self.geo.air.h,
|
|
4028
|
+
self.geo.terminals.outer.r,
|
|
3827
4029
|
)
|
|
3828
4030
|
|
|
3829
4031
|
toBeDeletedDimTags = []
|
|
@@ -3903,7 +4105,7 @@ class Geometry(Base):
|
|
|
3903
4105
|
|
|
3904
4106
|
# Start GMSH:
|
|
3905
4107
|
self.gu = GmshUtils(self.geom_folder)
|
|
3906
|
-
self.gu.initialize()
|
|
4108
|
+
self.gu.initialize(verbosity_Gmsh=fdm.run.verbosity_Gmsh)
|
|
3907
4109
|
|
|
3908
4110
|
# To speed up the GUI:
|
|
3909
4111
|
gmsh.option.setNumber("Geometry.NumSubEdges", 10)
|
|
@@ -3911,21 +4113,18 @@ class Geometry(Base):
|
|
|
3911
4113
|
# To see the surfaces in a better way in GUI:
|
|
3912
4114
|
gmsh.option.setNumber("Geometry.SurfaceType", 1)
|
|
3913
4115
|
|
|
3914
|
-
# Makes the gmsh.mode.occ.cut function faster:
|
|
3915
|
-
gmsh.option.setNumber("Geometry.OCCParallel", 1)
|
|
3916
|
-
|
|
3917
4116
|
# To avoid any unwanted modifications to the geometry, the automatic fixing of
|
|
3918
4117
|
# the geometry is disabled:
|
|
3919
4118
|
gmsh.option.setNumber("Geometry.OCCAutoFix", 0)
|
|
3920
4119
|
|
|
3921
4120
|
# Set the tolerance:
|
|
3922
|
-
if self.geo.
|
|
3923
|
-
gmsh.option.setNumber("Geometry.Tolerance", self.geo.
|
|
4121
|
+
if self.geo.dimensionTolerance < gmsh.option.getNumber("Geometry.Tolerance"):
|
|
4122
|
+
gmsh.option.setNumber("Geometry.Tolerance", self.geo.dimensionTolerance)
|
|
3924
4123
|
|
|
3925
|
-
gmsh.option.setNumber("Geometry.ToleranceBoolean", self.geo.
|
|
4124
|
+
gmsh.option.setNumber("Geometry.ToleranceBoolean", self.geo.dimensionTolerance)
|
|
3926
4125
|
|
|
3927
|
-
spiralCurve.sectionsPerTurn = self.geo.
|
|
3928
|
-
spiralCurve.curvesPerTurn = self.geo.
|
|
4126
|
+
spiralCurve.sectionsPerTurn = self.geo.winding.spt
|
|
4127
|
+
spiralCurve.curvesPerTurn = self.geo.winding.numberOfVolumesPerTurn
|
|
3929
4128
|
|
|
3930
4129
|
def generate_geometry(self):
|
|
3931
4130
|
"""
|