opm-simulators
BioeffectsContainer.hpp
Go to the documentation of this file.
1 // -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 // vi: set et ts=4 sw=4 sts=4:
3 /*
4  This file is part of the Open Porous Media project (OPM).
5 
6  OPM is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 2 of the License, or
9  (at your option) any later version.
10 
11  OPM is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with OPM. If not, see <http://www.gnu.org/licenses/>.
18  Consult the COPYING file in the top-level source directory of this
19  module for the precise wording of the license and the list of
20  copyright holders.
21 */
26 #ifndef OPM_BIOEFFECTS_CONTAINER_HPP
27 #define OPM_BIOEFFECTS_CONTAINER_HPP
28 
29 #include <vector>
30 
31 namespace Opm {
32 
33 namespace data { class Solution; }
34 template<class Scalar> struct BioeffectsSolutionContainer;
35 
36 template<class Scalar>
38 {
39  using ScalarBuffer = std::vector<Scalar>;
40 
41 public:
42  void allocate(const unsigned bufferSize, const bool isMICP);
43 
44  void assign(const unsigned globalDofIdx,
45  const Scalar oxygenConcentration,
46  const Scalar ureaConcentration,
47  const Scalar calciteVolumeFraction);
48 
49  void assign(const unsigned globalDofIdx,
50  const Scalar microbialConcentration,
51  const Scalar biofilmVolumeFraction);
52 
53  BioeffectsSolutionContainer<Scalar> getSolution() const;
54 
55  void outputRestart(data::Solution& sol, const bool isMICP);
56 
57  void readRestart(const unsigned globalDofIdx,
58  const unsigned elemIdx,
59  const data::Solution& sol,
60  const bool isMICP);
61 
62  bool allocated() const
63  { return allocated_; }
64 
65 private:
66  bool allocated_ = false;
67  ScalarBuffer cMicrobes_{};
68  ScalarBuffer cOxygen_{};
69  ScalarBuffer cUrea_{};
70  ScalarBuffer cBiofilm_{};
71  ScalarBuffer cCalcite_{};
72 };
73 
74 } // namespace Opm
75 
76 #endif // OPM_BIOEFFECTS_CONTAINER_HPP
Struct holding MICP extension data.
Definition: BioeffectsContainer.hpp:34
Definition: BioeffectsContainer.hpp:37
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: blackoilbioeffectsmodules.hh:45