Loading...
Searching...
No Matches
GenericThresholdPressure.hpp
Go to the documentation of this file.
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
Consult the COPYING file in the top-level source directory of this
module for the precise wording of the license and the list of
copyright holders.
*/
#ifndef OPM_GENERIC_THRESHOLD_PRESSURE_HPP
#define OPM_GENERIC_THRESHOLD_PRESSURE_HPP
#include <opm/grid/common/CartesianIndexMapper.hpp>
#include <opm/grid/LookUpData.hh>
#include <vector>
namespace Opm {
class EclipseState;
template<typename Grid, typename GridView> class LookUpData;
template<typename Grid, typename GridView> class LookUpCartesianData;
template<class Grid, class GridView, class ElementMapper, class Scalar>
class GenericThresholdPressure {
public:
using CartesianIndexMapper = Dune::CartesianIndexMapper<Grid>;
using LookUpData = Opm::LookUpData<Grid,GridView>;
using LookUpCartesianData = Opm::LookUpCartesianData<Grid,GridView>;
GenericThresholdPressure(const CartesianIndexMapper& cartMapper,
const GridView& gridView,
const ElementMapper& elementMapper,
const EclipseState& eclState);
Scalar thresholdPressure(int elem1Idx, int elem2Idx) const;
const std::vector<Scalar>& data() const
{ return thpres_; }
void setFromRestart(const std::vector<double>& values)
{
this->restart_ = true;
thpres_.assign(values.begin(), values.end());
thpresDefault_.assign(values.begin(), values.end());
}
std::vector<Scalar> getRestartVector() const;
bool enableThresholdPressure() const;
protected:
void finishInit();
// internalize the threshold pressures which where explicitly specified via the
// THPRES keyword.
void applyExplicitThresholdPressures_();
void configureThpresft_();
void logPressures();
const CartesianIndexMapper& cartMapper_;
const GridView& gridView_;
const ElementMapper& elementMapper_;
const LookUpData lookUpData_;
const LookUpCartesianData lookUpCartesianData_;
const EclipseState& eclState_;
std::vector<Scalar> thpresDefault_;
std::vector<Scalar> thpres_;
unsigned numEquilRegions_{};
std::vector<unsigned short> elemEquilRegion_;
// threshold pressure accross faults. EXPERIMENTAL!
std::vector<Scalar> thpresftValues_;
std::vector<int> cartElemFaultIdx_;
bool enableThresholdPressure_ {false};
bool restart_ {false};
};
} // namespace Opm
#endif // OPM_GENERIC_THRESHOLD_PRESSURE_HPP
Dune::CartesianIndexMapper
Definition CollectDataOnIORank.hpp:49
Opm::GenericThresholdPressure::setFromRestart
void setFromRestart(const std::vector< double > &values)
Set the threshold pressures from a raw array.
Definition GenericThresholdPressure.hpp:77
Opm::GenericThresholdPressure::finishInit
void finishInit()
Actually compute the threshold pressures over a face as a pre-compute step.
Definition GenericThresholdPressure_impl.hpp:103
Opm::GenericThresholdPressure::thresholdPressure
Scalar thresholdPressure(int elem1Idx, int elem2Idx) const
Returns the theshold pressure [Pa] for the intersection between two elements.
Definition GenericThresholdPressure_impl.hpp:65
Opm::GenericThresholdPressure::getRestartVector
std::vector< Scalar > getRestartVector() const
Returns a fully expanded vector for restart file writing.
Definition GenericThresholdPressure_impl.hpp:234
Opm::GenericThresholdPressure::data
const std::vector< Scalar > & data() const
Return the raw array with the threshold pressures.
Definition GenericThresholdPressure.hpp:69
Opm::LookUpCartesianData
Definition GenericThresholdPressure.hpp:40
Opm::LookUpData
Definition FlowGenericProblem.hpp:51
Opm
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:43