-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3378 from GitPaean/support_aquflux
supporting the keyword AQUFLUX
- Loading branch information
Showing
17 changed files
with
321 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
/* | ||
Copyright (C) 2023 Equinor | ||
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 3 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/>. | ||
*/ | ||
|
||
#ifndef OPM_AQUIFERFLUX_HPP | ||
#define OPM_AQUIFERFLUX_HPP | ||
|
||
#include <optional> | ||
#include <unordered_map> | ||
#include <unordered_set> | ||
#include <vector> | ||
|
||
namespace Opm { | ||
class DeckKeyword; | ||
class DeckRecord; | ||
} | ||
|
||
namespace Opm::RestartIO { | ||
class RstAquifer; | ||
} // Opm::RestartIO | ||
|
||
namespace Opm { | ||
struct SingleAquiferFlux { | ||
explicit SingleAquiferFlux(const DeckRecord& record); | ||
|
||
// using id to create an inactive dummy aquifer | ||
explicit SingleAquiferFlux(int id); | ||
SingleAquiferFlux() = default; | ||
SingleAquiferFlux(int id, double flux, double sal, bool active_, double temp, double pres); | ||
|
||
int id {0}; | ||
double flux {0.}; | ||
double salt_concentration {0.}; | ||
bool active {false}; | ||
std::optional<double> temperature; | ||
std::optional<double> datum_pressure; | ||
|
||
bool operator==(const SingleAquiferFlux& other) const; | ||
|
||
template<class Serializer> | ||
void serializeOp(Serializer& serializer) | ||
{ | ||
serializer(this->id); | ||
serializer(this->flux); | ||
serializer(this->salt_concentration); | ||
serializer(this->active); | ||
serializer(this->temperature); | ||
serializer(this->datum_pressure); | ||
} | ||
|
||
static SingleAquiferFlux serializationTestObject(); | ||
}; | ||
|
||
class AquiferFlux { | ||
public: | ||
using AquFluxs = std::unordered_map<int, SingleAquiferFlux>; | ||
|
||
explicit AquiferFlux(const std::vector<const DeckKeyword*>& keywords); | ||
AquiferFlux() = default; | ||
|
||
void appendAqufluxSchedule(const std::unordered_set<int>& ids); | ||
|
||
bool hasAquifer(int id) const; | ||
|
||
bool operator==(const AquiferFlux& other) const; | ||
|
||
size_t size() const; | ||
|
||
AquFluxs::const_iterator begin() const; | ||
AquFluxs::const_iterator end() const; | ||
|
||
void loadFromRestart(const RestartIO::RstAquifer& rst); | ||
|
||
template<class Serializer> | ||
void serializeOp(Serializer& serializer) { | ||
serializer(this->m_aquifers); | ||
} | ||
|
||
static AquiferFlux serializationTestObject(); | ||
|
||
private: | ||
AquFluxs m_aquifers; | ||
}; | ||
} // end of namespace Opm | ||
|
||
#endif //OPM_AQUIFERFLUX_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.