diff --git a/dumux/freeflow/staggered/properties.hh b/dumux/freeflow/staggered/properties.hh index 3d9a591cd30a3765b81e9f4adc09d1847673a5cc..0cf851a97db76983a80b87931a0c7b642389d43d 100644 --- a/dumux/freeflow/staggered/properties.hh +++ b/dumux/freeflow/staggered/properties.hh @@ -27,7 +27,8 @@ #ifndef DUMUX_NAVIERSTOKES_PROPERTIES_HH #define DUMUX_NAVIERSTOKES_PROPERTIES_HH -// #include <dumux/porousmediumflow/nonisothermal/implicit/properties.hh> +#include <dumux/freeflow/staggeredni/properties.hh> + namespace Dumux { @@ -43,9 +44,10 @@ namespace Properties { //! The type tags for the implicit single-phase problems NEW_TYPE_TAG(NavierStokes); +// NEW_TYPE_TAG(NavierStokesNI); //! The type tags for the corresponding non-isothermal problems -// NEW_TYPE_TAG(NavierStokesNI, INHERITS_FROM(NavierStokes, NonIsothermal)); +NEW_TYPE_TAG(NavierStokesNI, INHERITS_FROM(NavierStokes, StaggeredNonIsothermal)); ////////////////////////////////////////////////////////////////// // Property tags @@ -66,6 +68,8 @@ NEW_PROP_TAG(EnableComponentTransport); //!< Returns whether to consider compone NEW_PROP_TAG(EnableEnergyTransport); //!< Returns whether to consider energy transport or not NEW_PROP_TAG(FaceVariables); //!< 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); //!< Returns whether to normalize the pressure term in the momentum balance or not +NEW_PROP_TAG(EnergyFluxVariables); //!< Returns whether to normalize the pressure term in the momentum balance or not // \} } diff --git a/dumux/freeflow/staggeredni/localresidual.hh b/dumux/freeflow/staggeredni/localresidual.hh deleted file mode 100644 index 43b22fe26249ab5bf89baed2330bcc411271af7c..0000000000000000000000000000000000000000 --- a/dumux/freeflow/staggeredni/localresidual.hh +++ /dev/null @@ -1,145 +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 Jacobian matrix for problems - * using the non-isothermal Stokes model with a staggered grid. - * - */ -#ifndef DUMUX_STAGGERED_NAVIERSTOKES_NI_LOCAL_RESIDUAL_HH -#define DUMUX_STAGGERED_NAVIERSTOKES_NI_LOCAL_RESIDUAL_HH - -#include <dune/istl/matrix.hh> - -#include <dumux/common/valgrind.hh> -#include <dumux/implicit/staggered/localresidual.hh> - -#include "properties.hh" - -namespace Dumux -{ - -namespace Properties -{ -// forward declaration -NEW_PROP_TAG(EnableEnergyBalanceStokes); -NEW_PROP_TAG(EnableInertiaTerms); -} - -/*! - * \ingroup StaggeredModel - * \ingroup StaggeredLocalResidual - * \brief Element-wise calculation of the residual for models - * based on the staggered grid scheme - * - * \todo Please doc me more! - */ - -// forward declaration -template<class TypeTag, bool enableComponentTransport, bool enableEnergyBalance> -class StaggeredNavierStokesResidualImpl; - -// specialization for immiscible, non-isothermal flow -template<class TypeTag> -class StaggeredNavierStokesResidualImpl<TypeTag, false, true> : public StaggeredNavierStokesResidualImpl<TypeTag, false, false> -{ - friend class StaggeredLocalResidual<TypeTag>; - using ParentType = StaggeredNavierStokesResidualImpl<TypeTag, false, false>; - - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using SubControlVolume = typename GET_PROP_TYPE(TypeTag, SubControlVolume); - using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); - using Indices = typename GET_PROP_TYPE(TypeTag, Indices); - using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables); - - using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices); - typename DofTypeIndices::CellCenterIdx cellCenterIdx; - typename DofTypeIndices::FaceIdx faceIdx; - - enum { - massBalanceIdx = Indices::massBalanceIdx, - energyBalanceIdx = Indices::energyBalanceIdx - }; - - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using GlobalFaceVars = typename GET_PROP_TYPE(TypeTag, GlobalFaceVars); - - using GridView = typename GET_PROP_TYPE(TypeTag, GridView); - using Element = typename GridView::template Codim<0>::Entity; - using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVElementGeometry); - using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, ElementVolumeVariables); - -// static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); - -public: - /*! - * \brief Evaluate the cell center storage terms of the non-isothermal Stokes model. - * - * The result should be averaged over the volume (e.g. phase mass - * inside a sub control volume divided by the volume) - * - * \param scv The sub control volume - * \param volVars The volume variables - */ - CellCenterPrimaryVariables computeStorageForCellCenter(const SubControlVolume& scv, const VolumeVariables& volVars) - { - CellCenterPrimaryVariables storage(0.0); -// const Scalar density = useMoles? volVars.molarDensity() : volVars.density(); - - // compute storage of mass - storage = ParentType::computeStorageForCellCenter(scv, volVars); - - // compute the storage of energy - storage[energyBalanceIdx] = volVars.density() * volVars.internalEnergy(); - - return storage; - } - - - /*! - * \brief Evaluate the cell center source terms of the non-isothermal Stokes model. - * - * The result should be averaged over the volume (e.g. phase mass - * inside a sub control volume divided by the volume) - * - * \param element The element - * \param fvGeometry The finite-volume geometry - * \param elemVolVars All volume variables for the element - * \param globalFaceVars The face variables - * \param scv The sub control volume - */ - CellCenterPrimaryVariables computeSourceForCellCenter(const Element &element, - const FVElementGeometry& fvGeometry, - const ElementVolumeVariables& elemVolVars, - const GlobalFaceVars& globalFaceVars, - const SubControlVolume &scv) - { - CellCenterPrimaryVariables source(0.0); - - source = this->problem().sourceAtPos(scv.center())[cellCenterIdx][massBalanceIdx]; - source = this->problem().sourceAtPos(scv.center())[cellCenterIdx][energyBalanceIdx]; - - return source; - } -}; - -} // end namespace - -#endif diff --git a/dumux/freeflow/staggeredni/properties.hh b/dumux/freeflow/staggeredni/properties.hh index 19f6a6bf2ef455018952cb967440e074c999f239..eafcdbdaf5a2a4e7c89ebd24a84041bd9e8e657f 100644 --- a/dumux/freeflow/staggeredni/properties.hh +++ b/dumux/freeflow/staggeredni/properties.hh @@ -27,7 +27,7 @@ #ifndef DUMUX_NAVIERSTOKES_NI_PROPERTIES_HH #define DUMUX_NAVIERSTOKES_NI_PROPERTIES_HH -#include <dumux/freeflow/staggered/properties.hh> +// #include <dumux/freeflow/staggered/properties.hh> namespace Dumux { @@ -42,7 +42,7 @@ namespace Properties { ////////////////////////////////////////////////////////////////// //! The type tags for the non-isothermal Navier Stokes problems -NEW_TYPE_TAG(NavierStokesNI, INHERITS_FROM(NavierStokes)); +NEW_TYPE_TAG(StaggeredNonIsothermal); NEW_PROP_TAG(EnableEnergyBalanceStokes); @@ -54,6 +54,29 @@ NEW_PROP_TAG(EnableEnergyBalanceStokes); ////////////////////////////////////////////////////////////////// NEW_PROP_TAG(PhaseIdx); //!< Defines the phaseIdx + +////////////////////////////////////////////////////////////////// +// Property tags required for the non-isothermal models +////////////////////////////////////////////////////////////////// + +//TODO cleanup + +NEW_PROP_TAG(IsothermalModel); +NEW_PROP_TAG(IsothermalFluxVariables); +NEW_PROP_TAG(IsothermalVolumeVariables); +NEW_PROP_TAG(IsothermalIndices); +NEW_PROP_TAG(IsothermalNumEqCellCenter); +NEW_PROP_TAG(IsothermalNumEqFace); +NEW_PROP_TAG(HaveVariableFormulation); +NEW_PROP_TAG(ThermalConductivityModel); +NEW_PROP_TAG(NiOutputLevel); + +// forward declaration of other property tags +NEW_PROP_TAG(Indices); +NEW_PROP_TAG(NumPhases); +NEW_PROP_TAG(FluidSystem); + + // \} } diff --git a/dumux/freeflow/staggeredni/propertydefaults.hh b/dumux/freeflow/staggeredni/propertydefaults.hh index 93163c2866e2c24754072d742dec04694220d561..e719c97ec2683d6497435fa767f1e263bc7923fb 100644 --- a/dumux/freeflow/staggeredni/propertydefaults.hh +++ b/dumux/freeflow/staggeredni/propertydefaults.hh @@ -27,35 +27,16 @@ #ifndef DUMUX_NAVIER_STOKES_NI_PROPERTY_DEFAULTS_HH #define DUMUX_NAVIER_STOKES_NI_PROPERTY_DEFAULTS_HH -// TODO clean-up #include "properties.hh" - #include "model.hh" #include "volumevariables.hh" #include "indices.hh" -#include "localresidual.hh" -#include "fluxvariables.hh" -#include "../staggered/problem.hh" -#include "../staggered/propertydefaults.hh" - -#include <dumux/implicit/staggered/localresidual.hh> -//#include <dumux/material/fluidsystems/gasphase.hh> -#include <dumux/material/fluidsystems/liquidphase.hh> -//#include <dumux/material/components/nullcomponent.hh> -//#include <dumux/material/fluidsystems/1p.hh> - -#include <dumux/material/fluidstates/immiscible.hh> +#include "../staggered/propertydefaults.hh" //TODO: why do we need this include? namespace Dumux { -namespace Properties -{ -// forward declaration -NEW_PROP_TAG(FluxVariables); -NEW_PROP_TAG(FluxVariablesCache); -} // \{ /////////////////////////////////////////////////////////////////////////// @@ -63,20 +44,28 @@ NEW_PROP_TAG(FluxVariablesCache); /////////////////////////////////////////////////////////////////////////// namespace Properties { -SET_INT_PROP(NavierStokesNI, NumEqCellCenter, 2); - -//! the VolumeVariables property -SET_TYPE_PROP(NavierStokesNI, VolumeVariables, NavierStokesNIVolumeVariables<TypeTag>); -SET_TYPE_PROP(NavierStokesNI, Model, NavierStokesNIModel<TypeTag>); -SET_TYPE_PROP(NavierStokesNI, Indices, NavierStokesNIIndices<TypeTag>); - -SET_BOOL_PROP(NavierStokesNI, EnableEnergyBalanceStokes, true); - -SET_BOOL_PROP(NavierStokesNI, UseMoles, true); - -SET_TYPE_PROP(NavierStokesNI, HeatConductionType, FouriersLaw<TypeTag>); - -SET_INT_PROP(NavierStokesNI, PhaseIdx, 0); //!< Defines the phaseIdx +SET_PROP(StaggeredNonIsothermal, NumEqCellCenter) +{ +private: + static constexpr auto isothermalNumEqCellCenter = GET_PROP_VALUE(TypeTag, IsothermalNumEqCellCenter); +public: + static constexpr auto value = isothermalNumEqCellCenter + 1; +}; + +// SET_INT_PROP(StaggeredNonIsothermal, NumEqCellCenter, 2); +// +// //! the VolumeVariables property +SET_TYPE_PROP(StaggeredNonIsothermal, VolumeVariables, NavierStokesNIVolumeVariables<TypeTag>); +SET_TYPE_PROP(StaggeredNonIsothermal, Model, StaggeredNonIsothermalModel<TypeTag>); +SET_TYPE_PROP(StaggeredNonIsothermal, Indices, StaggeredNonIsothermalIndices<TypeTag>); +// +SET_BOOL_PROP(StaggeredNonIsothermal, EnableEnergyBalanceStokes, true); +// +SET_BOOL_PROP(StaggeredNonIsothermal, UseMoles, true); +// +SET_TYPE_PROP(StaggeredNonIsothermal, HeatConductionType, FouriersLaw<TypeTag>); +// +SET_INT_PROP(StaggeredNonIsothermal, PhaseIdx, 0); //!< Defines the phaseIdx } // end namespace Properties