Merge pull request #5882 from akva2/outputblackmodule_param_generic

OutputBlackoilModule: move some more code to GenericOutputBlackoilModule
This commit is contained in:
Bård Skaflestad 2025-01-15 10:43:59 +01:00 committed by GitHub
commit fe94ea1100
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 46 additions and 40 deletions

View File

@ -25,15 +25,13 @@
#include <opm/common/OpmLog/OpmLog.hpp>
#include <opm/grid/common/CommunicationUtils.hpp>
#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
#include <opm/material/fluidsystems/BlackOilDefaultIndexTraits.hpp>
#include <opm/material/fluidsystems/GenericOilGasFluidSystem.hpp>
#include <opm/grid/common/CommunicationUtils.hpp>
#include <opm/output/data/Solution.hpp>
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
#include <opm/input/eclipse/EclipseState/Runspec.hpp>
#include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
@ -46,6 +44,10 @@
#include <opm/input/eclipse/Units/Units.hpp>
#include <opm/models/utils/parametersystem.hpp>
#include <opm/output/data/Solution.hpp>
#include <opm/simulators/utils/PressureAverage.hpp>
#include <algorithm>
@ -270,12 +272,29 @@ GenericOutputBlackoilModule(const EclipseState& eclState,
break;
}
}
forceDisableFipOutput_ =
Parameters::Get<Parameters::ForceDisableFluidInPlaceOutput>();
forceDisableFipresvOutput_ =
Parameters::Get<Parameters::ForceDisableResvFluidInPlaceOutput>();
}
template<class FluidSystem>
GenericOutputBlackoilModule<FluidSystem>::
~GenericOutputBlackoilModule() = default;
template<class FluidSystem>
void GenericOutputBlackoilModule<FluidSystem>::
registerParameters()
{
Parameters::Register<Parameters::ForceDisableFluidInPlaceOutput>
("Do not print fluid-in-place values after each report step "
"even if requested by the deck.");
Parameters::Register<Parameters::ForceDisableResvFluidInPlaceOutput>
("Do not print reservoir volumes values after each report step "
"even if requested by the deck.");
}
template<class FluidSystem>
void GenericOutputBlackoilModule<FluidSystem>::
outputTimeStamp(const std::string& lbl,
@ -361,9 +380,9 @@ outputFipAndResvLog(const Inplace& inplace,
const bool substep,
const Parallel::Communication& comm)
{
if (comm.rank() != 0)
if (comm.rank() != 0) {
return;
}
// For report step 0 we use the RPTSOL config, else derive from RPTSCHED
std::unique_ptr<FIPConfig> fipSched;

View File

@ -48,6 +48,13 @@
#include <utility>
#include <vector>
namespace Opm::Parameters {
struct ForceDisableFluidInPlaceOutput { static constexpr bool value = false; };
struct ForceDisableResvFluidInPlaceOutput { static constexpr bool value = false; };
} // namespace Opm::Parameters
namespace Opm {
namespace data { class Solution; }
@ -65,13 +72,20 @@ public:
// Virtual destructor for safer inheritance.
virtual ~GenericOutputBlackoilModule();
Scalar* getPRESSURE_ptr(void) {
return (this->fluidPressure_.data()) ;
};
Scalar* getPRESSURE_ptr()
{
return this->fluidPressure_.data();
}
int getPRESSURE_size( void ) {
return (this->fluidPressure_.size()) ;
};
int getPRESSURE_size()
{
return this->fluidPressure_.size();
}
/*!
* \brief Register all run-time parameters for the Vtk output module.
*/
static void registerParameters();
void outputTimeStamp(const std::string& lbl,
double elapsed,

View File

@ -65,15 +65,7 @@
#include <utility>
#include <vector>
namespace Opm::Parameters {
struct ForceDisableFluidInPlaceOutput { static constexpr bool value = false; };
struct ForceDisableResvFluidInPlaceOutput { static constexpr bool value = false; };
} // namespace Opm::Parameters
namespace Opm
{
namespace Opm {
// forward declaration
template <class TypeTag>
@ -146,12 +138,6 @@ public:
this->setupBlockData(isCartIdxOnThisRank);
this->forceDisableFipOutput_ =
Parameters::Get<Parameters::ForceDisableFluidInPlaceOutput>();
this->forceDisableFipresvOutput_ =
Parameters::Get<Parameters::ForceDisableResvFluidInPlaceOutput>();
if (! Parameters::Get<Parameters::OwnerCellsFirst>()) {
const std::string msg = "The output code does not support --owner-cells-first=false.";
if (collectToIORank.isIORank()) {
@ -176,19 +162,6 @@ public:
}
}
/*!
* \brief Register all run-time parameters for the Vtk output module.
*/
static void registerParameters()
{
Parameters::Register<Parameters::ForceDisableFluidInPlaceOutput>
("Do not print fluid-in-place values after each report step "
"even if requested by the deck.");
Parameters::Register<Parameters::ForceDisableResvFluidInPlaceOutput>
("Do not print reservoir volumes values after each report step "
"even if requested by the deck.");
}
/*!
* \brief Allocate memory for the scalar fields we would like to
* write to ECL output files