Commit d74c3f21 authored by Martin Schneider's avatar Martin Schneider
Browse files

[tests][md][ffpm] Add box staggered tests

parent 7e5efcb0
......@@ -2,45 +2,90 @@ add_subdirectory(diffusionlawcomparison)
add_input_file_links()
add_executable(test_md_boundary_darcy1p2c_stokes1p2c EXCLUDE_FROM_ALL main.cc)
add_executable(test_md_boundary_darcy1p2ctpfa_stokes1p2c EXCLUDE_FROM_ALL main.cc)
target_compile_definitions(test_md_boundary_darcy1p2ctpfa_stokes1p2c PUBLIC DARCYTYPETAG=DarcyOnePTwoCTpfa)
dumux_add_test(NAME test_md_boundary_darcy1p2c_stokes1p2c_horizontal
add_executable(test_md_boundary_darcy1p2cbox_stokes1p2c EXCLUDE_FROM_ALL main.cc)
target_compile_definitions(test_md_boundary_darcy1p2cbox_stokes1p2c PUBLIC DARCYTYPETAG=DarcyOnePTwoCBox)
dumux_add_test(NAME test_md_boundary_darcy1p2ctpfa_stokes1p2c_horizontal
LABELS multidomain multidomain_boundary stokesdarcy 1pnc navierstokes
TARGET test_md_boundary_darcy1p2c_stokes1p2c
TARGET test_md_boundary_darcy1p2ctpfa_stokes1p2c
CMAKE_GUARD HAVE_UMFPACK
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy1p2c_stokes1p2c_horizontal_stokes-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy1p2c_stokes1p2c_horizontal_stokes-00020.vtu
${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy1p2c_stokes1p2c_horizontal_darcy-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy1p2c_stokes1p2c_horizontal_darcy-00020.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy1p2c_stokes1p2c params_horizontalflow.input
-Vtk.OutputName test_md_boundary_darcy1p2c_stokes1p2c_horizontal")
dumux_add_test(NAME test_md_boundary_darcy1p2c_stokes1p2c_vertical_diffusion
--files ${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy1p2ctpfa_stokes1p2c_horizontal_stokes-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy1p2ctpfa_stokes1p2c_horizontal_stokes-00020.vtu
${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy1p2ctpfa_stokes1p2c_horizontal_darcy-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy1p2ctpfa_stokes1p2c_horizontal_darcy-00020.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy1p2ctpfa_stokes1p2c params_horizontalflow.input
-Vtk.OutputName test_md_boundary_darcy1p2ctpfa_stokes1p2c_horizontal")
dumux_add_test(NAME test_md_boundary_darcy1p2ctpfa_stokes1p2c_vertical_diffusion
LABELS multidomain multidomain_boundary stokesdarcy 1pnc navierstokes
TARGET test_md_boundary_darcy1p2c_stokes1p2c
TARGET test_md_boundary_darcy1p2ctpfa_stokes1p2c
CMAKE_GUARD HAVE_UMFPACK
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--zeroThreshold {"velocity_liq \(m/s\)":1e-20}
--files ${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy1p2c_stokes1p2c_vertical_diffusion_stokes-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy1p2c_stokes1p2c_vertical_diffusion_stokes-00003.vtu
${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy1p2c_stokes1p2c_vertical_diffusion_darcy-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy1p2c_stokes1p2c_vertical_diffusion_darcy-00003.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy1p2c_stokes1p2c params_verticalflow_diffusion.input
-Vtk.OutputName test_md_boundary_darcy1p2c_stokes1p2c_vertical_diffusion")
dumux_add_test(NAME test_md_boundary_darcy1p2c_stokes1p2c_vertical_advection
--files ${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy1p2ctpfa_stokes1p2c_vertical_diffusion_stokes-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy1p2ctpfa_stokes1p2c_vertical_diffusion_stokes-00003.vtu
${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy1p2ctpfa_stokes1p2c_vertical_diffusion_darcy-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy1p2ctpfa_stokes1p2c_vertical_diffusion_darcy-00003.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy1p2ctpfa_stokes1p2c params_verticalflow_diffusion.input
-Vtk.OutputName test_md_boundary_darcy1p2ctpfa_stokes1p2c_vertical_diffusion")
dumux_add_test(NAME test_md_boundary_darcy1p2ctpfa_stokes1p2c_vertical_advection
LABELS multidomain multidomain_boundary stokesdarcy 1pnc navierstokes
TARGET test_md_boundary_darcy1p2c_stokes1p2c
TARGET test_md_boundary_darcy1p2ctpfa_stokes1p2c
CMAKE_GUARD HAVE_UMFPACK
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--zeroThreshold {"velocity_liq \(m/s\)":1e-15}
--files ${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy1p2c_stokes1p2c_vertical_advection_stokes-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy1p2c_stokes1p2c_vertical_stokes-00030.vtu
${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy1p2c_stokes1p2c_vertical_advection_darcy-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy1p2c_stokes1p2c_vertical_darcy-00030.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy1p2c_stokes1p2c params_verticalflow.input
-Vtk.OutputName test_md_boundary_darcy1p2c_stokes1p2c_vertical")
--files ${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy1p2ctpfa_stokes1p2c_vertical_advection_stokes-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy1p2ctpfa_stokes1p2c_vertical_advection_stokes-00030.vtu
${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy1p2ctpfa_stokes1p2c_vertical_advection_darcy-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy1p2ctpfa_stokes1p2c_vertical_advection_darcy-00030.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy1p2ctpfa_stokes1p2c params_verticalflow.input
-Vtk.OutputName test_md_boundary_darcy1p2ctpfa_stokes1p2c_vertical_advection")
dumux_add_test(NAME test_md_boundary_darcy1p2cbox_stokes1p2c_horizontal
LABELS multidomain multidomain_boundary stokesdarcy 1pnc navierstokes
TARGET test_md_boundary_darcy1p2cbox_stokes1p2c
CMAKE_GUARD HAVE_UMFPACK
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy1p2cbox_stokes1p2c_horizontal_stokes-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy1p2cbox_stokes1p2c_horizontal_stokes-00020.vtu
${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy1p2cbox_stokes1p2c_horizontal_darcy-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy1p2cbox_stokes1p2c_horizontal_darcy-00020.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy1p2cbox_stokes1p2c params_horizontalflow.input
-Vtk.OutputName test_md_boundary_darcy1p2cbox_stokes1p2c_horizontal")
dumux_add_test(NAME test_md_boundary_darcy1p2cbox_stokes1p2c_vertical_diffusion
LABELS multidomain multidomain_boundary stokesdarcy 1pnc navierstokes
TARGET test_md_boundary_darcy1p2cbox_stokes1p2c
CMAKE_GUARD HAVE_UMFPACK
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--zeroThreshold {"velocity_liq \(m/s\)":1e-20}
--files ${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy1p2cbox_stokes1p2c_vertical_diffusion_stokes-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy1p2cbox_stokes1p2c_vertical_diffusion_stokes-00003.vtu
${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy1p2cbox_stokes1p2c_vertical_diffusion_darcy-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy1p2cbox_stokes1p2c_vertical_diffusion_darcy-00003.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy1p2cbox_stokes1p2c params_verticalflow_diffusion.input
-Vtk.OutputName test_md_boundary_darcy1p2cbox_stokes1p2c_vertical_diffusion")
dumux_add_test(NAME test_md_boundary_darcy1p2cbox_stokes1p2c_vertical_advection
LABELS multidomain multidomain_boundary stokesdarcy 1pnc navierstokes
TARGET test_md_boundary_darcy1p2cbox_stokes1p2c
CMAKE_GUARD HAVE_UMFPACK
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--zeroThreshold {"velocity_liq \(m/s\)":1e-15}
--files ${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy1p2cbox_stokes1p2c_vertical_advection_stokes-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy1p2cbox_stokes1p2c_vertical_advection_stokes-00030.vtu
${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy1p2cbox_stokes1p2c_vertical_advection_darcy-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy1p2cbox_stokes1p2c_vertical_advection_darcy-00030.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy1p2cbox_stokes1p2c params_verticalflow.input
-Vtk.OutputName test_md_boundary_darcy1p2cbox_stokes1p2c_vertical_advection")
\ No newline at end of file
......@@ -63,7 +63,7 @@ int main(int argc, char** argv)
// Define the sub problem type tags
using StokesTypeTag = Properties::TTag::StokesOnePTwoC;
using DarcyTypeTag = Properties::TTag::DarcyOnePTwoC;
using DarcyTypeTag = Properties::TTag::DARCYTYPETAG;
// try to create a grid (from the given grid file or the input file)
// for both sub-domains
......
......@@ -112,16 +112,47 @@ public:
}
/*!
* \brief Evaluates the boundary conditions for a Dirichlet control volume.
*
* \param element The element for which the Dirichlet boundary condition is set
* \param scvf The boundary subcontrolvolumeface
* \brief Specifies which kind of boundary condition should be
* used for which equation on a given boundary control volume
* when using the Box method.
*
* \param element The element
* \param scv The boundary sub control volume
*/
BoundaryTypes boundaryTypes(const Element &element, const SubControlVolume &scv) const
{
BoundaryTypes values;
values.setAllNeumann();
auto fvGeometry = localView(this->gridGeometry());
fvGeometry.bindElement(element);
for (auto&& scvf : scvfs(fvGeometry))
{
if (couplingManager().isCoupledEntity(CouplingManager::porousMediumIdx, element, scvf))
values.setAllCouplingNeumann();
}
if (verticalFlow_)
{
if (onLowerBoundary_(scv.dofPosition()))
values.setAllDirichlet();
}
return values;
}
/*!
* \brief Evaluate the boundary conditions for a dirichlet
* control volume.
*
* \param globalPos The position of the center of the finite volume
* for which the dirichlet condition ought to be
* set in global coordinates
*/
PrimaryVariables dirichlet(const Element &element, const SubControlVolumeFace &scvf) const
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
{
PrimaryVariables values(0.0);
values = initial(element);
values = initialAtPos(globalPos);
if (verticalFlow_)
{
......@@ -138,7 +169,7 @@ public:
bottomMoleFraction = 1e-3;
}
if(onLowerBoundary_(scvf.center()))
if(onLowerBoundary_(globalPos))
values[Indices::conti0EqIdx + 1] = bottomMoleFraction;
}
......@@ -165,7 +196,7 @@ public:
{
NumEqVector values(0.0);
if (couplingManager().isCoupledEntity(CouplingManager::porousMediumIdx, scvf))
if (couplingManager().isCoupledEntity(CouplingManager::porousMediumIdx, element, scvf))
values = couplingManager().couplingData().massCouplingCondition(element, fvGeometry, elemVolVars, elemFluxVarsCache, scvf);
return values;
......@@ -196,14 +227,11 @@ public:
// \}
/*!
* \brief Evaluates the initial value for a control volume.
*
* \param element The element
* \brief Evaluate the initial value for a control volume.
*
* For this method, the \a priVars parameter stores primary
* variables.
* \param globalPos The global position
*/
PrimaryVariables initial(const Element &element) const
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
{
PrimaryVariables values(0.0);
values[Indices::pressureIdx] = 1e5;
......
......@@ -27,6 +27,7 @@
#include <dune/grid/yaspgrid.hh>
#include <dumux/discretization/cctpfa.hh>
#include <dumux/discretization/box.hh>
#include <dumux/material/fluidmatrixinteractions/diffusivityconstanttortuosity.hh>
#include <dumux/material/fluidsystems/1padapter.hh>
......@@ -48,7 +49,9 @@ namespace Dumux::Properties {
// Create new type tags
namespace TTag {
struct DarcyOnePTwoC { using InheritsFrom = std::tuple<OnePNC, CCTpfaModel>; };
struct DarcyOnePTwoC { using InheritsFrom = std::tuple<OnePNC>; };
struct DarcyOnePTwoCBox { using InheritsFrom = std::tuple<DarcyOnePTwoC, BoxModel>; };
struct DarcyOnePTwoCTpfa { using InheritsFrom = std::tuple<DarcyOnePTwoC, CCTpfaModel>; };
} // end namespace TTag
// Set the problem property
......@@ -131,12 +134,12 @@ struct ReplaceCompEqIdx<TypeTag, TTag::StokesOnePTwoC> { static constexpr int va
template<class TypeTag>
struct CouplingManager<TypeTag, TTag::StokesOnePTwoC>
{
using Traits = StaggeredMultiDomainTraits<TypeTag, TypeTag, Properties::TTag::DarcyOnePTwoC>;
using Traits = StaggeredMultiDomainTraits<TypeTag, TypeTag, Properties::TTag::DARCYTYPETAG>;
using type = Dumux::StokesDarcyCouplingManager<Traits>;
};
template<class TypeTag>
struct CouplingManager<TypeTag, TTag::DarcyOnePTwoC>
struct CouplingManager<TypeTag, TTag::DARCYTYPETAG>
{
using Traits = StaggeredMultiDomainTraits<Properties::TTag::StokesOnePTwoC, Properties::TTag::StokesOnePTwoC, TypeTag>;
using type = Dumux::StokesDarcyCouplingManager<Traits>;
......
add_input_file_links()
dumux_add_test(NAME test_md_boundary_darcy2p2c_stokes1p2c_horizontal
add_executable(test_md_boundary_darcy2p2ctpfa_stokes1p2c_horizontal EXCLUDE_FROM_ALL main.cc)
target_compile_definitions(test_md_boundary_darcy2p2ctpfa_stokes1p2c_horizontal PUBLIC DARCYTYPETAG=DarcyTwoPTwoCTpfa)
add_executable(test_md_boundary_darcy2p2cnitpfa_stokes1p2cni_horizontal EXCLUDE_FROM_ALL main.cc)
target_compile_definitions(test_md_boundary_darcy2p2cnitpfa_stokes1p2cni_horizontal PUBLIC "DARCYTYPETAG=DarcyTwoPTwoCTpfa" "NONISOTHERMAL=1")
add_executable(test_md_boundary_darcy2p2cbox_stokes1p2c_horizontal EXCLUDE_FROM_ALL main.cc)
target_compile_definitions(test_md_boundary_darcy2p2cbox_stokes1p2c_horizontal PUBLIC DARCYTYPETAG=DarcyTwoPTwoCBox)
add_executable(test_md_boundary_darcy2p2cnibox_stokes1p2cni_horizontal EXCLUDE_FROM_ALL main.cc)
target_compile_definitions(test_md_boundary_darcy2p2cnibox_stokes1p2cni_horizontal PUBLIC "DARCYTYPETAG=DarcyTwoPTwoCBox" "NONISOTHERMAL=1")
dumux_add_test(NAME test_md_boundary_darcy2p2ctpfa_stokes1p2c_horizontal
TARGET test_md_boundary_darcy2p2ctpfa_stokes1p2c_horizontal
LABELS multidomain multidomain_boundary stokesdarcy 2p2c navierstokes
CMAKE_GUARD HAVE_UMFPACK
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy2p2ctpfa_stokes1p2c_horizontal_stokes-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy2p2ctpfa_stokes1p2c_horizontal_stokes-00039.vtu
${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy2p2ctpfa_stokes1p2c_horizontal_darcy-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy2p2ctpfa_stokes1p2c_horizontal_darcy-00039.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy2p2ctpfa_stokes1p2c_horizontal params.input
-Vtk.OutputName test_md_boundary_darcy2p2ctpfa_stokes1p2c_horizontal")
dumux_add_test(NAME test_md_boundary_darcy2p2cnitpfa_stokes1p2cni_horizontal
TARGET test_md_boundary_darcy2p2cnitpfa_stokes1p2cni_horizontal
LABELS multidomain multidomain_boundary stokesdarcy 2p2c navierstokes
SOURCES main.cc
CMAKE_GUARD HAVE_UMFPACK
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy2p2c_stokes1p2c_horizontal_stokes-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy2p2c_stokes1p2c_horizontal_stokes-00039.vtu
${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy2p2c_stokes1p2c_horizontal_darcy-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy2p2c_stokes1p2c_horizontal_darcy-00039.vtu
--files ${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy2p2cnitpfa_stokes1p2cni_horizontal_stokes-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy2p2cnitpfa_stokes1p2cni_horizontal_stokes-00039.vtu
${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy2p2cnitpfa_stokes1p2cni_horizontal_darcy-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy2p2cnitpfa_stokes1p2cni_horizontal_darcy-00039.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy2p2c_stokes1p2c_horizontal params.input
-Vtk.OutputName test_md_boundary_darcy2p2c_stokes1p2c_horizontal")
--command "${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy2p2cnitpfa_stokes1p2cni_horizontal params_nonisothermal.input
-Vtk.OutputName test_md_boundary_darcy2p2cnitpfa_stokes1p2cni_horizontal")
dumux_add_test(NAME test_md_boundary_darcy2p2cni_stokes1p2cni_horizontal
dumux_add_test(NAME test_md_boundary_darcy2p2cbox_stokes1p2c_horizontal
TARGET test_md_boundary_darcy2p2cbox_stokes1p2c_horizontal
LABELS multidomain multidomain_boundary stokesdarcy 2p2c navierstokes
SOURCES main.cc
COMPILE_DEFINITIONS NONISOTHERMAL=1
CMAKE_GUARD HAVE_UMFPACK
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy2p2cni_stokes1p2cni_horizontal_stokes-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy2p2cni_stokes1p2cni_horizontal_stokes-00039.vtu
${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy2p2cni_stokes1p2cni_horizontal_darcy-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy2p2cni_stokes1p2cni_horizontal_darcy-00039.vtu
--files ${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy2p2cbox_stokes1p2c_horizontal_stokes-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy2p2cbox_stokes1p2c_horizontal_stokes-00040.vtu
${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy2p2cbox_stokes1p2c_horizontal_darcy-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy2p2cbox_stokes1p2c_horizontal_darcy-00040.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy2p2cbox_stokes1p2c_horizontal params.input
-Vtk.OutputName test_md_boundary_darcy2p2cbox_stokes1p2c_horizontal")
--command "${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy2p2cni_stokes1p2cni_horizontal params_nonisothermal.input
-Vtk.OutputName test_md_boundary_darcy2p2cni_stokes1p2cni_horizontal")
dumux_add_test(NAME test_md_boundary_darcy2p2cnibox_stokes1p2cni_horizontal
TARGET test_md_boundary_darcy2p2cnibox_stokes1p2cni_horizontal
LABELS multidomain multidomain_boundary stokesdarcy 2p2c navierstokes
CMAKE_GUARD HAVE_UMFPACK
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy2p2cnibox_stokes1p2cni_horizontal_stokes-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy2p2cnibox_stokes1p2cni_horizontal_stokes-00044.vtu
${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy2p2cnibox_stokes1p2cni_horizontal_darcy-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy2p2cnibox_stokes1p2cni_horizontal_darcy-00044.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy2p2cnibox_stokes1p2cni_horizontal params_nonisothermal.input
-Vtk.OutputName test_md_boundary_darcy2p2cnibox_stokes1p2cni_horizontal")
\ No newline at end of file
......@@ -65,7 +65,7 @@ int main(int argc, char** argv)
// Define the sub problem type tags
using StokesTypeTag = Properties::TTag::StokesOnePTwoC;
using DarcyTypeTag = Properties::TTag::DarcyTwoPTwoC;
using DarcyTypeTag = Properties::TTag::DARCYTYPETAG;
// try to create a grid (from the given grid file or the input file)
// for both sub-domains
......
......@@ -162,17 +162,41 @@ public:
}
/*!
* \brief Evaluates the boundary conditions for a Dirichlet control volume.
*
* \param element The element for which the Dirichlet boundary condition is set
* \param scvf The boundary sub control volume face
* \brief Specifies which kind of boundary condition should be
* used for which equation on a given boundary control volume
* when using the Box method.
*
* \param element The element
* \param scv The boundary sub control volume
*/
BoundaryTypes boundaryTypes(const Element &element, const SubControlVolume &scv) const
{
BoundaryTypes values;
values.setAllNeumann();
auto fvGeometry = localView(this->gridGeometry());
fvGeometry.bindElement(element);
for (auto&& scvf : scvfs(fvGeometry))
{
if (couplingManager().isCoupledEntity(CouplingManager::porousMediumIdx, element, scvf))
values.setAllCouplingNeumann();
}
return values;
}
/*!
* \brief Evaluate the boundary conditions for a dirichlet
* control volume.
*
* For this method, the \a values parameter stores primary variables.
* \param globalPos The position of the center of the finite volume
* for which the dirichlet condition ought to be
* set in global coordinates
*/
PrimaryVariables dirichlet(const Element &element, const SubControlVolumeFace &scvf) const
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
{
PrimaryVariables values(0.0);
values = initialAtPos(scvf.center());
values = initialAtPos(globalPos);
return values;
}
......@@ -194,7 +218,7 @@ public:
{
NumEqVector values(0.0);
if (couplingManager().isCoupledEntity(CouplingManager::porousMediumIdx, scvf))
if (couplingManager().isCoupledEntity(CouplingManager::porousMediumIdx, element, scvf))
{
#if !NONISOTHERMAL
values = couplingManager().couplingData().massCouplingCondition(element, fvGeometry, elemVolVars, elemFluxVarsCache, scvf, diffCoeffAvgType_);
......@@ -204,7 +228,7 @@ public:
for(int i = 0; i< massFlux.size(); ++i)
values[i] = massFlux[i];
values[Indices::energyEqIdx] = couplingManager().couplingData().energyCouplingCondition(element, fvGeometry, elemVolVars, scvf, diffCoeffAvgType_);
values[Indices::energyEqIdx] = couplingManager().couplingData().energyCouplingCondition(element, fvGeometry, elemVolVars, elemFluxVarsCache, scvf, diffCoeffAvgType_);
#endif
}
......
......@@ -28,6 +28,7 @@
#include <dune/grid/yaspgrid.hh>
#include <dumux/discretization/cctpfa.hh>
#include <dumux/discretization/box.hh>
#include <dumux/discretization/staggered/freeflow/properties.hh>
#include <dumux/material/fluidsystems/h2oair.hh>
......@@ -48,9 +49,13 @@ namespace Dumux::Properties {
// Create new type tags
namespace TTag {
#if !NONISOTHERMAL
struct DarcyTwoPTwoC { using InheritsFrom = std::tuple<TwoPTwoC, CCTpfaModel>; };
struct DarcyTwoPTwoC { using InheritsFrom = std::tuple<TwoPTwoC>; };
struct DarcyTwoPTwoCTpfa { using InheritsFrom = std::tuple<DarcyTwoPTwoC, CCTpfaModel>; };
struct DarcyTwoPTwoCBox { using InheritsFrom = std::tuple<DarcyTwoPTwoC, BoxModel>; };
#else
struct DarcyTwoPTwoC { using InheritsFrom = std::tuple<TwoPTwoCNI, CCTpfaModel>; };
struct DarcyTwoPTwoC { using InheritsFrom = std::tuple<TwoPTwoCNI>; };
struct DarcyTwoPTwoCTpfa { using InheritsFrom = std::tuple<DarcyTwoPTwoC, CCTpfaModel>; };
struct DarcyTwoPTwoCBox { using InheritsFrom = std::tuple<DarcyTwoPTwoC, BoxModel>; };
#endif
} // end namespace TTag
......@@ -130,12 +135,12 @@ struct EnableGridVolumeVariablesCache<TypeTag, TTag::StokesOnePTwoC> { static co
template<class TypeTag>
struct CouplingManager<TypeTag, TTag::StokesOnePTwoC>
{
using Traits = StaggeredMultiDomainTraits<TypeTag, TypeTag, Properties::TTag::DarcyTwoPTwoC>;
using Traits = StaggeredMultiDomainTraits<TypeTag, TypeTag, Properties::TTag::DARCYTYPETAG>;
using type = Dumux::StokesDarcyCouplingManager<Traits>;
};
template<class TypeTag>
struct CouplingManager<TypeTag, TTag::DarcyTwoPTwoC>
struct CouplingManager<TypeTag, TTag::DARCYTYPETAG>
{
using Traits = StaggeredMultiDomainTraits<Properties::TTag::StokesOnePTwoC, Properties::TTag::StokesOnePTwoC, TypeTag>;
using type = Dumux::StokesDarcyCouplingManager<Traits>;
......
......@@ -167,7 +167,7 @@ int main(int argc, char** argv)
// Define the sub problem type tags
using FreeFlowTypeTag = Properties::TTag::FreeFlowOneP;
using DarcyTypeTag = Properties::TTag::DarcyOneP;
using DarcyTypeTag = Properties::TTag::DARCYTYPETAG;
// try to create a grid (from the given grid file or the input file)
// for both sub-domains
......@@ -292,7 +292,7 @@ int main(int argc, char** argv)
freeFlowVtkWriter.write(1.0);
darcyVtkWriter.write(1.0);
printFreeFlowL2Error(*freeFlowProblem, freeFlowSol);
printFreeFlowL2Error(freeFlowProblem, freeFlowSol);
printDarcyL2Error(*darcyProblem, sol[porousMediumIdx]);
////////////////////////////////////////////////////////////
......
......@@ -46,39 +46,6 @@ namespace Dumux {
template <class TypeTag>
class DarcySubProblem;
namespace Properties {
// Create new type tags
namespace TTag {
struct DarcyOneP { using InheritsFrom = std::tuple<OneP>; };
struct DarcyOnePBox { using InheritsFrom = std::tuple<DarcyOneP, BoxModel>; };
struct DarcyOnePCC { using InheritsFrom = std::tuple<DarcyOneP, CCTpfaModel>; };
} // end namespace TTag
// Set the problem property
template<class TypeTag>
struct Problem<TypeTag, TTag::DarcyOneP> { using type = Dumux::DarcySubProblem<TypeTag>; };
// the fluid system
template<class TypeTag>
struct FluidSystem<TypeTag, TTag::DarcyOneP>
{
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using type = FluidSystems::OnePLiquid<Scalar, Dumux::Components::Constant<1, Scalar> > ;
};
// Set the grid type
template<class TypeTag>
struct Grid<TypeTag, TTag::DarcyOneP> { using type = Dune::YaspGrid<2>; };
template<class TypeTag>
struct SpatialParams<TypeTag, TTag::DarcyOneP>
{
using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using type = ConvergenceTestSpatialParams<GridGeometry, Scalar>;
};
} // end namespace Properties
/*!
* \ingroup BoundaryTests
* \brief The Darcy sub-problem of coupled Stokes-Darcy convergence test
......
......@@ -27,6 +27,7 @@
#include <dune/grid/yaspgrid.hh>
#include <dumux/discretization/cctpfa.hh>
#include <dumux/discretization/box.hh>
#include <dumux/material/components/constant.hh>
#include <dumux/material/fluidsystems/1pliquid.hh>
......
add_input_file_links()
dumux_add_test(NAME test_md_boundary_darcy2p_stokes1p_vertical
add_executable(test_md_boundary_pm2ptpfa_ff1p_vertical EXCLUDE_FROM_ALL main.cc)
target_compile_definitions(test_md_boundary_pm2ptpfa_ff1p_vertical PUBLIC DARCYTYPETAG=DarcyTwoPCC)
add_executable(test_md_boundary_pm2pbox_ff1p_vertical EXCLUDE_FROM_ALL main.cc)
target_compile_definitions(test_md_boundary_pm2pbox_ff1p_vertical PUBLIC DARCYTYPETAG=DarcyTwoPBox)
dumux_add_test(NAME test_md_boundary_darcy2ptpfa_stokes1p_vertical
TARGET test_md_boundary_pm2ptpfa_ff1p_vertical
LABELS multidomain multidomain_boundary stokesdarcy 1p navierstokes
SOURCES main.cc
CMAKE_GUARD HAVE_UMFPACK
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy2p_stokes1p_vertical_stokes-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy2p_stokes1p_vertical_stokes-00024.vtu
${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy2p_stokes1p_vertical_darcy-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy2p_stokes1p_vertical_darcy-00024.vtu
--files ${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy2ptpfa_stokes1p_vertical_stokes-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy2ptpfa_stokes1p_vertical_stokes-00024.vtu
${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy2ptpfa_stokes1p_vertical_darcy-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy2ptpfa_stokes1p_vertical_darcy-00024.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy2p_stokes1p_vertical params.input
-Vtk.OutputName test_md_boundary_darcy2p_stokes1p_vertical"
--command "${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_pm2ptpfa_ff1p_vertical params.input
-Vtk.OutputName test_md_boundary_darcy2ptpfa_stokes1p_vertical"
--zeroThreshold {"velocity_liq \(m/s\)_0":1e-14,"velocity_gas \(m/s\)":1e-15})
dumux_add_test(NAME test_md_boundary_darcy2pbox_stokes1p_vertical
TARGET test_md_boundary_pm2pbox_ff1p_vertical
LABELS multidomain multidomain_boundary stokesdarcy 1p navierstokes
CMAKE_GUARD HAVE_UMFPACK
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy2pbox_stokes1p_vertical_stokes-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy2pbox_stokes1p_vertical_stokes-00024.vtu
${CMAKE_SOURCE_DIR}/test/references/test_md_boundary_darcy2pbox_stokes1p_vertical_darcy-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_darcy2pbox_stokes1p_vertical_darcy-00024.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_md_boundary_pm2pbox_ff1p_vertical params.input
-Vtk.OutputName test_md_boundary_darcy2pbox_stokes1p_vertical"
--zeroThreshold {"velocity_liq \(m/s\)_0":1e-14,"velocity_gas \(m/s\)":1e-15})
\ No newline at end of file
......@@ -62,7 +62,7 @@ int main(int argc, char** argv)
// Define the sub problem type tags
using StokesTypeTag = Properties::TTag::StokesOneP;
using DarcyTypeTag = Properties::TTag::DarcyTwoP;
using DarcyTypeTag = Properties::TTag::DARCYTYPETAG;
// try to create a grid (from the given grid file or the input file)
// for both sub-domains
......