Skip to content

Commit ebc6fe6

Browse files
authored
Adding scale factor to generate_vsp_surfaces (#419)
1 parent afcc73f commit ebc6fe6

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

openaerostruct/geometry/utils.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ def generate_mesh(input_dict):
736736
return mesh
737737

738738

739-
def generate_vsp_surfaces(vsp_file, symmetry=False, include=None):
739+
def generate_vsp_surfaces(vsp_file, symmetry=False, include=None, scale=1.0):
740740
"""
741741
Generate a series of VLM surfaces based on geometries in an OpenVSP model.
742742
@@ -751,6 +751,10 @@ def generate_vsp_surfaces(vsp_file, symmetry=False, include=None):
751751
include : list[str]
752752
List of body names defined in OpenVSP model that should be included in VLM mesh output.
753753
Defaults to all bodies found in model.
754+
scale: float
755+
A global scale factor from the OpenVSP geometry to incoming VLM mesh
756+
geometry. For example, if the OpenVSP model is in inches, and the VLM
757+
in meters, scale=0.0254. Defaults to 1.0.
754758
755759
Returns
756760
-------
@@ -862,6 +866,7 @@ def generate_vsp_surfaces(vsp_file, symmetry=False, include=None):
862866
mesh[:, :, 0] = np.flipud(x.T)
863867
mesh[:, :, 1] = np.flipud(y.T)
864868
mesh[:, :, 2] = np.flipud(z.T)
869+
mesh *= scale
865870

866871
# Check if the surface has already been added (i.e. symmetry == False)
867872
if surf_name not in surfaces:
@@ -886,7 +891,7 @@ def generate_vsp_surfaces(vsp_file, symmetry=False, include=None):
886891

887892
# If a half-model was requested, go through and flag each surface as symmetrical
888893
# if a left and right surface was found.
889-
# NOTE: We don't necesarilly want to mark every surface as symmetrical,
894+
# NOTE: We don't necessarily want to mark every surface as symmetrical,
890895
# even if a half-model is requested, since some surfaces, like vertical tails,
891896
# might lie perfectly on the symmetry plane.
892897
if symmetry:

0 commit comments

Comments
 (0)