diff --git a/dumux/discretization/staggered/freeflow/properties.hh b/dumux/discretization/staggered/freeflow/properties.hh index 0af2f3b8529ca41cf091058a045f40aa5ea3c628..d10686fd54a796deaabc1fa01c9a2b9c0d0ff5f2 100644 --- a/dumux/discretization/staggered/freeflow/properties.hh +++ b/dumux/discretization/staggered/freeflow/properties.hh @@ -68,7 +68,6 @@ public: static constexpr int value = GET_PROP_VALUE(TypeTag, NumEq) - dim; }; - //! The default sub-controlvolume face SET_PROP(StaggeredFreeFlowModel, SubControlVolumeFace) { diff --git a/dumux/freeflow/CMakeLists.txt b/dumux/freeflow/CMakeLists.txt index 55731f840023bd8be4da71b66256ad7261736d50..d5ead8b68e20233f1f55c8c6342a17456808028a 100644 --- a/dumux/freeflow/CMakeLists.txt +++ b/dumux/freeflow/CMakeLists.txt @@ -1,3 +1,3 @@ add_subdirectory("navierstokes") add_subdirectory("staggerednc") -add_subdirectory("staggeredni") +add_subdirectory("nonisothermal") diff --git a/dumux/freeflow/navierstokes/model.hh b/dumux/freeflow/navierstokes/model.hh index d4afe30b7a7e8bc4b8852eb14e03f5b9d0e33cd0..b2349c20d889d4b68ce087feadb5f2d30570fea2 100644 --- a/dumux/freeflow/navierstokes/model.hh +++ b/dumux/freeflow/navierstokes/model.hh @@ -27,7 +27,7 @@ #include <dumux/common/properties.hh> #include <dumux/freeflow/properties.hh> -#include <dumux/freeflow/staggeredni/properties.hh> +#include <dumux/freeflow/nonisothermal/model.hh> #include "localresidual.hh" #include "volumevariables.hh" @@ -70,8 +70,6 @@ NEW_PROP_TAG(EnableComponentTransport); //!< Returns whether to consider component transport or not NEW_PROP_TAG(EnableEnergyTransport); //!< Returns whether to consider energy transport or not NEW_PROP_TAG(NormalizePressure); //!< Returns whether to normalize the pressure term in the momentum balance or not - NEW_PROP_TAG(EnergyLocalResidual); //!< The energy local residual - NEW_PROP_TAG(EnergyFluxVariables); //!< The energy flux variables /////////////////////////////////////////////////////////////////////////// // default property values for the isothermal single phase model @@ -80,6 +78,16 @@ SET_INT_PROP(NavierStokes, NumComponents, 1); //! The number of components in the 1p model is 1 SET_INT_PROP(NavierStokes, PhaseIdx, 0); //! The default phase index + //! The number of equations + SET_PROP(NavierStokes, NumEq) + { + private: + using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + static constexpr auto dim = GridView::dimension; + public: + static constexpr int value = dim + 1; + }; + /*! * \brief The fluid state which is used by the volume variables to * store the thermodynamic state. This should be chosen @@ -115,10 +123,6 @@ //! The indices required by the isothermal single-phase model SET_TYPE_PROP(NavierStokes, Indices, NavierStokesCommonIndices<TypeTag>); - SET_TYPE_PROP(NavierStokes, EnergyLocalResidual, FreeFlowEnergyLocalResidual<TypeTag>); - - SET_TYPE_PROP(NavierStokes, EnergyFluxVariables, FreeFlowEnergyFluxVariables<TypeTag>); - SET_BOOL_PROP(NavierStokes, EnableEnergyBalance, false); SET_TYPE_PROP(NavierStokes, VtkOutputFields, NavierStokesVtkOutputFields<TypeTag>); @@ -141,8 +145,14 @@ SET_TYPE_PROP(NavierStokesNI, IsothermalVtkOutputFields, NavierStokesVtkOutputFields<TypeTag>); //set isothermal NumEq - SET_INT_PROP(NavierStokesNI, IsothermalNumEqCellCenter, 1); //!< set the number of equations to 1 - SET_INT_PROP(NavierStokesNI, IsothermalNumEqFace, 1); //!< set the number of equations to 1 + SET_PROP(NavierStokesNI, IsothermalNumEq) + { + private: + using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + static constexpr auto dim = GridView::dimension; + public: + static constexpr int value = dim + 1; + }; // \} } diff --git a/dumux/freeflow/navierstokes/staggered/localresidual.hh b/dumux/freeflow/navierstokes/staggered/localresidual.hh index 469b7627a5c6ed3670a2a1999722a488261aa377..732a78fac4b541eb6dc2570977bff8b417422870 100644 --- a/dumux/freeflow/navierstokes/staggered/localresidual.hh +++ b/dumux/freeflow/navierstokes/staggered/localresidual.hh @@ -23,6 +23,7 @@ #ifndef DUMUX_STAGGERED_NAVIERSTOKES_LOCAL_RESIDUAL_HH #define DUMUX_STAGGERED_NAVIERSTOKES_LOCAL_RESIDUAL_HH +#include <dune/common/hybridutilities.hh> #include <dumux/common/properties.hh> namespace Dumux @@ -32,7 +33,6 @@ namespace Properties { // forward declaration NEW_PROP_TAG(EnableInertiaTerms); -NEW_PROP_TAG(EnergyFluxVariables); NEW_PROP_TAG(NormalizePressure); NEW_PROP_TAG(ElementFaceVariables); } @@ -74,8 +74,6 @@ class NavierStokesResidualImpl<TypeTag, DiscretizationMethods::Staggered> : publ using FacePrimaryVariables = typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables); using Indices = typename GET_PROP_TYPE(TypeTag, Indices); using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables); - using EnergyLocalResidual = typename GET_PROP_TYPE(TypeTag, EnergyLocalResidual); - using EnergyFluxVariables = typename GET_PROP_TYPE(TypeTag, EnergyFluxVariables); using ElementFaceVariables = typename GET_PROP_TYPE(TypeTag, ElementFaceVariables); @@ -85,7 +83,6 @@ class NavierStokesResidualImpl<TypeTag, DiscretizationMethods::Staggered> : publ using CellCenterResidual = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); using FaceResidual = typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables); - using FaceResidualVector = typename GET_PROP_TYPE(TypeTag, FaceSolutionVector); enum { // grid and world dimension @@ -121,7 +118,27 @@ public: CellCenterPrimaryVariables flux = fluxVars.computeFluxForCellCenter(problem, element, fvGeometry, elemVolVars, elemFaceVars, scvf, elemFluxVarsCache[scvf]); - EnergyFluxVariables::energyFlux(flux, problem, element, fvGeometry, elemVolVars, elemFaceVars, scvf, elemFluxVarsCache[scvf]); + // add energy fluxes for non-isothermal models + Dune::Hybrid::ifElse(std::integral_constant<bool, GET_PROP_VALUE(TypeTag, EnableEnergyBalance) >(), + [&](auto IF) + { + // if we are on an inflow/outflow boundary, use the volVars of the element itself + // TODO: catch neumann and outflow in localResidual's evalBoundary_() + bool isOutflow = false; + if(scvf.boundary()) + { + const auto bcTypes = problem.boundaryTypesAtPos(scvf.center()); + if(bcTypes.isOutflow(Indices::energyBalanceIdx)) + isOutflow = true; + } + + auto upwindTerm = [](const auto& volVars) { return volVars.density() * volVars.enthalpy(); }; + using HeatConductionType = typename GET_PROP_TYPE(TypeTag, HeatConductionType); + + flux[Indices::energyBalanceIdx] = FluxVariables::advectiveFluxForCellCenter(elemVolVars, elemFaceVars, scvf, upwindTerm, isOutflow); + flux[Indices::energyBalanceIdx] += HeatConductionType::diffusiveFluxForCellCenter(problem, element, fvGeometry, elemVolVars, scvf); + + }); return flux; } @@ -133,8 +150,7 @@ public: const ElementFaceVariables& elemFaceVars, const SubControlVolume &scv) const { - return CellCenterPrimaryVariables(0.0); - // TODO sources + return problem.sourceAtPos(scv.center())[cellCenterIdx]; } @@ -153,8 +169,15 @@ public: const VolumeVariables& volVars) const { CellCenterPrimaryVariables storage; - storage[0] = volVars.density(); - EnergyLocalResidual::fluidPhaseStorage(storage, scv, volVars); + storage[Indices::massBalanceIdx] = volVars.density(); + + // add energy storage for non-isothermal models + Dune::Hybrid::ifElse(std::integral_constant<bool, GET_PROP_VALUE(TypeTag, EnableEnergyBalance) >(), + [&](auto IF) + { + storage[Indices::energyBalanceIdx] = volVars.density() * volVars.internalEnergy(); + }); + return storage; } diff --git a/dumux/freeflow/nonisothermal/CMakeLists.txt b/dumux/freeflow/nonisothermal/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..1f1856fa57efc0aa6e98aec8bbe11e7b832f9165 --- /dev/null +++ b/dumux/freeflow/nonisothermal/CMakeLists.txt @@ -0,0 +1,7 @@ + +#install headers +install(FILES +indices.hh +model.hh +vtkoutputfields.hh +DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/freeflow/nonisothermal) diff --git a/dumux/freeflow/staggeredni/indices.hh b/dumux/freeflow/nonisothermal/indices.hh similarity index 77% rename from dumux/freeflow/staggeredni/indices.hh rename to dumux/freeflow/nonisothermal/indices.hh index 9045130ec1330ed21a0be27c9ab8dec874ad3340..047fef8dd0de902fd3495b0dfbb1aa4971dbb0bc 100644 --- a/dumux/freeflow/staggeredni/indices.hh +++ b/dumux/freeflow/nonisothermal/indices.hh @@ -18,10 +18,10 @@ *****************************************************************************/ /*! * \file - * \brief Defines the indices for the staggered Navier-Stokes NI model. + * \brief Defines the indices for the Navier-Stokes NI model. */ -#ifndef DUMUX_STAGGERED_NAVIERSTOKES_NI_INDICES_HH -#define DUMUX_STAGGERED_NAVIERSTOKES_NI_INDICES_HH +#ifndef DUMUX_NAVIERSTOKES_NI_INDICES_HH +#define DUMUX_NAVIERSTOKES_NI_INDICES_HH #include <dumux/common/properties.hh> @@ -31,7 +31,7 @@ namespace Dumux /*! * \ingroup NavierStokesNIModel * \ingroup ImplicitIndices - * \brief Indices for the staggered Navier-Stokes NI model model. + * \brief Indices for the Navier-Stokes NI model model. * * \tparam PVOffset The first index in a primary variable vector. */ @@ -39,11 +39,13 @@ template <class TypeTag, int PVOffset = 0> class NavierStokesNonIsothermalIndices : public GET_PROP_TYPE(TypeTag, IsothermalIndices) { public: - static const int numEqCC = GET_PROP_VALUE(TypeTag, NumEqCellCenter); + using GridView = typename GET_PROP_TYPE(TypeTag, GridView); + static constexpr auto dim = GridView::dimension; + static constexpr auto numEq = GET_PROP_VALUE(TypeTag, NumEq); - static constexpr int energyBalanceIdx = PVOffset + numEqCC -1; + static constexpr auto energyBalanceIdx = PVOffset + GET_PROP_VALUE(TypeTag, NumEq) - dim - 1; static constexpr int temperatureIdx = energyBalanceIdx; }; } // end namespace -#endif +#endif // DUMUX_NAVIERSTOKES_NI_INDICES_HH diff --git a/dumux/freeflow/staggeredni/properties.hh b/dumux/freeflow/nonisothermal/model.hh similarity index 74% rename from dumux/freeflow/staggeredni/properties.hh rename to dumux/freeflow/nonisothermal/model.hh index f7752d75e799eecb81e7fb21ac83d785f44b3d57..2763844f357114bf9fecefe257cdad88520409fd 100644 --- a/dumux/freeflow/staggeredni/properties.hh +++ b/dumux/freeflow/nonisothermal/model.hh @@ -17,28 +17,25 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * *****************************************************************************/ /*! - * \ingroup Properties - * \ingroup ImplicitProperties - * \ingroup OnePModel * \file * - * \brief Defines the properties required for the one-phase fully implicit model. + * \brief Base class for all models which use the one-phase, + * fully implicit model. + * Adaption of the fully implicit scheme to the one-phase flow model. */ -#ifndef DUMUX_NAVIER_STOKES_NI_PROPERTIES_HH -#define DUMUX_NAVIER_STOKES_NI_PROPERTIES_HH + +#ifndef DUMUX_STAGGERED_NI_MODEL_HH +#define DUMUX_STAGGERED_NI_MODEL_HH #include <dumux/common/properties.hh> -#include "fluxvariables.hh" #include "indices.hh" -#include "localresidual.hh" #include "vtkoutputfields.hh" #include <dumux/discretization/fourierslaw.hh> + namespace Dumux { -// \{ - namespace Properties { //! The type tags for the non-isothermal Navier Stokes problems @@ -51,22 +48,13 @@ NEW_PROP_TAG(IsothermalNumEqFace); // default property values for the non-isothermal single phase model /////////////////////////////////////////////////////////////////////////// -SET_PROP(NavierStokesNonIsothermal, NumEqCellCenter) -{ -private: - static constexpr auto isothermalNumEqCellCenter = GET_PROP_VALUE(TypeTag, IsothermalNumEqCellCenter); -public: - static constexpr auto value = isothermalNumEqCellCenter + 1; -}; SET_PROP(NavierStokesNonIsothermal, NumEq) { private: - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - static constexpr auto dim = GridView::dimension; - static constexpr auto numComponents = GET_PROP_VALUE(TypeTag, NumComponents); + static constexpr auto isothermalNumEq = GET_PROP_VALUE(TypeTag, IsothermalNumEq); public: - static constexpr int value = dim + numComponents + 1; + static constexpr int value = isothermalNumEq + 1; }; SET_TYPE_PROP(NavierStokesNonIsothermal, Indices, NavierStokesNonIsothermalIndices<TypeTag>); @@ -79,6 +67,6 @@ SET_TYPE_PROP(NavierStokesNonIsothermal, HeatConductionType, FouriersLaw<TypeTag } // end namespace Properties -} // end namespace Dumux +} #endif diff --git a/dumux/freeflow/staggeredni/vtkoutputfields.hh b/dumux/freeflow/nonisothermal/vtkoutputfields.hh similarity index 100% rename from dumux/freeflow/staggeredni/vtkoutputfields.hh rename to dumux/freeflow/nonisothermal/vtkoutputfields.hh diff --git a/dumux/freeflow/properties.hh b/dumux/freeflow/properties.hh index 5a5d6d6910b3b3e7283786fbbd1daa6b7522e1cb..07c249a60c4e9fc3835c9f9a162d0283681867b7 100644 --- a/dumux/freeflow/properties.hh +++ b/dumux/freeflow/properties.hh @@ -36,16 +36,6 @@ namespace Properties //! Type tag for free-flow models NEW_TYPE_TAG(FreeFlow, INHERITS_FROM(ModelProperties)); -SET_PROP(FreeFlow, NumEq) -{ -private: - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - static constexpr auto dim = GridView::dimension; - static constexpr auto numComponents = GET_PROP_VALUE(TypeTag, NumComponents); -public: - static constexpr int value = dim + numComponents; -}; - } // namespace Properties } // namespace Dumux diff --git a/dumux/freeflow/staggeredni/CMakeLists.txt b/dumux/freeflow/staggeredni/CMakeLists.txt deleted file mode 100644 index cd81e3cdc4921a04e59e03a6645e8200a03de4ed..0000000000000000000000000000000000000000 --- a/dumux/freeflow/staggeredni/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ - -#install headers -install(FILES -indices.hh -localresidual.hh -model.hh -properties.hh -propertydefaults.hh -volumevariables.hh -DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/porousmediumflow/1p/implicit) \ No newline at end of file diff --git a/dumux/freeflow/staggeredni/fluxvariables.hh b/dumux/freeflow/staggeredni/fluxvariables.hh deleted file mode 100644 index 5d7a6848064f457c72c5767110c1ac3211c88121..0000000000000000000000000000000000000000 --- a/dumux/freeflow/staggeredni/fluxvariables.hh +++ /dev/null @@ -1,131 +0,0 @@ -// -*- 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 Base class for the flux variables - */ -#ifndef DUMUX_FREELOW_IMPLICIT_NI_FLUXVARIABLES_HH -#define DUMUX_FREELOW_IMPLICIT_NI_FLUXVARIABLES_HH - -#include <dumux/common/properties.hh> - -namespace Dumux -{ - -namespace Properties -{ - NEW_PROP_TAG(ElementFaceVariables); -} - -/*! - * \ingroup ImplicitModel - * \brief The flux variables class - * specializations are provided for combinations of physical processes - * \note Not all specializations are currently implemented - */ - -// forward declaration -template<class TypeTag, bool enableEnergyBalance> -class FreeFlowEnergyFluxVariablesImplementation; - -template<class TypeTag> -using FreeFlowEnergyFluxVariables = FreeFlowEnergyFluxVariablesImplementation<TypeTag, GET_PROP_VALUE(TypeTag, EnableEnergyBalance)>; - -// specialization for isothermal flow -template<class TypeTag> -class FreeFlowEnergyFluxVariablesImplementation<TypeTag, false> -{ - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using Element = typename GridView::template Codim<0>::Entity; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVElementGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, ElementVolumeVariables); - using ElementFaceVariables = typename GET_PROP_TYPE(TypeTag, ElementFaceVariables); - using SubControlVolumeFace = typename GET_PROP_TYPE(TypeTag, SubControlVolumeFace); - using FluxVariablesCache = typename GET_PROP_TYPE(TypeTag, FluxVariablesCache); - using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); - -public: - - static void energyFlux(CellCenterPrimaryVariables& flux, - const Problem& problem, - const Element &element, - const FVElementGeometry& fvGeometry, - const ElementVolumeVariables& elemVolVars, - const ElementFaceVariables& elemFaceVars, - const SubControlVolumeFace &scvf, - const FluxVariablesCache& fluxVarsCache) - { } - -}; - -// specialization for non-isothermal flow -template<class TypeTag> -class FreeFlowEnergyFluxVariablesImplementation<TypeTag, true> -{ - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using Element = typename GridView::template Codim<0>::Entity; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVElementGeometry); - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using Indices = typename GET_PROP_TYPE(TypeTag, Indices); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, ElementVolumeVariables); - using ElementFaceVariables = typename GET_PROP_TYPE(TypeTag, ElementFaceVariables); - using SubControlVolumeFace = typename GET_PROP_TYPE(TypeTag, SubControlVolumeFace); - using FluxVariablesCache = typename GET_PROP_TYPE(TypeTag, FluxVariablesCache); - using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables); - using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); - - using HeatConductionType = typename GET_PROP_TYPE(TypeTag, HeatConductionType); - - enum { energyBalanceIdx = Indices::energyBalanceIdx }; - -public: - - static void energyFlux(CellCenterPrimaryVariables& flux, - const Problem& problem, - const Element &element, - const FVElementGeometry& fvGeometry, - const ElementVolumeVariables& elemVolVars, - const ElementFaceVariables& elemFaceVars, - const SubControlVolumeFace &scvf, - const FluxVariablesCache& fluxVarsCache) - { - // if we are on an inflow/outflow boundary, use the volVars of the element itself - // TODO: catch neumann and outflow in localResidual's evalBoundary_() - bool isOutflow = false; - if(scvf.boundary()) - { - const auto bcTypes = problem.boundaryTypesAtPos(scvf.center()); - if(bcTypes.isOutflow(energyBalanceIdx)) - isOutflow = true; - } - - auto upwindTerm = [](const auto& volVars) { return volVars.density() * volVars.enthalpy(); }; - - flux[energyBalanceIdx] = FluxVariables::advectiveFluxForCellCenter(elemVolVars, elemFaceVars, scvf, upwindTerm, isOutflow); - flux[energyBalanceIdx] += HeatConductionType::diffusiveFluxForCellCenter(problem, element, fvGeometry, elemVolVars, scvf); - } - -}; - -} // end namespace - -#endif diff --git a/dumux/freeflow/staggeredni/localresidual.hh b/dumux/freeflow/staggeredni/localresidual.hh deleted file mode 100644 index a067af392191002588be6f2f0f2cfcaa91966775..0000000000000000000000000000000000000000 --- a/dumux/freeflow/staggeredni/localresidual.hh +++ /dev/null @@ -1,94 +0,0 @@ -// -*- 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 Element-wise calculation of the local residual for non-isothermal - * fully implicit models. - */ -#ifndef DUMUX_FREE_FLOW_ENERGY_LOCAL_RESIDUAL_HH -#define DUMUX_FREE_FLOW_ENERGY_LOCAL_RESIDUAL_HH - -#include <dumux/common/properties.hh> - -namespace Dumux -{ - -// property forward declarations -namespace Properties -{ -NEW_PROP_TAG(Indices); -} - -// forward declaration -template<class TypeTag, bool enableEneryBalance> -class FreeFlowEnergyLocalResidualImplementation; - -/*! - * \ingroup NIModel - * \ingroup ImplicitLocalResidual - * \brief Element-wise calculation of the energy residual for non-isothermal problems. - */ -template<class TypeTag> -using FreeFlowEnergyLocalResidual = FreeFlowEnergyLocalResidualImplementation<TypeTag, GET_PROP_VALUE(TypeTag, EnableEnergyBalance)>; - -template<class TypeTag> -class FreeFlowEnergyLocalResidualImplementation<TypeTag, false> -{ - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using SubControlVolume = typename GET_PROP_TYPE(TypeTag, SubControlVolume); - using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables); - -public: - //! The energy storage in the fluid phase with index phaseIdx - static void fluidPhaseStorage(CellCenterPrimaryVariables& storage, - const SubControlVolume& scv, - const VolumeVariables& volVars) - {} -}; - -template<class TypeTag> -class FreeFlowEnergyLocalResidualImplementation<TypeTag, true> -{ - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using SubControlVolume = typename GET_PROP_TYPE(TypeTag, SubControlVolume); - using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables); - using Indices = typename GET_PROP_TYPE(TypeTag, Indices); - - enum { energyBalanceIdx = Indices::energyBalanceIdx }; - -public: - - //! The energy storage in the fluid phase - static void fluidPhaseStorage(CellCenterPrimaryVariables& storage, - const SubControlVolume& scv, - const VolumeVariables& volVars) - { - storage[energyBalanceIdx] += volVars.density() - * volVars.internalEnergy(); - } -}; - -} // end namespace Dumux - -#endif diff --git a/dumux/freeflow/staggeredni/model.hh b/dumux/freeflow/staggeredni/model.hh deleted file mode 100644 index 668a5a07651e949c8f7af121a8a3b8143f4d94d9..0000000000000000000000000000000000000000 --- a/dumux/freeflow/staggeredni/model.hh +++ /dev/null @@ -1,64 +0,0 @@ -// -*- 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 Base class for all models which use the one-phase, - * fully implicit model. - * Adaption of the fully implicit scheme to the one-phase flow model. - */ - -#ifndef DUMUX_STAGGERED_NI_MODEL_HH -#define DUMUX_STAGGERED_NI_MODEL_HH - -#include "properties.hh" - -namespace Dumux -{ -/*! - * \ingroup NavierStokesModel - * \brief A single-phase, non-isothermal flow model using the fully implicit scheme. - * - * All equations are discretized using a staggered grid as spatial - * and the implicit Euler method as time discretization. - * The model supports compressible as well as incompressible fluids. - */ -template<class TypeTag > -class NavierStokesNonIsothermalModel : public GET_PROP_TYPE(TypeTag, IsothermalModel) -{ - using ParentType = typename GET_PROP_TYPE(TypeTag, IsothermalModel); - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - using Indices = typename GET_PROP_TYPE(TypeTag, Indices); - -public: - - void init(Problem& problem) - { - ParentType::init(problem); - - // add temperature to output - auto& vtkOutputModule = problem.vtkOutputModule(); - vtkOutputModule.addPrimaryVariable("temperature", Indices::temperatureIdx); - } -}; -} - -#include "propertydefaults.hh" - -#endif