Fix minor comments in PR#425

This commit is contained in:
Tor Harald Sandve 2015-08-14 11:58:12 +02:00
parent 3b99338bd0
commit cca5410ebb
7 changed files with 27 additions and 61 deletions

View File

@ -230,18 +230,12 @@ try
std::vector<double> porv = eclipseState->getDoubleGridProperty("PORV")->getData();
#if USE_DUNE_CORNERPOINTGRID
// Dune::CpGrid as grid manager
typedef Dune::CpGrid Grid;
// Grid init
Grid grid;
grid.processEclipseFormat(deck, false, false, false, porv);
#else
// UnstructuredGrid as grid manager
typedef UnstructuredGrid Grid;
GridManager gridManager( eclipseState->getEclipseGrid(), porv );
const Grid& grid = *(gridManager.c_grid());
#endif
// Possibly override IOConfig setting (from deck) for how often RESTART files should get written to disk (every N report step)
if (param.has("output_interval")) {

View File

@ -77,22 +77,6 @@ namespace Opm {
const bool terminal_output,
const bool has_solvent);
/// Called once before each time step.
/// \param[in] dt time step size
/// \param[in, out] reservoir_state reservoir state variables
/// \param[in, out] well_state well state variables
void prepareStep(const double dt,
ReservoirState& reservoir_state,
WellState& well_state);
/// Called once after each time step.
/// \param[in] dt time step size
/// \param[in, out] reservoir_state reservoir state variables
/// \param[in, out] well_state well state variables
void afterStep(const double dt,
ReservoirState& reservoir_state,
WellState& well_state);
/// Apply an update to the primary variables, chopped if appropriate.
/// \param[in] dx updates to apply to primary variables
/// \param[in, out] reservoir_state reservoir state variables
@ -127,7 +111,7 @@ namespace Opm {
// --------- Data members ---------
const bool has_solvent_;
const int solvent_pos_;
const SolventPropsAdFromDeck solvent_props_;
const SolventPropsAdFromDeck& solvent_props_;
// Need to declare Base members we want to use here.
using Base::grid_;
@ -207,7 +191,7 @@ namespace Opm {
assembleMassBalanceEq(const SolutionState& state);
void
addWellContributionToMassBalanceEq(std::vector<ADB>& cq_s,
addWellContributionToMassBalanceEq(const std::vector<ADB>& cq_s,
const SolutionState& state,
WellState& xw);

View File

@ -103,32 +103,6 @@ namespace Opm {
template <class Grid>
void
BlackoilSolventModel<Grid>::
prepareStep(const double dt,
ReservoirState& reservoir_state,
WellState& well_state)
{
Base::prepareStep(dt, reservoir_state, well_state);
}
template <class Grid>
void
BlackoilSolventModel<Grid>::
afterStep(const double /* dt */,
ReservoirState& /* reservoir_state */,
WellState& /* well_state */)
{
}
template <class Grid>
@ -255,7 +229,7 @@ namespace Opm {
template <class Grid>
void BlackoilSolventModel<Grid>::addWellContributionToMassBalanceEq(std::vector<ADB>& cq_s,
void BlackoilSolventModel<Grid>::addWellContributionToMassBalanceEq(const std::vector<ADB>& cq_s,
const SolutionState& state,
WellState& xw)
@ -338,9 +312,17 @@ namespace Opm {
// adjust oil saturation
const Opm::PhaseUsage& pu = fluid_.phaseUsage();
const int pos = pu.phase_pos[ Oil ];
const int oilpos = pu.phase_pos[ Oil ];
for (int c = 0; c < nc; ++c) {
reservoir_state.saturation()[c*np + pos] = 1 - ss[c] - reservoir_state.saturation()[c*np + 0] - reservoir_state.saturation()[c*np + 2] ;
reservoir_state.saturation()[c*np + oilpos] = 1 - ss[c];
if (pu.phase_used[ Gas ]) {
const int gaspos = pu.phase_pos[ Gas ];
reservoir_state.saturation()[c*np + oilpos] -= reservoir_state.saturation()[c*np + gaspos];
}
if (pu.phase_used[ Water ]) {
const int waterpos = pu.phase_pos[ Water ];
reservoir_state.saturation()[c*np + oilpos] -= reservoir_state.saturation()[c*np + waterpos];
}
}
} else {
@ -481,6 +463,7 @@ namespace Opm {
}
if (has_solvent_) {
int gas_pos = fluid_.phaseUsage().phase_pos[Gas];
mob_perfcells[gas_pos] += subset(rq_[solvent_pos_].mob, well_cells);
}
@ -660,9 +643,11 @@ namespace Opm {
if (std::isnan(mass_balance_residual[Water]) || mass_balance_residual[Water] > maxResidualAllowed() ||
std::isnan(mass_balance_residual[Oil]) || mass_balance_residual[Oil] > maxResidualAllowed() ||
std::isnan(mass_balance_residual[Gas]) || mass_balance_residual[Gas] > maxResidualAllowed() ||
std::isnan(mass_balance_residual[Gas]) || mass_balance_residual[Solvent] > maxResidualAllowed() ||
std::isnan(CNV[Water]) || CNV[Water] > maxResidualAllowed() ||
std::isnan(CNV[Oil]) || CNV[Oil] > maxResidualAllowed() ||
std::isnan(CNV[Gas]) || CNV[Gas] > maxResidualAllowed() ||
std::isnan(CNV[Solvent]) || CNV[Solvent] > maxResidualAllowed() ||
std::isnan(well_flux_residual[Water]) || well_flux_residual[Water] > maxResidualAllowed() ||
std::isnan(well_flux_residual[Oil]) || well_flux_residual[Oil] > maxResidualAllowed() ||
std::isnan(well_flux_residual[Gas]) || well_flux_residual[Gas] > maxResidualAllowed() ||
@ -683,11 +668,11 @@ namespace Opm {
<< std::setw(11) << mass_balance_residual[Water]
<< std::setw(11) << mass_balance_residual[Oil]
<< std::setw(11) << mass_balance_residual[Gas]
<< std::setw(11) << mass_balance_residual[solvent_pos_]
<< std::setw(11) << mass_balance_residual[Solvent]
<< std::setw(11) << CNV[Water]
<< std::setw(11) << CNV[Oil]
<< std::setw(11) << CNV[Gas]
<< std::setw(11) << CNV[solvent_pos_]
<< std::setw(11) << CNV[Solvent]
<< std::setw(11) << well_flux_residual[Water]
<< std::setw(11) << well_flux_residual[Oil]
<< std::setw(11) << well_flux_residual[Gas]

View File

@ -20,7 +20,6 @@
#ifndef OPM_BLACKOILSOLVENTSTATE_HEADER_INCLUDED
#define OPM_BLACKOILSOLVENTSTATE_HEADER_INCLUDED
#include <opm/autodiff/BlackoilSolventState.hpp>
#include <opm/core/simulator/BlackoilState.hpp>
#include <opm/core/grid.h>
#include <vector>

View File

@ -18,7 +18,7 @@
*/
#include <config.h>
#include "SolventPropsAdFromDeck.hpp"
#include <opm/autodiff/SolventPropsAdFromDeck.hpp>
#include <opm/autodiff/AutoDiffHelpers.hpp>

View File

@ -66,19 +66,22 @@ public:
const Cells& cells) const;
/// Gas relPerm multipliers
/// \param[in] solventFraction Array of n gas pressure values.
/// \param[in] solventFraction Array of n solvent fraction values.
/// \param[in] cells Array of n cell indices to be associated with the fraction values.
/// \return Array of n gas relPerm multiplier values.
ADB gasRelPermMultiplier(const ADB& solventFraction,
const Cells& cells) const;
/// Solvent relPerm multipliers
/// \param[in] solventFraction Array of n gas pressure values.
/// \param[in] solventFraction Array of n solvent fraction values.
/// \param[in] cells Array of n cell indices to be associated with the fraction values.
/// \return Array of n solvent relPerm multiplier values.
ADB solventRelPermMultiplier(const ADB& solventFraction,
const Cells& cells) const;
/// Solvent surface density
/// \param[in] cells Array of n cell indices to be associated with the fraction values.
/// \return Array of n solvent density values.
V solventSurfaceDensity(const Cells& cells) const;
private:

View File

@ -30,6 +30,7 @@ namespace Opm
typedef WellStateFullyImplicitBlackoil BaseType;
public:
/// One solvent fraction per well connection
std::vector<double>& solventFraction() { return solvent_fraction_; }
const std::vector<double>& solventFraction() const { return solvent_fraction_; }
private: