Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dumux-repositories
dumux
Commits
ca13b523
Commit
ca13b523
authored
7 years ago
by
Kilian Weishaupt
Committed by
Timo Koch
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[navierstokes][test] Adapt test_angeli to changes
parent
37050489
No related branches found
No related tags found
2 merge requests
!676
Cleanup/staggered remove privar class
,
!617
[WIP] Next
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/freeflow/staggered/angelitestproblem.hh
+15
-20
15 additions, 20 deletions
test/freeflow/staggered/angelitestproblem.hh
with
15 additions
and
20 deletions
test/freeflow/staggered/angelitestproblem.hh
+
15
−
20
View file @
ca13b523
...
...
@@ -37,13 +37,6 @@ namespace Dumux
template
<
class
TypeTag
>
class
AngeliTestProblem
;
namespace
Capabilities
{
template
<
class
TypeTag
>
struct
isStationary
<
AngeliTestProblem
<
TypeTag
>>
{
static
const
bool
value
=
false
;
};
}
namespace
Properties
{
NEW_TYPE_TAG
(
AngeliTestProblem
,
INHERITS_FROM
(
StaggeredFreeFlowModel
,
NavierStokes
));
...
...
@@ -286,10 +279,10 @@ public:
// treat cell-center dofs
const
auto
dofIdxCellCenter
=
scv
.
dofIndex
();
const
auto
&
posCellCenter
=
scv
.
dofPosition
();
const
auto
analyticalSolutionCellCenter
=
dirichletAtPos
(
posCellCenter
)[
cellCenter
Idx
];
const
auto
numericalSolutionCellCenter
=
curSol
[
cellCenterIdx
][
dofIdxCellCenter
];
sumError
[
cellCenter
Idx
]
+=
squaredDiff_
(
analyticalSolutionCellCenter
,
numericalSolutionCellCenter
)
*
scv
.
volume
();
sumReference
[
cellCenter
Idx
]
+=
analyticalSolutionCellCenter
*
analyticalSolutionCellCenter
*
scv
.
volume
();
const
auto
analyticalSolutionCellCenter
=
dirichletAtPos
(
posCellCenter
)[
pressure
Idx
];
const
auto
numericalSolutionCellCenter
=
curSol
[
cellCenterIdx
][
dofIdxCellCenter
]
[
pressureIdx
]
;
sumError
[
pressure
Idx
]
+=
squaredDiff_
(
analyticalSolutionCellCenter
,
numericalSolutionCellCenter
)
*
scv
.
volume
();
sumReference
[
pressure
Idx
]
+=
analyticalSolutionCellCenter
*
analyticalSolutionCellCenter
*
scv
.
volume
();
totalVolume
+=
scv
.
volume
();
// treat face dofs
...
...
@@ -297,7 +290,7 @@ public:
{
const
int
dofIdxFace
=
scvf
.
dofIndex
();
const
int
dirIdx
=
scvf
.
directionIndex
();
const
auto
analyticalSolutionFace
=
dirichletAtPos
(
scvf
.
center
())[
faceIdx
][
dirIdx
];
const
auto
analyticalSolutionFace
=
dirichletAtPos
(
scvf
.
center
())[
Indices
::
velocity
(
dirIdx
)
];
const
auto
numericalSolutionFace
=
curSol
[
faceIdx
][
dofIdxFace
][
momentumBalanceIdx
];
directionIndex
[
dofIdxFace
]
=
dirIdx
;
errorVelocity
[
dofIdxFace
]
=
squaredDiff_
(
analyticalSolutionFace
,
numericalSolutionFace
);
...
...
@@ -309,8 +302,8 @@ public:
}
// get the absolute and relative discrete L2-error for cell-center dofs
l2NormAbs
[
cellCenter
Idx
]
=
std
::
sqrt
(
sumError
[
cellCenter
Idx
]
/
totalVolume
);
l2NormRel
[
cellCenter
Idx
]
=
std
::
sqrt
(
sumError
[
cellCenter
Idx
]
/
sumReference
[
cellCenter
Idx
]);
l2NormAbs
[
pressure
Idx
]
=
std
::
sqrt
(
sumError
[
pressure
Idx
]
/
totalVolume
);
l2NormRel
[
pressure
Idx
]
=
std
::
sqrt
(
sumError
[
pressure
Idx
]
/
sumReference
[
pressure
Idx
]);
// get the absolute and relative discrete L2-error for face dofs
for
(
int
i
=
0
;
i
<
numFaceDofs
;
++
i
)
...
...
@@ -319,14 +312,14 @@ public:
const
auto
error
=
errorVelocity
[
i
];
const
auto
ref
=
velocityReference
[
i
];
const
auto
volume
=
staggeredVolume
[
i
];
sumError
[
faceIdx
][
dirIdx
]
+=
error
*
volume
;
sumReference
[
faceIdx
][
dirIdx
]
+=
ref
*
volume
;
sumError
[
Indices
::
velocity
(
dirIdx
)
]
+=
error
*
volume
;
sumReference
[
Indices
::
velocity
(
dirIdx
)
]
+=
ref
*
volume
;
}
for
(
int
dirIdx
=
0
;
dirIdx
<
dimWorld
;
++
dirIdx
)
{
l2NormAbs
[
faceIdx
][
dirIdx
]
=
std
::
sqrt
(
sumError
[
faceIdx
][
dirIdx
]
/
totalVolume
);
l2NormRel
[
faceIdx
][
dirIdx
]
=
std
::
sqrt
(
sumError
[
faceIdx
][
dirIdx
]
/
sumReference
[
faceIdx
][
dirIdx
]);
l2NormAbs
[
Indices
::
velocity
(
dirIdx
)
]
=
std
::
sqrt
(
sumError
[
Indices
::
velocity
(
dirIdx
)
]
/
totalVolume
);
l2NormRel
[
Indices
::
velocity
(
dirIdx
)
]
=
std
::
sqrt
(
sumError
[
Indices
::
velocity
(
dirIdx
)
]
/
sumReference
[
Indices
::
velocity
(
dirIdx
)
]);
}
return
std
::
make_pair
(
l2NormAbs
,
l2NormRel
);
}
...
...
@@ -392,11 +385,13 @@ public:
const
auto
faceDofPosition
=
scvf
.
center
();
const
auto
dirIdx
=
scvf
.
directionIndex
();
const
auto
analyticalSolutionAtFace
=
analyticalSolution
(
faceDofPosition
,
time
());
analyticalVelocityOnFace_
[
faceDofIdx
][
dirIdx
]
=
analyticalSolutionAtFace
[
faceIdx
][
dirIdx
];
analyticalVelocityOnFace_
[
faceDofIdx
][
dirIdx
]
=
analyticalSolutionAtFace
[
Indices
::
velocity
(
dirIdx
)
];
}
analyticalPressure_
[
ccDofIdx
]
=
analyticalSolutionAtCc
[
pressureIdx
];
analyticalVelocity_
[
ccDofIdx
]
=
analyticalSolutionAtCc
[
faceIdx
];
for
(
int
dirIdx
=
0
;
dirIdx
<
dim
;
++
dirIdx
)
analyticalVelocity_
[
ccDofIdx
][
dirIdx
]
=
analyticalSolutionAtCc
[
Indices
::
velocity
(
dirIdx
)];
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment