Skip to content

Commit

Permalink
Ignore connections between atmosphere blocks in boundaries_json()
Browse files Browse the repository at this point in the history
  • Loading branch information
acroucher committed Jul 10, 2024
1 parent 96ee87b commit b338423
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions t2data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2672,25 +2672,26 @@ def boundaries_json(self, geo, bdy_incons, atmos_volume, eos, mesh_coords, trace
names.remove(blk.name)
interior_blkname = names[0]
interior_blk = self.grid.block[interior_blkname]
cell_index = geo.block_name_index[interior_blkname] - geo.num_atmosphere_blocks
if blk.centre is None:
if vertical_connection:
normal = np.array([0., 0., nz])
if 0. < interior_blk.volume < atmos_volume:
cell_index = geo.block_name_index[interior_blkname] - geo.num_atmosphere_blocks
if blk.centre is None:
if vertical_connection:
normal = np.array([0., 0., nz])
else:
raise Exception("Can't find normal vector for connection: " +
str(conname))
else:
raise Exception("Can't find normal vector for connection: " +
str(conname))
else:
normal = blk.centre - interior_blk.centre
normal /= np.linalg.norm(normal)
if mesh_coords != 'xyz':
if vertical_connection:
if mesh_coords in ['xz', 'yz', 'rz']:
normal = normal[[0,2]]
elif mesh_coords == 'xy': normal = None
else: normal = normal[[0,1]]
if normal is not None:
bc['faces'].append({"cells": [cell_index],
"normal": list(normal)})
normal = blk.centre - interior_blk.centre
normal /= np.linalg.norm(normal)
if mesh_coords != 'xyz':
if vertical_connection:
if mesh_coords in ['xz', 'yz', 'rz']:
normal = normal[[0,2]]
elif mesh_coords == 'xy': normal = None
else: normal = normal[[0,1]]
if normal is not None:
bc['faces'].append({"cells": [cell_index],
"normal": list(normal)})
normals = np.array([spec['normal'] for spec in bc['faces']])
if np.isclose(normals, normals[0], rtol = 1.e-8).all():
allcells = []
Expand Down

0 comments on commit b338423

Please sign in to comment.