mirror of
				https://github.com/OPM/opm-simulators.git
				synced 2025-02-25 18:55:30 -06:00 
			
		
		
		
	Restore threshold pressures from restart
This commit is contained in:
		| @@ -85,7 +85,7 @@ public: | ||||
|     void finishInit() | ||||
|     { | ||||
|         this->BaseType::finishInit(); | ||||
|         if (this->enableThresholdPressure_ && !this->thpresDefault_.empty()) { | ||||
|         if (this->enableThresholdPressure_ && !this->thpresDefault_.empty() && !this->restart_) { | ||||
|             this->computeDefaultThresholdPressures_(); | ||||
|             this->applyExplicitThresholdPressures_(); | ||||
|         } | ||||
|   | ||||
| @@ -75,7 +75,11 @@ public: | ||||
|      * This is used for the restart capability. | ||||
|      */ | ||||
|     void setFromRestart(const std::vector<double>& values) | ||||
|     { thpres_.assign(values.begin(), values.end()); } | ||||
|     { | ||||
|         this->restart_ = true; | ||||
|         thpres_.assign(values.begin(), values.end()); | ||||
|         thpresDefault_.assign(values.begin(), values.end()); | ||||
|     } | ||||
|  | ||||
|     //! \brief Returns a fully expanded vector for restart file writing. | ||||
|     //! \details Returns the union of explicitly configured entries and defaulted values. | ||||
| @@ -113,6 +117,7 @@ protected: | ||||
|     std::vector<int> cartElemFaultIdx_; | ||||
|  | ||||
|     bool enableThresholdPressure_ {false}; | ||||
|     bool restart_ {false}; | ||||
| }; | ||||
|  | ||||
| } // namespace Opm | ||||
|   | ||||
| @@ -134,8 +134,8 @@ finishInit() | ||||
|  | ||||
|     /* | ||||
|       If this is a restart run the ThresholdPressure object will be active, | ||||
|       but it will *not* be properly initialized with numerical values. The | ||||
|       values must instead come from the THPRES vector in the restart file. | ||||
|       and already properly initialized with numerical values from the restart. | ||||
|       Done using GenericThresholdPressure::setFromRestart() in EclWriter::beginRestart(). | ||||
|     */ | ||||
|     if (simConfig.getThresholdPressure().restart()) | ||||
|         return; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user