aboutsummaryrefslogtreecommitdiff
path: root/fullswof-utils
diff options
context:
space:
mode:
authorPaul Garlick <pgarlick@tourbillion-technology.com>2021-12-02 11:12:41 +0000
committerPaul Garlick <pgarlick@tourbillion-technology.com>2021-12-02 11:12:41 +0000
commitff8b0a4b85b98dd85d868d3e716e13073b11a335 (patch)
tree633ef00d829b062b36d0a30903804c903b1cfad8 /fullswof-utils
parent9d1da53b98824f897c31362d1a4223c46fa88fe9 (diff)
downloadfullSWOF-utils-ff8b0a4b85b98dd85d868d3e716e13073b11a335.tar.gz
makeBoundary: Use slope value to determine elevations at boundary cells.
* fullswof-utils/makeBoundary: Re-define yin and zin variables at top and bottom boundaries. Specifying the local gradient allows a smoother transition between the one-dimensional exterior region and the two-dimensional interior domain.
Diffstat (limited to 'fullswof-utils')
-rwxr-xr-xfullswof-utils/makeBoundary11
1 files changed, 6 insertions, 5 deletions
diff --git a/fullswof-utils/makeBoundary b/fullswof-utils/makeBoundary
index 097ae9e..512a968 100755
--- a/fullswof-utils/makeBoundary
+++ b/fullswof-utils/makeBoundary
@@ -175,7 +175,8 @@ xmax = (xtp[0]+xtp[-1]) # domain extent in x-direction
ymax = (ytp[0]+ytp[-1]) # domain extent in y-direction
ncols = int(math.sqrt(len(xtp)*xmax/ymax)) # number of cells in x-direction
nrows = int(len(xtp)/ncols) # number of cells in y-direction
-dX = xmax/ncols # cell size
+dX = xmax/ncols # cell size in x-direction
+dY = dX # for uniform grid
print('cell size, dX (/m) =', dX)
#print(ncols, nrows)
@@ -184,12 +185,12 @@ print('cell size, dX (/m) =', dX)
# blocks, with nrows lines per block.
if args.location == 'top':
xin = xtp[nrows-1:len(xtp):nrows]
- yin = 2*ytp[nrows-1:len(xtp):nrows] - ytp[nrows-2:len(xtp):nrows]
- zin = 2*ztp[nrows-1:len(xtp):nrows] - ztp[nrows-2:len(xtp):nrows]
+ yin = ytp[nrows-1:len(xtp):nrows] + dY
+ zin = ztp[nrows-1:len(xtp):nrows] + dY*slope
elif args.location == 'bottom':
xin = xtp[0:len(xtp):nrows]
- yin = 2*ytp[0:len(xtp):nrows] - ytp[1:len(xtp):nrows]
- zin = 2*ztp[0:len(xtp):nrows] - ztp[1:len(xtp):nrows]
+ yin = ytp[0:len(xtp):nrows] - dY
+ zin = ztp[0:len(xtp):nrows] - dY*slope
elif args.location == 'left':
xin = 2*xtp[:nrows] - xtp[nrows:2*nrows]
yin = ytp[:nrows]