mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-11-02 09:16:07 -06:00
Merge pull request #6041 from akva2/fix_tracer_comp
Fix tracercontainer in flowexp_comp
This commit is contained in:
4 files changed
+13
-18
No files matched your search
@@ -125,7 +125,6 @@ GenericOutputBlackoilModule(const EclipseState& eclState,
|
|||||||
, enableSaltPrecipitation_(enableSaltPrecipitation)
|
, enableSaltPrecipitation_(enableSaltPrecipitation)
|
||||||
, enableExtbo_(enableExtbo)
|
, enableExtbo_(enableExtbo)
|
||||||
, enableMICP_(enableMICP)
|
, enableMICP_(enableMICP)
|
||||||
, tracerC_(eclState_)
|
|
||||||
, flowsC_(schedule, summaryConfig)
|
, flowsC_(schedule, summaryConfig)
|
||||||
, rftC_(eclState_, schedule_,
|
, rftC_(eclState_, schedule_,
|
||||||
[this](const std::string& wname)
|
[this](const std::string& wname)
|
||||||
@@ -481,7 +480,7 @@ assignToSolution(data::Solution& sol)
|
|||||||
this->fipC_.outputRestart(sol);
|
this->fipC_.outputRestart(sol);
|
||||||
|
|
||||||
// Tracers
|
// Tracers
|
||||||
this->tracerC_.outputRestart(sol);
|
this->tracerC_.outputRestart(sol, eclState_.tracer());
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class FluidSystem>
|
template<class FluidSystem>
|
||||||
@@ -915,7 +914,7 @@ doAllocBuffers(const unsigned bufferSize,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// tracers
|
// tracers
|
||||||
this->tracerC_.allocate(bufferSize);
|
this->tracerC_.allocate(bufferSize, eclState_.tracer());
|
||||||
|
|
||||||
//Warn for any unhandled keyword
|
//Warn for any unhandled keyword
|
||||||
if (log) {
|
if (log) {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
namespace Opm {
|
namespace Opm {
|
||||||
|
|
||||||
namespace data { class Solution; }
|
namespace data { class Solution; }
|
||||||
template<class Scalar> class MICPSolutionContainer;
|
template<class Scalar> struct MICPSolutionContainer;
|
||||||
|
|
||||||
template<class Scalar>
|
template<class Scalar>
|
||||||
class MICPContainer
|
class MICPContainer
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <opm/simulators/flow/TracerContainer.hpp>
|
#include <opm/simulators/flow/TracerContainer.hpp>
|
||||||
|
|
||||||
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
|
#include <opm/input/eclipse/EclipseState/TracerConfig.hpp>
|
||||||
|
|
||||||
#include <opm/material/fluidsystems/BlackOilDefaultIndexTraits.hpp>
|
#include <opm/material/fluidsystems/BlackOilDefaultIndexTraits.hpp>
|
||||||
#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
|
#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
|
||||||
@@ -38,9 +38,9 @@ namespace Opm {
|
|||||||
|
|
||||||
template<class FluidSystem>
|
template<class FluidSystem>
|
||||||
void TracerContainer<FluidSystem>::
|
void TracerContainer<FluidSystem>::
|
||||||
allocate(const unsigned bufferSize)
|
allocate(const unsigned bufferSize,
|
||||||
|
const TracerConfig& tracers)
|
||||||
{
|
{
|
||||||
const auto& tracers = eclState_.tracer();
|
|
||||||
if (!tracers.empty()) {
|
if (!tracers.empty()) {
|
||||||
allocated_ = true;
|
allocated_ = true;
|
||||||
freeConcentrations_.resize(tracers.size());
|
freeConcentrations_.resize(tracers.size());
|
||||||
@@ -93,13 +93,13 @@ assignSolConcentrations(const unsigned globalDofIdx,
|
|||||||
|
|
||||||
template<class FluidSystem>
|
template<class FluidSystem>
|
||||||
void TracerContainer<FluidSystem>::
|
void TracerContainer<FluidSystem>::
|
||||||
outputRestart(data::Solution& sol)
|
outputRestart(data::Solution& sol,
|
||||||
|
const TracerConfig& tracers)
|
||||||
{
|
{
|
||||||
if (!this->allocated_) {
|
if (!this->allocated_) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto& tracers = this->eclState_.tracer();
|
|
||||||
std::for_each(tracers.begin(), tracers.end(),
|
std::for_each(tracers.begin(), tracers.end(),
|
||||||
[idx = 0, &sol, this](const auto& tracer) mutable
|
[idx = 0, &sol, this](const auto& tracer) mutable
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
namespace Opm {
|
namespace Opm {
|
||||||
|
|
||||||
namespace data { class Solution; }
|
namespace data { class Solution; }
|
||||||
class EclipseState;
|
class TracerConfig;
|
||||||
|
|
||||||
template<class FluidSystem>
|
template<class FluidSystem>
|
||||||
class TracerContainer
|
class TracerContainer
|
||||||
@@ -41,11 +41,8 @@ class TracerContainer
|
|||||||
using ScalarBuffer = std::vector<Scalar>;
|
using ScalarBuffer = std::vector<Scalar>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TracerContainer(const EclipseState& eclState)
|
void allocate(const unsigned bufferSize,
|
||||||
: eclState_(eclState)
|
const TracerConfig& tracers);
|
||||||
{}
|
|
||||||
|
|
||||||
void allocate(const unsigned bufferSize);
|
|
||||||
|
|
||||||
using AssignFunction = std::function<Scalar(const unsigned)>;
|
using AssignFunction = std::function<Scalar(const unsigned)>;
|
||||||
|
|
||||||
@@ -55,11 +52,10 @@ public:
|
|||||||
void assignSolConcentrations(const unsigned globalDofIdx,
|
void assignSolConcentrations(const unsigned globalDofIdx,
|
||||||
const AssignFunction& concentration);
|
const AssignFunction& concentration);
|
||||||
|
|
||||||
void outputRestart(data::Solution& sol);
|
void outputRestart(data::Solution& sol,
|
||||||
|
const TracerConfig& tracers);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const EclipseState& eclState_;
|
|
||||||
|
|
||||||
std::vector<ScalarBuffer> freeConcentrations_{};
|
std::vector<ScalarBuffer> freeConcentrations_{};
|
||||||
std::vector<ScalarBuffer> solConcentrations_{};
|
std::vector<ScalarBuffer> solConcentrations_{};
|
||||||
bool allocated_{false};
|
bool allocated_{false};
|
||||||
|
|||||||
Reference in new issue
Block a user