fixing the compilation and running of flow_solvent

This commit is contained in:
Kai Bao
2016-04-18 14:47:48 +02:00
parent b464e4fb4a
commit 5bce482086
4 changed files with 27 additions and 20 deletions

View File

@@ -36,18 +36,18 @@ namespace Opm {
/// It uses automatic differentiation via the class AutoDiffBlock
/// to simplify assembly of the jacobian matrix.
template<class Grid>
class BlackoilSolventModel : public BlackoilModelBase<Grid, BlackoilSolventModel<Grid> >
class BlackoilSolventModel : public BlackoilModelBase<Grid, BlackoilSolventModel<Grid>, StandardWellsSolvent>
{
public:
// --------- Types and enums ---------
typedef BlackoilModelBase<Grid, BlackoilSolventModel<Grid> > Base;
typedef BlackoilModelBase<Grid, BlackoilSolventModel<Grid>, StandardWellsSolvent> Base;
typedef typename Base::ReservoirState ReservoirState;
typedef typename Base::WellState WellState;
// The next line requires C++11 support available in g++ 4.7.
// friend Base;
friend class BlackoilModelBase<Grid, BlackoilSolventModel<Grid> >;
friend class BlackoilModelBase<Grid, BlackoilSolventModel<Grid>, StandardWellsSolvent>;
/// Construct the model. It will retain references to the
/// arguments of this functions, and they are expected to
@@ -104,10 +104,6 @@ namespace Opm {
const bool is_miscible_;
std::vector<ADB> mu_eff_;
std::vector<ADB> b_eff_;
StandardWellsSolvent std_wells_;
const StandardWellsSolvent& stdWells() const { return std_wells_; }
StandardWellsSolvent& stdWells() { return std_wells_; }
// Need to declare Base members we want to use here.
using Base::grid_;
@@ -134,7 +130,7 @@ namespace Opm {
// --------- Protected methods ---------
// Need to declare Base members we want to use here.
// using Base::stdWells;
using Base::stdWells;
using Base::wells;
using Base::variableState;
using Base::computeGasPressure;

View File

@@ -89,8 +89,7 @@ namespace Opm {
has_solvent_(has_solvent),
solvent_pos_(detail::solventPos(fluid.phaseUsage())),
solvent_props_(solvent_props),
is_miscible_(is_miscible),
std_wells_(wells_arg, solvent_props, solvent_pos_)
is_miscible_(is_miscible)
{
if (has_solvent_) {
@@ -105,6 +104,8 @@ namespace Opm {
}
residual_.matbalscale.resize(fluid_.numPhases() + 1, 0.0031); // use the same as gas
stdWells().initilazeSolvent(&solvent_props_, solvent_pos_);
}
if (is_miscible_) {
mu_eff_.resize(fluid_.numPhases() + 1, ADB::null());

View File

@@ -36,7 +36,11 @@ namespace Opm {
using Base = StandardWells;
// --------- Public methods ---------
explicit StandardWellsSolvent(const Wells* wells, const SolventPropsAdFromDeck& solvent_props, const int solvent_pos);
explicit StandardWellsSolvent(const Wells* wells);
// added the Solvent related
// TODO: Should add interface in StandardWells, so this can be put in the constructor
void initilazeSolvent(const SolventPropsAdFromDeck* solvent_props, const int solvent_pos);
template <class SolutionState, class WellState>
void computePropertiesForWellConnectionPressures(const SolutionState& state,
@@ -59,8 +63,8 @@ namespace Opm {
std::vector<ADB>& mob_perfcells,
std::vector<ADB>& b_perfcells) const;
protected:
const SolventPropsAdFromDeck& solvent_props_;
const int solvent_pos_;
const SolventPropsAdFromDeck* solvent_props_;
int solvent_pos_;
};

View File

@@ -32,12 +32,8 @@ namespace Opm
StandardWellsSolvent::StandardWellsSolvent(const Wells* wells_arg,
const SolventPropsAdFromDeck& solvent_props,
const int solvent_pos)
StandardWellsSolvent::StandardWellsSolvent(const Wells* wells_arg)
: Base(wells_arg)
, solvent_props_(solvent_props)
, solvent_pos_(solvent_pos)
{
}
@@ -45,6 +41,16 @@ namespace Opm
void StandardWellsSolvent::initilazeSolvent(const SolventPropsAdFromDeck* solvent_props, const int solvent_pos)
{
solvent_props_ = solvent_props;
solvent_pos_ = solvent_pos;
}
template<class SolutionState, class WellState>
void
StandardWellsSolvent::
@@ -129,7 +135,7 @@ namespace Opm
// to handle solvent related
{
const Vector bs = solvent_props_.bSolvent(avg_press_ad,well_cells).value();
const Vector bs = solvent_props_->bSolvent(avg_press_ad,well_cells).value();
//const V bs_eff = subset(rq_[solvent_pos_].b,well_cells).value();
// number of cells
@@ -161,7 +167,7 @@ namespace Opm
bg = bg * (ones - F_solvent);
bg = bg + F_solvent * bs;
const Vector& rhos = solvent_props_.solventSurfaceDensity(well_cells);
const Vector& rhos = solvent_props_->solventSurfaceDensity(well_cells);
rhog = ( (ones - F_solvent) * rhog ) + (F_solvent * rhos);
}
b.col(pu.phase_pos[BlackoilPhases::Vapour]) = bg;