Click here to return to top level Code Management page.
# The commands in the script below are executed in GENAIR
# to create the Geometry Control System files needed
# for a wing-only FFD optimization with Jetstream:
# - axial.con, axial.b, ffd.b, patch.ffd.con
#
# A one-segment, linear axial curve is created.
#
# The axial curve is located at the wing trailing-edge.
#
# The FFD volume has five spanwise sections, each with
# 10 control pts for top half of section and 10 control
# pts for bottom half of section.
#
# Verify that the FFD volume is just large enough to
# envelope the entire wing surface and all patches.
# The size of the FFD volume can be adjusted by modifiying
# the offset values in the 'opti.axial.make_axial_from_wing' command.
#
# Prerequisites:
# 1) Must have grid files in your working directory:
# - grid.g, grid.con, grid.map, patch.con
# 2) Must have a wing object loaded in GENAIR named 'wi'
#
#
#load(fn='wing.p')
#wi=_[0]
gd = Grid()
gd.read_grid(show=False)
gd.read_connectivity(show=False)
gd.read_map(show=False)
gd.read_patch(show=False)
save(gd, fn='gd.p')
ax = opti.axial.make_axial_from_wing(wi, 'TE', 2, 1, (10, 5, 2), (3, 3, 1), [(0.02,0.02), (0,0.08), (0.027,0.027)])
ax.snap_ffd()
#draw(wi,ax)
axials=[ax]
for ax in axials: ax.ffd.embed(*gd.ptch)
joints = opti.axial.make_joints_from_axials(axials)
opti.axial.set_module_variables(axials, joints)
#draw(*(gd.ptch+axials+joints))
opti.axial.write_axial_connectivity()
ffds = [ax.ffd for ax in axials]
gd.write_patch(ffds)