Commit 171ff32d authored by Kilian Weishaupt's avatar Kilian Weishaupt
Browse files

[freeflow][compositional] Change inheritance pattern

* Do not pass base class as template parameter for compositional
  localRes and fluxVars

* instead pass base class as template parameter for rans localRes
  and fluxVars
parent 756eb69c
......@@ -32,7 +32,7 @@ namespace Dumux
// forward declaration
template<class TypeTag, class BaseFluxVariables, DiscretizationMethod discMethod>
template<class TypeTag, DiscretizationMethod discMethod>
class FreeflowNCFluxVariablesImpl;
/*!
......@@ -42,8 +42,8 @@ class FreeflowNCFluxVariablesImpl;
discretization-specific flux variables.
* \note Not all specializations are currently implemented
*/
template<class TypeTag, class BaseFluxVariables>
using FreeflowNCFluxVariables = FreeflowNCFluxVariablesImpl<TypeTag, BaseFluxVariables, GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod>;
template<class TypeTag>
using FreeflowNCFluxVariables = FreeflowNCFluxVariablesImpl<TypeTag, GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod>;
} // end namespace
......
......@@ -33,7 +33,7 @@ namespace Dumux
{
// forward declaration
template<class TypeTag, class BaseLocalResidual, DiscretizationMethod discMethod>
template<class TypeTag, DiscretizationMethod discMethod>
class FreeflowNCResidualImpl;
/*!
......@@ -43,8 +43,8 @@ class FreeflowNCResidualImpl;
discretization-specific local residual.
* \note Not all specializations are currently implemented
*/
template<class TypeTag, class BaseLocalResidual>
using FreeflowNCResidual = FreeflowNCResidualImpl<TypeTag, BaseLocalResidual, GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod>;
template<class TypeTag>
using FreeflowNCResidual = FreeflowNCResidualImpl<TypeTag, GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod>;
}
......
......@@ -105,18 +105,18 @@ public:
SET_PROP(LowReKEpsilonNC, LocalResidual)
{
private:
using BaseLocalResidual = LowReKEpsilonResidual<TypeTag>;
using BaseLocalResidual = FreeflowNCResidual<TypeTag>;
public:
using type = FreeflowNCResidual<TypeTag, BaseLocalResidual>;
using type = LowReKEpsilonResidual<TypeTag, BaseLocalResidual>;
};
//! The flux variables
SET_PROP(LowReKEpsilonNC, FluxVariables)
{
private:
using BaseFluxVariables = LowReKEpsilonFluxVariables<TypeTag>;
using BaseFluxVariables = FreeflowNCFluxVariables<TypeTag>;
public:
using type = FreeflowNCFluxVariables<TypeTag, BaseFluxVariables>;
using type = LowReKEpsilonFluxVariables<TypeTag, BaseFluxVariables>;
};
//! The specific vtk output fields
......@@ -174,18 +174,18 @@ public:
SET_PROP(LowReKEpsilonNCNI, LocalResidual)
{
private:
using BaseLocalResidual = LowReKEpsilonResidual<TypeTag>;
using BaseLocalResidual = FreeflowNCResidual<TypeTag>;
public:
using type = FreeflowNCResidual<TypeTag, BaseLocalResidual>;
using type = LowReKEpsilonResidual<TypeTag, BaseLocalResidual>;
};
//! The flux variables
SET_PROP(LowReKEpsilonNCNI, FluxVariables)
{
private:
using BaseFluxVariables = LowReKEpsilonFluxVariables<TypeTag>;
using BaseFluxVariables = FreeflowNCFluxVariables<TypeTag>;
public:
using type = FreeflowNCFluxVariables<TypeTag, BaseFluxVariables>;
using type = LowReKEpsilonFluxVariables<TypeTag, BaseFluxVariables>;
};
//! The specific vtk output fields
......
......@@ -138,13 +138,7 @@ SET_BOOL_PROP(NavierStokesNC, EnableInertiaTerms, true); //!< Consider inertia t
SET_BOOL_PROP(NavierStokesNC, NormalizePressure, true); //!< Normalize the pressure term in the momentum balance by default
//! The local residual
SET_PROP(NavierStokesNC, LocalResidual)
{
private:
using BaseLocalResidual = NavierStokesResidual<TypeTag>;
public:
using type = FreeflowNCResidual<TypeTag, BaseLocalResidual>;
};
SET_TYPE_PROP(NavierStokesNC, LocalResidual, FreeflowNCResidual<TypeTag>);
//! Set the volume variables property
SET_PROP(NavierStokesNC, VolumeVariables)
......@@ -161,13 +155,7 @@ public:
};
//! The flux variables
SET_PROP(NavierStokesNC, FluxVariables)
{
private:
using BaseFluxVariables = NavierStokesFluxVariables<TypeTag>;
public:
using type = FreeflowNCFluxVariables<TypeTag, BaseFluxVariables>;
};
SET_TYPE_PROP(NavierStokesNC, FluxVariables, FreeflowNCFluxVariables<TypeTag>);
//! The flux variables cache class, by default the one for free flow
SET_TYPE_PROP(NavierStokesNC, FluxVariablesCache, FreeFlowFluxVariablesCache<TypeTag>);
......
......@@ -34,18 +34,18 @@ namespace Dumux
{
// forward declaration
template<class TypeTag, class BaseFluxVariables, DiscretizationMethod discMethod>
template<class TypeTag, DiscretizationMethod discMethod>
class FreeflowNCFluxVariablesImpl;
/*!
* \ingroup FreeflowNCModel
* \brief The flux variables class for the multi-component free-flow model using the staggered grid discretization.
*/
template<class TypeTag, class BaseFluxVariables>
class FreeflowNCFluxVariablesImpl<TypeTag, BaseFluxVariables, DiscretizationMethod::staggered>
: public BaseFluxVariables
template<class TypeTag>
class FreeflowNCFluxVariablesImpl<TypeTag, DiscretizationMethod::staggered>
: public NavierStokesFluxVariables<TypeTag>
{
using ParentType = BaseFluxVariables;
using ParentType = NavierStokesFluxVariables<TypeTag>;
using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
using FVElementGeometry = typename FVGridGeometry::LocalView;
......
......@@ -31,18 +31,18 @@
namespace Dumux {
// forward declaration
template<class TypeTag, class BaseLocalResidual, DiscretizationMethod discMethod>
template<class TypeTag, DiscretizationMethod discMethod>
class FreeflowNCResidualImpl;
/*!
* \ingroup FreeflowNCModel
* \brief Element-wise calculation of the multi-component free-flow residual for models using the staggered discretization
*/
template<class TypeTag, class BaseLocalResidual>
class FreeflowNCResidualImpl<TypeTag, BaseLocalResidual, DiscretizationMethod::staggered>
: public BaseLocalResidual
template<class TypeTag>
class FreeflowNCResidualImpl<TypeTag, DiscretizationMethod::staggered>
: public NavierStokesResidual<TypeTag>
{
using ParentType = BaseLocalResidual;
using ParentType = NavierStokesResidual<TypeTag>;
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
......@@ -70,7 +70,7 @@ public:
const SubControlVolume& scv,
const VolumeVariables& volVars) const
{
CellCenterPrimaryVariables storage = ParentType::computeStorageForCellCenter(problem, scv, volVars);
CellCenterPrimaryVariables storage(0.0);
const Scalar density = useMoles ? volVars.molarDensity() : volVars.density();
......
......@@ -31,7 +31,7 @@ namespace Dumux
{
// forward declaration
template<class TypeTag, DiscretizationMethod discMethod>
template<class TypeTag, class BaseFluxVariables, DiscretizationMethod discMethod>
class LowReKEpsilonFluxVariablesImpl;
/*!
......@@ -41,8 +41,8 @@ class LowReKEpsilonFluxVariablesImpl;
discretization-specific flux variables.
* \note Not all specializations are currently implemented
*/
template<class TypeTag>
using LowReKEpsilonFluxVariables = LowReKEpsilonFluxVariablesImpl<TypeTag, GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod>;
template<class TypeTag, class BaseFluxVariables>
using LowReKEpsilonFluxVariables = LowReKEpsilonFluxVariablesImpl<TypeTag, BaseFluxVariables, GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod>;
} // end namespace
......
......@@ -33,7 +33,7 @@ namespace Dumux
{
// forward declaration
template<class TypeTag, DiscretizationMethod discMethod>
template<class TypeTag, class BaseLocalResidual, DiscretizationMethod discMethod>
class LowReKEpsilonResidualImpl;
/*!
......@@ -43,8 +43,8 @@ class LowReKEpsilonResidualImpl;
discretization-specific local residual.
* \note Not all specializations are currently implemented
*/
template<class TypeTag>
using LowReKEpsilonResidual = LowReKEpsilonResidualImpl<TypeTag, GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod>;
template<class TypeTag, class BaseLocalResidual>
using LowReKEpsilonResidual = LowReKEpsilonResidualImpl<TypeTag, BaseLocalResidual, GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod>;
}
......
......@@ -133,10 +133,22 @@ public:
};
//! The flux variables
SET_TYPE_PROP(LowReKEpsilon, FluxVariables, LowReKEpsilonFluxVariables<TypeTag>);
SET_PROP(LowReKEpsilon, FluxVariables)
{
private:
using BaseFluxVariables = NavierStokesFluxVariables<TypeTag>;
public:
using type = LowReKEpsilonFluxVariables<TypeTag, BaseFluxVariables>;
};
//! The local residual
SET_TYPE_PROP(LowReKEpsilon, LocalResidual, LowReKEpsilonResidual<TypeTag>);
SET_PROP(LowReKEpsilon, LocalResidual)
{
private:
using BaseLocalResidual = NavierStokesResidual<TypeTag>;
public:
using type = LowReKEpsilonResidual<TypeTag, BaseLocalResidual>;
};
//! Set the volume variables property
SET_PROP(LowReKEpsilon, VolumeVariables)
......
......@@ -35,18 +35,18 @@ namespace Dumux
{
// forward declaration
template<class TypeTag, DiscretizationMethod discMethod>
template<class TypeTag, class BaseFluxVariables, DiscretizationMethod discMethod>
class LowReKEpsilonFluxVariablesImpl;
/*!
* \ingroup LowReKEpsilonModel
* \brief The flux variables class for the low-Reynolds k-epsilon model using the staggered grid discretization.
*/
template<class TypeTag>
class LowReKEpsilonFluxVariablesImpl<TypeTag, DiscretizationMethod::staggered>
: public NavierStokesFluxVariables<TypeTag>
template<class TypeTag, class BaseFluxVariables>
class LowReKEpsilonFluxVariablesImpl<TypeTag, BaseFluxVariables, DiscretizationMethod::staggered>
: public BaseFluxVariables
{
using ParentType = NavierStokesFluxVariables<TypeTag>;
using ParentType = BaseFluxVariables;
using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables);
......
......@@ -32,18 +32,18 @@
namespace Dumux {
// forward declaration
template<class TypeTag, DiscretizationMethod discMethod>
template<class TypeTag, class BaseLocalResidual, DiscretizationMethod discMethod>
class LowReKEpsilonResidualImpl;
/*!
* \ingroup LowReKepsilonModel
* \brief Element-wise calculation of the residual for low-Reynolds k-epsilon models using the staggered discretization
*/
template<class TypeTag>
class LowReKEpsilonResidualImpl<TypeTag, DiscretizationMethod::staggered>
: public NavierStokesResidual<TypeTag>
template<class TypeTag, class BaseLocalResidual>
class LowReKEpsilonResidualImpl<TypeTag, BaseLocalResidual, DiscretizationMethod::staggered>
: public BaseLocalResidual
{
using ParentType = NavierStokesResidual<TypeTag>;
using ParentType = BaseLocalResidual;
using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables);
......
......@@ -15,7 +15,7 @@ dune_add_test(NAME test_channel_zeroeq2cni
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/test_channel_zeroeq2cni.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_channel2cni-00035.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_channel2cni-00034.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_channel_zeroeq2cni test_channel2cni.input")
target_compile_definitions(test_channel_zeroeq2cni PUBLIC "NONISOTHERMAL=1")
......
......@@ -16,13 +16,11 @@ InletVelocity = 0.1 # [m/s]
EnableGravity = false
[RANS]
EddyViscosityModel = 3
TurbulentSchmidtNumber = 0.7
TurbulentPrandtlNumber = 0.85
[Assembly]
NumericDifferenceMethod = 0
NumericEpsilon.BaseEpsilon = 1e-8
[Newton]
MaxSteps = 10
......
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment