From ea25e40b07ec33fc6072cc96bc4feb1321071630 Mon Sep 17 00:00:00 2001 From: Sina Ackermann <sina.ackermann@iws.uni-stuttgart.de> Date: Fri, 2 Jun 2017 12:18:27 +0200 Subject: [PATCH] [staggeredGrid][nonisothermal] Clean-up and minor improvements --- dumux/freeflow/staggered/properties.hh | 7 +++--- dumux/freeflow/staggered/propertydefaults.hh | 3 --- dumux/freeflow/staggered/volumevariables.hh | 2 +- dumux/freeflow/staggeredni/fluxvariables.hh | 13 +++------- dumux/freeflow/staggeredni/indices.hh | 2 +- dumux/freeflow/staggeredni/localresidual.hh | 2 +- dumux/freeflow/staggeredni/model.hh | 2 +- dumux/freeflow/staggeredni/properties.hh | 22 +--------------- .../freeflow/staggeredni/propertydefaults.hh | 25 ++++++------------- 9 files changed, 19 insertions(+), 59 deletions(-) diff --git a/dumux/freeflow/staggered/properties.hh b/dumux/freeflow/staggered/properties.hh index 0cf851a97d..246bcc04d7 100644 --- a/dumux/freeflow/staggered/properties.hh +++ b/dumux/freeflow/staggered/properties.hh @@ -44,10 +44,9 @@ 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, StaggeredNonIsothermal)); +NEW_TYPE_TAG(NavierStokesNI, INHERITS_FROM(NavierStokes, NavierStokesNonIsothermal)); ////////////////////////////////////////////////////////////////// // Property tags @@ -68,8 +67,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 +NEW_PROP_TAG(EnergyLocalResidual); //!< The energy local residual +NEW_PROP_TAG(EnergyFluxVariables); //!< The energy flux variables // \} } diff --git a/dumux/freeflow/staggered/propertydefaults.hh b/dumux/freeflow/staggered/propertydefaults.hh index 183415654a..df8c3069f2 100644 --- a/dumux/freeflow/staggered/propertydefaults.hh +++ b/dumux/freeflow/staggered/propertydefaults.hh @@ -206,9 +206,6 @@ SET_TYPE_PROP(NavierStokes, EnergyFluxVariables, FreeFlowEnergyFluxVariables<Typ // set isothermal Model SET_TYPE_PROP(NavierStokesNI, IsothermalModel, NavierStokesModel<TypeTag>); -//set isothermal VolumeVariables -SET_TYPE_PROP(NavierStokesNI, IsothermalVolumeVariables, NavierStokesVolumeVariables<TypeTag>); - //set isothermal Indices SET_TYPE_PROP(NavierStokesNI, IsothermalIndices, NavierStokesCommonIndices<TypeTag>); diff --git a/dumux/freeflow/staggered/volumevariables.hh b/dumux/freeflow/staggered/volumevariables.hh index 192ec02d30..463710c46d 100644 --- a/dumux/freeflow/staggered/volumevariables.hh +++ b/dumux/freeflow/staggered/volumevariables.hh @@ -44,7 +44,7 @@ class NavierStokesVolumeVariablesImplementation; * is specialized for isothermal and non-isothermal models. */ template <class TypeTag> -using NavierStokesVolumeVariables = NavierStokesVolumeVariablesImplementation<TypeTag, GET_PROP_VALUE(TypeTag, EnableEnergyBalanceStokes)>; +using NavierStokesVolumeVariables = NavierStokesVolumeVariablesImplementation<TypeTag, GET_PROP_VALUE(TypeTag, EnableEnergyBalance)>; /*! * \ingroup NavierStokesModel diff --git a/dumux/freeflow/staggeredni/fluxvariables.hh b/dumux/freeflow/staggeredni/fluxvariables.hh index 346fe740a5..34d8b7f6b4 100644 --- a/dumux/freeflow/staggeredni/fluxvariables.hh +++ b/dumux/freeflow/staggeredni/fluxvariables.hh @@ -28,12 +28,6 @@ namespace Dumux { -namespace Properties -{ -// forward declaration -NEW_PROP_TAG(EnableEnergyBalanceStokes); -} - /*! * \ingroup ImplicitModel * \brief The flux variables class @@ -46,7 +40,7 @@ template<class TypeTag, bool enableEnergyBalance> class FreeFlowEnergyFluxVariablesImplementation; template<class TypeTag> -using FreeFlowEnergyFluxVariables = FreeFlowEnergyFluxVariablesImplementation<TypeTag, GET_PROP_VALUE(TypeTag, EnableEnergyBalanceStokes)>; +using FreeFlowEnergyFluxVariables = FreeFlowEnergyFluxVariablesImplementation<TypeTag, GET_PROP_VALUE(TypeTag, EnableEnergyBalance)>; // specialization for isothermal flow template<class TypeTag> @@ -94,7 +88,6 @@ class FreeFlowEnergyFluxVariablesImplementation<TypeTag, true> using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); using HeatConductionType = typename GET_PROP_TYPE(TypeTag, HeatConductionType); - static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); enum { energyBalanceIdx = Indices::energyBalanceIdx }; @@ -152,8 +145,8 @@ private: const auto& downstreamVolVars = insideIsUpstream ? outsideVolVars : insideVolVars; const Scalar upWindWeight = GET_PROP_VALUE(TypeTag, ImplicitUpwindWeight); - const Scalar upstreamDensity = useMoles ? upstreamVolVars.molarDensity() : upstreamVolVars.density(); - const Scalar downstreamDensity = useMoles ? downstreamVolVars.molarDensity() : downstreamVolVars.density(); + const Scalar upstreamDensity = upstreamVolVars.density(); + const Scalar downstreamDensity = downstreamVolVars.density(); const Scalar upstreamEnthalpy = upstreamVolVars.enthalpy(); const Scalar downstreamEnthalpy = downstreamVolVars.enthalpy(); diff --git a/dumux/freeflow/staggeredni/indices.hh b/dumux/freeflow/staggeredni/indices.hh index 1490e097df..63bf022ab8 100644 --- a/dumux/freeflow/staggeredni/indices.hh +++ b/dumux/freeflow/staggeredni/indices.hh @@ -34,7 +34,7 @@ namespace Dumux * \tparam PVOffset The first index in a primary variable vector. */ template <class TypeTag, int PVOffset = 0> -class StaggeredNonIsothermalIndices : public GET_PROP_TYPE(TypeTag, IsothermalIndices) +class NavierStokesNonIsothermalIndices : public GET_PROP_TYPE(TypeTag, IsothermalIndices) { public: static const int numEqCC = GET_PROP_VALUE(TypeTag, NumEqCellCenter); diff --git a/dumux/freeflow/staggeredni/localresidual.hh b/dumux/freeflow/staggeredni/localresidual.hh index 39ad52191a..b6517c21ac 100644 --- a/dumux/freeflow/staggeredni/localresidual.hh +++ b/dumux/freeflow/staggeredni/localresidual.hh @@ -46,7 +46,7 @@ class FreeFlowEnergyLocalResidualImplementation; * \brief Element-wise calculation of the energy residual for non-isothermal problems. */ template<class TypeTag> -using FreeFlowEnergyLocalResidual = FreeFlowEnergyLocalResidualImplementation<TypeTag, GET_PROP_VALUE(TypeTag, EnableEnergyBalanceStokes)>; +using FreeFlowEnergyLocalResidual = FreeFlowEnergyLocalResidualImplementation<TypeTag, GET_PROP_VALUE(TypeTag, EnableEnergyBalance)>; template<class TypeTag> class FreeFlowEnergyLocalResidualImplementation<TypeTag, false> diff --git a/dumux/freeflow/staggeredni/model.hh b/dumux/freeflow/staggeredni/model.hh index f3dd02701a..668a5a0765 100644 --- a/dumux/freeflow/staggeredni/model.hh +++ b/dumux/freeflow/staggeredni/model.hh @@ -40,7 +40,7 @@ namespace Dumux * The model supports compressible as well as incompressible fluids. */ template<class TypeTag > -class StaggeredNonIsothermalModel : public GET_PROP_TYPE(TypeTag, IsothermalModel) +class NavierStokesNonIsothermalModel : public GET_PROP_TYPE(TypeTag, IsothermalModel) { using ParentType = typename GET_PROP_TYPE(TypeTag, IsothermalModel); using Problem = typename GET_PROP_TYPE(TypeTag, Problem); diff --git a/dumux/freeflow/staggeredni/properties.hh b/dumux/freeflow/staggeredni/properties.hh index eafcdbdaf5..26683412f7 100644 --- a/dumux/freeflow/staggeredni/properties.hh +++ b/dumux/freeflow/staggeredni/properties.hh @@ -42,28 +42,14 @@ namespace Properties { ////////////////////////////////////////////////////////////////// //! The type tags for the non-isothermal Navier Stokes problems -NEW_TYPE_TAG(StaggeredNonIsothermal); - -NEW_PROP_TAG(EnableEnergyBalanceStokes); - -//! The type tags for the corresponding non-isothermal problems -// NEW_TYPE_TAG(NavierStokesNI, INHERITS_FROM(NavierStokes, NonIsothermal)); - -////////////////////////////////////////////////////////////////// -// Property tags -////////////////////////////////////////////////////////////////// -NEW_PROP_TAG(PhaseIdx); //!< Defines the phaseIdx - +NEW_TYPE_TAG(NavierStokesNonIsothermal); ////////////////////////////////////////////////////////////////// // 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); @@ -71,12 +57,6 @@ 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 2e6e6fb7ff..958025a640 100644 --- a/dumux/freeflow/staggeredni/propertydefaults.hh +++ b/dumux/freeflow/staggeredni/propertydefaults.hh @@ -29,9 +29,8 @@ #include "properties.hh" #include "model.hh" -#include "../staggered/volumevariables.hh" #include "indices.hh" -#include "../staggered/propertydefaults.hh" //TODO: why do we need this include? +#include "../staggered/propertydefaults.hh" namespace Dumux { @@ -43,7 +42,7 @@ namespace Dumux /////////////////////////////////////////////////////////////////////////// namespace Properties { -SET_PROP(StaggeredNonIsothermal, NumEqCellCenter) +SET_PROP(NavierStokesNonIsothermal, NumEqCellCenter) { private: static constexpr auto isothermalNumEqCellCenter = GET_PROP_VALUE(TypeTag, IsothermalNumEqCellCenter); @@ -51,21 +50,13 @@ public: static constexpr auto value = isothermalNumEqCellCenter + 1; }; -// SET_INT_PROP(StaggeredNonIsothermal, NumEqCellCenter, 2); -// -// //! the VolumeVariables property -SET_TYPE_PROP(StaggeredNonIsothermal, VolumeVariables, NavierStokesVolumeVariables<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 +SET_TYPE_PROP(NavierStokesNonIsothermal, Model, NavierStokesNonIsothermalModel<TypeTag>); +SET_TYPE_PROP(NavierStokesNonIsothermal, Indices, NavierStokesNonIsothermalIndices<TypeTag>); + +SET_BOOL_PROP(NavierStokesNonIsothermal, EnableEnergyBalance, true); + +SET_TYPE_PROP(NavierStokesNonIsothermal, HeatConductionType, FouriersLaw<TypeTag>); } // end namespace Properties -- GitLab