Merge pull request #358 from rania-pa/devel

Update add_surface_water.py and add_grass.py
这个提交包含在:
Craig Warren
2023-07-26 13:55:53 +01:00
提交者 GitHub
当前提交 038f21ce2c
共有 2 个文件被更改,包括 4 次插入4 次删除

查看文件

@@ -111,7 +111,7 @@ class AddGrass(UserObjectGeometry):
if ys == yf or zs == zf:
logger.exception(f"{self.__str__()} dimensions are not specified correctly")
raise ValueError
if xs not in [volume.xs and volume.xf]:
if xs not in [volume.xs, volume.xf]:
logger.exception(f"{self.__str__()} must specify external surfaces on a fractal box")
raise ValueError
fractalrange = (round_value(limits[0] / grid.dx), round_value(limits[1] / grid.dx))
@@ -136,7 +136,7 @@ class AddGrass(UserObjectGeometry):
if zs == zf:
logger.exception(f"{self.__str__()} dimensions are not specified correctly")
raise ValueError
if ys not in [volume.ys and volume.yf]:
if ys not in [volume.ys, volume.yf]:
logger.exception(f"{self.__str__()} must specify external surfaces on a fractal box")
raise ValueError
fractalrange = (round_value(limits[0] / grid.dy), round_value(limits[1] / grid.dy))
@@ -158,7 +158,7 @@ class AddGrass(UserObjectGeometry):
requestedsurface = "yplus"
elif zs == zf:
if zs not in [volume.zs and volume.zf]:
if zs not in [volume.zs, volume.zf]:
logger.exception(f"{self.__str__()} must specify external surfaces on a fractal box")
raise ValueError
fractalrange = (round_value(limits[0] / grid.dz), round_value(limits[1] / grid.dz))

查看文件

@@ -156,7 +156,7 @@ class AddSurfaceWater(UserObjectGeometry):
raise ValueError
# Check to see if water has been already defined as a material
if not any(x.ID != "water" for x in grid.materials):
if not any(x.ID == "water" for x in grid.materials):
create_water(grid)
# Check if time step for model is suitable for using water