mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
addd simple salt/brine implementation
This commit is contained in:
committed by
Tor Harald Sandve
parent
d20bec2f71
commit
5749615bd8
64
ebos/ebos_saltwater.cc
Normal file
64
ebos/ebos_saltwater.cc
Normal file
@@ -0,0 +1,64 @@
|
||||
// -*- 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.
|
||||
*/
|
||||
/*!
|
||||
* \file
|
||||
*
|
||||
* \brief A general-purpose simulator for ECL decks using the black-oil model.
|
||||
*/
|
||||
#include "config.h"
|
||||
|
||||
#include "ebos.hh"
|
||||
#include "startEbos.hh"
|
||||
|
||||
BEGIN_PROPERTIES
|
||||
|
||||
NEW_TYPE_TAG(EbosSaltWaterTypeTag, INHERITS_FROM(EbosTypeTag));
|
||||
|
||||
// enable the salt extension of the black oil model
|
||||
SET_BOOL_PROP(EbosSaltWaterTypeTag, EnableSaltWater, true);
|
||||
|
||||
END_PROPERTIES
|
||||
|
||||
namespace Opm {
|
||||
|
||||
void ebosSaltWaterSetDeck(Opm::Deck* deck,
|
||||
Opm::ParseContext* parseContext,
|
||||
Opm::ErrorGuard* errorGuard,
|
||||
double externalSetupTime)
|
||||
{
|
||||
typedef TTAG(EbosSaltWaterTypeTag) ProblemTypeTag;
|
||||
typedef GET_PROP_TYPE(ProblemTypeTag, Vanguard) Vanguard;
|
||||
|
||||
Vanguard::setExternalSetupTime(externalSetupTime);
|
||||
Vanguard::setExternalParseContext(parseContext);
|
||||
Vanguard::setExternalErrorGuard(errorGuard);
|
||||
Vanguard::setExternalDeck(deck);
|
||||
}
|
||||
|
||||
int ebosSaltWaterMain(int argc, char **argv)
|
||||
{
|
||||
typedef TTAG(EbosSaltWaterTypeTag) ProblemTypeTag;
|
||||
return Opm::startEbos<ProblemTypeTag>(argc, argv);
|
||||
}
|
||||
|
||||
}
|
||||
44
ebos/ebos_saltwater.hh
Normal file
44
ebos/ebos_saltwater.hh
Normal file
@@ -0,0 +1,44 @@
|
||||
// -*- 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.
|
||||
*/
|
||||
/*!
|
||||
* \file
|
||||
*
|
||||
* \brief The function prototypes required to start the salt variant of ebos
|
||||
*/
|
||||
#ifndef EBOS_SALTWATER_HH
|
||||
#define EBOS_SALTWATER_HH
|
||||
|
||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
|
||||
|
||||
namespace Opm {
|
||||
void ebosSaltWaterSetDeck(Opm::Deck* deck,
|
||||
Opm::ParseContext* parseContext,
|
||||
Opm::ErrorGuard* errorGuard,
|
||||
double externalSetupTime);
|
||||
|
||||
int ebosSaltWaterMain(int argc, char** argv);
|
||||
}
|
||||
|
||||
#endif
|
||||
37
ebos/ebos_saltwater_main.cc
Normal file
37
ebos/ebos_saltwater_main.cc
Normal file
@@ -0,0 +1,37 @@
|
||||
// -*- 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.
|
||||
*/
|
||||
/*!
|
||||
* \file
|
||||
*
|
||||
* \brief The main function for the stand alone salt variant of ebos.
|
||||
*
|
||||
* This only calls the ebosSaltWaterMain() function.
|
||||
*/
|
||||
#include "config.h"
|
||||
|
||||
#include "ebos_saltwater.hh"
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
return Opm::ebosSaltWaterMain(argc, argv);
|
||||
}
|
||||
@@ -312,6 +312,8 @@ public:
|
||||
cPolymer_.resize(bufferSize, 0.0);
|
||||
if (GET_PROP_VALUE(TypeTag, EnableFoam))
|
||||
cFoam_.resize(bufferSize, 0.0);
|
||||
if (GET_PROP_VALUE(TypeTag, EnableSaltWater))
|
||||
cSalt_.resize(bufferSize, 0.0);
|
||||
|
||||
if (simulator_.problem().vapparsActive())
|
||||
soMax_.resize(bufferSize, 0.0);
|
||||
@@ -567,6 +569,10 @@ public:
|
||||
cFoam_[globalDofIdx] = intQuants.foamConcentration().value();
|
||||
}
|
||||
|
||||
if (cSalt_.size() > 0) {
|
||||
cSalt_[globalDofIdx] = fs.saltconcentration().value();
|
||||
}
|
||||
|
||||
if (bubblePointPressure_.size() > 0) {
|
||||
try {
|
||||
bubblePointPressure_[globalDofIdx] = Opm::getValue(FluidSystem::bubblePointPressure(fs, intQuants.pvtRegionIndex()));
|
||||
@@ -961,6 +967,9 @@ public:
|
||||
if (cFoam_.size() > 0)
|
||||
sol.insert ("FOAM", Opm::UnitSystem::measure::identity, std::move(cFoam_), Opm::data::TargetType::RESTART_SOLUTION);
|
||||
|
||||
if (cSalt_.size() > 0)
|
||||
sol.insert ("SALT", Opm::UnitSystem::measure::identity, std::move(cSalt_), Opm::data::TargetType::RESTART_SOLUTION);
|
||||
|
||||
if (dewPointPressure_.size() > 0)
|
||||
sol.insert ("PDEW", Opm::UnitSystem::measure::pressure, std::move(dewPointPressure_), Opm::data::TargetType::RESTART_AUXILIARY);
|
||||
|
||||
@@ -1522,6 +1531,8 @@ public:
|
||||
cPolymer_[elemIdx] = sol.data("POLYMER")[globalDofIndex];
|
||||
if (cFoam_.size() > 0 && sol.has("FOAM"))
|
||||
cFoam_[elemIdx] = sol.data("FOAM")[globalDofIndex];
|
||||
if (cSalt_.size() > 0 && sol.has("SALT"))
|
||||
cSalt_[elemIdx] = sol.data("SALT")[globalDofIndex];
|
||||
if (soMax_.size() > 0 && sol.has("SOMAX"))
|
||||
soMax_[elemIdx] = sol.data("SOMAX")[globalDofIndex];
|
||||
if (pcSwMdcOw_.size() > 0 &&sol.has("PCSWM_OW"))
|
||||
@@ -1626,6 +1637,14 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
Scalar getSaltConcentration(unsigned elemIdx) const
|
||||
{
|
||||
if (cSalt_.size() > elemIdx)
|
||||
return cSalt_[elemIdx];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
const std::map<std::pair<std::string, int>, double>& getBlockData()
|
||||
{ return blockData_; }
|
||||
|
||||
@@ -2102,6 +2121,7 @@ private:
|
||||
ScalarBuffer sSol_;
|
||||
ScalarBuffer cPolymer_;
|
||||
ScalarBuffer cFoam_;
|
||||
ScalarBuffer cSalt_;
|
||||
ScalarBuffer soMax_;
|
||||
ScalarBuffer pcSwMdcOw_;
|
||||
ScalarBuffer krnSwMdcOw_;
|
||||
|
||||
Reference in New Issue
Block a user