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

        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  #ft^3/day
            },
            'bottom': {
                'type': 'prescribed flux',
                'value': 0  #ft^3/day
            }
        }

        implicit = TwoDimReservoir(self.inputs)
        implicit.solve()
        np.testing.assert_allclose(implicit.get_solution(),
                                   np.array([1015.9, 1051.5, 1184.8, 1582.9]),
                                   atol=0.5)
        return
コード例 #2
0
    def test_implicit_solve(self):

        implicit = TwoDimReservoir(self.inputs)
        implicit.solve()
        np.testing.assert_allclose(implicit.get_solution(),
                                   np.array([1582.9, 1184.8, 1051.5, 1015.9]),
                                   atol=0.5)
        return
コード例 #3
0
    def test_implicit_heterogeneous_permeability_and_grid_size_solve(self):

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

        implicit = TwoDimReservoir(self.inputs)
        implicit.solve()
        np.testing.assert_allclose(implicit.get_solution(),
                                   np.array([1295.6, 1039.1, 1019.9, 1002.5]),
                                   atol=0.5)
        return
コード例 #4
0
    def test_mixed_method_solve_crank_nicolson(self):

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

        mixed = TwoDimReservoir(self.inputs)

        mixed.solve()

        np.testing.assert_allclose(mixed.get_solution(),
                                   np.array([1642.0, 1196.5, 1043.8, 1009.1]),
                                   atol=0.5)
        return
コード例 #5
0
    def test_explicit_solve(self):

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

        explicit = TwoDimReservoir(self.inputs)

        explicit.solve()

        np.testing.assert_allclose(explicit.get_solution(),
                                   np.array([1689.8, 1222.3, 1032.4, 1000.0]),
                                   atol=0.5)
        return