...
 
Commits (4)
......@@ -110,14 +110,13 @@ class RootCap(object):
self.domain = Domain()
p = CoonsPatch(ni=self.patch_cons[0].ni, nj=self.patch_cons[3].ni, block_name='cap_base-0000')
p.add_edge(0, self.patch_cons[0].copy())
p.add_edge(1, self.patch_cons[2].copy())
p.add_edge(2, self.patch_cons[3].copy())
p.add_edge(3, self.patch_cons[1].copy())
p.add_edge(0, self.patch_cons[3].copy())
p.add_edge(1, self.patch_cons[1].copy())
p.add_edge(2, self.patch_cons[0].copy())
p.add_edge(3, self.patch_cons[2].copy())
p.update()
self.patches = []
self.patches.append(p)
p.P._flip_block()
self.domain.add_blocks(p.P.split(33))
for i in [0, 1]:
p = CoonsPatch(ni=self.collar_ps[i].ni, nj=self.base_cons[i].ni, block_name = 'cap-%04d' % i)
......@@ -126,7 +125,6 @@ class RootCap(object):
p.add_edge(2, self.base_cons[i].copy())
p.add_edge(3, self.patch_cons[i].copy())
p.update()
p.P._flip_block()
self.patches.append(p)
self.domain.add_blocks(p.P)
for i in [2, 3]:
......@@ -138,8 +136,6 @@ class RootCap(object):
p.update()
self.patches.append(p)
self.domain.add_blocks(p.P)
if self.direction == -1:
self.domain.flip_all()
self.domain.join_blocks('cap-0000', 'cap-0001', newname='root')
self.domain.join_blocks('root', 'cap-0002', newname='root')
self.domain.join_blocks('root', 'cap-0003', newname='root')
......
......@@ -9,6 +9,7 @@ from PGL.components.bladeroot import CoonsBladeRoot
from PGL.components.bladecap import RootCap
from PGL.components.bladetip import CoonsBladeTip
from PGL.components.nacelle import CoonsNacelle
from PGL.main.geom_tools import calculate_length
from PGL.main.domain import Domain, Block
from PGL.main.curve import Curve
......@@ -179,6 +180,7 @@ class BladeMesher(object):
self.pf = {}
self.planform_filename = ''
self.planform_spline = 'akima'
self.base_airfoils = []
self.base_airfoils_path = []
self.blend_var = np.array([])
......@@ -229,6 +231,8 @@ class BladeMesher(object):
self.pf['chord'] *= scaler
self.pf['x'] *= scaler
self.pf['y'] *= scaler
s = calculate_length(np.array([self.pf['x'], self.pf['y'], self.pf['z']]).T)
self.pf['s'] = s / s[-1]
self.pf_spline = RedistributedPlanform(**self.__dict__)
# if self.user_surface_file or self.user_surface.shape[0] > 0:
# self.pf_spline.only_s = True
......@@ -301,10 +305,8 @@ class BladeMesher(object):
self.pf['y'][0],
self.pf['z'][0]])
if self.ni_root > 0:
if self.root_type in ['cylinder', 'nacelle']:
if self.root_type in ['cylinder', 'nacelle', 'cap']:
self.root.tip_con = self.main_section.surface[:, self.ni_root-1, :]
elif self.root_type == 'cap':
self.root.tip_con = self.main_section.surface[:, 0, :]
self.root.update()
self.tip.main_section = self.main_section.surface
self.tip.update()
......@@ -312,13 +314,12 @@ class BladeMesher(object):
# assemble mesh and join blocks
x = self.main_section.surface
self.domain = Domain()
if self.root_type in ['cylinder', 'nacelle', 'tip']:
if self.root_type in ['cylinder', 'nacelle', 'tip', 'cap']:
ni_root = self.ni_root
elif self.root_type == 'cap':
ni_root = 0
self.domain.add_blocks(Block(x[:, np.maximum(0, ni_root-1):self.itip_start+1, 0],
x[:, np.maximum(0, ni_root-1):self.itip_start+1, 1],
x[:, np.maximum(0, ni_root-1):self.itip_start+1, 2], name='main_section'))
x[:, np.maximum(0, ni_root-1):self.itip_start+1, 2],
name='main_section'))
self.domain.add_domain(self.tip.domain)
self.domain.join_blocks('tip-base', 'main_section', newname='main_section')
......