Skip to content
Snippets Groups Projects
Commit 22550fba authored by Kilian Weishaupt's avatar Kilian Weishaupt
Browse files

[staggered][test] Adapt channel test for NI

* so additional clean-up
parent 8db3e352
No related branches found
No related tags found
3 merge requests!617[WIP] Next,!507Cleanup/staggered energy,!483Feature/staggered energy
......@@ -22,6 +22,21 @@ add_dumux_test(test_channel_stokes test_channel_stokes test_channel.cc
${CMAKE_CURRENT_BINARY_DIR}/test_channel_stokes-00002.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_channel_stokes")
add_dumux_test(test_channel_stokesni_convection test_channel_stokesni test_channel.cc
python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
--script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/channel-stokes.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_channel_stokes-00002.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_channel_stokesni test_channel_stokesni_convection.input")
target_compile_definitions(test_channel_stokesni PUBLIC "NONISOTHERMAL=1")
add_dumux_test(test_channel_stokesni_conduction test_channel_stokesni test_channel.cc
python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
--script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/channel-stokes.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_channel_stokes-00002.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_channel_stokesni test_channel_stokesni_conduction.input")
add_dumux_test(test_channel_navierstokes test_channel_navierstokes test_channel.cc
python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
--script fuzzy
......
......@@ -45,14 +45,22 @@ namespace Capabilities
namespace Properties
{
#if !NONISOTHERMAL
NEW_TYPE_TAG(ChannelTestProblem, INHERITS_FROM(StaggeredModel, NavierStokes));
#else
NEW_TYPE_TAG(ChannelTestProblem, INHERITS_FROM(StaggeredModel, NavierStokesNI));
#endif
SET_PROP(ChannelTestProblem, Fluid)
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
public:
typedef FluidSystems::LiquidPhase<Scalar, Dumux::Constant<TypeTag, Scalar> > type;
#if NONISOTHERMAL
using type = FluidSystems::LiquidPhase<Scalar, Dumux::SimpleH2O<Scalar> > ;
#else
using type = FluidSystems::LiquidPhase<Scalar, Dumux::Constant<TypeTag, Scalar> > ;
#endif
};
// Set the grid type
......@@ -77,7 +85,7 @@ SET_BOOL_PROP(ChannelTestProblem, EnableInertiaTerms, false);
}
/*!
* \brief Test problem for the one-phase model:
* \brief Test problem for the one-phase (Navier-) Stokes problem in a channel:
\todo doc me!
*/
template <class TypeTag>
......@@ -101,20 +109,24 @@ class ChannelTestProblem : public NavierStokesProblem<TypeTag>
momentumXBalanceIdx = Indices::momentumXBalanceIdx,
momentumYBalanceIdx = Indices::momentumYBalanceIdx,
pressureIdx = Indices::pressureIdx,
#if NONISOTHERMAL
temperatureIdx = Indices::temperatureIdx,
energyBalanceIdx = Indices::energyBalanceIdx,
#endif
velocityXIdx = Indices::velocityXIdx,
velocityYIdx = Indices::velocityYIdx
};
typedef typename GET_PROP_TYPE(TypeTag, BoundaryTypes) BoundaryTypes;
typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager;
using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
using TimeManager = typename GET_PROP_TYPE(TypeTag, TimeManager);
typedef typename GridView::template Codim<0>::Entity Element;
typedef typename GridView::Intersection Intersection;
using Element = typename GridView::template Codim<0>::Entity;
using Intersection = typename GridView::Intersection;
typedef typename GET_PROP_TYPE(TypeTag, FVElementGeometry) FVElementGeometry;
typedef typename GET_PROP_TYPE(TypeTag, SubControlVolume) SubControlVolume;
using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVElementGeometry);
using SubControlVolume = typename GET_PROP_TYPE(TypeTag, SubControlVolume);
typedef Dune::FieldVector<Scalar, dimWorld> GlobalPosition;
using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables);
using FacePrimaryVariables = typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables);
......@@ -194,6 +206,13 @@ public:
// set Dirichlet values for the velocity everywhere
values.setDirichlet(momentumBalanceIdx);
#if NONISOTHERMAL
if(isInlet(globalPos))
values.setDirichlet(energyBalanceIdx);
else
values.setOutflow(energyBalanceIdx);
#endif
// set a fixed pressure in one cell
if (isOutlet(globalPos))
{
......@@ -214,23 +233,18 @@ public:
*/
BoundaryValues dirichletAtPos(const GlobalPosition &globalPos) const
{
BoundaryValues values;
values[pressureIdx] = 1.1e+5;
BoundaryValues values = initialAtPos(globalPos);
if(isInlet(globalPos))
{
values[velocityXIdx] = inletVelocity_;
values[velocityYIdx] = 0.0;
}
else if(isWall(globalPos))
{
values[velocityXIdx] = 0.0;
values[velocityYIdx] = 0.0;
}
else if(isOutlet(globalPos))
{
values[velocityXIdx] = 1.0;
values[velocityYIdx]= 0.0;
#if NONISOTHERMAL
const Scalar time = this->timeManager().time() + this->timeManager().timeStepSize();
// give the system some time so that the pressure can equilibrate, then start the injection of the hot liquid
if(time > 20.0)
values[temperatureIdx] = 293.15;
#endif
}
return values;
......@@ -255,6 +269,10 @@ public:
values[velocityXIdx] = 0.0;
values[velocityYIdx] = 0.0;
#if NONISOTHERMAL
values[temperatureIdx] = 283.15;
#endif
return values;
}
......
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