barbagroup / geoclaw

A fork of GeoClaw (http://www.clawpack.org/geoclaw) for hydrocarbon overland flow
BSD 3-Clause "New" or "Revised" License
3 stars 3 forks source link

Implement point sources #8

Closed piyueh closed 5 years ago

piyueh commented 5 years ago

See the issue #2 for descriptions.

This pull request allows for setting up multiple point sources in setrun.py. The time histories of volumetric rates of the point sources accept piecewise constants.

An example is provided in ${GEOCLAW}/examples/landspill. And new source files are in ${GEOCLAW}/src/2d/shallow/landspill. The following modifications are done directly in GeoClaw original files:

  1. src/2d/shallow/amr2.f90
  2. src/2d/shallow/src2.f90
  3. src/python/geoclaw/data.py

Not sure who's supposed to be the reviewer.

piyueh commented 5 years ago

Update: Add a docker file ($GEOCLAW/docker/Dockerfile-PR8) to create an image for testing. Add a README ($GEOCLAW/docker/README.md) for how to use the image.

piyueh commented 5 years ago

Regarding the naming of example directory, I agree with the suggestion. In fact, I am considering adding more example cases. So I will follow the GeoClaw convention.

piyueh commented 5 years ago

@mandli I modify the code for most of your comments in 61455d9. Also, the utah_dem example has been moved from examples/landspill to examples/landspill/utah_dem in 3a3e8a5. Thanks!

~The remaining issue is the one adding some trivial amount into the domain for point sources.~

Update: In f5f787b, I modify the code to explicitly flag the cells containing point sources to be refined. So now no matter whether we add initial depth or not, the cells are always to be flagged when t=t0. And now the initial depths added to the point sources can be smaller than dry_tolerance. It's now 0.9*dry_tolerance.

mandli commented 5 years ago

So the remaining issues I believe can be better addressed by the following:

  1. Initial time step: You can set the initial time step but also initially taking a time step and finding that it violates the CFL condition will work as well and you will effectively compute the correct times step automatically.
  2. Initial refinement: Instead specifying a region around the point source for an initial time period.
piyueh commented 5 years ago

Thanks, @mandli ! I removed the code that adds initial amounts to point source locations. We will handle that in future development if we encounter the initial time-step problem.

Regarding the initial refinement, I now just flag the cells where point sources are located in to be refined in flag2refine2.f90 if t=t0. I think it works fine now. If there's any potential problem by doing so, please let me know! Thanks!

mandli commented 5 years ago

I think the main issue is that it makes the flag2refine code here diverge from the regular one. If you end up adding other specific flagging criteria this isn't that big of a deal as you would have to do this anyway but if not we may want to do this using a region. We can of course revisit this later on and see what other criteria might be useful.