makding StandardWells a template based on SolutionState and WellState

may need to be adjusted later.
This commit is contained in:
Kai Bao 2016-04-07 15:41:08 +02:00
parent fd99a9e6e9
commit 3bcfc905bd
4 changed files with 52 additions and 16 deletions

View File

@ -26,6 +26,7 @@
# originally generated with the command: # originally generated with the command:
# find opm -name '*.c*' -printf '\t%p\n' | sort # find opm -name '*.c*' -printf '\t%p\n' | sort
list (APPEND MAIN_SOURCE_FILES list (APPEND MAIN_SOURCE_FILES
opm/autodiff/BlackoilPropsAdInterface.cpp opm/autodiff/BlackoilPropsAdInterface.cpp
opm/autodiff/ExtractParallelGridInformationToISTL.cpp opm/autodiff/ExtractParallelGridInformationToISTL.cpp
opm/autodiff/NewtonIterationBlackoilCPR.cpp opm/autodiff/NewtonIterationBlackoilCPR.cpp
@ -47,7 +48,6 @@ list (APPEND MAIN_SOURCE_FILES
opm/autodiff/VFPProdProperties.cpp opm/autodiff/VFPProdProperties.cpp
opm/autodiff/VFPInjProperties.cpp opm/autodiff/VFPInjProperties.cpp
opm/autodiff/WellMultiSegment.cpp opm/autodiff/WellMultiSegment.cpp
opm/autodiff/StandardWells.cpp
opm/autodiff/BlackoilSolventState.cpp opm/autodiff/BlackoilSolventState.cpp
opm/autodiff/ThreadHandle.hpp opm/autodiff/ThreadHandle.hpp
opm/polymer/PolymerState.cpp opm/polymer/PolymerState.cpp
@ -68,6 +68,7 @@ list (APPEND MAIN_SOURCE_FILES
) )
# originally generated with the command: # originally generated with the command:
# find tests -name '*.cpp' -a ! -wholename '*/not-unit/*' -printf '\t%p\n' | sort # find tests -name '*.cpp' -a ! -wholename '*/not-unit/*' -printf '\t%p\n' | sort
list (APPEND TEST_SOURCE_FILES list (APPEND TEST_SOURCE_FILES
@ -130,6 +131,7 @@ list (APPEND PROGRAM_SOURCE_FILES
# originally generated with the command: # originally generated with the command:
# find opm -name '*.h*' -a ! -name '*-pch.hpp' -printf '\t%p\n' | sort # find opm -name '*.h*' -a ! -name '*-pch.hpp' -printf '\t%p\n' | sort
list (APPEND PUBLIC_HEADER_FILES list (APPEND PUBLIC_HEADER_FILES
<<<<<<< HEAD
opm/autodiff/AdditionalObjectDeleter.hpp opm/autodiff/AdditionalObjectDeleter.hpp
opm/autodiff/AutoDiffBlock.hpp opm/autodiff/AutoDiffBlock.hpp
opm/autodiff/AutoDiffHelpers.hpp opm/autodiff/AutoDiffHelpers.hpp
@ -195,6 +197,7 @@ list (APPEND PUBLIC_HEADER_FILES
opm/autodiff/WellStateMultiSegment.hpp opm/autodiff/WellStateMultiSegment.hpp
opm/autodiff/WellMultiSegment.hpp opm/autodiff/WellMultiSegment.hpp
opm/autodiff/StandardWells.hpp opm/autodiff/StandardWells.hpp
opm/autodiff/StandardWells_impl.hpp
opm/polymer/CompressibleTpfaPolymer.hpp opm/polymer/CompressibleTpfaPolymer.hpp
opm/polymer/GravityColumnSolverPolymer.hpp opm/polymer/GravityColumnSolverPolymer.hpp
opm/polymer/GravityColumnSolverPolymer_impl.hpp opm/polymer/GravityColumnSolverPolymer_impl.hpp

View File

@ -276,7 +276,7 @@ namespace Opm {
const BlackoilPropsAdInterface& fluid_; const BlackoilPropsAdInterface& fluid_;
const DerivedGeology& geo_; const DerivedGeology& geo_;
const RockCompressibility* rock_comp_props_; const RockCompressibility* rock_comp_props_;
StandardWells std_wells_; StandardWells<SolutionState, WellState> std_wells_;
VFPProperties vfp_properties_; VFPProperties vfp_properties_;
const NewtonIterationBlackoilInterface& linsolver_; const NewtonIterationBlackoilInterface& linsolver_;
// For each canonical phase -> true if active // For each canonical phase -> true if active
@ -329,8 +329,8 @@ namespace Opm {
} }
/// return the StandardWells object /// return the StandardWells object
StandardWells& stdWells() { return std_wells_; } StandardWells<SolutionState, WellState>& stdWells() { return std_wells_; }
const StandardWells& stdWells() const { return std_wells_; } const StandardWells<SolutionState, WellState>& stdWells() const { return std_wells_; }
/// return the Well struct in the StandardWells /// return the Well struct in the StandardWells
const Wells& wells() const { return std_wells_.wells(); } const Wells& wells() const { return std_wells_.wells(); }

View File

@ -40,6 +40,7 @@ namespace Opm {
typedef ADB::V Vector; typedef ADB::V Vector;
/// Class for handling the standard well model. /// Class for handling the standard well model.
template <class SolutionState, class WellState>
class StandardWells { class StandardWells {
protected: protected:
struct WellOps { struct WellOps {
@ -81,4 +82,7 @@ namespace Opm {
} // namespace Opm } // namespace Opm
#include "StandardWells_impl.hpp"
#endif #endif

View File

@ -27,7 +27,8 @@ namespace Opm
{ {
StandardWells:: template <class SolutionState, class WellState>
StandardWells<SolutionState, WellState>::
WellOps::WellOps(const Wells* wells) WellOps::WellOps(const Wells* wells)
: w2p(), : w2p(),
p2w(), p2w(),
@ -65,7 +66,9 @@ namespace Opm
StandardWells::StandardWells(const Wells* wells_arg) template <class SolutionState, class WellState>
StandardWells<SolutionState, WellState>::
StandardWells(const Wells* wells_arg)
: wells_(wells_arg) : wells_(wells_arg)
, wops_(wells_arg) , wops_(wells_arg)
, well_perforation_densities_(Vector()) , well_perforation_densities_(Vector())
@ -77,7 +80,10 @@ namespace Opm
const Wells& StandardWells::wells() const template <class SolutionState, class WellState>
const Wells&
StandardWells<SolutionState, WellState>::
wells() const
{ {
assert(wells_ != 0); assert(wells_ != 0);
return *(wells_); return *(wells_);
@ -87,7 +93,10 @@ namespace Opm
bool StandardWells::wellsActive() const template <class SolutionState, class WellState>
bool
StandardWells<SolutionState, WellState>::
wellsActive() const
{ {
return wells_active_; return wells_active_;
} }
@ -96,7 +105,10 @@ namespace Opm
void StandardWells::setWellsActive(const bool wells_active) template <class SolutionState, class WellState>
void
StandardWells<SolutionState, WellState>::
setWellsActive(const bool wells_active)
{ {
wells_active_ = wells_active; wells_active_ = wells_active;
} }
@ -105,7 +117,10 @@ namespace Opm
bool StandardWells::localWellsActive() const template <class SolutionState, class WellState>
bool
StandardWells<SolutionState, WellState>::
localWellsActive() const
{ {
return wells_ ? (wells_->number_of_wells > 0 ) : false; return wells_ ? (wells_->number_of_wells > 0 ) : false;
} }
@ -114,8 +129,10 @@ namespace Opm
const StandardWells::WellOps& template <class SolutionState, class WellState>
StandardWells::wellOps() const const typename StandardWells<SolutionState, WellState>::WellOps&
StandardWells<SolutionState, WellState>::
wellOps() const
{ {
return wops_; return wops_;
} }
@ -124,7 +141,10 @@ namespace Opm
Vector& StandardWells::wellPerforationDensities() template <class SolutionState, class WellState>
Vector&
StandardWells<SolutionState, WellState>::
wellPerforationDensities()
{ {
return well_perforation_densities_; return well_perforation_densities_;
} }
@ -133,7 +153,10 @@ namespace Opm
const Vector& StandardWells::wellPerforationDensities() const template <class SolutionState, class WellState>
const Vector&
StandardWells<SolutionState, WellState>::
wellPerforationDensities() const
{ {
return well_perforation_densities_; return well_perforation_densities_;
} }
@ -142,7 +165,10 @@ namespace Opm
Vector& StandardWells::wellPerforationPressureDiffs() template <class SolutionState, class WellState>
Vector&
StandardWells<SolutionState, WellState>::
wellPerforationPressureDiffs()
{ {
return well_perforation_pressure_diffs_; return well_perforation_pressure_diffs_;
} }
@ -151,7 +177,10 @@ namespace Opm
const Vector& StandardWells::wellPerforationPressureDiffs() const template <class SolutionState, class WellState>
const Vector&
StandardWells<SolutionState, WellState>::
wellPerforationPressureDiffs() const
{ {
return well_perforation_pressure_diffs_; return well_perforation_pressure_diffs_;
} }