nens / threedigrid

grid administration for 3Di models
Other
9 stars 0 forks source link

Add multiplier to surface sources and sinks endpoint(s) #212

Closed leendertvanwolfswinkel closed 2 months ago

leendertvanwolfswinkel commented 5 months ago

Similar implementation as /v3/simulations/{simulation_pk}/events/rain/rasters/lizard/.

Also allow negative multipliers

Applies to the following endpoints:

daanvaningen commented 4 months ago

Updated estimate because:

leendertvanwolfswinkel commented 2 months ago

@daanvaningen I tested with this simulation: https://api.staging.3di.live/v3/simulations/31093/events/

It uses Lizard raster rain (no multiplier), and uses the same (rain) raster as "evaporation" (surface sources and sinks), with a multiplier of -0.1. So I would expect a negative sss discharge of about 10% of the total rain.

However, the flow summary says:

        "rain_2D": {
            "units": "m3",
            "value": 39432.6652
        },
        [...]
        "volume_due_to_surface_source_and_sink_discharges": {
            "units": "m3",
            "value": 141957589673.1137
        },
daanvaningen commented 2 months ago

Nice find! multiplier field was being overwriten for lizard raster sources sinks additionaly units where always m/s Fixed these and got this as values for the flow summary.

"maximum_volume_error": {
    "units": "m3",
    "value": 14.7647
},
"rain_2D": {
    "units": "m3",
    "value": 473578.9432
},
"storage_2D_in_surface_water_domain_end_of_simulation": {
    "units": "m3",
    "value": 457879.1329
},
"volume_due_to_surface_source_and_sink_discharges": {
    "units": "m3",
    "value": -15714.575
},

The sources sinks value is not 10% of rain but ~3.3%. I am not sure if this explainable or this also needs to be looked into. What do you think?

daanvaningen commented 2 months ago

ran your simulation again: https://api.staging.3di.live/v3/simulations/31171/

        "maximum_volume_error": {
            "units": "m3",
            "value": 1.5122
        },
        "rain_2D": {
            "units": "m3",
            "value": 39461.8313
        },
        "storage_2D_in_surface_water_domain_end_of_simulation": {
            "units": "m3",
            "value": 39168.6248
        },
        "volume_due_to_surface_source_and_sink_discharges": {
            "units": "m3",
            "value": -294.7187
        },

difference is even smaller now..