Exemplo n.º 1
0
int main(int argc, char** argv)
{
    parameter::ParameterGroup param(argc, argv);
    CpGrid grid;
    grid.init(param);
    grid.setUniqueBoundaryIds(true);
    GridInterfaceEuler<CpGrid> gi(grid);
    typedef FlowBC FBC;
    boost::array<FBC, 6> fcond = {{ FBC(FBC::Periodic, 1.0e5),
				    FBC(FBC::Periodic, -1.0e5),
				    FBC(FBC::Periodic, 0.0),
				    FBC(FBC::Periodic, 0.0),
				    FBC(FBC::Neumann, 0.0),
				    FBC(FBC::Neumann, 0.0) }};
    typedef SatBC SBC;
    boost::array<SBC, 6> scond = {{ SBC(SBC::Periodic, 0.0),
				    SBC(SBC::Periodic, 0.0),
				    SBC(SBC::Periodic, 0.0),
				    SBC(SBC::Periodic, 0.0),
				    SBC(SBC::Dirichlet, 0.0),
				    SBC(SBC::Dirichlet, 0.0) }};
    BasicBoundaryConditions<true, true> bcs;
    createPeriodic(bcs, gi, fcond, scond);
    std::cout << bcs;
}
Exemplo n.º 2
0
    inline void setupGridAndProps(const Opm::parameter::ParameterGroup& param,
				  CpGrid& grid,
				  ResProp<3>& res_prop)
    {
	// Initialize grid and reservoir properties.
	// Parts copied from CpGrid::init().
	std::string fileformat = param.getDefault<std::string>("fileformat", "cartesian");
	if (fileformat == "sintef_legacy") {
	    std::string grid_prefix = param.get<std::string>("grid_prefix");
	    grid.readSintefLegacyFormat(grid_prefix);
	    MESSAGE("Warning: We do not yet read legacy reservoir properties. Using defaults.");
	    res_prop.init(grid.size(0));
	} else if (fileformat == "eclipse") {
	    Opm::EclipseGridParser parser(param.get<std::string>("filename"));
	    double z_tolerance = param.getDefault<double>("z_tolerance", 0.0);
	    bool periodic_extension = param.getDefault<bool>("periodic_extension", false);
	    bool turn_normals = param.getDefault<bool>("turn_normals", false);
	    grid.processEclipseFormat(parser, z_tolerance, periodic_extension, turn_normals);
            double perm_threshold_md = param.getDefault("perm_threshold_md", 0.0);
	    double perm_threshold = Opm::unit::convert::from(perm_threshold_md, Opm::prefix::milli*Opm::unit::darcy);
	    std::string rock_list = param.getDefault<std::string>("rock_list", "no_list");
	    std::string* rl_ptr = (rock_list == "no_list") ? 0 : &rock_list;
            bool use_j = param.getDefault("use_jfunction_scaling", useJ<ResProp<3> >());
            double sigma = 1.0;
            double theta = 0.0;
            if (use_j) {
                sigma = param.getDefault("sigma", sigma);
                theta = param.getDefault("theta", theta);
            }
            if (param.has("viscosity1") || param.has("viscosity2")) {
                double v1 = param.getDefault("viscosity1", 0.001);
                double v2 = param.getDefault("viscosity2", 0.003);
                res_prop.setViscosities(v1, v2);
            }
	    res_prop.init(parser, grid.globalCell(), perm_threshold, rl_ptr,
                          use_j, sigma, theta);
	} else if (fileformat == "cartesian") {
	    array<int, 3> dims = {{ param.getDefault<int>("nx", 1),
				    param.getDefault<int>("ny", 1),
				    param.getDefault<int>("nz", 1) }};
	    array<double, 3> cellsz = {{ param.getDefault<double>("dx", 1.0),
					 param.getDefault<double>("dy", 1.0),
					 param.getDefault<double>("dz", 1.0) }};
	    grid.createCartesian(dims, cellsz);
	    double default_poro = param.getDefault("default_poro", 0.2);
	    double default_perm_md = param.getDefault("default_perm_md", 100.0);
	    double default_perm = Opm::unit::convert::from(default_perm_md, Opm::prefix::milli*Opm::unit::darcy);
	    MESSAGE("Warning: For generated cartesian grids, we use uniform reservoir properties.");
	    res_prop.init(grid.size(0), default_poro, default_perm);
	} else {
	    THROW("Unknown file format string: " << fileformat);
	}
	if (param.getDefault("use_unique_boundary_ids", false)) {
	    grid.setUniqueBoundaryIds(true);
	}
    }
Exemplo n.º 3
0
    inline void setupGridAndPropsEclipse(const Opm::EclipseGridParser& parser,
                                         double z_tolerance,
                                         bool periodic_extension,
                                         bool turn_normals,
                                         bool clip_z,
                                         bool unique_bids,
                                         double perm_threshold,
                                         const std::string& rock_list,
                                         bool use_jfunction_scaling,
                                         double sigma,
                                         double theta,
                                         CpGrid& grid,
                                         ResProp<3>& res_prop)
    {
        grid.processEclipseFormat(parser, z_tolerance, periodic_extension, turn_normals, clip_z);
        const std::string* rl_ptr = (rock_list == "no_list") ? 0 : &rock_list;
        res_prop.init(parser, grid.globalCell(), perm_threshold, rl_ptr, use_jfunction_scaling, sigma, theta);
	if (unique_bids) {
	    grid.setUniqueBoundaryIds(true);
	}
    }