24#ifndef DUMUX_ROUGH_CHANNEL_SPATIAL_PARAMETERS_HH
25#define DUMUX_ROUGH_CHANNEL_SPATIAL_PARAMETERS_HH
40template<
class Gr
idGeometry,
class Scalar,
class VolumeVariables>
43 RoughChannelSpatialParams<GridGeometry, Scalar, VolumeVariables>>
47 using GridView =
typename GridGeometry::GridView;
48 using FVElementGeometry =
typename GridGeometry::LocalView;
49 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
50 using Element =
typename GridView::template Codim<0>::Entity;
51 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
57 gravity_ = getParam<Scalar>(
"Problem.Gravity");
58 bedSlope_ = getParam<Scalar>(
"Problem.BedSlope");
59 frictionLawType_ = getParam<std::string>(
"Problem.FrictionLaw");
68 if (frictionLawType_ ==
"Manning")
70 Scalar manningN = getParam<Scalar>(
"Problem.ManningN");
71 frictionLaw_ = std::make_unique<FrictionLawManning<VolumeVariables>>(gravity_, manningN);
73 else if (frictionLawType_ ==
"Nikuradse")
75 Scalar ks = getParam<Scalar>(
"Problem.Ks");
76 frictionLaw_ = std::make_unique<FrictionLawNikuradse<VolumeVariables>>(ks);
80 std::cout<<
"The FrictionLaw in params.input is unknown. Valid entries are 'Manning' and 'Nikuradse'!"<<std::endl;
88 Scalar
gravity(
const GlobalPosition& globalPos)
const
110 const SubControlVolume& scv)
const
112 return *frictionLaw_;
123 const SubControlVolume& scv)
const
126 return 10.0 - element.geometry().center()[0] * bedSlope_;
132 std::string frictionLawType_;
133 std::unique_ptr<FrictionLaw<VolumeVariables>> frictionLaw_;
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
The base class for spatial parameters of multi-phase problems using a fully implicit discretization m...
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
Implementation of the abstract base class for friction laws.
Definition: frictionlaw.hh:42
The base class for spatial parameters of multi-phase problems using a fully implicit discretization m...
Definition: fv.hh:57
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: fv1p.hh:334
The spatial parameters class for the rough channel test.
Definition: freeflow/shallowwater/roughchannel/spatialparams.hh:44
Scalar gravity() const
Define the gravitation.
Definition: freeflow/shallowwater/roughchannel/spatialparams.hh:97
Scalar bedSurface(const Element &element, const SubControlVolume &scv) const
Define the bed surface.
Definition: freeflow/shallowwater/roughchannel/spatialparams.hh:122
RoughChannelSpatialParams(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: freeflow/shallowwater/roughchannel/spatialparams.hh:54
Scalar gravity(const GlobalPosition &globalPos) const
Define the gravitation.
Definition: freeflow/shallowwater/roughchannel/spatialparams.hh:88
const FrictionLaw< VolumeVariables > & frictionLaw(const Element &element, const SubControlVolume &scv) const
Get the frictionLaw.
Definition: freeflow/shallowwater/roughchannel/spatialparams.hh:109
void initFrictionLaw()
Initialize the FrictionLaw.
Definition: freeflow/shallowwater/roughchannel/spatialparams.hh:66