Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Applying River Discharge #551

Open
sadaf-mahmoudi96 opened this issue Jun 29, 2023 · 3 comments
Open

Applying River Discharge #551

sadaf-mahmoudi96 opened this issue Jun 29, 2023 · 3 comments

Comments

@sadaf-mahmoudi96
Copy link

Does anyone know how to apply river discharge (time series or single value) at upstream of a domain? I tried to use set_eta_init.f90, however, the results did not change in comparison with the time I applied no river discharge.

@mandli
Copy link
Member

mandli commented Jul 3, 2023

I would ask this on claw-users or at least in GeoClaw raise the issue. As such I am going to close this issue.

@mandli mandli closed this as completed Jul 3, 2023
@rjleveque
Copy link
Member

Sorry for the late reply. It's true that this should eventually be documented in the docs, and it's something I've been meaning to create an example for in GeoClaw first. I'm going to transfer this issue to GeoClaw to remind me to do so soon.

@rjleveque rjleveque transferred this issue from clawpack/doc Jul 3, 2023
@rjleveque rjleveque reopened this Jul 4, 2023
@rjleveque
Copy link
Member

I will try to create a small working example soon, but the basic idea is pretty easy to implement:

Copy the library file

$CLAW/geoclaw/src/shallow/src2.f90

to your application directory and modify the Makefile to use it, by listing it
under

SOURCES = \

See https://www.clawpack.org/makefiles_library.html

Then add to your version of src2.f90 the local variables

real(kind=8) :: x1rs,x2rs,y1rs,y2rs,area,discharge_cfs,discharge,rs

and some code like the following after the declarations (before the other executable code for the friction source term):

x1rs = -123.743d0
x2rs = -123.740d0
y1rs = 46.956d0
y2rs = 46.958d0

area = (x2rs-x1rs)*(y2rs-y1rs)*(111d3)**2 * cos(y1rs*DEG2RAD) ! m**2
discharge_cfs = 20000d0  ! cubic feet / second
discharge = discharge_cfs *(0.3048)**3  ! m**3 / second
rs = discharge/area  ! m/sec needed in source area

do i=1,mx
    x = xlower + (i-0.5d0)*dx
    do j=1,my
        y = ylower + (j-0.5d0)*dy
        if ((x >= x1rs) .and. (x <= x2rs) .and. &
            (y >= y1rs) .and. (y <= y2rs)) then
            q(1,i,j) = q(1,i,j) + dt*rs
          endif
        enddo
    enddo

The rectangle [x1rs,x2rs,y1rs,y2rs] should be roughly in the river upstream from where you are modeling, and discharge_cfs should be set to the discharge rate in cubic feet per second.

What this does is to add a bit of water everywhere in the specified rectangle in every time step, at the rate specified. If you start doing this at time 0 they you may have to let it run for a while in order for the river to reach a steady state, but with luck it will soon reach a state that looks reasonable.

If not, you might have to adjust the discharge, and/or make sure you have good topography data for the river bed far enough upstream from your study area.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants