Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
waLBerla
waLBerla
Commits
ba9a3810
Commit
ba9a3810
authored
Aug 18, 2020
by
Christoph Rettinger
Browse files
Added shortrun to viscoelasticity test and shortened pe coupling test
parent
7fdee2be
Pipeline
#26290
failed with stages
in 19 minutes and 57 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
tests/lbm/CMakeLists.txt
View file @
ba9a3810
...
...
@@ -68,7 +68,8 @@ waLBerla_compile_test( FILES initializer/PdfFieldInitializerTest.cpp )
waLBerla_execute_test
(
NAME PdfFieldInitializerTest COMMAND $<TARGET_FILE:PdfFieldInitializerTest>
${
CMAKE_CURRENT_SOURCE_DIR
}
/PdfFieldInitializerTest.prm PROCESSES 4 CONFIGURATIONS Release RelWithDbgInfo
)
waLBerla_compile_test
(
FILES SuViscoelasticityTest.cpp DEPENDS field blockforest timeloop
)
waLBerla_execute_test
(
NAME SuViscoelasticityTest COMMAND $<TARGET_FILE:SuViscoelasticityTest>
${
CMAKE_CURRENT_SOURCE_DIR
}
/Su.prm
)
waLBerla_execute_test
(
NAME SuViscoelasticityLongTest COMMAND $<TARGET_FILE:SuViscoelasticityTest>
${
CMAKE_CURRENT_SOURCE_DIR
}
/Su.prm LABELS longrun
)
waLBerla_execute_test
(
NAME SuViscoelasticityShortTest COMMAND $<TARGET_FILE:SuViscoelasticityTest> -Parameters.shortrun=true
${
CMAKE_CURRENT_SOURCE_DIR
}
/Su.prm
)
# Code Generation
if
(
WALBERLA_BUILD_WITH_CODEGEN
)
...
...
tests/lbm/Su.prm
View file @
ba9a3810
...
...
@@ -12,6 +12,7 @@ Parameters
uMax 1.28737;
t0 370;
t1 326;
shortrun false;
}
DomainSetup
...
...
tests/lbm/SuViscoelasticityTest.cpp
View file @
ba9a3810
...
...
@@ -244,15 +244,16 @@ int main(int argc, char ** argv ){
auto
parameters
=
env
.
config
()
->
getOneBlock
(
"Parameters"
);
// extract some constants from the parameters
const
real_t
eta_s
=
parameters
.
getParameter
<
real_t
>
(
"eta_s"
);
const
real_t
force
=
parameters
.
getParameter
<
real_t
>
(
"force"
);
const
real_t
eta_p
=
parameters
.
getParameter
<
real_t
>
(
"eta_p"
);
const
real_t
lambda_p
=
parameters
.
getParameter
<
real_t
>
(
"lambda_p"
);
const
uint_t
period
=
parameters
.
getParameter
<
uint_t
>
(
"period"
);
const
real_t
L
=
parameters
.
getParameter
<
real_t
>
(
"L"
);
const
real_t
H
=
parameters
.
getParameter
<
real_t
>
(
"H"
);
const
uint_t
blockSize
=
parameters
.
getParameter
<
uint_t
>
(
"blockSize"
);
const
uint_t
timesteps
=
parameters
.
getParameter
<
uint_t
>
(
"timesteps"
);
const
real_t
eta_s
=
parameters
.
getParameter
<
real_t
>
(
"eta_s"
);
const
real_t
force
=
parameters
.
getParameter
<
real_t
>
(
"force"
);
const
real_t
eta_p
=
parameters
.
getParameter
<
real_t
>
(
"eta_p"
);
const
real_t
lambda_p
=
parameters
.
getParameter
<
real_t
>
(
"lambda_p"
);
const
uint_t
period
=
parameters
.
getParameter
<
uint_t
>
(
"period"
);
const
real_t
L
=
parameters
.
getParameter
<
real_t
>
(
"L"
);
const
real_t
H
=
parameters
.
getParameter
<
real_t
>
(
"H"
);
const
uint_t
blockSize
=
parameters
.
getParameter
<
uint_t
>
(
"blockSize"
);
const
bool
shortrun
=
parameters
.
getParameter
<
bool
>
(
"shortrun"
);
const
uint_t
timesteps
=
shortrun
?
uint_t
(
2
)
:
parameters
.
getParameter
<
uint_t
>
(
"timesteps"
);
// reference data
const
real_t
uExpected
=
force
*
H
*
H
/
(
real_c
(
8.0
)
*
(
eta_s
+
eta_p
));
...
...
@@ -293,26 +294,31 @@ int main(int argc, char ** argv ){
timeloop
.
run
();
// compare to reference data
real_t
errSteady
=
real_c
(
fabs
(
testData
->
getUSteady
()
-
real_c
(
1.0
))
/
real_c
(
1.0
));
real_t
errMax
=
real_c
(
fabs
(
testData
->
getUMax
()
-
uMax
)
/
uMax
);
real_t
errt0
=
real_c
(
fabs
(
testData
->
getT0
()
-
t0
)
/
t0
);
real_t
errt1
=
real_c
(
fabs
(
testData
->
getT1
()
-
t1
)
/
t1
);
WALBERLA_LOG_RESULT
(
"Steady State Velocity Error: "
<<
errSteady
);
WALBERLA_LOG_RESULT
(
"Maximum Velocity Error: "
<<
errMax
);
WALBERLA_LOG_RESULT
(
"Time of Maximum Error: "
<<
errt0
);
WALBERLA_LOG_RESULT
(
"Decay Time Error: "
<<
errt1
);
// check that errors < 1%
if
(
errSteady
<
0.01
&&
errMax
<
0.01
&&
errt0
<
0.01
&&
errt1
<
0.01
){
WALBERLA_LOG_RESULT
(
"Success"
);
if
(
!
shortrun
)
{
// compare to reference data
real_t
errSteady
=
real_c
(
fabs
(
testData
->
getUSteady
()
-
real_c
(
1.0
))
/
real_c
(
1.0
));
real_t
errMax
=
real_c
(
fabs
(
testData
->
getUMax
()
-
uMax
)
/
uMax
);
real_t
errt0
=
real_c
(
fabs
(
testData
->
getT0
()
-
t0
)
/
t0
);
real_t
errt1
=
real_c
(
fabs
(
testData
->
getT1
()
-
t1
)
/
t1
);
WALBERLA_LOG_RESULT
(
"Steady State Velocity Error: "
<<
errSteady
);
WALBERLA_LOG_RESULT
(
"Maximum Velocity Error: "
<<
errMax
);
WALBERLA_LOG_RESULT
(
"Time of Maximum Error: "
<<
errt0
);
WALBERLA_LOG_RESULT
(
"Decay Time Error: "
<<
errt1
);
// check that errors < 1%
if
(
errSteady
<
0.01
&&
errMax
<
0.01
&&
errt0
<
0.01
&&
errt1
<
0.01
){
WALBERLA_LOG_RESULT
(
"Success"
);
return
EXIT_SUCCESS
;
}
else
{
WALBERLA_LOG_RESULT
(
"Failure"
);
return
EXIT_FAILURE
;
}
}
else
{
return
EXIT_SUCCESS
;
}
else
{
WALBERLA_LOG_RESULT
(
"Failure"
);
return
EXIT_FAILURE
;
}
}
...
...
tests/pe_coupling/partially_saturated_cells_method/DragForceSpherePSMRefinement.cpp
View file @
ba9a3810
...
...
@@ -488,7 +488,7 @@ int main( int argc, char **argv )
const
real_t
omega
=
real_c
(
1
)
/
setup
.
tau
;
setup
.
visc
=
lbm
::
collision_model
::
viscosityFromOmega
(
omega
);
const
real_t
dx
=
real_c
(
1
);
const
uint_t
timesteps
=
funcTest
?
2
:
(
shortrun
?
uint_c
(
150
)
:
uint_c
(
1000000
)
);
// maximum number of time steps for the whole simulation
const
uint_t
timesteps
=
funcTest
?
1
:
(
shortrun
?
uint_c
(
150
)
:
uint_c
(
1000000
)
);
// maximum number of time steps for the whole simulation
///////////////////////////
// BLOCK STRUCTURE SETUP //
...
...
Write
Preview
Markdown
is supported
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