mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-07-04 11:33:06 -05:00
Merge pull request #5455 from akva2/fvbasediscretization_param_split
Adjust to to changes in fvbaseproperties.hh (moving of parameters to Opm::Parmeters namespace)
This commit is contained in:
commit
9f8075e8a0
|
@ -176,21 +176,6 @@ struct NewtonMaxIterations<TypeTag, TTag::FlowExpTypeTag> {
|
|||
static constexpr int value = 8;
|
||||
};
|
||||
|
||||
// if openMP is available, set the default the number of threads per process for the main
|
||||
// simulation to 2 (instead of grabbing everything that is available).
|
||||
#if _OPENMP
|
||||
template<class TypeTag>
|
||||
struct ThreadsPerProcess<TypeTag, TTag::FlowExpTypeTag> {
|
||||
static constexpr int value = 2;
|
||||
};
|
||||
#endif
|
||||
|
||||
// By default, flowexp accepts the result of the time integration unconditionally if the
|
||||
// smallest time step size is reached.
|
||||
template<class TypeTag>
|
||||
struct ContinueOnConvergenceError<TypeTag, TTag::FlowExpTypeTag> {
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct LinearSolverBackend<TypeTag, TTag::FlowExpTypeTag> {
|
||||
using type = ISTLSolver<TypeTag>;
|
||||
|
@ -198,6 +183,24 @@ struct LinearSolverBackend<TypeTag, TTag::FlowExpTypeTag> {
|
|||
|
||||
} // namespace Opm::Properties
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
// if openMP is available, set the default the number of threads per process for the main
|
||||
// simulation to 2 (instead of grabbing everything that is available).
|
||||
#if _OPENMP
|
||||
template<class TypeTag>
|
||||
struct ThreadsPerProcess<TypeTag, Properties::TTag::FlowExpTypeTag>
|
||||
{ static constexpr int value = 2; };
|
||||
#endif
|
||||
|
||||
// By default, flowexp accepts the result of the time integration unconditionally if the
|
||||
// smallest time step size is reached.
|
||||
template<class TypeTag>
|
||||
struct ContinueOnConvergenceError<TypeTag, Properties::TTag::FlowExpTypeTag>
|
||||
{ static constexpr bool value = true; };
|
||||
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
namespace Opm {
|
||||
template <class TypeTag>
|
||||
class FlowExpProblem : public FlowProblem<TypeTag> //, public FvBaseProblem<TypeTag>
|
||||
|
|
|
@ -54,18 +54,6 @@ struct Problem<TypeTag, TTag::FlowExpProblemBlackOil>
|
|||
using type = FlowExpProblem<TypeTag>;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct ThreadsPerProcess<TypeTag, TTag::FlowExpProblemBlackOil>
|
||||
{
|
||||
static constexpr int value = 1;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct ContinueOnConvergenceError<TypeTag, TTag::FlowExpProblemBlackOil>
|
||||
{
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
|
||||
template<class TypeTag>
|
||||
struct EclNewtonSumTolerance<TypeTag, TTag::FlowExpProblemBlackOil>
|
||||
{
|
||||
|
@ -117,6 +105,18 @@ struct Simulator<TypeTag, TTag::FlowExpProblemBlackOil>
|
|||
|
||||
}
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
template<class TypeTag>
|
||||
struct ThreadsPerProcess<TypeTag, Properties::TTag::FlowExpProblemBlackOil>
|
||||
{ static constexpr int value = 1; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct ContinueOnConvergenceError<TypeTag, Properties::TTag::FlowExpProblemBlackOil>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
using TypeTag = Opm::Properties::TTag::FlowExpProblemBlackOil;
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
#ifndef OPM_AQUIFERANALYTICAL_HEADER_INCLUDED
|
||||
#define OPM_AQUIFERANALYTICAL_HEADER_INCLUDED
|
||||
|
||||
#include <dune/grid/common/partitionset.hh>
|
||||
|
||||
#include <opm/common/ErrorMacros.hpp>
|
||||
|
||||
#include <opm/input/eclipse/EclipseState/Aquifer/Aquancon.hpp>
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
#ifndef OPM_AQUIFERNUMERICAL_HEADER_INCLUDED
|
||||
#define OPM_AQUIFERNUMERICAL_HEADER_INCLUDED
|
||||
|
||||
#include <dune/grid/common/partitionset.hh>
|
||||
|
||||
#include <opm/input/eclipse/EclipseState/Aquifer/NumericalAquifer/SingleNumericalAquifer.hpp>
|
||||
|
||||
#include <opm/material/common/MathToolbox.hpp>
|
||||
|
|
|
@ -80,10 +80,6 @@ struct FlowProblem {
|
|||
};
|
||||
}
|
||||
template<class TypeTag>
|
||||
struct OutputDir<TypeTag, TTag::FlowProblem> {
|
||||
static constexpr auto value = "";
|
||||
};
|
||||
template<class TypeTag>
|
||||
struct EnableDebuggingChecks<TypeTag, TTag::FlowProblem> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
|
@ -152,6 +148,14 @@ struct LinearSolverSplice<TypeTag, TTag::FlowProblem> {
|
|||
|
||||
} // namespace Opm::Properties
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
template<class TypeTag>
|
||||
struct OutputDir<TypeTag, Properties::TTag::FlowProblem>
|
||||
{ static constexpr auto value = ""; };
|
||||
|
||||
}
|
||||
|
||||
namespace Opm {
|
||||
|
||||
/// A model implementation for three-phase black oil.
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#ifndef OPM_BLACKOILMODELPARAMETERS_HEADER_INCLUDED
|
||||
#define OPM_BLACKOILMODELPARAMETERS_HEADER_INCLUDED
|
||||
|
||||
#include <opm/models/discretization/common/fvbaseparameters.hh>
|
||||
#include <opm/models/discretization/common/fvbaseproperties.hh>
|
||||
|
||||
#include <opm/models/utils/basicproperties.hh>
|
||||
|
@ -467,15 +468,21 @@ template<class TypeTag>
|
|||
struct LocalDomainsOrderingMeasure<TypeTag, TTag::FlowModelParameters> {
|
||||
static constexpr auto value = "maxpressure";
|
||||
};
|
||||
|
||||
} // namespace Opm::Properties
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
// if openMP is available, determine the number threads per process automatically.
|
||||
#if _OPENMP
|
||||
template<class TypeTag>
|
||||
struct ThreadsPerProcess<TypeTag, TTag::FlowModelParameters> {
|
||||
struct ThreadsPerProcess<TypeTag, Properties::TTag::FlowModelParameters>
|
||||
{
|
||||
static constexpr int value = -1;
|
||||
};
|
||||
#endif
|
||||
|
||||
} // namespace Opm::Properties
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
|
|
|
@ -530,7 +530,7 @@ protected:
|
|||
{
|
||||
asImp_().createGrids_();
|
||||
asImp_().filterConnections_();
|
||||
std::string outputDir = Parameters::get<TypeTag, Properties::OutputDir>();
|
||||
std::string outputDir = Parameters::get<TypeTag, Parameters::OutputDir>();
|
||||
bool enableEclCompatFile = !Parameters::get<TypeTag, Properties::EnableOpmRstFile>();
|
||||
asImp_().updateOutputDir_(outputDir, enableEclCompatFile);
|
||||
asImp_().finalizeInit_();
|
||||
|
|
|
@ -129,25 +129,25 @@ namespace Opm {
|
|||
|
||||
// hide the parameters unused by flow. TODO: this is a pain to maintain
|
||||
Parameters::hideParam<TypeTag, Properties::EnableGravity>();
|
||||
Parameters::hideParam<TypeTag, Properties::EnableGridAdaptation>();
|
||||
Parameters::hideParam<TypeTag, Parameters::EnableGridAdaptation>();
|
||||
|
||||
// this parameter is actually used in eWoms, but the flow well model
|
||||
// hard-codes the assumption that the intensive quantities cache is enabled,
|
||||
// so flow crashes. Let's hide the parameter for that reason.
|
||||
Parameters::hideParam<TypeTag, Properties::EnableIntensiveQuantityCache>();
|
||||
Parameters::hideParam<TypeTag, Parameters::EnableIntensiveQuantityCache>();
|
||||
|
||||
// thermodynamic hints are not implemented/required by the eWoms blackoil
|
||||
// model
|
||||
Parameters::hideParam<TypeTag, Properties::EnableThermodynamicHints>();
|
||||
Parameters::hideParam<TypeTag, Parameters::EnableThermodynamicHints>();
|
||||
|
||||
// in flow only the deck file determines the end time of the simulation
|
||||
Parameters::hideParam<TypeTag, Properties::EndTime>();
|
||||
|
||||
// time stepping is not done by the eWoms code in flow
|
||||
Parameters::hideParam<TypeTag, Properties::InitialTimeStepSize>();
|
||||
Parameters::hideParam<TypeTag, Properties::MaxTimeStepDivisions>();
|
||||
Parameters::hideParam<TypeTag, Properties::MaxTimeStepSize>();
|
||||
Parameters::hideParam<TypeTag, Properties::MinTimeStepSize>();
|
||||
Parameters::hideParam<TypeTag, Parameters::MaxTimeStepDivisions>();
|
||||
Parameters::hideParam<TypeTag, Parameters::MaxTimeStepSize>();
|
||||
Parameters::hideParam<TypeTag, Parameters::MinTimeStepSize>();
|
||||
Parameters::hideParam<TypeTag, Properties::PredeterminedTimeStepsFile>();
|
||||
|
||||
// flow also does not use the eWoms Newton method
|
||||
|
@ -388,7 +388,7 @@ namespace Opm {
|
|||
if (!getenv("OMP_NUM_THREADS"))
|
||||
{
|
||||
int threads = 2;
|
||||
const int requested_threads = Parameters::get<TypeTag, Properties::ThreadsPerProcess>();
|
||||
const int requested_threads = Parameters::get<TypeTag, Parameters::ThreadsPerProcess>();
|
||||
if (requested_threads > 0)
|
||||
threads = requested_threads;
|
||||
|
||||
|
|
|
@ -297,12 +297,6 @@ struct NewtonTolerance<TypeTag, TTag::FlowBaseProblem> {
|
|||
static constexpr type value = 1e-2;
|
||||
};
|
||||
|
||||
// Disable the VTK output by default for this problem ...
|
||||
template<class TypeTag>
|
||||
struct EnableVtkOutput<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
|
||||
// ... but enable the ECL output by default
|
||||
template<class TypeTag>
|
||||
struct EnableEclOutput<TypeTag,TTag::FlowBaseProblem> {
|
||||
|
@ -404,25 +398,6 @@ struct EclOutputDoublePrecision<TypeTag, TTag::FlowBaseProblem> {
|
|||
static constexpr bool value = false;
|
||||
};
|
||||
|
||||
// The default location for the ECL output files
|
||||
template<class TypeTag>
|
||||
struct OutputDir<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr auto value = ".";
|
||||
};
|
||||
|
||||
// the cache for intensive quantities can be used for ECL problems and also yields a
|
||||
// decent speedup...
|
||||
template<class TypeTag>
|
||||
struct EnableIntensiveQuantityCache<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
|
||||
// the cache for the storage term can also be used and also yields a decent speedup
|
||||
template<class TypeTag>
|
||||
struct EnableStorageCache<TypeTag, TTag::FlowBaseProblem> {
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
|
||||
// Use the "velocity module" which uses the Eclipse "NEWTRAN" transmissibilities
|
||||
template<class TypeTag>
|
||||
struct FluxModule<TypeTag, TTag::FlowBaseProblem> {
|
||||
|
@ -523,4 +498,29 @@ struct ExplicitRockCompaction<TypeTag, TTag::FlowBaseProblem> {
|
|||
|
||||
} // namespace Opm::Properties
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
// The default location for the ECL output files
|
||||
template<class TypeTag>
|
||||
struct OutputDir<TypeTag, Properties::TTag::FlowBaseProblem>
|
||||
{ static constexpr auto value = "."; };
|
||||
|
||||
// Disable the VTK output by default for this problem ...
|
||||
template<class TypeTag>
|
||||
struct EnableVtkOutput<TypeTag, Properties::TTag::FlowBaseProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
// the cache for intensive quantities can be used for ECL problems and also yields a
|
||||
// decent speedup...
|
||||
template<class TypeTag>
|
||||
struct EnableIntensiveQuantityCache<TypeTag, Properties::TTag::FlowBaseProblem>
|
||||
{ static constexpr bool value = true; };
|
||||
|
||||
// the cache for the storage term can also be used and also yields a decent speedup
|
||||
template<class TypeTag>
|
||||
struct EnableStorageCache<TypeTag, Properties::TTag::FlowBaseProblem>
|
||||
{ static constexpr bool value = true; };
|
||||
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
#endif // OPM_FLOW_PROBLEM_PROPERTIES_HPP
|
||||
|
|
|
@ -336,7 +336,7 @@ private:
|
|||
}
|
||||
else {
|
||||
deckFilename = Parameters::get<PreTypeTag, Properties::EclDeckFileName>();
|
||||
outputDir = Parameters::get<PreTypeTag, Properties::OutputDir>();
|
||||
outputDir = Parameters::get<PreTypeTag, Parameters::OutputDir>();
|
||||
}
|
||||
|
||||
#if HAVE_DAMARIS
|
||||
|
@ -719,7 +719,7 @@ private:
|
|||
else {
|
||||
threads = 2;
|
||||
|
||||
const int input_threads = Parameters::get<TypeTag, Properties::ThreadsPerProcess>();
|
||||
const int input_threads = Parameters::get<TypeTag, Parameters::ThreadsPerProcess>();
|
||||
|
||||
if (input_threads > 0)
|
||||
threads = input_threads;
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include <dune/common/fvector.hh>
|
||||
|
||||
#include <opm/models/blackoil/blackoilproperties.hh>
|
||||
#include <opm/models/discretization/common/fvbaseparameters.hh>
|
||||
#include <opm/models/io/baseoutputmodule.hh>
|
||||
#include <opm/models/io/vtkmultiwriter.hh>
|
||||
#include <opm/models/utils/parametersystem.hh>
|
||||
|
@ -126,7 +127,7 @@ namespace Opm {
|
|||
*/
|
||||
void processElement(const ElementContext& elemCtx)
|
||||
{
|
||||
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
|
||||
if (!Parameters::get<TypeTag, Parameters::EnableVtkOutput>())
|
||||
return;
|
||||
|
||||
if (eclTracerConcentrationOutput_()) {
|
||||
|
@ -172,9 +173,6 @@ namespace Opm {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -184,10 +182,10 @@ namespace Opm {
|
|||
return val;
|
||||
}
|
||||
|
||||
|
||||
std::vector<ScalarBuffer> eclFreeTracerConcentration_;
|
||||
std::vector<ScalarBuffer> eclSolTracerConcentration_;
|
||||
};
|
||||
|
||||
} // namespace Opm
|
||||
|
||||
#endif // OPM_VTK_TRACER_MODULE_HPP
|
||||
|
|
|
@ -126,22 +126,24 @@ struct NewtonMaxIterations<TypeTag, TTag::TestTypeTag> {
|
|||
static constexpr int value = 8;
|
||||
};
|
||||
|
||||
} // namespace Opm::Properties
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
// if openMP is available, set the default the number of threads per process for the main
|
||||
// simulation to 2 (instead of grabbing everything that is available).
|
||||
#if _OPENMP
|
||||
template<class TypeTag>
|
||||
struct ThreadsPerProcess<TypeTag, TTag::TestTypeTag> {
|
||||
static constexpr int value = 2;
|
||||
};
|
||||
struct ThreadsPerProcess<TypeTag, Properties::TTag::TestTypeTag>
|
||||
{ static constexpr int value = 2; };
|
||||
#endif
|
||||
|
||||
// By default, ebos accepts the result of the time integration unconditionally if the
|
||||
// smallest time step size is reached.
|
||||
template<class TypeTag>
|
||||
struct ContinueOnConvergenceError<TypeTag, TTag::TestTypeTag> {
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
struct ContinueOnConvergenceError<TypeTag, Properties::TTag::TestTypeTag>
|
||||
{ static constexpr bool value = true; };
|
||||
|
||||
} // namespace Opm::Properties
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
#endif // OPM_TEST_TYPETAG_HPP
|
||||
|
|
Loading…
Reference in New Issue
Block a user