Commit 19a7afd0 authored by Martin Utz's avatar Martin Utz
Browse files

[swe][frictionlaws] Change reading of the friction value

parent d19f374c
[Problem]
Name = roughchannel
FrictionValue = 0.025 # [-]
BedSlope = 0.001 # [-]
Gravity = 9.81 # [m/s^2]
Discharge = -1.0 # [m^2/s] discharge per meter at the inflow boundary
FrictionLaw = Manning
ManningN = 0.025 # [-]
# Ks = 0.15 # [m] equivalent sand roughness
[TimeLoop]
TEnd = 900.0 # [s]
......
......@@ -135,7 +135,7 @@ public:
name_ = getParam<std::string>("Problem.Name");
exactWaterDepth_.resize(fvGridGeometry->numDofs(), 0.0);
exactVelocityX_.resize(fvGridGeometry->numDofs(), 0.0);
constManningN_ = this->spatialParams().frictionValue();
constManningN_ = getParam<Scalar>("Problem.ManningN");
bedSlope_ = getParam<Scalar>("Problem.BedSlope");
discharge_ = getParam<Scalar>("Problem.Discharge");
hBoundary_ = this->gauklerManningStrickler(discharge_,constManningN_,bedSlope_);
......
......@@ -56,29 +56,29 @@ public:
{
gravity_ = getParam<Scalar>("Problem.Gravity");
bedSlope_ = getParam<Scalar>("Problem.BedSlope");
frictionValue_ = getParam<Scalar>("Problem.FrictionValue");
frictionLawType_ = getParam<std::string>("Problem.FrictionLaw");
initFrictionLaw();
}
/*!
* \brief Initialize FrictionLaws
* \brief Initialize the FrictionLaw
*/
void initFrictionLaw()
{
if (frictionLawType_ == "Manning")
{
frictionLaw_ = std::make_unique<FrictionLawManning<VolumeVariables>>(gravity_, frictionValue_);
Scalar manningN = getParam<Scalar>("Problem.ManningN");
frictionLaw_ = std::make_unique<FrictionLawManning<VolumeVariables>>(gravity_, manningN);
}
if (frictionLawType_ == "Nikuradse")
{
frictionLaw_ = std::make_unique<FrictionLawNikuradse<VolumeVariables>>(frictionValue_);
Scalar ks = getParam<Scalar>("Problem.Ks"); // equivalent sand roughness
frictionLaw_ = std::make_unique<FrictionLawNikuradse<VolumeVariables>>(ks);
}
else
{
std::cout<<"The FrictionLaw in params.input is unknown. Valid entries are 'Manning' and 'Nikuradse'!"<<std::endl;
}
}
/*! \brief Define the gravitation.
......@@ -99,34 +99,6 @@ public:
return gravity_;
}
/*! \brief Define the friction value.
*
* The unit of the friction value depends on the used friction law.
* The Mannng friction value is just a coefficient and has no unit $[-]$
* In the Nikuradse law the friction value is the equivalent sand roughness
* with the unit $[m]$.
*
* \return friction value
*/
Scalar frictionValue(const GlobalPosition& globalPos) const
{
return frictionValue_;
}
/*! \brief Define the friction value.
*
* The unit of the friction value depends on the used friction law.
* The Mannng friction value is just a coefficient and has no unit $[-]$
* In the Nikuradse law the friction value is the equivalent sand roughness
* with the unit $[m]$.
*
* \return friction value
*/
Scalar frictionValue() const
{
return frictionValue_;
}
/*! \brief Get the frictionLaw.
*
* Get the frictionLaw, which already includes the friction value.
......@@ -156,7 +128,6 @@ public:
private:
Scalar gravity_;
Scalar bedSlope_;
Scalar frictionValue_;
std::string frictionLawType_;
std::unique_ptr<FrictionLaw<VolumeVariables>> frictionLaw_;
};
......
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