move BlackOilConvectiveMixingParam to separate header

This commit is contained in:
Arne Morten Kvarving committed 2026-06-03 09:21:34 +02:00
1 parent 1eecc8eea6
commit c1461845ec
3 files changed
+82 -37

No files matched your search

+1
View File
@@ -716,6 +716,7 @@ list (APPEND PUBLIC_HEADER_FILES
opm/models/blackoil/blackoilbrinemodules.hh
opm/models/blackoil/blackoilbrineparams.hpp
opm/models/blackoil/blackoilconvectivemixingmodule.hh
opm/models/blackoil/blackoilconvectivemixingmoduleparam.hpp
opm/models/blackoil/blackoildarcyfluxmodule.hh
opm/models/blackoil/blackoildiffusionmodule.hh
opm/models/blackoil/blackoildispersionmodule.hh
@@ -36,52 +36,17 @@
#include <opm/material/common/MathToolbox.hpp>
#include <opm/material/common/Valgrind.hpp>
#include <opm/models/common/multiphasebaseproperties.hh>
#include <opm/models/blackoil/blackoilconvectivemixingmoduleparam.hpp>
#include <opm/models/blackoil/blackoilenergymodules.hh>
#include <opm/models/common/multiphasebaseproperties.hh>
#include <opm/models/discretization/common/fvbaseproperties.hh>
#include <opm/common/utility/VectorWithDefaultAllocator.hpp>
#include <opm/common/utility/gpuistl_if_available.hpp>
#include <cstddef>
namespace Opm {
template<class Scalar, template<class> class Storage = Opm::VectorWithDefaultAllocator>
struct ConvectiveMixingModuleParam
{
Storage<bool> active_;
Storage<Scalar> Xhi_;
Storage<Scalar> Psi_;
};
#ifdef HAVE_CUDA
namespace gpuistl
{
template <class Scalar>
ConvectiveMixingModuleParam<Scalar, GpuView> make_view(ConvectiveMixingModuleParam<Scalar, GpuBuffer>& params)
{
ConvectiveMixingModuleParam<Scalar, GpuView> view;
view.active_ = gpuistl::make_view(params.active_);
view.Xhi_ = gpuistl::make_view(params.Xhi_);
view.Psi_ = gpuistl::make_view(params.Psi_);
return view;
}
template <class Scalar>
ConvectiveMixingModuleParam<Scalar, GpuBuffer> copy_to_gpu(const ConvectiveMixingModuleParam<Scalar, Opm::VectorWithDefaultAllocator>& params)
{
return ConvectiveMixingModuleParam<Scalar, GpuBuffer>{
gpuistl::GpuBuffer(params.active_),
gpuistl::GpuBuffer(params.Xhi_),
gpuistl::GpuBuffer(params.Psi_)
};
}
}
#endif
/*!
* \copydoc Opm::BlackOilConvectiveMixingModule
* \brief Provides the convective term in the transport flux for the brine
@@ -0,0 +1,79 @@
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*
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 2 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/>.
Consult the COPYING file in the top-level source directory of this
module for the precise wording of the license and the list of
copyright holders.
*/
/*!
* \file
*
* \brief Classes required for dynamic convective mixing.
*/
#ifndef OPM_CONVECTIVEMIXING_MODULE_PARAM_HPP
#define OPM_CONVECTIVEMIXING_MODULE_PARAM_HPP
#include <opm/common/utility/VectorWithDefaultAllocator.hpp>
#ifdef HAVE_CUDA
#include <opm/simulators/linalg/gpuistl/GpuBuffer.hpp>
#include <opm/simulators/linalg/gpuistl/GpuView.hpp>
#endif
namespace Opm {
template<class Scalar, template<class> class Storage = VectorWithDefaultAllocator>
struct ConvectiveMixingModuleParam
{
Storage<bool> active_;
Storage<Scalar> Xhi_;
Storage<Scalar> Psi_;
};
#ifdef HAVE_CUDA
namespace gpuistl
{
template <class Scalar>
ConvectiveMixingModuleParam<Scalar, GpuView>
make_view(ConvectiveMixingModuleParam<Scalar, GpuBuffer>& params)
{
ConvectiveMixingModuleParam<Scalar, GpuView> view;
view.active_ = gpuistl::make_view(params.active_);
view.Xhi_ = gpuistl::make_view(params.Xhi_);
view.Psi_ = gpuistl::make_view(params.Psi_);
return view;
}
template <class Scalar>
ConvectiveMixingModuleParam<Scalar, GpuBuffer>
copy_to_gpu(const ConvectiveMixingModuleParam<Scalar, VectorWithDefaultAllocator>& params)
{
return ConvectiveMixingModuleParam<Scalar, GpuBuffer>{
gpuistl::GpuBuffer(params.active_),
gpuistl::GpuBuffer(params.Xhi_),
gpuistl::GpuBuffer(params.Psi_)
};
}
}
#endif
}
#endif