Skip to content

How to setup river level in anuga #270

@chooron

Description

@chooron

I have prepared the elevation data for the basin and the river polygon. However, when I run this code:

domain.set_quantity('stage', expression='elevation + %f' % 3, polygon=river_polygon)

I encounter the following error:


Traceback (most recent call last):
  File "D:\miniconda3\envs\anuga_env\lib\site-packages\IPython\core\interactiveshell.py", line 3508, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-4-3914e5c91e47>", line 1, in <module>
    domain.set_quantity('stage', expression='elevation + %f' % 3, polygon=river_polygon)
  File "D:\miniconda3\envs\anuga_env\lib\site-packages\anuga\shallow_water\shallow_water_domain.py", line 1058, in set_quantity
    Generic_Domain.set_quantity(self, name, *args, **kwargs)
  File "D:\miniconda3\envs\anuga_env\lib\site-packages\anuga\abstract_2d_finite_volumes\generic_domain.py", line 722, in set_quantity
    self.quantities[name].set_values(*args, **kwargs)
  File "D:\miniconda3\envs\anuga_env\lib\site-packages\anuga\abstract_2d_finite_volumes\quantity.py", line 839, in set_values
    raise Exception(msg)
Exception: With a polygon selected, 'set_quantity' must provide the 'numeric' keyword, and it must be a constant value.

Therefore, I want to know how to initialize the water level of the river using a polygon. When I run the code:

domain.set_quantity('stage', 1900, polygon=river_polygon)

It seems to run without errors, but the river stages are definitely inconsistent."

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions