Commit e2b2e77d authored by Timo Koch's avatar Timo Koch
Browse files

[test][1p] Add fracture 2din3d test for 1p model box/cc

parent 5f0cd2af
......@@ -77,12 +77,12 @@ add_dumux_test(test_box1p1d3d test_box1p1d3d test_box1p1d3d.cc
${CMAKE_CURRENT_BINARY_DIR}/1ptestbox1d3d-00001.vtp
--command "${CMAKE_CURRENT_BINARY_DIR}/test_box1p1d3d")
add_dumux_test(test_box1p2d3d test_box1p2d3d test_box1p2d3d.cc
add_dumux_test(test_box1pfracture2d3d test_box1pfracture2d3d test_box1pfracture2d3d.cc
python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
--script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/1ptestbox2d3d-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/1ptestbox2d3d-00001.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_box1p2d3d")
--files ${CMAKE_SOURCE_DIR}/test/references/1pboxfracture2d3d-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/1pboxfracture2d3d-00001.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_box1pfracture2d3d")
add_dumux_test(test_cc1p1d3d test_cc1p1d3d test_cc1p1d3d.cc
python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
......@@ -91,12 +91,12 @@ add_dumux_test(test_cc1p1d3d test_cc1p1d3d test_cc1p1d3d.cc
${CMAKE_CURRENT_BINARY_DIR}/1ptestcc1d3d-00001.vtp
--command "${CMAKE_CURRENT_BINARY_DIR}/test_cc1p1d3d")
add_dumux_test(test_cc1p2d3d test_cc1p2d3d test_cc1p2d3d.cc
add_dumux_test(test_cc1pfracture2d3d test_cc1pfracture2d3d test_cc1pfracture2d3d.cc
python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
--script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/1ptestcc2d3d-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/1ptestcc2d3d-00001.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_cc1p2d3d")
--files ${CMAKE_SOURCE_DIR}/test/references/1pccfracture2d3d-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/1pccfracture2d3d-00001.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_cc1pfracture2d3d")
#install sources
......@@ -106,14 +106,14 @@ install(FILES
1pnispatialparams.hh
1ptestproblem.hh
1ptestspatialparams.hh
test_box1p1d3d.cc
test_box1p2d3d.cc
1pboxfracture2d3d.cc
1pboxnetwork1d3d.cc
test_box1p.cc
test_box1pniconduction.cc
test_box1pniconvection.cc
test_box1pwithamg.cc
test_cc1p1d3d.cc
test_cc1p2d3d.cc
test_cc1pfracture2d3d.cc
test_cc1pnetwork1d3d.cc
test_cc1p.cc
test_cc1pniconduction.cc
test_cc1pniconvection.cc
......
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*****************************************************************************
* See the file COPYING for full copying permissions. *
* *
* This program 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. *
* *
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
/*!
* \file
*
* \brief A discrete fracture network embedded in an impermeable matrix.
* The fracture is a 2D network embedded in 3D.
*/
#ifndef DUMUX_ONEP_FRACTURE_TEST_PROBLEM_HH
#define DUMUX_ONEP_FRACTURE_TEST_PROBLEM_HH
#include <dumux/material/components/simpleh2o.hh>
#include <dumux/porousmediumflow/1p/implicit/model.hh>
#include <dumux/porousmediumflow/implicit/problem.hh>
#include <dumux/implicit/cellcentered/tpfa/properties.hh>
#include <dumux/implicit/cellcentered/propertydefaults.hh>
#include "fracturespatialparams.hh"
namespace Dumux
{
template <class TypeTag>
class FractureProblem;
namespace Properties
{
NEW_TYPE_TAG(FractureProblem, INHERITS_FROM(OneP, FractureSpatialParams));
NEW_TYPE_TAG(FractureBoxProblem, INHERITS_FROM(BoxModel, FractureProblem));
NEW_TYPE_TAG(FractureCCProblem, INHERITS_FROM(CCTpfaModel, FractureProblem));
NEW_TYPE_TAG(FractureCCMpfaProblem, INHERITS_FROM(CCMpfaModel, FractureProblem));
SET_BOOL_PROP(FractureCCProblem, EnableGlobalFVGeometryCache, true);
SET_BOOL_PROP(FractureCCProblem, EnableGlobalVolumeVariablesCache, true);
SET_BOOL_PROP(FractureCCProblem, EnableGlobalFluxVariablesCache, true);
#if HAVE_DUNE_FOAMGRID
SET_TYPE_PROP(FractureProblem, Grid, Dune::FoamGrid<2, 3>);
#else
SET_TYPE_PROP(FractureProblem, Grid, Dune::YaspGrid<3>);
#endif
// Set the problem property
SET_TYPE_PROP(FractureProblem, Problem, Dumux::FractureProblem<TypeTag>);
// The fluid type
SET_PROP(FractureProblem, Fluid)
{
private:
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
public:
using type = FluidSystems::LiquidPhase<Scalar, SimpleH2O<Scalar>>;
};
// Linear solver settings
SET_TYPE_PROP(FractureProblem, LinearSolver, Dumux::ILU0BiCGSTABBackend<TypeTag>);
SET_BOOL_PROP(FractureProblem, ProblemEnableGravity, false);
}
/*!
* \ingroup OnePModel
* \ingroup ImplicitTestProblems
* \brief A discrete fracture network embedded in an impermeable matrix.
* The fracture is a 2D network embedded in 3D.
*
* This problem uses the \ref OnePModel.
*/
template <class TypeTag>
class FractureProblem : public ImplicitPorousMediaProblem<TypeTag>
{
using ParentType = ImplicitPorousMediaProblem<TypeTag>;
using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
enum {
// Grid and world dimension
dim = GridView::dimension,
dimWorld = GridView::dimensionworld
};
enum {
// indices of the primary variables
conti0EqIdx = Indices::conti0EqIdx,
pressureIdx = Indices::pressureIdx
};
using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
using TimeManager = typename GET_PROP_TYPE(TypeTag, TimeManager);
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
public:
/*!
* \brief The constructor
*
* \param timeManager The time manager
* \param gridView The grid view
*/
FractureProblem(TimeManager &timeManager, const GridView &gridView)
: ParentType(timeManager, gridView)
{
name_ = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, std::string, Problem, Name);
}
/*!
* \name Problem parameters
*/
// \{
/*!
* \brief Returns the problem name
*
* This is used as a prefix for files generated by the simulation.
*/
const std::string& name() const
{
return name_;
}
/*!
* \brief User defined output after the time integration
*
* Will be called diretly after the time integration.
*/
void postTimeStep()
{
// Calculate storage terms
PrimaryVariables storage;
this->model().globalStorage(storage);
// Write mass balance information for rank 0
if (this->gridView().comm().rank() == 0) {
std::cout<<"Storage: " << storage << std::endl;
}
}
/*!
* \brief Returns the temperature \f$ K \f$
*
* This problem assumes a uniform temperature of 20 degrees Celsius.
*/
Scalar temperature() const
{ return 273.15 + 20; }
/*!
* \brief Returns the source term
*
* \param values Stores the source values for the conservation equations in
* \f$ [ \textnormal{unit of primary variable} / (m^\textrm{dim} \cdot s )] \f$
* \param globalPos The global position
*/
PrimaryVariables sourceAtPos(const GlobalPosition &globalPos) const
{
return PrimaryVariables(0.0);
}
// \}
/*!
* \name Boundary conditions
*/
// \{
/*!
* \brief Specifies which kind of boundary condition should be
* used for which equation on a given boundary segment.
*
* \param values The boundary types for the conservation equations
* \param vertex The vertex for which the boundary type is set
*/
BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
{
BoundaryTypes values;
values.setAllNeumann();
if (globalPos[0] > this->bBoxMax()[0] - eps_ || globalPos[0] < this->bBoxMin()[0] + eps_)
values.setAllDirichlet();
return values;
}
/*!
* \brief Evaluates the boundary conditions for a Dirichlet
* boundary segment
*
* \param values Stores the Dirichlet values for the conservation equations in
* \f$ [ \textnormal{unit of primary variable} ] \f$
* \param globalPos The global position
*/
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
{
return initialAtPos(globalPos);
}
/*!
* \brief Evaluate the boundary conditions for a neumann
* boundary segment.
*
* \param values Stores the Neumann values for the conservation equations in
* \f$ [ \textnormal{unit of conserved quantity} / (m^(dim-1) \cdot s )] \f$
* \param globalPos The position of the integration point of the boundary segment.
*
* For this method, the \a values parameter stores the mass flux
* in normal direction of each phase. Negative values mean influx.
*/
PrimaryVariables neumannAtPos(const GlobalPosition &globalPos) const
{
return PrimaryVariables(0.0);
}
// \}
/*!
* \name Volume terms
*/
// \{
/*!
* \brief Evaluates the initial values for a control volume
*
* \param values Stores the initial values for the conservation equations in
* \f$ [ \textnormal{unit of primary variables} ] \f$
* \param globalPos The global position
*/
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
{
PrimaryVariables values(0.0);
values[pressureIdx] = 1.0e5*(globalPos[0] - this->bBoxMin()[0])/(this->bBoxMax()[0] - this->bBoxMin()[0]) + 1.0e5;
return values;
}
// \}
private:
static constexpr Scalar eps_ = 1.5e-7;
std::string name_;
};
} //end namespace Dumux
#endif
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*****************************************************************************
* See the file COPYING for full copying permissions. *
* *
* This program 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. *
* *
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
/*!
* \file
*
* \brief The spatial parameters for the LensProblem which uses the
* two-phase fully implicit model
*/
#ifndef DUMUX_ONEP_FRACTURE_TEST_SPATIALPARAMS_HH
#define DUMUX_ONEP_FRACTURE_TEST_SPATIALPARAMS_HH
#include <dumux/material/spatialparams/implicit1p.hh>
namespace Dumux
{
//forward declaration
template<class TypeTag>
class FractureSpatialParams;
namespace Properties
{
// The spatial parameters TypeTag
NEW_TYPE_TAG(FractureSpatialParams);
// Set the spatial parameters
SET_TYPE_PROP(FractureSpatialParams, SpatialParams, Dumux::FractureSpatialParams<TypeTag>);
}
/*!
* \ingroup TwoPModel
* \ingroup ImplicitTestProblems
* \brief The spatial parameters for the LensProblem which uses the
* two-phase fully implicit model
*/
template<class TypeTag>
class FractureSpatialParams : public ImplicitSpatialParamsOneP<TypeTag>
{
using ParentType = ImplicitSpatialParamsOneP<TypeTag>;
using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
using SubControlVolume = typename GET_PROP_TYPE(TypeTag, SubControlVolume);
using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
public:
/*!
* \brief The constructor
*
* \param gridView The grid view
*/
FractureSpatialParams(const Problem& problem, const GridView& gridView)
: ParentType(problem, gridView)
{}
/*!
* \brief Returns the scalar intrinsic permeability \f$[m^2]\f$
*
* \param element The finite element
* \param fvGeometry The finite volume geometry of the element
* \param scvIdx The local index of the sub-control volume
*/
Scalar intrinsicPermeability (const SubControlVolume &scv,
const VolumeVariables& volVars) const
{ return 1e-12; }
/*!
* \brief Returns the porosity \f$[-]\f$
*
* \param element The finite element
* \param fvGeometry The finite volume geometry of the element
* \param scvIdx The local index of the sub-control volume
*/
Scalar porosity(const SubControlVolume &scv) const
{ return 0.4; }
};
} // end namespace Dumux
#endif
This diff is collapsed.
$MeshFormat
2.2 0 8
$EndMeshFormat
$Nodes
33
1 0.5 0.5 0.5
2 0.5 0.5 1
3 0 0 0
4 0 1 0
5 1 1 0
6 1 0 0
7 0.5 0.5 0.875
8 0.5 0.5 0.75
9 0.5 0.5 0.625
10 0.4285714285712303 0.4285714285712303 0.4285714285712303
11 0.3571428571431545 0.3571428571431545 0.3571428571431545
12 0.2857142857150788 0.2857142857150788 0.2857142857150788
13 0.2142857142866066 0.2142857142866066 0.2142857142866066
14 0.1428571428577377 0.1428571428577377 0.1428571428577377
15 0.07142857142886883 0.07142857142886883 0.07142857142886883
16 0.4285714285712966 0.5714285714287034 0.4285714285712966
17 0.3571428571430558 0.6428571428569442 0.3571428571430558
18 0.2857142857148152 0.7142857142851848 0.2857142857148152
19 0.2142857142863099 0.7857142857136901 0.2142857142863099
20 0.14285714285754 0.85714285714246 0.14285714285754
21 0.07142857142876996 0.9285714285712301 0.07142857142876996
22 0.5714285714286373 0.5714285714286373 0.4285714285713627
23 0.6428571428570434 0.6428571428570434 0.3571428571429566
24 0.7142857142854493 0.7142857142854493 0.2857142857145507
25 0.7857142857139876 0.7857142857139876 0.2142857142860124
26 0.8571428571426584 0.8571428571426584 0.1428571428573416
27 0.9285714285713291 0.9285714285713291 0.07142857142867082
28 0.5714285714287034 0.4285714285712966 0.4285714285712966
29 0.6428571428569442 0.3571428571430558 0.3571428571430558
30 0.7142857142851848 0.2857142857148152 0.2857142857148152
31 0.7857142857136901 0.2142857142863099 0.2142857142863099
32 0.85714285714246 0.14285714285754 0.14285714285754
33 0.9285714285712301 0.07142857142876996 0.07142857142876996
$EndNodes
$Elements
38
1 15 2 0 1 1
2 15 2 0 2 2
3 15 2 0 3 3
4 15 2 0 4 4
5 15 2 0 5 5
6 15 2 0 6 6
7 1 2 0 1 2 7
8 1 2 0 1 7 8
9 1 2 0 1 8 9
10 1 2 0 1 9 1
11 1 2 0 2 1 10
12 1 2 0 2 10 11
13 1 2 0 2 11 12
14 1 2 0 2 12 13
15 1 2 0 2 13 14
16 1 2 0 2 14 15
17 1 2 0 2 15 3
18 1 2 0 3 1 16
19 1 2 0 3 16 17
20 1 2 0 3 17 18
21 1 2 0 3 18 19
22 1 2 0 3 19 20
23 1 2 0 3 20 21
24 1 2 0 3 21 4
25 1 2 0 4 1 22
26 1 2 0 4 22 23
27 1 2 0 4 23 24
28 1 2 0 4 24 25
29 1 2 0 4 25 26
30 1 2 0 4 26 27
31 1 2 0 4 27 5
32 1 2 0 5 1 28
33 1 2 0 5 28 29
34 1 2 0 5 29 30
35 1 2 0 5 30 31
36 1 2 0 5 31 32
37 1 2 0 5 32 33
38 1 2 0 5 33 6
$EndElements
DGF
Vertex
0 0 0
0.5 0 0
1 0 0
0 0.5 0.5
0.5 0.5 0.5
1 0.5 0.5
0 1 1
0.5 1 1
1 1 1
#
Simplex
0 1 4
0 4 3
1 2 4
2 5 4
3 4 6
4 7 6
4 5 8
4 8 7
#
Boundarydomain
default 1 % all boundaries have id 1
#
# unitcube.dgf
[TimeManager]
DtInitial = 1 # [s]
TEnd = 1 # [s]
[Grid]
File = grids/test_1p_2d3d.dgf
[Problem]
Name = 1ptestbox2d3d # name passed to the output routines
[SpatialParams]
LensLowerLeft = 0.2 0.2 0.2
LensUpperRight = 0.8 0.8 0.8
Permeability = 1e-10 # [m^2]
PermeabilityLens = 1e-12 # [m^2]
......@@ -22,7 +22,7 @@
* \brief test for the one-phase CC model
*/
#include <config.h>
#include "1ptestproblem.hh"
#include "fractureproblem.hh"
#include <dumux/common/start.hh>
/*!
......@@ -43,13 +43,7 @@ void usage(const char *progName, const std::string &errorMsg)
errorMessageOut += "\n\nThe list of mandatory arguments for this program is:\n"
"\t-TimeManager.TEnd End of the simulation [s] \n"
"\t-TimeManager.DtInitial Initial timestep size [s] \n"
"\t-Grid.LowerLeft Lower left corner coordinates\n"
"\t-Grid.UpperRight Upper right corner coordinates\n"
"\t-Grid.Cells Number of cells in respective coordinate directions\n"
"\t-SpatialParams.LensLowerLeft coordinates of the lower left corner of the lens [m] \n"
"\t-SpatialParams.LensUpperRight coordinates of the upper right corner of the lens [m] \n"
"\t-SpatialParams.Permeability Permeability of the domain [m^2] \n"
"\t-SpatialParams.PermeabilityLens Permeability of the lens [m^2] \n";
"\t-Grid.File The grid file\n";
std::cout << errorMessageOut
<< "\n";
......@@ -59,7 +53,7 @@ void usage(const char *progName, const std::string &errorMsg)
int main(int argc, char** argv)
{
#if HAVE_DUNE_FOAMGRID
typedef TTAG(OnePTwoDThreeDTestBoxProblem) ProblemTypeTag;
typedef TTAG(FractureBoxProblem) ProblemTypeTag;
return Dumux::start<ProblemTypeTag>(argc, argv, usage);
#else
#warning External grid module dune-foamgrid needed to run this example.
......
[TimeManager]
DtInitial = 1 # [s]
TEnd = 1 # [s]
[Grid]
File = grids/fracture2d3d.msh
[Problem]
Name = 1pboxfracture2d3d # name passed to the output routines
[TimeManager]
DtInitial = 1 # [s]
TEnd = 1 # [s]
[Grid]
File = grids/test_1p_2d3d.dgf
[Problem]
Name = 1ptestcc2d3d # name passed to the output routines
[SpatialParams]
LensLowerLeft = 0.2 0.2 0.2
LensUpperRight = 0.8 0.8 0.8
Permeability = 1e-10 # [m^2]
PermeabilityLens = 1e-12 # [m^2]
......@@ -22,7 +22,7 @@
* \brief test for the one-phase CC model
*/
#include <config.h>
#include "1ptestproblem.hh"