Commit 3c8fd3c8 authored by Timo Koch's avatar Timo Koch
Browse files

Merge branch 'feature/mpfa-boundary-flag' into 'master'

Feature/mpfa boundary flag

See merge request !2695
parents ab9389eb c7b8a00c
Pipeline #5683 passed with stage
in 22 seconds
......@@ -419,7 +419,7 @@ private:
scvfs_.emplace_back(MpfaHelper(),
MpfaHelper::getScvfCorners(isPositions, numCorners, c),
is.centerUnitOuterNormal(),
is,
vIdxGlobal,
vIdxLocal,
scvFaceIndices[scvfCounter],
......@@ -509,7 +509,7 @@ private:
// build scvf
neighborScvfs_.emplace_back(MpfaHelper(),
MpfaHelper::getScvfCorners(isPositions, numCorners, c),
is.centerUnitOuterNormal(),
is,
vIdxGlobal,
vIdxLocal,
scvFaceIndices[scvfCounter],
......
......@@ -294,7 +294,7 @@ public:
scvfIndexSet.push_back(scvfIdx);
scvfs_.emplace_back(MpfaHelper(),
MpfaHelper::getScvfCorners(isPositions, numCorners, c),
is.centerUnitOuterNormal(),
is,
vIdxGlobal,
vIdxLocal,
scvfIdx,
......
......@@ -33,6 +33,7 @@
#include <dune/geometry/multilineargeometry.hh>
#include <dumux/common/indextraits.hh>
#include <dumux/common/boundaryflag.hh>
namespace Dumux {
......@@ -81,6 +82,7 @@ struct CCMpfaDefaultScvfGeometryTraits
using Geometry = Dune::MultiLinearGeometry<Scalar, dim-1, dimWorld, ScvfMLGTraits<Scalar> >;
using CornerStorage = typename ScvfMLGTraits<Scalar>::template CornerStorage<dim-1, dimWorld>::Type;
using GlobalPosition = typename CornerStorage::value_type;
using BoundaryFlag = Dumux::BoundaryFlag<Grid>;
};
/*!
......@@ -99,6 +101,7 @@ class CCMpfaSubControlVolumeFace
using CornerStorage = typename T::CornerStorage;
using OutsideGridIndexStorage = typename T::OutsideGridIndexStorage;
using Geometry = typename T::Geometry;
using BoundaryFlag = typename T::BoundaryFlag;
public:
//! export the type used for global coordinates
......@@ -121,6 +124,7 @@ public:
* \param boundary Boolean to specify whether or not the scvf is on a boundary
*/
template<class MpfaHelper>
[[deprecated("Use constructor taking an intersection instead")]]
CCMpfaSubControlVolumeFace(const MpfaHelper& helper,
CornerStorage&& corners,
GlobalPosition&& unitOuterNormal,
......@@ -151,6 +155,39 @@ public:
area_ = helper.computeScvfArea(corners_);
}
//! Construction with given intersection
template<class MpfaHelper, class Intersection>
CCMpfaSubControlVolumeFace(const MpfaHelper& helper,
CornerStorage&& corners,
const Intersection& intersection,
GridIndexType vIdxGlobal,
unsigned int vIdxLocal,
GridIndexType scvfIndex,
GridIndexType insideScvIdx,
const OutsideGridIndexStorage& outsideScvIndices,
Scalar q,
bool boundary)
: boundary_(boundary)
, vertexIndex_(vIdxGlobal)
, scvfIndex_(scvfIndex)
, insideScvIdx_(insideScvIdx)
, outsideScvIndices_(outsideScvIndices)
, vIdxInElement_(vIdxLocal)
, corners_(std::move(corners))
, center_(0.0)
, unitOuterNormal_(intersection.centerUnitOuterNormal())
, boundaryFlag_{intersection}
{
// compute the center of the scvf
for (const auto& corner : corners_)
center_ += corner;
center_ /= corners_.size();
// use helper class to obtain area & integration point
ipGlobal_ = helper.getScvfIntegrationPoint(corners_, q);
area_ = helper.computeScvfArea(corners_);
}
//! The area of the sub control volume face
Scalar area() const
{ return area_; }
......@@ -223,6 +260,10 @@ public:
Geometry geometry() const
{ return Geometry(Dune::GeometryTypes::cube(Geometry::mydimension), corners_); }
//! Return the boundary flag
typename BoundaryFlag::value_type boundaryFlag() const
{ return boundaryFlag_.get(); }
private:
bool boundary_;
GridIndexType vertexIndex_;
......@@ -236,6 +277,7 @@ private:
GlobalPosition ipGlobal_;
GlobalPosition unitOuterNormal_;
Scalar area_;
BoundaryFlag boundaryFlag_;
};
} // end namespace Dumux
......
......@@ -31,6 +31,18 @@ dumux_add_test(NAME test_co2_tpfa
${CMAKE_CURRENT_BINARY_DIR}/test_co2_tpfa-00028.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_co2_tpfa params.input -Problem.Name test_co2_tpfa")
dumux_add_test(NAME test_co2_mpfa
LABELS porousmediumflow co2
TIMEOUT 3600
SOURCES main.cc
COMPILE_DEFINITIONS TYPETAG=HeterogeneousCCMpfa
CMAKE_GUARD "( dune-alugrid_FOUND )"
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/test_co2_mpfa-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_co2_mpfa-00028.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_co2_mpfa params.input -Problem.Name test_co2_mpfa")
dumux_add_test(NAME test_co2_box_parallel
TARGET test_co2_box
LABELS porousmediumflow co2 parallel
......
......@@ -28,6 +28,7 @@
#include <dune/alugrid/grid.hh>
#include <dumux/discretization/cctpfa.hh>
#include <dumux/discretization/ccmpfa.hh>
#include <dumux/discretization/box.hh>
#include <dumux/porousmediumflow/co2/model.hh>
......@@ -51,6 +52,7 @@ namespace TTag {
struct Heterogeneous { using InheritsFrom = std::tuple<TwoPTwoCCO2>; };
struct HeterogeneousBox { using InheritsFrom = std::tuple<Heterogeneous, BoxModel>; };
struct HeterogeneousCCTpfa { using InheritsFrom = std::tuple<Heterogeneous, CCTpfaModel>; };
struct HeterogeneousCCMpfa { using InheritsFrom = std::tuple<Heterogeneous, CCMpfaModel>; };
} // end namespace TTag
//Set the grid type
......@@ -83,6 +85,19 @@ struct FluidSystem<TypeTag, TTag::Heterogeneous>
template<class TypeTag>
struct UseMoles<TypeTag, TTag::Heterogeneous> { static constexpr bool value = false; };
// solution-independent permeability
template<class TypeTag>
struct SolutionDependentAdvection<TypeTag, TTag::Heterogeneous> { static constexpr bool value = false; };
// enable caches
template<class TypeTag>
struct EnableGridGeometryCache<TypeTag, TTag::Heterogeneous> { static constexpr bool value = true; };
template<class TypeTag>
struct EnableGridVolumeVariablesCache<TypeTag, TTag::Heterogeneous> { static constexpr bool value = true; };
// TODO: Test fails using this cache
// template<class TypeTag>
// struct EnableGridFluxVariablesCache<TypeTag, TTag::Heterogeneous> { static constexpr bool value = true; };
#if !ISOTHERMAL
// Create new type tags
namespace TTag {
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment