/**/ #ifndef OPM_FULLYIMPLICITTWOPHASEPOLYMERSOLVER_HEADER_INCLUDED #define OPM_FULLYIMPLICITTWOPHASEPOLYMERSOLVER_HEADER_INCLUDED #include #include #include #include #include #include struct UnstructuredGrid; namespace Opm { class LinearSolverInterface; class PolymerState; class FullyImplicitTwophasePolymerSolver { public: FullyImplicitTwophasePolymerSolver(const UnstructuredGrid& grid, const IncompPropsAdInterface& fluid, const PolymerPropsAd& polymer_props_ad, const LinearSolverInterface& linsolver); void step(const double dt, PolymerState& state, const std::vector& src, const std::vector& polymer_inflow ); // const bool if_polymer_actived); private: typedef AutoDiffBlock ADB; typedef ADB::V V; typedef ADB::M M; typedef Eigen::Array DataBlock; struct SolutionState { SolutionState(const int np); ADB pressure; std::vector saturation; ADB concentration; // ADB cmax; }; const UnstructuredGrid& grid_; const IncompPropsAdInterface& fluid_; const PolymerPropsAd& polymer_props_ad_; const LinearSolverInterface& linsolver_; const std::vector cells_; HelperOps ops_; std::vector residual_; SolutionState constantState(const PolymerState& x); SolutionState variableState(const PolymerState& x); void assemble(const V& pvdt, const SolutionState& old_state, const PolymerState& x, const std::vector& src, const std::vector& polymer_inflow); // const bool if_polymer_actived); V solveJacobianSystem() const; void updateState(const V& dx, PolymerState& x) const; std::vector computeRelPerm(const SolutionState& state) const; V transmissibility() const; ADB computeFracFlow(int phase, const std::vector& kr) const; ADB accumSource(const int phase, const std::vector& kr, const std::vector& src) const; ADB computeMassFlux(const int phase, const V& trans, const std::vector& kr, const SolutionState& state) const; double residualNorm() const; ADB computeMc(const SolutionState& state) const; ADB rockPorosity(const ADB& p) const; ADB rockPermeability(const ADB& p) const; const double fluidDensity(const int phase) const; ADB transMult(const ADB& p) const; double PolymerInjectedAmount(const std::vector& polymer_inflow) const; }; } // namespace Opm #endif// OPM_FULLYIMPLICITTWOPHASESOLVER_HEADER_INCLUDED