From ff8b0a4b85b98dd85d868d3e716e13073b11a335 Mon Sep 17 00:00:00 2001 From: Paul Garlick Date: Thu, 2 Dec 2021 11:12:41 +0000 Subject: 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. --- fullswof-utils/makeBoundary | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'fullswof-utils') 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] -- cgit