mirror of
				https://github.com/OPM/opm-simulators.git
				synced 2025-02-25 18:55:30 -06:00 
			
		
		
		
	changed: move three more methods to generic problem class
This commit is contained in:
		@@ -242,6 +242,41 @@ readRockCompactionParameters_()
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template<class GridView, class FluidSystem, class Scalar>
 | 
			
		||||
Scalar EclGenericProblem<GridView,FluidSystem,Scalar>::
 | 
			
		||||
rockCompressibility(unsigned globalSpaceIdx) const
 | 
			
		||||
{
 | 
			
		||||
    if (this->rockParams_.empty())
 | 
			
		||||
        return 0.0;
 | 
			
		||||
 | 
			
		||||
    unsigned tableIdx = 0;
 | 
			
		||||
    if (!this->rockTableIdx_.empty()) {
 | 
			
		||||
        tableIdx = this->rockTableIdx_[globalSpaceIdx];
 | 
			
		||||
    }
 | 
			
		||||
    return this->rockParams_[tableIdx].compressibility;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template<class GridView, class FluidSystem, class Scalar>
 | 
			
		||||
Scalar EclGenericProblem<GridView,FluidSystem,Scalar>::
 | 
			
		||||
rockReferencePressure(unsigned globalSpaceIdx) const
 | 
			
		||||
{
 | 
			
		||||
    if (this->rockParams_.empty())
 | 
			
		||||
        return 1e5;
 | 
			
		||||
 | 
			
		||||
    unsigned tableIdx = 0;
 | 
			
		||||
    if (!this->rockTableIdx_.empty()) {
 | 
			
		||||
        tableIdx = this->rockTableIdx_[globalSpaceIdx];
 | 
			
		||||
    }
 | 
			
		||||
    return this->rockParams_[tableIdx].referencePressure;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template<class GridView, class FluidSystem, class Scalar>
 | 
			
		||||
Scalar EclGenericProblem<GridView,FluidSystem,Scalar>::
 | 
			
		||||
porosity(unsigned globalSpaceIdx, unsigned timeIdx) const
 | 
			
		||||
{
 | 
			
		||||
    return this->referencePorosity_[timeIdx][globalSpaceIdx];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template<class GridView, class FluidSystem, class Scalar>
 | 
			
		||||
template<class T>
 | 
			
		||||
void EclGenericProblem<GridView,FluidSystem,Scalar>::
 | 
			
		||||
 
 | 
			
		||||
@@ -203,6 +203,34 @@ public:
 | 
			
		||||
     */
 | 
			
		||||
    Scalar maxPolymerAdsorption(unsigned elemIdx) const;
 | 
			
		||||
 | 
			
		||||
    /*!
 | 
			
		||||
     * Direct access to rock compressibility.
 | 
			
		||||
     *
 | 
			
		||||
     * While the above overload could be implemented in terms of this method,
 | 
			
		||||
     * that would require always looking up the global space index, which
 | 
			
		||||
     * is not always needed.
 | 
			
		||||
     */
 | 
			
		||||
    Scalar rockCompressibility(unsigned globalSpaceIdx) const;
 | 
			
		||||
 | 
			
		||||
    /*!
 | 
			
		||||
     * Direct access to rock reference pressure.
 | 
			
		||||
     *
 | 
			
		||||
     * While the above overload could be implemented in terms of this method,
 | 
			
		||||
     * that would require always looking up the global space index, which
 | 
			
		||||
     * is not always needed.
 | 
			
		||||
     */
 | 
			
		||||
    Scalar rockReferencePressure(unsigned globalSpaceIdx) const;
 | 
			
		||||
 | 
			
		||||
    /*!
 | 
			
		||||
     * \brief Direct indexed access to the porosity.
 | 
			
		||||
     *
 | 
			
		||||
     * For the EclProblem, this method is identical to referencePorosity(). The intensive
 | 
			
		||||
     * quantities object may apply various multipliers (e.g. ones which model rock
 | 
			
		||||
     * compressibility and water induced rock compaction) to it which depend on the
 | 
			
		||||
     * current physical conditions.
 | 
			
		||||
     */
 | 
			
		||||
    Scalar porosity(unsigned globalSpaceIdx, unsigned timeIdx) const;
 | 
			
		||||
 | 
			
		||||
    /*!
 | 
			
		||||
     * \brief Returns the minimum allowable size of a time step.
 | 
			
		||||
     */
 | 
			
		||||
 
 | 
			
		||||
@@ -675,6 +675,9 @@ public:
 | 
			
		||||
    using EclGenericProblem<GridView,FluidSystem,Scalar>::shouldWriteRestartFile;
 | 
			
		||||
    using EclGenericProblem<GridView,FluidSystem,Scalar>::maxTimeIntegrationFailures;
 | 
			
		||||
    using EclGenericProblem<GridView,FluidSystem,Scalar>::minTimeStepSize;
 | 
			
		||||
    using EclGenericProblem<GridView,FluidSystem,Scalar>::rockCompressibility;
 | 
			
		||||
    using EclGenericProblem<GridView,FluidSystem,Scalar>::rockReferencePressure;
 | 
			
		||||
    using EclGenericProblem<GridView,FluidSystem,Scalar>::porosity;
 | 
			
		||||
 | 
			
		||||
    /*!
 | 
			
		||||
     * \copydoc FvBaseProblem::registerParameters
 | 
			
		||||
@@ -1545,19 +1548,6 @@ public:
 | 
			
		||||
        return this->porosity(globalSpaceIdx, timeIdx);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /*!
 | 
			
		||||
     * \brief Direct indexed access to the porosity.
 | 
			
		||||
     *
 | 
			
		||||
     * For the EclProblem, this method is identical to referencePorosity(). The intensive
 | 
			
		||||
     * quantities object may apply various multipliers (e.g. ones which model rock
 | 
			
		||||
     * compressibility and water induced rock compaction) to it which depend on the
 | 
			
		||||
     * current physical conditions.
 | 
			
		||||
     */
 | 
			
		||||
    Scalar porosity(unsigned globalSpaceIdx, unsigned timeIdx) const
 | 
			
		||||
    {
 | 
			
		||||
        return this->referencePorosity_[timeIdx][globalSpaceIdx];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /*!
 | 
			
		||||
     * \brief Returns the depth of an degree of freedom [m]
 | 
			
		||||
     *
 | 
			
		||||
@@ -1588,35 +1578,8 @@ public:
 | 
			
		||||
    template <class Context>
 | 
			
		||||
    Scalar rockCompressibility(const Context& context, unsigned spaceIdx, unsigned timeIdx) const
 | 
			
		||||
    {
 | 
			
		||||
        if (this->rockParams_.empty())
 | 
			
		||||
            return 0.0;
 | 
			
		||||
 | 
			
		||||
        unsigned tableIdx = 0;
 | 
			
		||||
        if (!this->rockTableIdx_.empty()) {
 | 
			
		||||
            unsigned globalSpaceIdx = context.globalSpaceIndex(spaceIdx, timeIdx);
 | 
			
		||||
            tableIdx = this->rockTableIdx_[globalSpaceIdx];
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return this->rockParams_[tableIdx].compressibility;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /*!
 | 
			
		||||
     * Direct access to rock compressibility.
 | 
			
		||||
     *
 | 
			
		||||
     * While the above overload could be implemented in terms of this method,
 | 
			
		||||
     * that would require always looking up the global space index, which
 | 
			
		||||
     * is not always needed.
 | 
			
		||||
     */
 | 
			
		||||
    Scalar rockCompressibility(unsigned globalSpaceIdx) const
 | 
			
		||||
    {
 | 
			
		||||
        if (this->rockParams_.empty())
 | 
			
		||||
            return 0.0;
 | 
			
		||||
 | 
			
		||||
        unsigned tableIdx = 0;
 | 
			
		||||
        if (!this->rockTableIdx_.empty()) {
 | 
			
		||||
            tableIdx = this->rockTableIdx_[globalSpaceIdx];
 | 
			
		||||
        }
 | 
			
		||||
        return this->rockParams_[tableIdx].compressibility;
 | 
			
		||||
        unsigned globalSpaceIdx = context.globalSpaceIndex(spaceIdx, timeIdx);
 | 
			
		||||
        return this->rockCompressibility(globalSpaceIdx);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /*!
 | 
			
		||||
@@ -1625,35 +1588,8 @@ public:
 | 
			
		||||
    template <class Context>
 | 
			
		||||
    Scalar rockReferencePressure(const Context& context, unsigned spaceIdx, unsigned timeIdx) const
 | 
			
		||||
    {
 | 
			
		||||
        if (this->rockParams_.empty())
 | 
			
		||||
            return 1e5;
 | 
			
		||||
 | 
			
		||||
        unsigned tableIdx = 0;
 | 
			
		||||
        if (!this->rockTableIdx_.empty()) {
 | 
			
		||||
            unsigned globalSpaceIdx = context.globalSpaceIndex(spaceIdx, timeIdx);
 | 
			
		||||
            tableIdx = this->rockTableIdx_[globalSpaceIdx];
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return this->rockParams_[tableIdx].referencePressure;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /*!
 | 
			
		||||
     * Direct access to rock reference pressure.
 | 
			
		||||
     *
 | 
			
		||||
     * While the above overload could be implemented in terms of this method,
 | 
			
		||||
     * that would require always looking up the global space index, which
 | 
			
		||||
     * is not always needed.
 | 
			
		||||
     */
 | 
			
		||||
    Scalar rockReferencePressure(unsigned globalSpaceIdx) const
 | 
			
		||||
    {
 | 
			
		||||
        if (this->rockParams_.empty())
 | 
			
		||||
            return 1e5;
 | 
			
		||||
 | 
			
		||||
        unsigned tableIdx = 0;
 | 
			
		||||
        if (!this->rockTableIdx_.empty()) {
 | 
			
		||||
            tableIdx = this->rockTableIdx_[globalSpaceIdx];
 | 
			
		||||
        }
 | 
			
		||||
        return this->rockParams_[tableIdx].referencePressure;
 | 
			
		||||
        unsigned globalSpaceIdx = context.globalSpaceIndex(spaceIdx, timeIdx);
 | 
			
		||||
        return this->rockReferencePressure(globalSpaceIdx);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /*!
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user