BIOFILM effects for gas-water systems

This commit is contained in:
David Landa Marban committed 2025-09-18 11:15:48 +02:00
1 parent 484e61b573
commit d3101a9c80
81 files changed
+1872 -1308

No files matched your search

+124
View File
@@ -0,0 +1,124 @@
/*
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/>.
*/
#include "config.h"
// Define making clear that the simulator supports AMG
#define FLOW_SUPPORT_AMG 1
#include <flow/flow_biofilm.hpp>
#include <opm/material/common/ResetLocale.hpp>
#include <opm/models/blackoil/blackoiltwophaseindices.hh>
#include <opm/models/blackoil/blackoillocalresidualtpfa.hh>
#include <opm/models/discretization/common/tpfalinearizer.hh>
#include <opm/grid/CpGrid.hpp>
#include <opm/simulators/flow/Main.hpp>
#include <opm/simulators/flow/SimulatorFullyImplicitBlackoil.hpp>
namespace Opm {
/*!
* \brief Two-phase (gas+water) flow problem including biofilm effects (one transported
* quantity: suspended microbes and one solid phase: biofilm).
*/
namespace Properties {
namespace TTag {
struct FlowBiofilmProblem {
using InheritsFrom = std::tuple<FlowProblem>;
};
}
template<class TypeTag>
struct EnableBioeffects<TypeTag, TTag::FlowBiofilmProblem> {
static constexpr bool value = true;
};
template<class TypeTag>
struct EnableDiffusion<TypeTag, TTag::FlowBiofilmProblem> {
static constexpr bool value = true;
};
template<class TypeTag>
struct EnableDispersion<TypeTag, TTag::FlowBiofilmProblem> {
static constexpr bool value = true;
};
template<class TypeTag>
struct EnableDisgasInWater<TypeTag, TTag::FlowBiofilmProblem> {
static constexpr bool value = true;
};
template<class TypeTag>
struct EnableVapwat<TypeTag, TTag::FlowBiofilmProblem> {
static constexpr bool value = true;
};
template<class TypeTag>
struct Linearizer<TypeTag, TTag::FlowBiofilmProblem> { using type = TpfaLinearizer<TypeTag>; };
template<class TypeTag>
struct LocalResidual<TypeTag, TTag::FlowBiofilmProblem> { using type = BlackOilLocalResidualTPFA<TypeTag>; };
//! The indices required by the model
template<class TypeTag>
struct Indices<TypeTag, TTag::FlowBiofilmProblem>
{
private:
// it is unfortunately not possible to simply use 'TypeTag' here because this leads
// to cyclic definitions of some properties. if this happens the compiler error
// messages unfortunately are *really* confusing and not really helpful.
using BaseTypeTag = TTag::FlowProblem;
using FluidSystem = GetPropType<BaseTypeTag, Properties::FluidSystem>;
public:
using type = BlackOilTwoPhaseIndices<getPropValue<TypeTag, Properties::EnableSolvent>(),
getPropValue<TypeTag, Properties::EnableExtbo>(),
getPropValue<TypeTag, Properties::EnablePolymer>(),
getPropValue<TypeTag, Properties::EnableEnergy>(),
getPropValue<TypeTag, Properties::EnableFoam>(),
getPropValue<TypeTag, Properties::EnableBrine>(),
/*PVOffset=*/0,
/*disabledCompIdx=*/FluidSystem::oilCompIdx,
2>; //Two biocomponents (suspended microbes and biofilm)
};
}}
namespace Opm {
// ----------------- Main program -----------------
int flowBiofilmMain(int argc, char** argv, bool outputCout, bool outputFiles)
{
// we always want to use the default locale, and thus spare us the trouble
// with incorrect locale settings.
resetLocale();
FlowMain<Properties::TTag::FlowBiofilmProblem>
mainfunc {argc, argv, outputCout, outputFiles} ;
return mainfunc.execute();
}
int flowBiofilmMainStandalone(int argc, char** argv)
{
using TypeTag = Properties::TTag::FlowBiofilmProblem;
auto mainObject = std::make_unique<Opm::Main>(argc, argv);
auto ret = mainObject->runStatic<TypeTag>();
// Destruct mainObject as the destructor calls MPI_Finalize!
mainObject.reset();
return ret;
}
} // namespace Opm
+27
View File
@@ -0,0 +1,27 @@
/*
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 FLOW_BIOFILM_HPP
#define FLOW_BIOFILM_HPP
namespace Opm {
//! \brief Main function used in flow binary.
int flowBiofilmMain(int argc, char** argv, bool outputCout, bool outputFiles);
//! \brief Main function used in flow_biofilm binary.
int flowBiofilmMainStandalone(int argc, char** argv);
}
#endif // FLOW_BIOFILM_HPP
+21
View File
@@ -0,0 +1,21 @@
/*
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/>.
*/
#include "config.h"
#include <flow/flow_biofilm.hpp>
int main(int argc, char** argv)
{
return Opm::flowBiofilmMainStandalone(argc, argv);
}
+1 -1
View File
@@ -65,7 +65,7 @@ public:
getPropValue<TypeTag, Properties::EnableBrine>(),
/*PVOffset=*/0,
/*disabledCompIdx=*/FluidSystem::waterCompIdx,
getPropValue<TypeTag, Properties::EnableMICP>()>;
getPropValue<TypeTag, Properties::EnableBioeffects>()>;
};
}}
+1 -1
View File
@@ -55,7 +55,7 @@ public:
getPropValue<TypeTag, Properties::EnableBrine>(),
/*PVOffset=*/0,
/*disabledCompIdx=*/FluidSystem::waterCompIdx,
getPropValue<TypeTag, Properties::EnableMICP>()>;
getPropValue<TypeTag, Properties::EnableBioeffects>()>;
};
template<class TypeTag>
struct EnableEnergy<TypeTag, TTag::FlowGasOilEnergyProblem> {
+1 -1
View File
@@ -67,7 +67,7 @@ public:
getPropValue<TypeTag, Properties::EnableBrine>(),
/*PVOffset=*/0,
/*disabledCompIdx=*/FluidSystem::waterCompIdx,
getPropValue<TypeTag, Properties::EnableMICP>()>;
getPropValue<TypeTag, Properties::EnableBioeffects>()>;
};
}}
+1 -1
View File
@@ -63,7 +63,7 @@ public:
getPropValue<TypeTag, Properties::EnableBrine>(),
/*PVOffset=*/0,
/*disabledCompIdx=*/FluidSystem::oilCompIdx,
getPropValue<TypeTag, Properties::EnableMICP>()>;
getPropValue<TypeTag, Properties::EnableBioeffects>()>;
};
}}
+1 -1
View File
@@ -64,7 +64,7 @@ public:
getPropValue<TypeTag, Properties::EnableBrine>(),
/*PVOffset=*/0,
/*disabledCompIdx=*/FluidSystem::oilCompIdx,
getPropValue<TypeTag, Properties::EnableMICP>()>;
getPropValue<TypeTag, Properties::EnableBioeffects>()>;
};
}}
+1 -1
View File
@@ -78,7 +78,7 @@ public:
getPropValue<TypeTag, Properties::EnableBrine>(),
/*PVOffset=*/0,
/*disabledCompIdx=*/FluidSystem::oilCompIdx,
getPropValue<TypeTag, Properties::EnableMICP>()>;
getPropValue<TypeTag, Properties::EnableBioeffects>()>;
};
}}
+1 -1
View File
@@ -81,7 +81,7 @@ public:
getPropValue<TypeTag, Properties::EnableBrine>(),
/*PVOffset=*/0,
/*disabledCompIdx=*/FluidSystem::oilCompIdx,
getPropValue<TypeTag, Properties::EnableMICP>()>;
getPropValue<TypeTag, Properties::EnableBioeffects>()>;
};
}}
+1 -1
View File
@@ -86,7 +86,7 @@ public:
getPropValue<TypeTag, Properties::EnableBrine>(),
/*PVOffset=*/0,
/*disabledCompIdx=*/FluidSystem::oilCompIdx,
getPropValue<TypeTag, Properties::EnableMICP>()>;
getPropValue<TypeTag, Properties::EnableBioeffects>()>;
};
}}
+1 -1
View File
@@ -77,7 +77,7 @@ public:
getPropValue<TypeTag, Properties::EnableBrine>(),
/*PVOffset=*/0,
/*disabledCompIdx=*/FluidSystem::oilCompIdx,
getPropValue<TypeTag, Properties::EnableMICP>()>;
getPropValue<TypeTag, Properties::EnableBioeffects>()>;
};
}}
+1 -1
View File
@@ -72,7 +72,7 @@ public:
getPropValue<TypeTag, Properties::EnableBrine>(),
/*PVOffset=*/0,
/*disabledCompIdx=*/FluidSystem::oilCompIdx,
getPropValue<TypeTag, Properties::EnableMICP>()>;
getPropValue<TypeTag, Properties::EnableBioeffects>()>;
};
}}
+1 -1
View File
@@ -61,7 +61,7 @@ public:
getPropValue<TypeTag, Properties::EnableBrine>(),
/*PVOffset=*/0,
/*disabledCompIdx=*/FluidSystem::oilCompIdx,
getPropValue<TypeTag, Properties::EnableMICP>()>;
getPropValue<TypeTag, Properties::EnableBioeffects>()>;
};
}}
+6 -1
View File
@@ -29,6 +29,11 @@
#include <opm/simulators/flow/SimulatorFullyImplicitBlackoil.hpp>
namespace Opm {
/*!
* \brief Single-phase (water) flow problem including microbially induced calcite precipitation (MICP)
* effects (three transported quantities: suspended microbes, oxygen, and urea, and two solid phases:
* biofilm and calcite).
*/
namespace Properties {
namespace TTag {
struct FlowMICPProblem {
@@ -36,7 +41,7 @@ struct FlowMICPProblem {
};
}
template<class TypeTag>
struct EnableMICP<TypeTag, TTag::FlowMICPProblem> {
struct EnableBioeffects<TypeTag, TTag::FlowMICPProblem> {
static constexpr bool value = true;
};
template<class TypeTag>
+1 -1
View File
@@ -66,7 +66,7 @@ public:
getPropValue<TypeTag, Properties::EnableBrine>(),
/*PVOffset=*/0,
/*disabledCompIdx=*/FluidSystem::gasCompIdx,
getPropValue<TypeTag, Properties::EnableMICP>()>;
getPropValue<TypeTag, Properties::EnableBioeffects>()>;
};
}}
+1 -1
View File
@@ -56,7 +56,7 @@ public:
getPropValue<TypeTag, Properties::EnableBrine>(),
/*PVOffset=*/0,
/*disabledCompIdx=*/FluidSystem::gasCompIdx,
getPropValue<TypeTag, Properties::EnableMICP>()>;
getPropValue<TypeTag, Properties::EnableBioeffects>()>;
};
}}
+1 -1
View File
@@ -56,7 +56,7 @@ public:
getPropValue<TypeTag, Properties::EnableBrine>(),
/*PVOffset=*/0,
/*disabledCompIdx=*/FluidSystem::gasCompIdx,
getPropValue<TypeTag, Properties::EnableMICP>()>;
getPropValue<TypeTag, Properties::EnableBioeffects>()>;
};
}}
+1 -1
View File
@@ -63,7 +63,7 @@ public:
getPropValue<TypeTag, Properties::EnableBrine>(),
/*PVOffset=*/0,
/*disabledCompIdx=*/FluidSystem::gasCompIdx,
getPropValue<TypeTag, Properties::EnableMICP>()>;
getPropValue<TypeTag, Properties::EnableBioeffects>()>;
};
}}
+1 -1
View File
@@ -63,7 +63,7 @@ public:
getPropValue<TypeTag, Properties::EnableBrine>(),
/*PVOffset=*/0,
/*enabledCompIdx=*/FluidSystem::waterCompIdx,
getPropValue<TypeTag, Properties::EnableMICP>()>;
getPropValue<TypeTag, Properties::EnableBioeffects>()>;
};
} // namespace Opm::Properties
+1 -1
View File
@@ -58,7 +58,7 @@ public:
getPropValue<TypeTag, Properties::EnableBrine>(),
/*PVOffset=*/0,
/*enebledCompIdx=*/FluidSystem::waterCompIdx,
getPropValue<TypeTag, Properties::EnableMICP>()>;
getPropValue<TypeTag, Properties::EnableBioeffects>()>;
};
} // namespace Opm::Properties