Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dumux-repositories
dumux
Commits
19a7afd0
Commit
19a7afd0
authored
Jul 01, 2019
by
Martin Utz
Browse files
[swe][frictionlaws] Change reading of the friction value
parent
d19f374c
Changes
3
Hide whitespace changes
Inline
Side-by-side
test/freeflow/shallowwater/roughchannel/params.input
View file @
19a7afd0
[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]
...
...
test/freeflow/shallowwater/roughchannel/problem.hh
View file @
19a7afd0
...
...
@@ -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
->
spati
al
P
ar
ams
().
frictionValue
(
);
constManningN_
=
getParam
<
Sc
alar
>
(
"Problem.ManningN"
);
bedSlope_
=
getParam
<
Scalar
>
(
"Problem.BedSlope"
);
discharge_
=
getParam
<
Scalar
>
(
"Problem.Discharge"
);
hBoundary_
=
this
->
gauklerManningStrickler
(
discharge_
,
constManningN_
,
bedSlope_
);
...
...
test/freeflow/shallowwater/roughchannel/spatialparams.hh
View file @
19a7afd0
...
...
@@ -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 FrictionLaw
s
* \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_
;
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment