Skip to content

Commit

Permalink
fixed formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ingojahn committed Sep 7, 2023
1 parent 038e2df commit 6e00b85
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 23 deletions.
12 changes: 6 additions & 6 deletions hypervehicle/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ def __call__(self, r, s):
z_cube = z * self.c + self.centre.z

return Vector3(x=x_cube, y=y_cube, z=z_cube)


class CubePatch(CuboidPatch):
"""Creates a cube face patch for a cube of length
Expand Down Expand Up @@ -843,8 +843,8 @@ class FacePatchRough(ParametricSurface):
"roughnessData",
"lambda_0",
"roughness_height",
"roll_off"
] # TODO: Add roughness information.
"roll_off",
] # TODO: Add roughness information.

def __init__(
self, a, b, c, centre, face, roughnessData, lambda_0, roughness_height, roll_off
Expand All @@ -871,7 +871,7 @@ def __init__(
row = 0
for m in range(self.ny):
for n in range(self.nx):
row=row+1
row = row + 1
self.amp[n, m] = roughnessData[row, 0]
self.phase[n, m] = roughnessData[row, 1]

Expand All @@ -891,8 +891,8 @@ def roughnessFunction(self, x, y):
for n in range(self.ny):
for m in range(self.nx):
h = h + self.amp[n, m] * np.cos(
2*np.pi*m * x/self.lambda_0
+ 2*np.pi*n * y/self.lambda_0
2 * np.pi * m * x / self.lambda_0
+ 2 * np.pi * n * y / self.lambda_0
+ self.phase[n, m]
)
return h
Expand Down
32 changes: 15 additions & 17 deletions hypervehicle/hangar/cube_rough.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,10 @@ def generate_patches(self):
self.roughness_data,
self.lambda_0,
self.roughness_height,
self.roll_off
self.roll_off,
)




if __name__ == "__main__":
# config_case = "cube"
# config_case = "cuboid"
Expand All @@ -99,28 +97,28 @@ def generate_patches(self):

case "cuboid_rough":
print(f" Example - Cuboid with 'rough' top surface")
a = 0.08/2
b = 0.08/2
a = 0.08 / 2
b = 0.08 / 2
c = 0.005
print(f" Cuboid Dimensions a={a}, b={b}, c={c}")
body = CuboidRough(a=a, b=b, c=c, stl_resolution=30)

roughness_height = 0.005
lambda_0 = 0.04 # [m] - length of longest frequency to be included
roll_off = 0.01 # [m] - distance over which stencil rolls off
roll_off = 0.01 # [m] - distance over which stencil rolls off

roughness_data = np.array(
[
[3, 3],
[0.23858489823E+00, 0.76882559458E+00],
[0.13405469344E+00, 0.32250873843E+01],
[0.37001241020E+00, 0.39367026114E+01],
[0.77008101266E-01, 0.13989718680E+01],
[0.36533620243E+00, 0.37127829101E+01],
[0.00000000000E+00, 0.13001876919E+01],
[0.28378862436E+00, 0.21209129392E+00],
[0.00000000000E+00, 0.44289617133E+01],
[0.00000000000E+00, 0.55468162808E+01]
[0.23858489823e+00, 0.76882559458e+00],
[0.13405469344e+00, 0.32250873843e+01],
[0.37001241020e+00, 0.39367026114e+01],
[0.77008101266e-01, 0.13989718680e+01],
[0.36533620243e+00, 0.37127829101e+01],
[0.00000000000e+00, 0.13001876919e+01],
[0.28378862436e+00, 0.21209129392e+00],
[0.00000000000e+00, 0.44289617133e+01],
[0.00000000000e+00, 0.55468162808e+01],
]
)

Expand Down

0 comments on commit 6e00b85

Please sign in to comment.