mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
AquiferConstantFlux: use Scalar type
This commit is contained in:
parent
f9f568d5ea
commit
687695882c
@ -43,9 +43,10 @@ public:
|
|||||||
using ElementMapper = GetPropType<TypeTag, Properties::ElementMapper>;
|
using ElementMapper = GetPropType<TypeTag, Properties::ElementMapper>;
|
||||||
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
|
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
|
||||||
using BlackoilIndices = GetPropType<TypeTag, Properties::Indices>;
|
using BlackoilIndices = GetPropType<TypeTag, Properties::Indices>;
|
||||||
|
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
|
||||||
|
|
||||||
static constexpr int numEq = BlackoilIndices::numEq;
|
static constexpr int numEq = BlackoilIndices::numEq;
|
||||||
using Eval = DenseAd::Evaluation<double, /*size=*/numEq>;
|
using Eval = DenseAd::Evaluation<Scalar, /*size=*/numEq>;
|
||||||
|
|
||||||
AquiferConstantFlux(const std::vector<Aquancon::AquancCell>& connections,
|
AquiferConstantFlux(const std::vector<Aquancon::AquancCell>& connections,
|
||||||
const Simulator& simulator,
|
const Simulator& simulator,
|
||||||
@ -68,15 +69,15 @@ public:
|
|||||||
|
|
||||||
virtual ~AquiferConstantFlux() = default;
|
virtual ~AquiferConstantFlux() = default;
|
||||||
|
|
||||||
void computeFaceAreaFraction(const std::vector<double>& total_face_area) override
|
void computeFaceAreaFraction(const std::vector<Scalar>& total_face_area) override
|
||||||
{
|
{
|
||||||
assert (total_face_area.size() >= static_cast<std::vector<double>::size_type>(this->aquiferID()));
|
assert (total_face_area.size() >= static_cast<typename std::vector<Scalar>::size_type>(this->aquiferID()));
|
||||||
|
|
||||||
this->area_fraction_ = this->totalFaceArea()
|
this->area_fraction_ = this->totalFaceArea()
|
||||||
/ total_face_area[this->aquiferID() - 1];
|
/ total_face_area[this->aquiferID() - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
double totalFaceArea() const override
|
Scalar totalFaceArea() const override
|
||||||
{
|
{
|
||||||
return this->total_face_area_;
|
return this->total_face_area_;
|
||||||
}
|
}
|
||||||
@ -163,12 +164,12 @@ private:
|
|||||||
SingleAquiferFlux aquifer_data_;
|
SingleAquiferFlux aquifer_data_;
|
||||||
std::vector<Eval> connection_flux_{};
|
std::vector<Eval> connection_flux_{};
|
||||||
std::vector<int> cellToConnectionIdx_{};
|
std::vector<int> cellToConnectionIdx_{};
|
||||||
double flux_rate_{};
|
Scalar flux_rate_{};
|
||||||
double cumulative_flux_{};
|
Scalar cumulative_flux_{};
|
||||||
double total_face_area_{0.0};
|
Scalar total_face_area_{0.0};
|
||||||
double area_fraction_{1.0};
|
Scalar area_fraction_{1.0};
|
||||||
|
|
||||||
double initializeConnections()
|
Scalar initializeConnections()
|
||||||
{
|
{
|
||||||
auto connected_face_area = 0.0;
|
auto connected_face_area = 0.0;
|
||||||
|
|
||||||
@ -196,7 +197,7 @@ private:
|
|||||||
return connected_face_area;
|
return connected_face_area;
|
||||||
}
|
}
|
||||||
|
|
||||||
double computeFaceAreaFraction(const double connected_face_area) const
|
Scalar computeFaceAreaFraction(const Scalar connected_face_area) const
|
||||||
{
|
{
|
||||||
const auto tot_face_area = this->simulator_.vanguard()
|
const auto tot_face_area = this->simulator_.vanguard()
|
||||||
.grid().comm().sum(connected_face_area);
|
.grid().comm().sum(connected_face_area);
|
||||||
@ -215,11 +216,11 @@ private:
|
|||||||
return FluidSystem::waterCompIdx;
|
return FluidSystem::waterCompIdx;
|
||||||
}
|
}
|
||||||
|
|
||||||
double totalFluxRate() const
|
Scalar totalFluxRate() const
|
||||||
{
|
{
|
||||||
return std::accumulate(this->connection_flux_.begin(),
|
return std::accumulate(this->connection_flux_.begin(),
|
||||||
this->connection_flux_.end(), 0.0,
|
this->connection_flux_.end(), 0.0,
|
||||||
[](const double rate, const auto& q)
|
[](const Scalar rate, const auto& q)
|
||||||
{
|
{
|
||||||
return rate + getValue(q);
|
return rate + getValue(q);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user