Commit 2f89ac0c authored by Bernd Flemisch's avatar Bernd Flemisch Committed by hanchuan
Browse files

[test][angeli] add test for averaging velocity initial and boundary conditions

parent 91110633
Pipeline #4152 waiting for manual action with stages
......@@ -9,4 +9,18 @@ dumux_add_test(NAME test_ff_navierstokes_angeli
--command "${CMAKE_CURRENT_BINARY_DIR}/test_ff_navierstokes_angeli params.input
-Problem.Name test_ff_navierstokes_angeli")
dumux_add_test(NAME test_ff_navierstokes_angeli_averaged
LABELS freeflow navierstokes
TARGET test_ff_navierstokes_angeli
CMAKE_GUARD HAVE_UMFPACK
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/test_ff_navierstokes_angeli_averaged-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_ff_navierstokes_angeli_averaged-00001.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_ff_navierstokes_angeli params.input
-TimeLoop.TEnd 1e-6 -TimeLoop.DtInitial 1e-6
-Problem.Name test_ff_navierstokes_angeli_averaged
-Problem.UseVelocityAveragingForInitial true
-Problem.UseVelocityAveragingForDirichlet true")
dune_symlink_to_source_files(FILES "params.input")
......@@ -12,6 +12,8 @@ Name = test_angeli # name passed to the output routines
EnableGravity = false
PrintL2Error = false
EnableInertiaTerms = true
UseVelocityAveragingForInitial = false
UseVelocityAveragingForDirichlet = false
[Component]
LiquidDensity = 1
......
......@@ -77,6 +77,8 @@ public:
{
kinematicViscosity_ = getParam<Scalar>("Component.LiquidKinematicViscosity", 1.0);
rho_ = getParam<Scalar>("Component.LiquidDensity", 1.0);
useVelocityAveragingForDirichlet_ = getParam<bool>("Problem.UseVelocityAveragingForDirichlet", false);
useVelocityAveragingForInitial_ = getParam<bool>("Problem.UseVelocityAveragingForInitial", false);
}
/*!
......@@ -135,10 +137,15 @@ public:
*
* \param element The finite element
* \param scvf the sub control volume face
*
* Concerning the usage of averagedVelocity_, see the explanation of the initial function.
*/
PrimaryVariables dirichlet(const Element& element, const SubControlVolumeFace& scvf) const
{
return velocityDirichlet_(scvf);
if (useVelocityAveragingForDirichlet_)
return averagedVelocity_(scvf);
else
return analyticalSolution(scvf.center());
}
/*!
......@@ -192,11 +199,21 @@ public:
}
/*!
* \brief Evaluates the initial value for a face control volume (velocities)
* \brief Evaluates the initial value for a sub control volume face (velocities)
*
* Simply assigning the value of the analytical solution at the face center
* gives a discrete solution that is not divergence-free. For small initial
* time steps, this has a negative impact on the pressure solution
* after the first time step. The flag UseVelocityAveragingForInitial triggers the
* function averagedVelocity_ which uses a higher order quadrature formula to
* bring the discrete solution sufficiently close to being divergence-free.
*/
PrimaryVariables initial(const SubControlVolumeFace& scvf) const
{
return velocityDirichlet_(scvf);
if (useVelocityAveragingForInitial_)
return averagedVelocity_(scvf);
else
return analyticalSolution(scvf.center());
}
// \}
......@@ -210,7 +227,7 @@ public:
}
private:
PrimaryVariables velocityDirichlet_(const SubControlVolumeFace& scvf) const
PrimaryVariables averagedVelocity_(const SubControlVolumeFace& scvf) const
{
PrimaryVariables priVars(0.0);
const auto geo = scvf.geometry();
......@@ -230,6 +247,8 @@ private:
Scalar kinematicViscosity_, rho_;
Scalar time_ = 0;
bool useVelocityAveragingForDirichlet_;
bool useVelocityAveragingForInitial_;
};
} // end namespace Dumux
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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