Commit eb70e907 authored by Kilian Weishaupt's avatar Kilian Weishaupt
Browse files

[freeflow][test] Adapt all tests

* Use PrimaryVariables instead of InitialValues, SourceValues, ...
parent 11385f40
......@@ -128,12 +128,7 @@ class ChannelTestProblem : public NavierStokesProblem<TypeTag>
using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables);
using FacePrimaryVariables = typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables);
using BoundaryValues = typename GET_PROP_TYPE(TypeTag, BoundaryValues);
using InitialValues = typename GET_PROP_TYPE(TypeTag, BoundaryValues);
using SourceValues = typename GET_PROP_TYPE(TypeTag, BoundaryValues);
using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
using TimeLoopPtr = std::shared_ptr<CheckPointTimeLoop<Scalar>>;
......@@ -168,9 +163,9 @@ public:
*
* \param globalPos The global position
*/
SourceValues sourceAtPos(const GlobalPosition &globalPos) const
PrimaryVariables sourceAtPos(const GlobalPosition &globalPos) const
{
return SourceValues(0.0);
return PrimaryVariables(0.0);
}
// \}
/*!
......@@ -216,9 +211,9 @@ public:
*
* \param globalPos The center of the finite volume which ought to be set.
*/
BoundaryValues dirichletAtPos(const GlobalPosition &globalPos) const
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
{
BoundaryValues values = initialAtPos(globalPos);
PrimaryVariables values = initialAtPos(globalPos);
if(isInlet(globalPos))
{
......@@ -245,9 +240,9 @@ public:
*
* \param globalPos The global position
*/
InitialValues initialAtPos(const GlobalPosition &globalPos) const
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
{
InitialValues values;
PrimaryVariables values;
values[pressureIdx] = 1.1e+5;
values[velocityXIdx] = 0.0;
values[velocityYIdx] = 0.0;
......
......@@ -110,12 +110,7 @@ class ClosedSystemTestProblem : public NavierStokesProblem<TypeTag>
using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables);
using FacePrimaryVariables = typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables);
using BoundaryValues = typename GET_PROP_TYPE(TypeTag, BoundaryValues);
using InitialValues = typename GET_PROP_TYPE(TypeTag, BoundaryValues);
using SourceValues = typename GET_PROP_TYPE(TypeTag, BoundaryValues);
using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices);
......@@ -158,9 +153,9 @@ public:
* \param values Stores the source values, acts as return value
* \param globalPos The global position
*/
SourceValues sourceAtPos(const GlobalPosition &globalPos) const
PrimaryVariables sourceAtPos(const GlobalPosition &globalPos) const
{
return SourceValues(0.0);
return PrimaryVariables(0.0);
}
// \}
/*!
......@@ -196,9 +191,9 @@ public:
*
* \param globalPos The global position
*/
BoundaryValues dirichletAtPos(const GlobalPosition &globalPos) const
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
{
BoundaryValues values;
PrimaryVariables values;
values[pressureIdx] = 1.1e+5;
values[velocityXIdx] = 0.0;
values[velocityYIdx] = 0.0;
......@@ -214,9 +209,9 @@ public:
*
* \param globalPos The global position
*/
InitialValues initialAtPos(const GlobalPosition &globalPos) const
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
{
InitialValues values;
PrimaryVariables values;
values[pressureIdx] = 1.0e+5;
values[velocityXIdx] = 0.0;
values[velocityYIdx] = 0.0;
......
......@@ -119,12 +119,8 @@ class DoneaTestProblem : public NavierStokesProblem<TypeTag>
using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables);
using FacePrimaryVariables = typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables);
using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
using BoundaryValues = typename GET_PROP_TYPE(TypeTag, BoundaryValues);
using InitialValues = typename GET_PROP_TYPE(TypeTag, BoundaryValues);
using SourceValues = typename GET_PROP_TYPE(TypeTag, BoundaryValues);
using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices);
......@@ -192,9 +188,9 @@ public:
*
* \param globalPos The global position
*/
SourceValues sourceAtPos(const GlobalPosition &globalPos) const
PrimaryVariables sourceAtPos(const GlobalPosition &globalPos) const
{
SourceValues source(0.0);
PrimaryVariables source(0.0);
Scalar x = globalPos[0];
Scalar y = globalPos[1];
......@@ -235,7 +231,7 @@ public:
*
* \param globalPos The global position
*/
BoundaryValues dirichletAtPos(const GlobalPosition& globalPos) const
PrimaryVariables dirichletAtPos(const GlobalPosition& globalPos) const
{
// use the values of the analytical solution
return analyticalSolution(globalPos);
......@@ -246,12 +242,12 @@ public:
*
* \param globalPos The global position
*/
BoundaryValues analyticalSolution(const GlobalPosition& globalPos) const
PrimaryVariables analyticalSolution(const GlobalPosition& globalPos) const
{
Scalar x = globalPos[0];
Scalar y = globalPos[1];
BoundaryValues values;
PrimaryVariables values;
values[pressureIdx] = x * (1.0-x); // p(x,y) = x(1-x) [Donea2003]
values[velocityXIdx] = x*x * (1.0 - x)*(1.0 - x) * (2.0*y - 6.0*y*y + 4.0*y*y*y);
values[velocityYIdx] = -1.0*y*y * (1.0 - y)*(1.0 - y) * (2.0*x - 6.0*x*x + 4.0*x*x*x);
......@@ -271,9 +267,9 @@ public:
*
* \param globalPos The global position
*/
InitialValues initialAtPos(const GlobalPosition& globalPos) const
PrimaryVariables initialAtPos(const GlobalPosition& globalPos) const
{
InitialValues values;
PrimaryVariables values;
values[pressureIdx] = 0.0;
values[velocityXIdx] = 0.0;
values[velocityYIdx] = 0.0;
......@@ -287,7 +283,7 @@ public:
*/
auto calculateL2Error(const SolutionVector& curSol) const
{
BoundaryValues sumError(0.0), sumReference(0.0), l2NormAbs(0.0), l2NormRel(0.0);
PrimaryVariables sumError(0.0), sumReference(0.0), l2NormAbs(0.0), l2NormRel(0.0);
const int numFaceDofs = this->fvGridGeometry().gridView().size(1);
......
......@@ -120,12 +120,8 @@ class KovasznayTestProblem : public NavierStokesProblem<TypeTag>
using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables);
using FacePrimaryVariables = typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables);
using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
using BoundaryValues = typename GET_PROP_TYPE(TypeTag, BoundaryValues);
using InitialValues = typename GET_PROP_TYPE(TypeTag, BoundaryValues);
using SourceValues = typename GET_PROP_TYPE(TypeTag, BoundaryValues);
using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices);
......@@ -192,9 +188,9 @@ public:
*
* \param globalPos The global position
*/
SourceValues sourceAtPos(const GlobalPosition &globalPos) const
PrimaryVariables sourceAtPos(const GlobalPosition &globalPos) const
{
return SourceValues(0.0);
return PrimaryVariables(0.0);
}
// \}
......@@ -230,7 +226,7 @@ public:
*
* \param globalPos The global position
*/
BoundaryValues dirichletAtPos(const GlobalPosition & globalPos) const
PrimaryVariables dirichletAtPos(const GlobalPosition & globalPos) const
{
// use the values of the analytical solution
return analyticalSolution(globalPos);
......@@ -241,12 +237,12 @@ public:
*
* \param globalPos The global position
*/
BoundaryValues analyticalSolution(const GlobalPosition& globalPos) const
PrimaryVariables analyticalSolution(const GlobalPosition& globalPos) const
{
Scalar x = globalPos[0];
Scalar y = globalPos[1];
BoundaryValues values;
PrimaryVariables values;
values[pressureIdx] = 0.5 * (1.0 - std::exp(2.0 * lambda_ * x));
values[velocityXIdx] = 1.0 - std::exp(lambda_ * x) * std::cos(2.0 * M_PI * y);
values[velocityYIdx] = 0.5 * lambda_ / M_PI * std::exp(lambda_ * x) * std::sin(2.0 * M_PI * y);
......@@ -266,9 +262,9 @@ public:
*
* \param globalPos The global position
*/
InitialValues initialAtPos(const GlobalPosition &globalPos) const
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
{
InitialValues values;
PrimaryVariables values;
values[pressureIdx] = 0.0;
values[velocityXIdx] = 0.0;
values[velocityYIdx] = 0.0;
......@@ -283,7 +279,7 @@ public:
*/
auto calculateL2Error(const SolutionVector& curSol) const
{
BoundaryValues sumError(0.0), sumReference(0.0), l2NormAbs(0.0), l2NormRel(0.0);
PrimaryVariables sumError(0.0), sumReference(0.0), l2NormAbs(0.0), l2NormRel(0.0);
const int numFaceDofs = this->fvGridGeometry().gridView().size(1);
......
......@@ -137,9 +137,7 @@ class ChannelNCTestProblem : public NavierStokesProblem<TypeTag>
using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables);
using FacePrimaryVariables = typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables);
using BoundaryValues = typename GET_PROP_TYPE(TypeTag, BoundaryValues);
using InitialValues = typename GET_PROP_TYPE(TypeTag, BoundaryValues);
using SourceValues = typename GET_PROP_TYPE(TypeTag, BoundaryValues);
using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
using TimeLoopPtr = std::shared_ptr<CheckPointTimeLoop<Scalar>>;
using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables);
......@@ -178,9 +176,9 @@ public:
*
* \param globalPos The global position
*/
SourceValues sourceAtPos(const GlobalPosition &globalPos) const
PrimaryVariables sourceAtPos(const GlobalPosition &globalPos) const
{
return SourceValues(0.0);
return PrimaryVariables(0.0);
}
// \}
/*!
......@@ -237,9 +235,9 @@ public:
*
* \param globalPos The center of the finite volume which ought to be set.
*/
BoundaryValues dirichletAtPos(const GlobalPosition &globalPos) const
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
{
BoundaryValues values = initialAtPos(globalPos);
PrimaryVariables values = initialAtPos(globalPos);
// give the system some time so that the pressure can equilibrate, then start the injection of the tracer
if(isInlet(globalPos))
......@@ -268,9 +266,9 @@ public:
*
* \param globalPos The global position
*/
InitialValues initialAtPos(const GlobalPosition &globalPos) const
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
{
InitialValues values;
PrimaryVariables values;
values[pressureIdx] = 1.1e+5;
values[transportCompIdx] = 0.0;
#if NONISOTHERMAL
......
......@@ -122,12 +122,7 @@ class DensityDrivenFlowProblem : public NavierStokesProblem<TypeTag>
using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables);
using FacePrimaryVariables = typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables);
using BoundaryValues = typename GET_PROP_TYPE(TypeTag, BoundaryValues);
using InitialValues = typename GET_PROP_TYPE(TypeTag, BoundaryValues);
using SourceValues = typename GET_PROP_TYPE(TypeTag, BoundaryValues);
using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
using TimeLoopPtr = std::shared_ptr<CheckPointTimeLoop<Scalar>>;
using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables);
......@@ -169,9 +164,9 @@ public:
*
* \param globalPos The global position
*/
SourceValues sourceAtPos(const GlobalPosition &globalPos) const
PrimaryVariables sourceAtPos(const GlobalPosition &globalPos) const
{
return SourceValues(0.0);
return PrimaryVariables(0.0);
}
// \}
/*!
......@@ -215,9 +210,9 @@ public:
*
* \param globalPos The center of the finite volume which ought to be set.
*/
BoundaryValues dirichletAtPos(const GlobalPosition &globalPos) const
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
{
BoundaryValues values;
PrimaryVariables values;
values[pressureIdx] = 1.1e+5;
values[transportCompIdx] = 1e-3;
......@@ -239,9 +234,9 @@ public:
*
* \param globalPos The global position
*/
InitialValues initialAtPos(const GlobalPosition &globalPos) const
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
{
InitialValues values;
PrimaryVariables values;
values[pressureIdx] = 1.1e+5;
values[transportCompIdx] = 0.0;
values[velocityXIdx] = 0.0;
......
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