|
From: Kyle A W. <kyl...@ut...> - 2019-04-01 23:12:14
|
Hi,
I am currently using Anuga to model a river delta, and need a discharge
inflow at the upstream boundary. For physical reasons, I would prefer to
prescribe this discharge using a Dirichlet boundary condition (rather than
an inlet + reflective BC). I have tried multiple boundary conditions for
this input, including: the default Dirichlet, the
Dirichlet_discharge_boundary, the Inflow_boundary, and one additional BC
module I wrote that uses discharge and stage as inputs. I have tested all
of these on a simplified case, and with minor differences, all appear to
work fine.
Here is my problem: when I use these BCs on my full domain, the discharge I
am measuring across the upstream channel (~780 m3/s) is much lower than the
discharge I am prescribing at the boundary (1620 m3/s). I do not know if
this discrepancy is due to the BC, to the model evolution, or the data
post-processing. Has anybody else encountered this problem, and does
anybody know what the issue is?
For context, I have even tried multiplying the inflow by the fractional
difference in the model results (2.09x), and the resulting discharge was
still too low (~1300 m3/s). Aside from the discharge, everything about the
model evolution appears normal.
A simplified version of the code/workflow, if needed:
### Compute inflow:
Q = 1620 # [m3/s]
upstream_stage = 0.74 # [m]
z = pd.read_csv('channel_profile.csv', names=['elev']) # reads in
1-meter-res csv of elevations along the boundary
z = np.array(z['elev'])
profile = -z[z <= upstream_stage] + upstream_stage # to find channel area
mean_depth = np.mean(profile)
channel_area = np.trapz(profile)
U = Q / channel_area
momentum_in = mean_depth*U
### [establish domain, mesh, topography, etc. Manning's is n=0.03 in
channel]
### Inflow BC is one of the following:
Bin = anuga.shallow_water.boundaries.Dirichlet_discharge_boundary(domain,
stage0 = upstream_stage, wh0 = momentum_in) # my default choice
Bin = anuga.Dirichlet_boundary([upstream_stage, x_momentum_in,
y_momentum_in]) # equivalent to above, requires computing x,y components
Bin = anuga.shallow_water.boundaries.Inflow_boundary(domain, rate = Q) #
requires changing the mesh boundary & gives unrealistic depths, but still
results in a discharge
Bin = anuga.shallow_water.boundaries.Dirichlet_Q_stage_boundary(domain,
rate = Q, stage = upstream_stage) # I wrote this to work like an
Inflow_boundary, but uses a prescribed stage instead of a calculated one,
and only applies it over BC edges with elevation < upstream_stage
domain.set_boundary({'upstream: Bin, 'bay': Bout, 'sides': Br})
### [run model, save SWW]
### Post-processing:
anuga.utilities.plot_utils.Make_Geotif(
swwFile = swwname,
output_quantities = ['depth', 'velocity', 'depthIntegratedVelocity'],
myTimeStep = 100,
CellSize = 10.0, # cell size of raster in meters
proj4string = '+proj=utm +zone=15 +datum=NAVD88 +units=m +no_defs',
k_nearest_neighbours = 3) # number of nearest neighbors for
interpolation (I've tried = 1)
### [load in raster, sum depthIntegratedVelocity across transects of the
upstream channel, multiply by cell size. Resulting Q is too low]
Any help or insight would be greatly appreciated.
-- Kyle
*----------------------------------------------------------------------------------------*
*Kyle Wright*
The University of Texas at Austin
Department of Environmental & Water Resources Engineering
|