Skip to content
Snippets Groups Projects
Commit 0fbf1798 authored by Ned Coltman's avatar Ned Coltman
Browse files

[test][1pncni][dispersion] add non-isothermal tests

parent 6e7e069e
No related branches found
No related tags found
1 merge request!2921Dispersion
......@@ -36,3 +36,40 @@ dumux_add_test(NAME test_1pnc_dispersion_fulldispersiontensor_anisotropic
--command "${CMAKE_CURRENT_BINARY_DIR}/test_1pnc_dispersion_fulldispersiontensor_anisotropic params.input
-Problem.Name test_1pnc_dispersion_fulldispersiontensor_anisotropic
-Problem.DispersionTensor '1e-6 5e-8 6e-9 5e-6'")
dumux_add_test(NAME test_1pncni_dispersion_scheidegger
LABELS porousmediumflow dispersion 1pncni
SOURCES main.cc
COMPILE_DEFINITIONS TYPETAG=OnePNCNIDispersionTestBox SCHEIDEGGER=1 NONISOTHERMAL=1
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/test_1pncni_dispersion_scheidegger-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_1pncni_dispersion_scheidegger-00026.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_1pncni_dispersion_scheidegger params.input
-Problem.Name test_1pncni_dispersion_scheidegger
-Problem.AlphaL 0.1
-Problem.AlphaT 0.01")
dumux_add_test(NAME test_1pncni_dispersion_fulldispersiontensor_isotropic
LABELS porousmediumflow dispersion 1pncni
SOURCES main.cc
COMPILE_DEFINITIONS TYPETAG=OnePNCNIDispersionTestBox SCHEIDEGGER=0 NONISOTHERMAL=1
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/test_1pncni_dispersion_fulldispersiontensor_isotropic-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_1pncni_dispersion_fulldispersiontensor_isotropic-00026.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_1pncni_dispersion_fulldispersiontensor_isotropic params.input
-Problem.Name test_1pncni_dispersion_fulldispersiontensor_isotropic
-Problem.DispersionTensor 1e-6")
dumux_add_test(NAME test_1pncni_dispersion_fulldispersiontensor_anisotropic
LABELS porousmediumflow dispersion 1pncni
SOURCES main.cc
COMPILE_DEFINITIONS TYPETAG=OnePNCNIDispersionTestBox SCHEIDEGGER=0 NONISOTHERMAL=1
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/test_1pncni_dispersion_fulldispersiontensor_anisotropic-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_1pncni_dispersion_fulldispersiontensor_anisotropic-00026.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_1pncni_dispersion_fulldispersiontensor_anisotropic params.input
-Problem.Name test_1pncni_dispersion_fulldispersiontensor_anisotropic
-Problem.DispersionTensor '1e-6 5e-8 6e-9 5e-6'")
......@@ -24,15 +24,11 @@
#include <config.h>
#include <ctime>
#include <iostream>
#include <dune/common/parallel/mpihelper.hh>
#include <dune/common/timer.hh>
#include <dune/grid/io/file/vtk.hh>
#include <dune/istl/io.hh>
#include <dumux/discretization/method.hh>
#include <dumux/common/properties.hh>
#include <dumux/common/parameters.hh>
......@@ -44,7 +40,8 @@
#include <dumux/assembly/fvassembler.hh>
#include <dumux/io/vtkoutputmodule.hh>
#include <dumux/io/grid/gridmanager.hh>
#include <dumux/io/grid/gridmanager_yasp.hh>
#include <dumux/io/grid/gridmanager_ug.hh>
#include "properties.hh"
......
......@@ -11,6 +11,7 @@ Cells = 20 20
Name = default
EnableGravity = true
BoundaryConcentration = 0.04 # molfrac
BoundaryTemperatureDifference = 3 # K
CounterFlowRate = 1e-4
Pressure = 1e5
AlphaL = 0.1 # longitual dispersivity
......@@ -22,3 +23,8 @@ UseLineSearch = true
[Vtk]
AddVelocity = 1 # enable velocity output
[Component]
SolidDensity = 2700
SolidThermalConductivity = 2.8
SolidHeatCapacity = 790
......@@ -87,13 +87,15 @@ class OnePNCDispersionProblem : public PorousMediumFlowProblem<TypeTag>
enum
{
#if NONISOTHERMAL
energyEqIdx = Indices::energyEqIdx,
#endif
// indices of the primary variables
pressureIdx = Indices::pressureIdx,
// component indices
H2OIdx = FluidSystem::compIdx(FluidSystem::MultiPhaseFluidSystem::H2OIdx),
N2Idx = FluidSystem::compIdx(FluidSystem::MultiPhaseFluidSystem::N2Idx),
// indices of the equations
contiH2OEqIdx = Indices::conti0EqIdx + H2OIdx,
contiN2EqIdx = Indices::conti0EqIdx + N2Idx
......@@ -119,6 +121,7 @@ public:
std::cout<<"problem uses mass fractions" << '\n';
boundaryConcentration_ = getParam<Scalar>("Problem.BoundaryConcentration");
temperatureDifference_ = getParam<Scalar>("Problem.BoundaryTemperatureDifference");
counterFlowRate_ = getParam<Scalar>("Problem.CounterFlowRate");
pressure_ = getParam<Scalar>("Problem.Pressure");
problemName_ = getParam<std::string>("Problem.Name");
......@@ -169,6 +172,9 @@ public:
if (isLeftBoundary_(globalPos))
{
values[contiN2EqIdx] = boundaryConcentration_;
#if NONISOTHERMAL
values[energyEqIdx] = temperature() + temperatureDifference_;
#endif
}
return values;
......@@ -201,7 +207,7 @@ public:
const auto globalPos = element.geometry().corner(scvf.insideScvIdx());
NumEqVector values(0.0);
if (isRightBoundary_(globalPos))
values[contiH2OEqIdx] = -1.0 * counterFlowRate_; //-5E-2; //5e-5*m2/s*1000kg/m^3
values[contiH2OEqIdx] = -1.0 * counterFlowRate_;
return values;
}
......@@ -233,6 +239,9 @@ public:
values[Indices::pressureIdx] = pressure_ - (density * gravity * depth); //initial condition for the pressure
values[contiN2EqIdx] = 0.0; //initial condition for the molefraction
#if NONISOTHERMAL
values[energyEqIdx] = temperature();
#endif
return values;
}
......@@ -252,6 +261,7 @@ private:
static constexpr Scalar eps_ = 1e-6;
Scalar pressure_;
Scalar counterFlowRate_;
Scalar temperatureDifference_;
Scalar boundaryConcentration_;
std::string problemName_;
};
......
......@@ -31,6 +31,10 @@
#endif
#include <dune/grid/yaspgrid.hh>
#ifndef NONISOTHERMAL // default to false if not set through CMake
#define NONISOTHERMAL false
#endif
#include <dumux/common/math.hh>
#include <dumux/discretization/cctpfa.hh>
......@@ -54,6 +58,7 @@ namespace Dumux::Properties {
namespace TTag {
struct DispersionTest { using InheritsFrom = std::tuple<BoxModel>; };
struct OnePNCDispersionTestBox { using InheritsFrom = std::tuple<DispersionTest, OnePNC>; };
struct OnePNCNIDispersionTestBox { using InheritsFrom = std::tuple<DispersionTest, OnePNCNI>; };
} // end namespace TTag
// Set the grid type
......@@ -95,6 +100,7 @@ template<class TypeTag>
struct EnableCompositionalDispersion<TypeTag, TTag::DispersionTest> { static constexpr bool value = true; };
template<class TypeTag>
struct EnableThermalDispersion<TypeTag, TTag::DispersionTest> { static constexpr bool value = NONISOTHERMAL; };
template<class TypeTag>
struct DispersionFluxType<TypeTag, TTag::DispersionTest> { using type = OnePDiffusiveDispersionFlux<TypeTag>; };
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment