Exemplo n.º 1
0
    def _init_model(self, solver):

        if solver == 'numba':
            solver = PegasusNumba()
            num_app = ImplicitEulerNumba(root_finder=solver)
        elif solver == 'python':
            solver = PegasusPython()
            num_app = ImplicitEulerPython(root_finder=solver)

        fr = PowerReservoir(parameters = {'k' : 0.01,
                                         'alpha' : 2.5},
                           states = {'S0' : 0.0},
                           approximation=num_app,
                           id = 'FR')

        ur = UnsaturatedReservoir(parameters = {'Smax' : 50.0,
                                                'Ce' : 1.5,
                                                'm' : 0.01,
                                                'beta' : 1.5,
                                                },
                                  states = {'S0' : 0.2*50.0, 'PET' : None},
                                  approximation=num_app,
                                  id = 'UR')

        hru = Unit(layers = [
            [ur],
            [fr]
        ],
                  id = 'H1')

        hru.set_timestep(1.0)
        self._model = hru
Exemplo n.º 2
0
    def _init_model(self, solver):

        if solver == 'numba':
            solver = PegasusNumba()
            num_app = ImplicitEulerNumba(root_finder=solver)
        elif solver == 'python':
            solver = PegasusPython()
            num_app = ImplicitEulerPython(root_finder=solver)

        fr = PowerReservoir(parameters={
            'k': 0.01,
            'alpha': 2.5
        },
                            states={'S0': 0.0},
                            approximation=num_app,
                            id='FR')

        fr.set_timestep(2.0)
        self._model = fr
Exemplo n.º 3
0
    def _init_model(self, solver):

        if solver == 'numba':
            solver = PegasusNumba()
            num_app = ImplicitEulerNumba(root_finder=solver)
        elif solver == 'python':
            solver = PegasusPython()
            num_app = ImplicitEulerPython(root_finder=solver)

        ur = UnsaturatedReservoir(parameters={
            'Smax': 50.0,
            'Ce': 1.5,
            'm': 0.01,
            'beta': 1.5
        },
                                  states={'S0': 0.2 * 50.0},
                                  approximation=num_app,
                                  id='UR')

        ur.set_timestep(2.0)
        self._model = ur
Exemplo n.º 4
0
    def _init_model(self, solver):

        if solver == 'numba':
            solver = PegasusNumba()
            num_app = ImplicitEulerNumba(root_finder=solver)
        elif solver == 'python':
            solver = PegasusPython()
            num_app = ImplicitEulerPython(root_finder=solver)

        # Define HRU 1 (40%)
        fr = PowerReservoir(parameters={
            'k': 0.01,
            'alpha': 2.5
        },
                            states={'S0': 0.0},
                            approximation=num_app,
                            id='FR')

        h1 = Unit(layers=[[fr]], id='H1')

        # Define HRU 2 (60%)
        fr = PowerReservoir(parameters={
            'k': 0.01,
            'alpha': 2.5
        },
                            states={'S0': 0.0},
                            approximation=num_app,
                            id='FR')

        sr = PowerReservoir(parameters={
            'k': 1e-4,
            'alpha': 1.0
        },
                            states={'S0': 0.0},
                            approximation=num_app,
                            id='SR')

        ur = UnsaturatedReservoir(parameters={
            'Smax': 50.0,
            'Ce': 1.5,
            'm': 0.01,
            'beta': 1.5,
        },
                                  states={
                                      'S0': 0.2 * 50.0,
                                      'PET': None
                                  },
                                  approximation=num_app,
                                  id='UR')

        s = Splitter(weight=[[0.3], [0.7]], direction=[[0], [0]], id='S')

        j = Junction(direction=[[0, 0]], id='J')

        h2 = Unit(layers=[[ur], [s], [fr, sr], [j]], id='H2')

        # Define the catchment
        cat = Node(units=[h1, h2], weights=[0.4, 0.6], area=1.0, id='Cat')

        cat.set_timestep(1.0)
        self._model = cat