Merge pull request #920 from andlaus/frankenstein_merge_master_v11

Frankenstein merge master v11
This commit is contained in:
Andreas Lauser
2016-11-15 12:31:37 +01:00
committed by GitHub
4 changed files with 15 additions and 7 deletions

View File

@@ -149,10 +149,7 @@ if (HAVE_OPM_DATA)
endif()
# create a symbolic link from flow to flow_legacy
message("create symlink")
ADD_CUSTOM_TARGET(flow ALL
COMMAND ${CMAKE_COMMAND} -E create_symlink "flow_legacy" "${CMAKE_BINARY_DIR}/bin/flow")
install(
FILES "${CMAKE_BINARY_DIR}/bin/flow"
DESTINATION "${CMAKE_INSTALL_PREFIX}/bin"
)
COMMAND ${CMAKE_COMMAND} -E create_symlink "flow_legacy" "${CMAKE_BINARY_DIR}/bin/flow")

View File

@@ -1645,6 +1645,7 @@ typedef Eigen::Array<double,
const double tol_mb = param_.tolerance_mb_;
const double tol_cnv = param_.tolerance_cnv_;
const double tol_wells = param_.tolerance_wells_;
const double tol_well_control = param_.tolerance_well_control_;
const int nc = Opm::AutoDiffGrid::numCells(grid_);
const int np = asImpl().numPhases();
@@ -1698,7 +1699,7 @@ typedef Eigen::Array<double,
const double residualWell = detail::infinityNormWell(residual_.well_eq,
linsolver_.parallelInformation());
converged_Well = converged_Well && (residualWell < Opm::unit::barsa);
converged_Well = converged_Well && (residualWell < tol_well_control);
const bool converged = converged_MB && converged_CNV && converged_Well;
// Residual in Pascal can have high values and still be ok.
@@ -1718,6 +1719,7 @@ typedef Eigen::Array<double,
for (int idx = 0; idx < np; ++idx) {
msg += " W-FLUX(" + materialName(idx).substr(0, 1) + ")";
}
msg += " WELL-CONT";
// std::cout << " WELL-CONT ";
OpmLog::note(msg);
}
@@ -1734,6 +1736,7 @@ typedef Eigen::Array<double,
for (int idx = 0; idx < np; ++idx) {
ss << std::setw(11) << well_flux_residual[idx];
}
ss << std::setw(11) << residualWell;
// std::cout << std::setw(11) << residualWell;
ss.precision(oprec);
ss.flags(oflags);
@@ -1781,6 +1784,7 @@ typedef Eigen::Array<double,
getWellConvergence(const int iteration)
{
const double tol_wells = param_.tolerance_wells_;
const double tol_well_control = param_.tolerance_well_control_;
const int nc = Opm::AutoDiffGrid::numCells(grid_);
const int np = asImpl().numPhases();
@@ -1815,7 +1819,7 @@ typedef Eigen::Array<double,
const double residualWell = detail::infinityNormWell(residual_.well_eq,
linsolver_.parallelInformation());
converged_Well = converged_Well && (residualWell < Opm::unit::barsa);
converged_Well = converged_Well && (residualWell < tol_well_control);
const bool converged = converged_Well;
// if one of the residuals is NaN, throw exception, so that the solver can be restarted
@@ -1845,6 +1849,7 @@ typedef Eigen::Array<double,
for (int idx = 0; idx < np; ++idx) {
msg += " W-FLUX(" + materialName(idx).substr(0, 1) + ")";
}
msg += " WELL-CONT";
OpmLog::note(msg);
}
std::ostringstream ss;
@@ -1854,6 +1859,7 @@ typedef Eigen::Array<double,
for (int idx = 0; idx < np; ++idx) {
ss << std::setw(11) << well_flux_residual[idx];
}
ss << std::setw(11) << residualWell;
ss.precision(oprec);
ss.flags(oflags);
OpmLog::note(ss.str());

View File

@@ -46,6 +46,7 @@ namespace Opm
tolerance_mb_ = param.getDefault("tolerance_mb", tolerance_mb_);
tolerance_cnv_ = param.getDefault("tolerance_cnv", tolerance_cnv_);
tolerance_wells_ = param.getDefault("tolerance_wells", tolerance_wells_ );
tolerance_well_control_ = param.getDefault("tolerance_well_control", tolerance_well_control_);
solve_welleq_initially_ = param.getDefault("solve_welleq_initially",solve_welleq_initially_);
update_equations_scaling_ = param.getDefault("update_equations_scaling", update_equations_scaling_);
compute_well_potentials_ = param.getDefault("compute_well_potentials", compute_well_potentials_);
@@ -66,6 +67,7 @@ namespace Opm
tolerance_mb_ = 1.0e-5;
tolerance_cnv_ = 1.0e-2;
tolerance_wells_ = 1.0e-3;
tolerance_well_control_ = 1.0e-7;
solve_welleq_initially_ = true;
update_equations_scaling_ = false;
compute_well_potentials_ = false;

View File

@@ -44,6 +44,9 @@ namespace Opm
double tolerance_cnv_;
/// Well convergence tolerance.
double tolerance_wells_;
/// Tolerance for the well control equations
// TODO: it might need to distinguish between rate control and pressure control later
double tolerance_well_control_;
/// Solve well equation initially
bool solve_welleq_initially_;