コード例 #1
0
    def test_two_dim_solve_one_step(self):

        self.inputs['numerical']['number of grids'] = {'x': 3, 'y': 3}
        self.inputs['reservoir']['height'] = 10000.
        self.inputs['reservoir']['depth'] = 20.
        self.inputs['boundary conditions'] = {
            'right': {
                'type': 'prescribed pressure',
                'value': 2000  #psi
            },
            'left': {
                'type': 'prescribed flux',
                'value': 0  #ft^3/day
            },
            'top': {
                'type': 'prescribed flux',
                'value': 0  #psi
            },
            'bottom': {
                'type': 'prescribed flux',
                'value': 0  #ft^3/day
            }
        }

        implicit = TwoDimReservoir(self.inputs)
        implicit.solve_one_step()
        np.testing.assert_allclose(implicit.get_solution(),
                                   np.array([
                                       1002.8, 1022.6, 1201.8, 1002.8, 1022.6,
                                       1201.8, 1002.8, 1022.6, 1201.8
                                   ]),
                                   atol=0.5)
        return
コード例 #2
0
    def test_implicit_solve_one_step(self):

        implicit = TwoDimReservoir(self.inputs)
        implicit.solve_one_step()
        np.testing.assert_allclose(
            implicit.get_solution(),
            np.array([1295.1463, 1051.1036, 1008.8921, 1001.7998]),
            atol=0.5)
        return
コード例 #3
0
    def test_implicit_heterogeneous_permeability_solve_one_step(self):

        self.inputs['reservoir']['permeability'] = [10., 100., 50., 20]

        implicit = TwoDimReservoir(self.inputs)
        implicit.solve_one_step()
        np.testing.assert_allclose(implicit.get_solution(),
                                   np.array([1085.3, 1005.8, 1001.3, 1000.1]),
                                   atol=0.5)
        return
コード例 #4
0
    def test_implicit_heterogeneous_permeability_and_grid_size_solve_one_step(
            self):

        self.inputs['reservoir']['permeability'] = [10., 100., 50., 20]
        self.inputs['numerical']['delta x'] = [2000., 3000., 1500., 3500]

        implicit = TwoDimReservoir(self.inputs)
        implicit.solve_one_step()
        np.testing.assert_allclose(implicit.get_solution(),
                                   np.array([1123.0, 1008.5, 1003.1, 1000.2]),
                                   atol=0.5)
        return
コード例 #5
0
    def test_mixed_method_solve_one_step_crank_nicolson(self):

        self.inputs['numerical']['solver'] = {'mixed method': {'theta': 0.5}}

        mixed = TwoDimReservoir(self.inputs)

        mixed.solve_one_step()

        np.testing.assert_allclose(mixed.get_solution(),
                                   np.array([1370.4, 1037.8, 1003.8, 1000.4]),
                                   atol=0.5)
        return
コード例 #6
0
    def test_mixed_method_solve_one_step_explicit(self):

        self.inputs['numerical']['solver'] = {'mixed method': {'theta': 1.0}}

        mixed_explicit = TwoDimReservoir(self.inputs)

        mixed_explicit.solve_one_step()

        np.testing.assert_allclose(mixed_explicit.get_solution(),
                                   np.array([1506., 1000., 1000., 1000.004]),
                                   atol=0.5)
        return
コード例 #7
0
    def test_explicit_solve_one_step(self):

        self.inputs['numerical']['solver'] = 'explicit'

        explicit = TwoDimReservoir(self.inputs)

        explicit.solve_one_step()

        np.testing.assert_allclose(explicit.get_solution(),
                                   np.array([1506., 1000., 1000., 1000.004]),
                                   atol=0.5)
        return
コード例 #8
0
    def test_mixed_method_solve_one_step_implicit(self):

        self.inputs['numerical']['solver'] = {'mixed method': {'theta': 0.0}}

        mixed_implicit = TwoDimReservoir(self.inputs)

        mixed_implicit.solve_one_step()

        np.testing.assert_allclose(
            mixed_implicit.get_solution(),
            np.array([1295.1463, 1051.1036, 1008.8921, 1001.7998]),
            atol=0.5)
        return