openearth / glofrim

Globally Applicable Framework for Integrated Hydrological-Hydrodynamic Modelling (GLOFRIM)
GNU General Public License v3.0
46 stars 27 forks source link

add functions to get total input/output volumes and delta storage per model #97

Open DirkEilander opened 5 years ago

DirkEilander commented 5 years ago

The total input/output volume functions are implemented for PCR and CMF yielding good results, see reference to old post below. We should try to extent this to other models and add a "delta storage" or "storage state" function.


we should should try to implement a "_get_tot_volume_out" and "_get_tot_volume_in" function for each mode (so far PCR and CMF). For instance for CMF the functions are given below. We could implement similar function to get the change in storage. But, if we assume the change in storage is neglectable over long periods we can get the approximate mass balance per model. To get the volume of water leaving the CMF outside the LFP/DFM domain we simply can substract the volume exchanged from the CMF model from the total outlfow.

def _get_tot_volume_in(self):
    # runoff in [m3/s]
    Rin = np.nansum(self.get_value('runoff')) * self._dt.total_seconds()
    return Rin

def _get_tot_volume_out(self):
    # get outlfow at pits
    Qout = np.nansum(self.get_value_at_indices('outflw', self.grid.pits)) * self._dt.total_seconds()
    return Qout

I'm doing some test runs and will update later ...

Originally posted by @DirkEilander in https://github.com/openearth/glofrim/issues/92#issuecomment-456053979