Skip to content
Snippets Groups Projects
Commit a2935f1c authored by Timo Koch's avatar Timo Koch
Browse files

[swe] Fix missing includes. Cleanup. Pass param group.

parent eb0a5fc9
No related branches found
No related tags found
1 merge request!2486Fix/missing includes
......@@ -27,7 +27,11 @@
#include <cmath>
#include <algorithm>
#include <utility>
#include <type_traits>
#include <dumux/common/parameters.hh>
#include <dumux/flux/fluxvariablescaching.hh>
#include <dumux/flux/shallowwater/fluxlimiterlet.hh>
namespace Dumux {
......@@ -37,7 +41,8 @@ namespace Dumux {
* by adding all surrounding shear stresses.
* For now implemented strictly for 2D depth-averaged models (i.e. 3 equations)
*/
template<class PrimaryVariables, class NumEqVector, typename std::enable_if_t<NumEqVector::size() == 3, int> = 0>
template<class PrimaryVariables, class NumEqVector,
typename std::enable_if_t<NumEqVector::size() == 3, int> = 0>
class ShallowWaterViscousFlux
{
......@@ -112,10 +117,10 @@ public:
const Scalar turbViscosity = [&,gradU=gradU,gradV=gradV]()
{
// The (constant) background turbulent viscosity
static const auto turbBGViscosity = getParam<Scalar>("ShallowWater.TurbulentViscosity", 1.0e-6);
static const auto turbBGViscosity = getParamFromGroup<Scalar>(problem.paramGroup(), "ShallowWater.TurbulentViscosity", 1.0e-6);
// Check whether the mixing-length turbulence model is used
static const auto useMixingLengthTurbulenceModel = getParam<bool>("ShallowWater.UseMixingLengthTurbulenceModel", false);
static const auto useMixingLengthTurbulenceModel = getParamFromGroup<bool>(problem.paramGroup(), "ShallowWater.UseMixingLengthTurbulenceModel", false);
// constant eddy viscosity equal to the prescribed background eddy viscosity
if (!useMixingLengthTurbulenceModel)
......@@ -124,8 +129,8 @@ public:
// turbulence model based on mixing length
// Compute the turbulent viscosity using a combined horizonal/vertical mixing length approach
// Turbulence coefficients: vertical (Elder like) and horizontal (Smagorinsky like)
static const auto turbConstV = getParam<Scalar>("ShallowWater.VerticalCoefficientOfMixingLengthModel", 1.0);
static const auto turbConstH = getParam<Scalar>("ShallowWater.HorizontalCoefficientOfMixingLengthModel", 0.1);
static const auto turbConstV = getParamFromGroup<Scalar>(problem.paramGroup(), "ShallowWater.VerticalCoefficientOfMixingLengthModel", 1.0);
static const auto turbConstH = getParamFromGroup<Scalar>(problem.paramGroup(), "ShallowWater.HorizontalCoefficientOfMixingLengthModel", 0.1);
/** The vertical (Elder-like) contribution to the turbulent viscosity scales with water depth \f[ h \f] and shear velocity \f[ u_{*} \f] :
*
......@@ -193,8 +198,8 @@ public:
const auto vViscousFlux = turbViscosity * averageDepth * gradV;
// compute the mobility of the flux with the fluxlimiter
static const auto upperWaterDepthFluxLimiting = getParam<double>("FluxLimiterLET.UpperWaterDepth", 1e-3);
static const auto lowerWaterDepthFluxLimiting = getParam<double>("FluxLimiterLET.LowerWaterDepth", 1e-5);
static const auto upperWaterDepthFluxLimiting = getParamFromGroup<double>(problem.paramGroup(), "FluxLimiterLET.UpperWaterDepth", 1e-3);
static const auto lowerWaterDepthFluxLimiting = getParamFromGroup<double>(problem.paramGroup(), "FluxLimiterLET.LowerWaterDepth", 1e-5);
const auto limitingDepth = (waterDepthLeft + waterDepthRight) * 0.5;
const auto mobility = ShallowWater::fluxLimiterLET(limitingDepth,
......
......@@ -24,6 +24,7 @@
#ifndef DUMUX_FREEFLOW_SHALLOW_WATER_LOCAL_RESIDUAL_HH
#define DUMUX_FREEFLOW_SHALLOW_WATER_LOCAL_RESIDUAL_HH
#include <dumux/common/parameters.hh>
#include <dumux/common/properties.hh>
namespace Dumux{
......@@ -99,7 +100,7 @@ public:
flux += fluxVars.advectiveFlux(problem, element, fvGeometry, elemVolVars, scvf);
// Compute viscous momentum flux contribution if required
static const bool enableViscousFlux = getParam<bool>("ShallowWater.EnableViscousFlux", false);
static const bool enableViscousFlux = getParamFromGroup<bool>(problem.paramGroup(), "ShallowWater.EnableViscousFlux", false);
if (enableViscousFlux)
flux += fluxVars.viscousFlux(problem, element, fvGeometry, elemVolVars, scvf);
return flux;
......
......@@ -23,11 +23,13 @@
#include <dumux/common/properties.hh>
#include <dumux/freeflow/shallowwater/model.hh>
#include <dumux/discretization/cctpfa.hh>
#include <dune/grid/yaspgrid.hh>
#if HAVE_UG
#include <dune/grid/uggrid.hh>
#else
#include <dune/grid/yaspgrid.hh>
#endif
#ifndef GRIDTYPE
#define GRIDTYPE Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>
#endif
#include "problem.hh"
......
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