diff --git a/flow/flow_biofilm.cpp b/flow/flow_biofilm.cpp index 4b650f9819..08a0677c87 100644 --- a/flow/flow_biofilm.cpp +++ b/flow/flow_biofilm.cpp @@ -28,47 +28,46 @@ #include #include -namespace Opm { +namespace Opm::Properties { + +namespace TTag { + /*! * \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; -}; +struct FlowBiofilmProblem +{ using InheritsFrom = std::tuple; }; + } template -struct EnableBioeffects { - static constexpr bool value = true; -}; +struct EnableBioeffects +{ static constexpr bool value = true; }; template -struct EnableDiffusion { - static constexpr bool value = true; -}; +struct EnableDiffusion +{ static constexpr bool value = true; }; template -struct EnableDispersion { - static constexpr bool value = true; -}; +struct EnableDispersion +{ static constexpr bool value = true; }; template -struct EnableDisgasInWater { - static constexpr bool value = true; -}; +struct EnableDisgasInWater +{ static constexpr bool value = true; }; template -struct EnableVapwat { - static constexpr bool value = true; -}; +struct EnableVapwat +{ static constexpr bool value = true; }; template -struct Linearizer { using type = TpfaLinearizer; }; +struct Linearizer +{ using type = TpfaLinearizer; }; + template -struct LocalResidual { using type = BlackOilLocalResidualTPFA; }; +struct LocalResidual +{ using type = BlackOilLocalResidualTPFA; }; template struct EnergyModuleType @@ -87,7 +86,8 @@ private: // get the energy module type to determine the equation number static constexpr EnergyModules energyModuleType = getPropValue(); - static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal; + static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal ? 1 : 0; + public: using type = BlackOilTwoPhaseIndices(), getPropValue(), @@ -99,11 +99,11 @@ public: /*disabledCompIdx=*/FluidSystem::oilCompIdx, 2>; //Two biocomponents (suspended microbes and biofilm) }; -}} + +} // namespace Opm::Properties namespace Opm { - // ----------------- Main program ----------------- int flowBiofilmMain(int argc, char** argv, bool outputCout, bool outputFiles) { diff --git a/flow/flow_blackoil.cpp b/flow/flow_blackoil.cpp index ce284beb32..fd03073979 100644 --- a/flow/flow_blackoil.cpp +++ b/flow/flow_blackoil.cpp @@ -26,27 +26,28 @@ #include #include +namespace Opm::Properties { + +template +struct Linearizer +{ using type = TpfaLinearizer; }; + +template +struct LocalResidual +{ using type = BlackOilLocalResidualTPFA; }; + +template +struct EnableDiffusion +{ static constexpr bool value = false; }; + +template +struct AvoidElementContext +{ static constexpr bool value = true; }; + +} // namespace Opm::Properties + namespace Opm { - namespace Properties { - template - struct Linearizer { using type = TpfaLinearizer; }; - - template - struct LocalResidual { using type = BlackOilLocalResidualTPFA; }; - - template - struct EnableDiffusion { static constexpr bool value = false; }; - - template - struct AvoidElementContext { static constexpr bool value = true; }; - - } -} - - -namespace Opm -{ std::unique_ptr> flowBlackoilTpfaMainInit(int argc, char** argv, bool outputCout, bool outputFiles) { diff --git a/flow/flow_blackoil_alugrid.cpp b/flow/flow_blackoil_alugrid.cpp index 6f2cc67a19..85a23f89a7 100644 --- a/flow/flow_blackoil_alugrid.cpp +++ b/flow/flow_blackoil_alugrid.cpp @@ -46,16 +46,18 @@ #include #include -namespace Opm { -namespace Properties { +namespace Opm::Properties { + namespace TTag { -struct FlowProblemAlugrid { - using InheritsFrom = std::tuple; -}; + +struct FlowProblemAlugrid +{ using InheritsFrom = std::tuple; }; + } template -struct Grid { +struct Grid +{ static const int dim = 3; #if HAVE_MPI using type = Dune::ALUGrid; @@ -66,21 +68,23 @@ struct Grid { // alugrid need cp grid as equilgrid template -struct EquilGrid { - using type = Dune::CpGrid; -}; +struct EquilGrid +{ using type = Dune::CpGrid; }; + template -struct Vanguard { - using type = Opm::AluGridVanguard; -}; -} +struct Vanguard +{ using type = Opm::AluGridVanguard; }; + +} // namespace Opm::Properties + +namespace Opm { template<> class SupportsFaceTag> : public std::bool_constant {}; -} +} // namespace Opm int main(int argc, char** argv) { diff --git a/flow/flow_blackoil_nohyst.cpp b/flow/flow_blackoil_nohyst.cpp index 457cbaeaeb..9699acacbb 100644 --- a/flow/flow_blackoil_nohyst.cpp +++ b/flow/flow_blackoil_nohyst.cpp @@ -29,33 +29,43 @@ #include -namespace Opm { -namespace Properties { - namespace TTag { - struct FlowProblemNohyst { - using InheritsFrom = std::tuple; - }; - } - template - struct Linearizer { using type = TpfaLinearizer; }; +namespace Opm::Properties { - template - struct LocalResidual { using type = BlackOilLocalResidualTPFA; }; +namespace TTag { - template - struct EnableDiffusion { static constexpr bool value = false; }; - - template - struct EnableHysteresis { static constexpr bool value = false; }; - - template - struct EnableEndpointScaling { static constexpr bool value = true; }; - - template - struct AvoidElementContext { static constexpr bool value = true; }; +struct FlowProblemNohyst +{ using InheritsFrom = std::tuple; }; } +template +struct Linearizer +{ using type = TpfaLinearizer; }; + +template +struct LocalResidual +{ using type = BlackOilLocalResidualTPFA; }; + +template +struct EnableDiffusion +{ static constexpr bool value = false; }; + +template +struct EnableHysteresis +{ static constexpr bool value = false; }; + +template +struct EnableEndpointScaling +{ static constexpr bool value = true; }; + +template +struct AvoidElementContext +{ static constexpr bool value = true; }; + +} // namespace Opm::Properties + +namespace Opm { + std::unique_ptr> flowBlackoilTpfaNohystMainInit(int argc, char** argv, bool outputCout, bool outputFiles) { diff --git a/flow/flow_blackoil_polyhedralgrid.cpp b/flow/flow_blackoil_polyhedralgrid.cpp index 70e3637bbc..ab15bae752 100644 --- a/flow/flow_blackoil_polyhedralgrid.cpp +++ b/flow/flow_blackoil_polyhedralgrid.cpp @@ -36,45 +36,49 @@ #include #include -namespace Opm { -namespace Properties { - namespace TTag { - struct FlowProblemPoly { - using InheritsFrom = std::tuple; - }; - } +namespace Opm::Properties { - template - struct Linearizer { using type = TpfaLinearizer; }; +namespace TTag { - template - struct LocalResidual { using type = BlackOilLocalResidualTPFA; }; +struct FlowProblemPoly +{ using InheritsFrom = std::tuple; }; - template - struct EnableDiffusion { static constexpr bool value = false; }; - - template - struct Grid { - using type = Dune::PolyhedralGrid<3, 3>; - }; - template - struct EquilGrid { - //using type = Dune::CpGrid; - using type = GetPropType; - }; - - template - struct Vanguard { - using type = Opm::PolyhedralGridVanguard; - }; } +template +struct Linearizer +{ using type = TpfaLinearizer; }; + +template +struct LocalResidual +{ using type = BlackOilLocalResidualTPFA; }; + +template +struct EnableDiffusion +{ static constexpr bool value = false; }; + +template +struct Grid +{ using type = Dune::PolyhedralGrid<3, 3>; }; + +template +struct EquilGrid +{ using type = GetPropType; }; + +template +struct Vanguard +{ using type = Opm::PolyhedralGridVanguard; }; + +} // namespace Opm::Properties + +namespace Opm { + template<> class SupportsFaceTag> : public std::bool_constant {}; -} +} // namespace Opm int main(int argc, char** argv) { diff --git a/flow/flow_blackoil_temp.cpp b/flow/flow_blackoil_temp.cpp index d02b56a4bb..82b1529f0f 100644 --- a/flow/flow_blackoil_temp.cpp +++ b/flow/flow_blackoil_temp.cpp @@ -27,12 +27,13 @@ #include #include -namespace Opm { -namespace Properties { +namespace Opm::Properties { + namespace TTag { -struct flowBlackoilTempProblem { - using InheritsFrom = std::tuple; -}; + +struct flowBlackoilTempProblem +{ using InheritsFrom = std::tuple; }; + } template @@ -40,19 +41,22 @@ struct EnergyModuleType { static constexpr EnergyModules value = EnergyModules::SequentialImplicitThermal; }; template -struct Linearizer { using type = TpfaLinearizer; }; +struct Linearizer +{ using type = TpfaLinearizer; }; template -struct LocalResidual { using type = BlackOilLocalResidualTPFA; }; +struct LocalResidual +{ using type = BlackOilLocalResidualTPFA; }; template -struct EnableDiffusion { static constexpr bool value = false; }; +struct EnableDiffusion +{ static constexpr bool value = false; }; template -struct AvoidElementContext { static constexpr bool value = true; }; +struct AvoidElementContext +{ static constexpr bool value = true; }; - -}} +} // namespace Opm::Properties namespace Opm { @@ -78,4 +82,4 @@ int flowBlackoilTempMainStandalone(int argc, char** argv) return ret; } -} +} // namespace Opm diff --git a/flow/flow_blackoil_tpsa.cpp b/flow/flow_blackoil_tpsa.cpp index 9f3a2015be..b5e80a65c6 100644 --- a/flow/flow_blackoil_tpsa.cpp +++ b/flow/flow_blackoil_tpsa.cpp @@ -35,9 +35,7 @@ namespace Opm::Properties { namespace TTag { struct FlowBlackOilProblemTPSA -{ - using InheritsFrom = std::tuple; -}; +{ using InheritsFrom = std::tuple; }; } // namespace Opm::Properties::TTag diff --git a/flow/flow_brine.cpp b/flow/flow_brine.cpp index b1e7a029a3..ada143a7f2 100644 --- a/flow/flow_brine.cpp +++ b/flow/flow_brine.cpp @@ -26,29 +26,28 @@ #include #include -namespace Opm { -namespace Properties { +namespace Opm::Properties { + namespace TTag { -struct FlowBrineProblem { - using InheritsFrom = std::tuple; -}; + +struct FlowBrineProblem +{ using InheritsFrom = std::tuple; }; + } template -struct EnableBrine { - static constexpr bool value = true; -}; +struct EnableBrine +{ static constexpr bool value = true; }; template -struct Linearizer { - using type = TpfaLinearizer; -}; +struct Linearizer +{ using type = TpfaLinearizer; }; template -struct LocalResidual { - using type = BlackOilLocalResidualTPFA; -}; -}} +struct LocalResidual +{ using type = BlackOilLocalResidualTPFA; }; + +} // namespace Opm::Properties namespace Opm { @@ -74,4 +73,4 @@ int flowBrineMainStandalone(int argc, char** argv) return ret; } -} +} // namespace Opm diff --git a/flow/flow_brine_energy.cpp b/flow/flow_brine_energy.cpp index db4461af71..6b116fbaac 100644 --- a/flow/flow_brine_energy.cpp +++ b/flow/flow_brine_energy.cpp @@ -21,33 +21,32 @@ #include #include -namespace Opm { -namespace Properties { +namespace Opm::Properties { + namespace TTag { -struct FlowBrineEnergyProblem { - using InheritsFrom = std::tuple; -}; + +struct FlowBrineEnergyProblem +{ using InheritsFrom = std::tuple; }; + } template -struct EnableBrine { - static constexpr bool value = true; -}; +struct EnableBrine +{ static constexpr bool value = true; }; template -struct Linearizer { - using type = TpfaLinearizer; -}; +struct Linearizer +{ using type = TpfaLinearizer; }; template -struct LocalResidual { - using type = BlackOilLocalResidualTPFA; -}; +struct LocalResidual +{ using type = BlackOilLocalResidualTPFA; }; + template struct EnergyModuleType { static constexpr EnergyModules value = EnergyModules::FullyImplicitThermal; }; -}} +} // namespace Opm::Properties namespace Opm { @@ -74,4 +73,4 @@ int flowBrineEnergyMainStandalone(int argc, char** argv) return ret; } -} +} // namespace Opm diff --git a/flow/flow_brine_precsalt_vapwat.cpp b/flow/flow_brine_precsalt_vapwat.cpp index e03d3da632..fb4011dac7 100644 --- a/flow/flow_brine_precsalt_vapwat.cpp +++ b/flow/flow_brine_precsalt_vapwat.cpp @@ -26,38 +26,36 @@ #include #include -namespace Opm { -namespace Properties { +namespace Opm::Properties { + namespace TTag { -struct FlowBrinePrecsaltVapwatProblem { - using InheritsFrom = std::tuple; -}; + +struct FlowBrinePrecsaltVapwatProblem +{ using InheritsFrom = std::tuple; }; + } -template -struct EnableBrine { - static constexpr bool value = true; -}; template -struct EnableSaltPrecipitation { - static constexpr bool value = true; -}; +struct EnableBrine +{ static constexpr bool value = true; }; template -struct EnableVapwat { - static constexpr bool value = true; -}; +struct EnableSaltPrecipitation +{ static constexpr bool value = true; }; template -struct Linearizer { - using type = TpfaLinearizer; -}; +struct EnableVapwat +{ static constexpr bool value = true; }; template -struct LocalResidual { - using type = BlackOilLocalResidualTPFA; -}; -}} +struct Linearizer +{ using type = TpfaLinearizer; }; + +template +struct LocalResidual +{ using type = BlackOilLocalResidualTPFA; }; + +} // namespace Opm::Properties namespace Opm { @@ -83,4 +81,4 @@ int flowBrinePrecsaltVapwatMainStandalone(int argc, char** argv) return ret; } -} +} // namespace Opm diff --git a/flow/flow_brine_saltprecipitation.cpp b/flow/flow_brine_saltprecipitation.cpp index c1e3a1c5ce..961fa8bd1e 100644 --- a/flow/flow_brine_saltprecipitation.cpp +++ b/flow/flow_brine_saltprecipitation.cpp @@ -26,34 +26,32 @@ #include #include -namespace Opm { -namespace Properties { +namespace Opm::Properties { + namespace TTag { -struct FlowBrineSaltPrecipitationProblem { - using InheritsFrom = std::tuple; -}; + +struct FlowBrineSaltPrecipitationProblem +{ using InheritsFrom = std::tuple; }; + } template -struct EnableBrine { - static constexpr bool value = true; -}; +struct EnableBrine +{ static constexpr bool value = true; }; template -struct EnableSaltPrecipitation { - static constexpr bool value = true; -}; +struct EnableSaltPrecipitation +{ static constexpr bool value = true; }; template -struct Linearizer { - using type = TpfaLinearizer; -}; +struct Linearizer +{ using type = TpfaLinearizer; }; template -struct LocalResidual { - using type = BlackOilLocalResidualTPFA; -}; -}} +struct LocalResidual +{ using type = BlackOilLocalResidualTPFA; }; + +} // namespace Opm::Properties namespace Opm { @@ -79,4 +77,4 @@ int flowBrineSaltPrecipitationMainStandalone(int argc, char** argv) return ret; } -} +} // namespace Opm diff --git a/flow/flow_distribute_z.cpp b/flow/flow_distribute_z.cpp index d0848f0d6a..8ca71c2ea0 100644 --- a/flow/flow_distribute_z.cpp +++ b/flow/flow_distribute_z.cpp @@ -47,8 +47,8 @@ std::vector loadBalanceInZOnly(const Dune::CpGrid& grid) for( const auto &element : elements(gridView) ) { const auto& id = idSet.id(element); - unsigned elemIdx = elemMapper.index(element); - const auto& cartIndex = cartMapper.cartesianIndex(elemIdx); + const auto elemIdx = elemMapper.index(element); + const auto& cartIndex = cartMapper.cartesianIndex(static_cast(elemIdx)); std::array cartCoord; cartMapper.cartesianCoordinate(cartIndex, cartCoord); using std::min; diff --git a/flow/flow_energy.cpp b/flow/flow_energy.cpp index 650f024f53..200cb7e176 100644 --- a/flow/flow_energy.cpp +++ b/flow/flow_energy.cpp @@ -25,26 +25,29 @@ #include #include #include -namespace Opm { -namespace Properties { + +namespace Opm::Properties { + namespace TTag { -struct FlowEnergyProblem { - using InheritsFrom = std::tuple; -}; + +struct FlowEnergyProblem +{ using InheritsFrom = std::tuple; }; + } template struct EnergyModuleType { static constexpr EnergyModules value = EnergyModules::FullyImplicitThermal; }; +template +struct Linearizer +{ using type = TpfaLinearizer; }; template -struct Linearizer { using type = TpfaLinearizer; }; -template -struct LocalResidual { using type = BlackOilLocalResidualTPFA; }; +struct LocalResidual +{ using type = BlackOilLocalResidualTPFA; }; - -}} +} // namespace Opm::Properties namespace Opm { @@ -70,4 +73,4 @@ int flowEnergyMainStandalone(int argc, char** argv) return ret; } -} +} // namespace Opm diff --git a/flow/flow_extbo.cpp b/flow/flow_extbo.cpp index 7c9340240c..7806eec8b1 100644 --- a/flow/flow_extbo.cpp +++ b/flow/flow_extbo.cpp @@ -23,18 +23,20 @@ #include #include -namespace Opm { -namespace Properties { +namespace Opm::Properties { + namespace TTag { -struct FlowExtboProblem { - using InheritsFrom = std::tuple; -}; + +struct FlowExtboProblem +{ using InheritsFrom = std::tuple; }; + } + template -struct EnableExtbo { - static constexpr bool value = true; -}; -}} +struct EnableExtbo +{ static constexpr bool value = true; }; + +} // namespace Opm::Properties namespace Opm { @@ -60,4 +62,4 @@ int flowExtboMainStandalone(int argc, char** argv) return ret; } -} +} // namespace Opm diff --git a/flow/flow_foam.cpp b/flow/flow_foam.cpp index 8e1109a165..e5cc7adaad 100644 --- a/flow/flow_foam.cpp +++ b/flow/flow_foam.cpp @@ -23,18 +23,20 @@ #include #include -namespace Opm { -namespace Properties { +namespace Opm::Properties { + namespace TTag { -struct FlowFoamProblem { - using InheritsFrom = std::tuple; -}; + +struct FlowFoamProblem +{ using InheritsFrom = std::tuple; }; + } + template -struct EnableFoam { - static constexpr bool value = true; -}; -}} +struct EnableFoam +{ static constexpr bool value = true; }; + +} // namespace Opm::Properties namespace Opm { @@ -60,4 +62,4 @@ int flowFoamMainStandalone(int argc, char** argv) return ret; } -} +} // namespace Opm diff --git a/flow/flow_gasoil.cpp b/flow/flow_gasoil.cpp index 1ab5e63a24..9cf8b55459 100644 --- a/flow/flow_gasoil.cpp +++ b/flow/flow_gasoil.cpp @@ -29,22 +29,26 @@ #include #include -namespace Opm { -namespace Properties { +namespace Opm::Properties { + namespace TTag { -struct FlowGasOilProblem { - using InheritsFrom = std::tuple; -}; + +struct FlowGasOilProblem +{ using InheritsFrom = std::tuple; }; + } template -struct Linearizer { using type = TpfaLinearizer; }; +struct Linearizer +{ using type = TpfaLinearizer; }; template -struct LocalResidual { using type = BlackOilLocalResidualTPFA; }; +struct LocalResidual +{ using type = BlackOilLocalResidualTPFA; }; template -struct EnableDiffusion { static constexpr bool value = false; }; +struct EnableDiffusion +{ static constexpr bool value = false; }; template struct EnergyModuleType @@ -61,7 +65,8 @@ private: using BaseTypeTag = TTag::FlowProblem; using FluidSystem = GetPropType; static constexpr EnergyModules energyModuleType = getPropValue(); - static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal; + static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal ? 1 : 0; + public: using type = BlackOilTwoPhaseIndices(), getPropValue(), @@ -73,7 +78,8 @@ public: /*disabledCompIdx=*/FluidSystem::waterCompIdx, getPropValue()>; }; -}} + +} // namespace Opm::Properties namespace Opm { @@ -99,4 +105,4 @@ int flowGasOilMainStandalone(int argc, char** argv) return ret; } -} +} // namespace Opm diff --git a/flow/flow_gasoil_energy.cpp b/flow/flow_gasoil_energy.cpp index 0a826d5413..8f415c7cf2 100644 --- a/flow/flow_gasoil_energy.cpp +++ b/flow/flow_gasoil_energy.cpp @@ -28,12 +28,13 @@ #include #include -namespace Opm { -namespace Properties { +namespace Opm::Properties { + namespace TTag { -struct FlowGasOilEnergyProblem { - using InheritsFrom = std::tuple; -}; + +struct FlowGasOilEnergyProblem +{ using InheritsFrom = std::tuple; }; + } //! The indices required by the model @@ -48,7 +49,7 @@ private: using FluidSystem = GetPropType; // get the energy module type to determine the equation number static constexpr EnergyModules energyModuleType = getPropValue(); - static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal; + static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal ? 1 : 0; public: using type = BlackOilTwoPhaseIndices(), @@ -61,22 +62,28 @@ public: /*disabledCompIdx=*/FluidSystem::waterCompIdx, getPropValue()>; }; + template struct EnergyModuleType { static constexpr EnergyModules value = EnergyModules::FullyImplicitThermal; }; -template -struct Linearizer { using type = TpfaLinearizer; }; template -struct LocalResidual { using type = BlackOilLocalResidualTPFA; }; +struct Linearizer +{ using type = TpfaLinearizer; }; template -struct EnableDiffusion { static constexpr bool value = true; }; +struct LocalResidual +{ using type = BlackOilLocalResidualTPFA; }; template -struct EnableDispersion { static constexpr bool value = true; }; +struct EnableDiffusion +{ static constexpr bool value = true; }; -}} +template +struct EnableDispersion +{ static constexpr bool value = true; }; + +} // namespace Opm::Properties namespace Opm { @@ -102,4 +109,4 @@ int flowGasOilEnergyMainStandalone(int argc, char** argv) return ret; } -} +} // namespace Opm diff --git a/flow/flow_gasoildiffuse.cpp b/flow/flow_gasoildiffuse.cpp index 1177d18ac4..6cc6b26e09 100644 --- a/flow/flow_gasoildiffuse.cpp +++ b/flow/flow_gasoildiffuse.cpp @@ -28,25 +28,30 @@ #include #include -namespace Opm { -namespace Properties { +namespace Opm::Properties { + namespace TTag { -struct FlowGasOilDiffuseProblem { - using InheritsFrom = std::tuple; -}; + +struct FlowGasOilDiffuseProblem +{ using InheritsFrom = std::tuple; }; + } template -struct Linearizer { using type = TpfaLinearizer; }; +struct Linearizer +{ using type = TpfaLinearizer; }; template -struct LocalResidual { using type = BlackOilLocalResidualTPFA; }; +struct LocalResidual +{ using type = BlackOilLocalResidualTPFA; }; template -struct EnableDiffusion { static constexpr bool value = true; }; +struct EnableDiffusion +{ static constexpr bool value = true; }; template -struct EnableDispersion { static constexpr bool value = true; }; +struct EnableDispersion +{ static constexpr bool value = true; }; template struct EnergyModuleType @@ -63,7 +68,8 @@ private: using BaseTypeTag = TTag::FlowProblem; using FluidSystem = GetPropType; static constexpr EnergyModules energyModuleType = getPropValue(); - static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal; + static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal ? 1 : 0; + public: using type = BlackOilTwoPhaseIndices(), getPropValue(), @@ -75,7 +81,8 @@ public: /*disabledCompIdx=*/FluidSystem::waterCompIdx, getPropValue()>; }; -}} + +} // namespace Opm::Properties namespace Opm { @@ -101,4 +108,4 @@ int flowGasOilDiffuseMainStandalone(int argc, char** argv) return ret; } -} +} // namespace Opm diff --git a/flow/flow_gaswater.cpp b/flow/flow_gaswater.cpp index 0d9aec6d9d..d113fb8353 100644 --- a/flow/flow_gaswater.cpp +++ b/flow/flow_gaswater.cpp @@ -28,17 +28,19 @@ #include #include -namespace Opm { -namespace Properties { +namespace Opm::Properties { template -struct Linearizer { using type = TpfaLinearizer; }; +struct Linearizer +{ using type = TpfaLinearizer; }; template -struct LocalResidual { using type = BlackOilLocalResidualTPFA; }; +struct LocalResidual +{ using type = BlackOilLocalResidualTPFA; }; template -struct EnableDiffusion { static constexpr bool value = false; }; +struct EnableDiffusion +{ static constexpr bool value = false; }; template struct EnergyModuleType @@ -55,7 +57,8 @@ private: using BaseTypeTag = TTag::FlowProblem; using FluidSystem = GetPropType; static constexpr EnergyModules energyModuleType = getPropValue(); - static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal; + static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal ? 1 : 0; + public: using type = BlackOilTwoPhaseIndices(), getPropValue(), @@ -67,11 +70,11 @@ public: /*disabledCompIdx=*/FluidSystem::oilCompIdx, getPropValue()>; }; -}} + +} // namespace Opm::Properties namespace Opm { - // ----------------- Main program ----------------- int flowGasWaterMain(int argc, char** argv, bool outputCout, bool outputFiles) { @@ -105,4 +108,4 @@ flowGasWaterMainInit(int argc, char** argv, bool outputCout, bool outputFiles) argc, argv, outputCout, outputFiles); } -} +} // namespace Opm diff --git a/flow/flow_gaswater_brine.cpp b/flow/flow_gaswater_brine.cpp index 1062f4c95f..292635148e 100644 --- a/flow/flow_gaswater_brine.cpp +++ b/flow/flow_gaswater_brine.cpp @@ -28,38 +28,34 @@ #include #include -namespace Opm { -namespace Properties { +namespace Opm::Properties { + namespace TTag { -struct FlowGasWaterBrineProblem { - using InheritsFrom = std::tuple; -}; + +struct FlowGasWaterBrineProblem +{ using InheritsFrom = std::tuple; }; + } template -struct EnableBrine { - static constexpr bool value = true; -}; +struct EnableBrine +{ static constexpr bool value = true; }; template -struct EnableDisgasInWater { - static constexpr bool value = true; -}; +struct EnableDisgasInWater +{ static constexpr bool value = true; }; template -struct EnableVapwat { - static constexpr bool value = true; -}; +struct EnableVapwat +{ static constexpr bool value = true; }; template -struct Linearizer { - using type = TpfaLinearizer; -}; +struct Linearizer +{ using type = TpfaLinearizer; }; template -struct LocalResidual { - using type = BlackOilLocalResidualTPFA; -}; +struct LocalResidual +{ using type = BlackOilLocalResidualTPFA; }; template struct EnergyModuleType @@ -76,7 +72,8 @@ private: using BaseTypeTag = TTag::FlowProblem; using FluidSystem = GetPropType; static constexpr EnergyModules energyModuleType = getPropValue(); - static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal; + static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal ? 1 : 0; + public: using type = BlackOilTwoPhaseIndices(), getPropValue(), @@ -88,7 +85,8 @@ public: /*disabledCompIdx=*/FluidSystem::oilCompIdx, getPropValue()>; }; -}} + +} // namespace Opm::Properties namespace Opm { @@ -114,4 +112,4 @@ int flowGasWaterBrineMainStandalone(int argc, char** argv) return ret; } -} +} // namespace Opm diff --git a/flow/flow_gaswater_dissolution.cpp b/flow/flow_gaswater_dissolution.cpp index 393b89f441..f4290f2fba 100644 --- a/flow/flow_gaswater_dissolution.cpp +++ b/flow/flow_gaswater_dissolution.cpp @@ -29,36 +29,38 @@ #include #include -namespace Opm { -namespace Properties { +namespace Opm::Properties { + namespace TTag { -struct FlowGasWaterDissolutionProblem { - using InheritsFrom = std::tuple; -}; + +struct FlowGasWaterDissolutionProblem +{ using InheritsFrom = std::tuple; }; + } template -struct Linearizer { using type = TpfaLinearizer; }; +struct Linearizer +{ using type = TpfaLinearizer; }; template -struct LocalResidual { using type = BlackOilLocalResidualTPFA; }; +struct LocalResidual +{ using type = BlackOilLocalResidualTPFA; }; template -struct EnableDiffusion { static constexpr bool value = false; }; +struct EnableDiffusion +{ static constexpr bool value = false; }; template -struct EnableDisgasInWater { - static constexpr bool value = true; -}; +struct EnableDisgasInWater +{ static constexpr bool value = true; }; template struct EnergyModuleType { static constexpr EnergyModules value = EnergyModules::ConstantTemperature; }; template -struct EnableVapwat { - static constexpr bool value = true; -}; +struct EnableVapwat +{ static constexpr bool value = true; }; //! The indices required by the model template @@ -71,7 +73,8 @@ private: using BaseTypeTag = TTag::FlowProblem; using FluidSystem = GetPropType; static constexpr EnergyModules energyModuleType = getPropValue(); - static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal; + static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal ? 1 : 0; + public: using type = BlackOilTwoPhaseIndices(), getPropValue(), @@ -83,11 +86,11 @@ public: /*disabledCompIdx=*/FluidSystem::oilCompIdx, getPropValue()>; }; -}} + +} // namespace Opm::Properties namespace Opm { - // ----------------- Main program ----------------- int flowGasWaterDissolutionMain(int argc, char** argv, bool outputCout, bool outputFiles) { @@ -110,4 +113,4 @@ int flowGasWaterDissolutionMainStandalone(int argc, char** argv) return ret; } -} +} // namespace Opm diff --git a/flow/flow_gaswater_dissolution_diffuse.cpp b/flow/flow_gaswater_dissolution_diffuse.cpp index 930519fa42..89f2197f9f 100644 --- a/flow/flow_gaswater_dissolution_diffuse.cpp +++ b/flow/flow_gaswater_dissolution_diffuse.cpp @@ -29,35 +29,38 @@ #include #include -namespace Opm { -namespace Properties { +namespace Opm::Properties { + namespace TTag { -struct FlowGasWaterDissolutionDiffuseProblem { - using InheritsFrom = std::tuple; -}; + +struct FlowGasWaterDissolutionDiffuseProblem +{ using InheritsFrom = std::tuple; }; + } template -struct Linearizer { using type = TpfaLinearizer; }; +struct Linearizer +{ using type = TpfaLinearizer; }; template -struct LocalResidual { using type = BlackOilLocalResidualTPFA; }; +struct LocalResidual +{ using type = BlackOilLocalResidualTPFA; }; template -struct EnableDiffusion { static constexpr bool value = true; }; +struct EnableDiffusion +{ static constexpr bool value = true; }; template -struct EnableDispersion { static constexpr bool value = true; }; +struct EnableDispersion +{ static constexpr bool value = true; }; template -struct EnableDisgasInWater { - static constexpr bool value = true; -}; +struct EnableDisgasInWater +{ static constexpr bool value = true; }; template -struct EnableVapwat { - static constexpr bool value = true; -}; +struct EnableVapwat +{ static constexpr bool value = true; }; template struct EnergyModuleType @@ -74,7 +77,8 @@ private: using BaseTypeTag = TTag::FlowProblem; using FluidSystem = GetPropType; static constexpr EnergyModules energyModuleType = getPropValue(); - static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal; + static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal ? 1 : 0; + public: using type = BlackOilTwoPhaseIndices(), getPropValue(), @@ -86,11 +90,11 @@ public: /*disabledCompIdx=*/FluidSystem::oilCompIdx, getPropValue()>; }; -}} + +} // namespace Opm::Properties namespace Opm { - // ----------------- Main program ----------------- int flowGasWaterDissolutionDiffuseMain(int argc, char** argv, bool outputCout, bool outputFiles) { @@ -113,4 +117,4 @@ int flowGasWaterDissolutionDiffuseMainStandalone(int argc, char** argv) return ret; } -} +} // namespace Opm diff --git a/flow/flow_gaswater_dissolution_tpsa.cpp b/flow/flow_gaswater_dissolution_tpsa.cpp index c9d8094a26..4b8a6158e3 100644 --- a/flow/flow_gaswater_dissolution_tpsa.cpp +++ b/flow/flow_gaswater_dissolution_tpsa.cpp @@ -36,9 +36,7 @@ namespace Opm::Properties { namespace TTag { struct FlowGasWaterDissolutionProblemTPSA -{ - using InheritsFrom = std::tuple; -}; +{ using InheritsFrom = std::tuple; }; } // namespace Opm::Properties::TTag @@ -76,7 +74,7 @@ private: using BaseTypeTag = TTag::FlowProblem; using FluidSystem = GetPropType; static constexpr EnergyModules energyModuleType = getPropValue(); - static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal; + static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal ? 1 : 0; public: using type = BlackOilTwoPhaseIndices(), diff --git a/flow/flow_gaswater_energy.cpp b/flow/flow_gaswater_energy.cpp index a35dda24aa..ad7a527c3f 100644 --- a/flow/flow_gaswater_energy.cpp +++ b/flow/flow_gaswater_energy.cpp @@ -28,7 +28,6 @@ namespace Opm { - // ----------------- Main program ----------------- int flowGasWaterEnergyMain(int argc, char** argv, bool outputCout, bool outputFiles) { @@ -51,4 +50,4 @@ int flowGasWaterEnergyMainStandalone(int argc, char** argv) return ret; } -} +} // namespace Opm diff --git a/flow/flow_gaswater_saltprec_energy.cpp b/flow/flow_gaswater_saltprec_energy.cpp index 7a712deac6..c55cf76550 100644 --- a/flow/flow_gaswater_saltprec_energy.cpp +++ b/flow/flow_gaswater_saltprec_energy.cpp @@ -28,42 +28,39 @@ #include #include -namespace Opm { -namespace Properties { +namespace Opm::Properties { + namespace TTag { -struct FlowGasWaterSaltprecEnergyProblem { - using InheritsFrom = std::tuple; -}; + +struct FlowGasWaterSaltprecEnergyProblem +{ using InheritsFrom = std::tuple; }; + } -template -struct EnableBrine { - static constexpr bool value = true; -}; template -struct EnableSaltPrecipitation { - static constexpr bool value = true; -}; +struct EnableBrine +{ static constexpr bool value = true; }; template -struct EnableVapwat { - static constexpr bool value = true; -}; +struct EnableSaltPrecipitation +{ static constexpr bool value = true; }; template -struct EnableDisgasInWater { - static constexpr bool value = true; -}; +struct EnableVapwat +{ static constexpr bool value = true; }; template -struct Linearizer { - using type = TpfaLinearizer; -}; +struct EnableDisgasInWater +{ static constexpr bool value = true; }; template -struct LocalResidual { - using type = BlackOilLocalResidualTPFA; -}; +struct Linearizer +{ using type = TpfaLinearizer; }; + +template +struct LocalResidual +{ using type = BlackOilLocalResidualTPFA; }; + template struct EnergyModuleType { static constexpr EnergyModules value = EnergyModules::FullyImplicitThermal; }; @@ -79,7 +76,8 @@ private: using BaseTypeTag = TTag::FlowProblem; using FluidSystem = GetPropType; static constexpr EnergyModules energyModuleType = getPropValue(); - static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal; + static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal ? 1 : 0; + public: using type = BlackOilTwoPhaseIndices(), getPropValue(), @@ -91,7 +89,8 @@ public: /*disabledCompIdx=*/FluidSystem::oilCompIdx, getPropValue()>; }; -}} + +} // namespace Opm::Properties namespace Opm { @@ -117,4 +116,4 @@ int flowGasWaterSaltprecEnergyMainStandalone(int argc, char** argv) return ret; } -} +} // namespace Opm diff --git a/flow/flow_gaswater_saltprec_vapwat.cpp b/flow/flow_gaswater_saltprec_vapwat.cpp index c69b7cbd5a..660b40c087 100644 --- a/flow/flow_gaswater_saltprec_vapwat.cpp +++ b/flow/flow_gaswater_saltprec_vapwat.cpp @@ -28,42 +28,39 @@ #include #include -namespace Opm { -namespace Properties { +namespace Opm::Properties { + namespace TTag { -struct FlowGasWaterSaltprecVapwatProblem { - using InheritsFrom = std::tuple; -}; + +struct FlowGasWaterSaltprecVapwatProblem +{ using InheritsFrom = std::tuple; }; + } -template -struct EnableBrine { - static constexpr bool value = true; -}; template -struct EnableSaltPrecipitation { - static constexpr bool value = true; -}; +struct EnableBrine +{ static constexpr bool value = true; }; template -struct EnableVapwat { - static constexpr bool value = true; -}; +struct EnableSaltPrecipitation +{ static constexpr bool value = true; }; template -struct EnableDisgasInWater { - static constexpr bool value = true; -}; +struct EnableVapwat +{ static constexpr bool value = true; }; template -struct Linearizer { - using type = TpfaLinearizer; -}; +struct EnableDisgasInWater +{ static constexpr bool value = true; }; template -struct LocalResidual { - using type = BlackOilLocalResidualTPFA; -}; +struct Linearizer +{ using type = TpfaLinearizer; }; + +template +struct LocalResidual +{ using type = BlackOilLocalResidualTPFA; }; + template struct EnergyModuleType { static constexpr EnergyModules value = EnergyModules::ConstantTemperature; }; @@ -79,7 +76,8 @@ private: using BaseTypeTag = TTag::FlowProblem; using FluidSystem = GetPropType; static constexpr EnergyModules energyModuleType = getPropValue(); - static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal; + static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal ? 1 : 0; + public: using type = BlackOilTwoPhaseIndices(), getPropValue(), @@ -91,7 +89,8 @@ public: /*disabledCompIdx=*/FluidSystem::oilCompIdx, getPropValue()>; }; -}} + +} // namespace Opm::Properties namespace Opm { @@ -117,4 +116,4 @@ int flowGasWaterSaltprecVapwatMainStandalone(int argc, char** argv) return ret; } -} +} // namespace Opm diff --git a/flow/flow_gaswater_solvent.cpp b/flow/flow_gaswater_solvent.cpp index 1ee649ac7c..9a1de5b425 100644 --- a/flow/flow_gaswater_solvent.cpp +++ b/flow/flow_gaswater_solvent.cpp @@ -25,18 +25,18 @@ #include #include -namespace Opm { -namespace Properties { +namespace Opm::Properties { + namespace TTag { -struct FlowGasWaterSolventProblem { - using InheritsFrom = std::tuple; -}; + +struct FlowGasWaterSolventProblem +{ using InheritsFrom = std::tuple; }; + } template -struct EnableSolvent { - static constexpr bool value = true; -}; +struct EnableSolvent +{ static constexpr bool value = true; }; template struct EnergyModuleType @@ -53,7 +53,8 @@ private: using BaseTypeTag = TTag::FlowProblem; using FluidSystem = GetPropType; static constexpr EnergyModules energyModuleType = getPropValue(); - static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal; + static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal ? 1 : 0; + public: using type = BlackOilTwoPhaseIndices(), getPropValue(), @@ -65,11 +66,11 @@ public: /*disabledCompIdx=*/FluidSystem::oilCompIdx, getPropValue()>; }; -}} + +} // namespace Opm::Properties namespace Opm { - // ----------------- Main program ----------------- int flowGasWaterSolventMain(int argc, char** argv, bool outputCout, bool outputFiles) { @@ -92,4 +93,4 @@ int flowGasWaterSolventMainStandalone(int argc, char** argv) return ret; } -} +} // namespace Opm diff --git a/flow/flow_micp.cpp b/flow/flow_micp.cpp index defb243ee4..f8ffc5546e 100644 --- a/flow/flow_micp.cpp +++ b/flow/flow_micp.cpp @@ -28,26 +28,32 @@ #include #include -namespace Opm { +namespace Opm::Properties { + +namespace TTag { + /*! * \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 { - using InheritsFrom = std::tuple; -}; +struct FlowMICPProblem +{ using InheritsFrom = std::tuple; }; + } + template -struct EnableBioeffects { - static constexpr bool value = true; -}; +struct EnableBioeffects +{ static constexpr bool value = true; }; + template -struct Linearizer { using type = TpfaLinearizer; }; +struct Linearizer +{ using type = TpfaLinearizer; }; + template -struct LocalResidual { using type = BlackOilLocalResidualTPFA; }; +struct LocalResidual +{ using type = BlackOilLocalResidualTPFA; }; + //! The indices required by the model template struct Indices @@ -59,7 +65,8 @@ private: using BaseTypeTag = TTag::FlowProblem; using FluidSystem = GetPropType; static constexpr EnergyModules energyModuleType = getPropValue(); - static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal; + static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal ? 1 : 0; + public: using type = BlackOilOnePhaseIndices(), getPropValue(), @@ -73,12 +80,14 @@ public: }; template -struct EnableDiffusion { static constexpr bool value = true; }; +struct EnableDiffusion +{ static constexpr bool value = true; }; template -struct EnableDispersion { static constexpr bool value = true; }; +struct EnableDispersion +{ static constexpr bool value = true; }; -}} +} // namespace Opm::Properties namespace Opm { @@ -104,4 +113,4 @@ int flowMICPMainStandalone(int argc, char** argv) return ret; } -} +} // namespace Opm diff --git a/flow/flow_oilwater.cpp b/flow/flow_oilwater.cpp index 6a7ef616ee..92ffb857a8 100644 --- a/flow/flow_oilwater.cpp +++ b/flow/flow_oilwater.cpp @@ -28,23 +28,26 @@ #include #include -namespace Opm { -namespace Properties { +namespace Opm::Properties { + namespace TTag { -struct FlowOilWaterProblem { - using InheritsFrom = std::tuple; -}; + +struct FlowOilWaterProblem +{ using InheritsFrom = std::tuple; }; + } template -struct Linearizer { using type = TpfaLinearizer; }; +struct Linearizer +{ using type = TpfaLinearizer; }; template -struct LocalResidual { using type = BlackOilLocalResidualTPFA; }; +struct LocalResidual +{ using type = BlackOilLocalResidualTPFA; }; template -struct EnableDiffusion { static constexpr bool value = false; }; - +struct EnableDiffusion +{ static constexpr bool value = false; }; //! The indices required by the model template @@ -57,7 +60,7 @@ private: using BaseTypeTag = TTag::FlowProblem; using FluidSystem = GetPropType; static constexpr EnergyModules energyModuleType = getPropValue(); - static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal; + static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal ? 1 : 0; public: using type = BlackOilTwoPhaseIndices(), @@ -70,7 +73,8 @@ public: /*disabledCompIdx=*/FluidSystem::gasCompIdx, getPropValue()>; }; -}} + +} // namespace Opm::Properties namespace Opm { @@ -96,4 +100,4 @@ int flowOilWaterMainStandalone(int argc, char** argv) return ret; } -} +} // namespace Opm diff --git a/flow/flow_oilwater_brine.cpp b/flow/flow_oilwater_brine.cpp index b997edb92f..9b7cda56cb 100644 --- a/flow/flow_oilwater_brine.cpp +++ b/flow/flow_oilwater_brine.cpp @@ -27,28 +27,26 @@ #include #include -namespace Opm { -namespace Properties { +namespace Opm::Properties { + namespace TTag { -struct FlowOilWaterBrineProblem { - using InheritsFrom = std::tuple; -}; + +struct FlowOilWaterBrineProblem +{ using InheritsFrom = std::tuple; }; + } template -struct EnableBrine { - static constexpr bool value = true; -}; +struct EnableBrine +{ static constexpr bool value = true; }; template -struct Linearizer { - using type = TpfaLinearizer; -}; +struct Linearizer +{ using type = TpfaLinearizer; }; template -struct LocalResidual { - using type = BlackOilLocalResidualTPFA; -}; +struct LocalResidual +{ using type = BlackOilLocalResidualTPFA; }; //! The indices required by the model template @@ -61,7 +59,8 @@ private: using BaseTypeTag = TTag::FlowProblem; using FluidSystem = GetPropType; static constexpr EnergyModules energyModuleType = getPropValue(); - static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal; + static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal ? 1 : 0; + public: using type = BlackOilTwoPhaseIndices(), getPropValue(), @@ -73,7 +72,8 @@ public: /*disabledCompIdx=*/FluidSystem::gasCompIdx, getPropValue()>; }; -}} + +} // namespace Opm::Properties namespace Opm { @@ -99,4 +99,4 @@ int flowOilWaterBrineMainStandalone(int argc, char** argv) return ret; } -} +} // namespace Opm diff --git a/flow/flow_oilwater_polymer.cpp b/flow/flow_oilwater_polymer.cpp index 34a7801666..a296767e41 100644 --- a/flow/flow_oilwater_polymer.cpp +++ b/flow/flow_oilwater_polymer.cpp @@ -25,17 +25,19 @@ #include #include -namespace Opm { -namespace Properties { +namespace Opm::Properties { + namespace TTag { -struct FlowOilWaterPolymerProblem { - using InheritsFrom = std::tuple; -}; + +struct FlowOilWaterPolymerProblem +{ using InheritsFrom = std::tuple; }; + } + template -struct EnablePolymer { - static constexpr bool value = true; -}; +struct EnablePolymer +{ static constexpr bool value = true; }; + //! The indices required by the model template struct Indices @@ -47,7 +49,8 @@ private: using BaseTypeTag = TTag::FlowProblem; using FluidSystem = GetPropType; static constexpr EnergyModules energyModuleType = getPropValue(); - static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal; + static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal ? 1 : 0; + public: using type = BlackOilTwoPhaseIndices(), getPropValue(), @@ -59,7 +62,8 @@ public: /*disabledCompIdx=*/FluidSystem::gasCompIdx, getPropValue()>; }; -}} + +} // namespace Opm::Properties namespace Opm { @@ -85,4 +89,4 @@ int flowOilWaterPolymerMainStandalone(int argc, char** argv) return ret; } -} +} // namespace Opm diff --git a/flow/flow_oilwater_polymer_injectivity.cpp b/flow/flow_oilwater_polymer_injectivity.cpp index 41ac729428..739970bd77 100644 --- a/flow/flow_oilwater_polymer_injectivity.cpp +++ b/flow/flow_oilwater_polymer_injectivity.cpp @@ -25,21 +25,22 @@ #include #include -namespace Opm { -namespace Properties { +namespace Opm::Properties { + namespace TTag { -struct FlowOilWaterPolymerInjectivityProblem { - using InheritsFrom = std::tuple; -}; + +struct FlowOilWaterPolymerInjectivityProblem +{ using InheritsFrom = std::tuple; }; + } + template -struct EnablePolymer { - static constexpr bool value = true; -}; +struct EnablePolymer +{ static constexpr bool value = true; }; + template -struct EnablePolymerMW { - static constexpr bool value = true; -}; +struct EnablePolymerMW +{ static constexpr bool value = true; }; //! The indices required by the model // For this case, there will be two primary variables introduced for the polymer @@ -54,7 +55,8 @@ private: using BaseTypeTag = TTag::FlowProblem; using FluidSystem = GetPropType; static constexpr EnergyModules energyModuleType = getPropValue(); - static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal; + static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal ? 1 : 0; + public: using type = BlackOilTwoPhaseIndices<0, 0, @@ -66,7 +68,8 @@ public: /*disabledCompIdx=*/FluidSystem::gasCompIdx, getPropValue()>; }; -}} + +} // namespace Opm::Properties namespace Opm { @@ -92,4 +95,4 @@ int flowOilWaterPolymerInjectivityMainStandalone(int argc, char** argv) return ret; } -} +} // namespace Opm diff --git a/flow/flow_onephase.cpp b/flow/flow_onephase.cpp index f3ae54b2c0..3539dd690e 100644 --- a/flow/flow_onephase.cpp +++ b/flow/flow_onephase.cpp @@ -25,23 +25,26 @@ #include #include -namespace Opm { -namespace Properties { +namespace Opm::Properties { namespace TTag { -struct FlowWaterOnlyProblem { - using InheritsFrom = std::tuple; -}; + +struct FlowWaterOnlyProblem +{ using InheritsFrom = std::tuple; }; + } template -struct Linearizer { using type = TpfaLinearizer; }; +struct Linearizer +{ using type = TpfaLinearizer; }; template -struct LocalResidual { using type = BlackOilLocalResidualTPFA; }; +struct LocalResidual +{ using type = BlackOilLocalResidualTPFA; }; template -struct EnableDiffusion { static constexpr bool value = false; }; +struct EnableDiffusion +{ static constexpr bool value = false; }; //! The indices required by the model template @@ -54,7 +57,8 @@ private: using BaseTypeTag = TTag::FlowProblem; using FluidSystem = GetPropType; static constexpr EnergyModules energyModuleType = getPropValue(); - static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal; + static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal ? 1 : 0; + public: using type = BlackOilOnePhaseIndices(), getPropValue(), @@ -69,6 +73,8 @@ public: } // namespace Opm::Properties +namespace Opm { + // ----------------- Main program ----------------- int flowWaterOnlyMain(int argc, char** argv, bool outputCout, bool outputFiles) { @@ -91,4 +97,4 @@ int flowWaterOnlyMainStandalone(int argc, char** argv) return ret; } -} +} // namespace Opm diff --git a/flow/flow_onephase_energy.cpp b/flow/flow_onephase_energy.cpp index f9a9844b09..cb80c275dd 100644 --- a/flow/flow_onephase_energy.cpp +++ b/flow/flow_onephase_energy.cpp @@ -26,14 +26,15 @@ #include #include -namespace Opm { -namespace Properties { +namespace Opm::Properties { namespace TTag { -struct FlowWaterOnlyEnergyProblem { - using InheritsFrom = std::tuple; -}; + +struct FlowWaterOnlyEnergyProblem +{ using InheritsFrom = std::tuple; }; + } + template struct EnergyModuleType { static constexpr EnergyModules value = EnergyModules::FullyImplicitThermal; }; @@ -49,7 +50,7 @@ private: using BaseTypeTag = TTag::FlowProblem; using FluidSystem = GetPropType; static constexpr EnergyModules energyModuleType = getPropValue(); - static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal; + static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal ? 1 : 0; public: using type = Opm::BlackOilOnePhaseIndices(), @@ -65,6 +66,8 @@ public: } // namespace Opm::Properties +namespace Opm { + // ----------------- Main program ----------------- int flowWaterOnlyEnergyMain(int argc, char** argv, bool outputCout, bool outputFiles) { @@ -87,4 +90,4 @@ int flowWaterOnlyEnergyMainStandalone(int argc, char** argv) return ret; } -} +} // namespace Opm diff --git a/flow/flow_onephase_tpsa.cpp b/flow/flow_onephase_tpsa.cpp index deae40ba7a..91ed08499d 100644 --- a/flow/flow_onephase_tpsa.cpp +++ b/flow/flow_onephase_tpsa.cpp @@ -30,15 +30,12 @@ #include - namespace Opm::Properties { namespace TTag { struct FlowWaterOnlyProblemTPSA -{ - using InheritsFrom = std::tuple; -}; +{ using InheritsFrom = std::tuple; }; } // namespace Opm::Properties::TTag @@ -67,7 +64,7 @@ private: using BaseTypeTag = TTag::FlowProblem; using FluidSystem = GetPropType; static constexpr EnergyModules energyModuleType = getPropValue(); - static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal; + static constexpr int numEnergyVars = energyModuleType == EnergyModules::FullyImplicitThermal ? 1 : 0; public: using type = BlackOilOnePhaseIndices(), diff --git a/flow/flow_polymer.cpp b/flow/flow_polymer.cpp index 3456b41321..87bbdb91b5 100644 --- a/flow/flow_polymer.cpp +++ b/flow/flow_polymer.cpp @@ -23,18 +23,20 @@ #include #include -namespace Opm { -namespace Properties { +namespace Opm::Properties { + namespace TTag { -struct FlowPolymerProblem { - using InheritsFrom = std::tuple; -}; + +struct FlowPolymerProblem +{ using InheritsFrom = std::tuple; }; + } + template -struct EnablePolymer { - static constexpr bool value = true; -}; -}} +struct EnablePolymer +{ static constexpr bool value = true; }; + +} // namespace Opm::Properties namespace Opm { @@ -60,4 +62,4 @@ int flowPolymerMainStandalone(int argc, char** argv) return ret; } -} +} // namespace Opm diff --git a/flow/flow_solvent.cpp b/flow/flow_solvent.cpp index f331c85446..230fbc56c9 100644 --- a/flow/flow_solvent.cpp +++ b/flow/flow_solvent.cpp @@ -23,18 +23,20 @@ #include #include -namespace Opm { -namespace Properties { +namespace Opm::Properties { + namespace TTag { -struct FlowSolventProblem { - using InheritsFrom = std::tuple; -}; + +struct FlowSolventProblem +{ using InheritsFrom = std::tuple; }; + } + template -struct EnableSolvent { - static constexpr bool value = true; -}; -}} +struct EnableSolvent +{ static constexpr bool value = true; }; + +} // namespace Opm::Properties namespace Opm { @@ -60,4 +62,4 @@ int flowSolventMainStandalone(int argc, char** argv) return ret; } -} +} // namespace Opm diff --git a/flow/flow_solvent_foam.cpp b/flow/flow_solvent_foam.cpp index eadd1b740e..e69e164e3a 100644 --- a/flow/flow_solvent_foam.cpp +++ b/flow/flow_solvent_foam.cpp @@ -23,23 +23,24 @@ #include #include -namespace Opm { -namespace Properties { +namespace Opm::Properties { + namespace TTag { -struct FlowSolventFoamProblem { - using InheritsFrom = std::tuple; -}; + +struct FlowSolventFoamProblem +{ using InheritsFrom = std::tuple; }; + } -template -struct EnableSolvent { - static constexpr bool value = true; -}; template -struct EnableFoam { - static constexpr bool value = true; -}; -}} +struct EnableSolvent +{ static constexpr bool value = true; }; + +template +struct EnableFoam +{ static constexpr bool value = true; }; + +} // namespace Opm::Properties namespace Opm { @@ -65,4 +66,4 @@ int flowSolventFoamMainStandalone(int argc, char** argv) return ret; } -} +} // namespace Opm