Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
waLBerla
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sudesh Rathnayake
waLBerla
Commits
de0056ff
Commit
de0056ff
authored
2 years ago
by
Samuel Kemmler
Browse files
Options
Downloads
Patches
Plain Diff
Add cohesion to PipingErosion.cpp
parent
de9d7ca3
Branches
bam_piping_erosion
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/showcases/PipingErosion/PipingErosion.cpp
+101
-17
101 additions, 17 deletions
apps/showcases/PipingErosion/PipingErosion.cpp
with
101 additions
and
17 deletions
apps/showcases/PipingErosion/PipingErosion.cpp
+
101
−
17
View file @
de0056ff
...
...
@@ -70,6 +70,8 @@
#include
"mesa_pd/data/shape/Sphere.h"
#include
"mesa_pd/domain/BlockForestDataHandling.h"
#include
"mesa_pd/domain/BlockForestDomain.h"
#include
"mesa_pd/kernel/Cohesion.h"
#include
"mesa_pd/kernel/CohesionInitialization.h"
#include
"mesa_pd/kernel/DoubleCast.h"
#include
"mesa_pd/kernel/LinearSpringDashpot.h"
#include
"mesa_pd/kernel/ParticleSelector.h"
...
...
@@ -86,6 +88,8 @@
#include
"vtk/all.h"
#include
"../apps/bam/Utility.h"
namespace
fluidized_bed
{
...
...
@@ -347,7 +351,7 @@ void initSpheresFromFile(const std::string& filename, walberla::mesa_pd::data::P
pIt->getBaseShapeRef()->updateMassAndInertia(density);*/
pIt
->
setInteractionRadius
(
diameter
/
2
);
pIt
->
setOwner
(
rank
);
pIt
->
setType
(
1
);
pIt
->
setType
(
0
);
numParticles
++
;
...
...
@@ -555,7 +559,7 @@ int main( int argc, char **argv )
// in simulation units: dt = 1, dx = 1, densityFluid = 1
const
real_t
dt_SI
=
uOutflow
/
uOutflow_SI
*
dx_SI
;
const
real_t
diameter
=
1
0
;
// average diameter from bed generation TODO: remove hard coded diameter
const
real_t
diameter
=
1
5
;
// average diameter from bed generation TODO: remove hard coded diameter
const
real_t
viscosity
=
kinematicViscosityFluid_SI
*
dt_SI
/
(
dx_SI
*
dx_SI
);
const
real_t
omega
=
lbm
::
collision_model
::
omegaFromViscosity
(
viscosity
);
const
real_t
gravitationalAcceleration
=
gravitationalAcceleration_SI
*
dt_SI
*
dt_SI
/
dx_SI
;
...
...
@@ -725,6 +729,78 @@ int main( int argc, char **argv )
return
ac
.
getShapeID
(
particleIdx
)
==
boxShape
;
},
*
accessor
,
particleMappingKernel
,
*
accessor
,
NoSlip_Flag
);
// cohesion init
mesa_pd
::
kernel
::
CohesionInitialization
cohesionInitKernel
;
mesa_pd
::
kernel
::
Cohesion
cohesionKernel
(
2
);
real_t
densityFluid_SI
=
real_t
(
1000
);
real_t
diameter_SI
=
real_t
(
0.0029
);
// m
real_t
densityParticle_SI
=
real_t
(
2550
);
real_t
y_n_SI
=
200
_r
;
// N = tensile force, where bond breaks
real_t
frictionCoefficient
=
real_t
(
0.3
);
real_t
sphereRadius_SI
=
diameter_SI
/
2
_r
;
real_t
sphereVolume_SI
=
4
_r
/
3
_r
*
math
::
pi
*
sphereRadius_SI
*
sphereRadius_SI
*
sphereRadius_SI
;
real_t
sphereMass_SI
=
densityParticle_SI
*
sphereVolume_SI
;
real_t
E_SI
=
1e3
_r
;
// kg / (m * s^2)
real_t
en
=
0.2
_r
;
// coefficient of restitution
real_t
kn_SI
=
2
_r
*
E_SI
*
(
sphereRadius_SI
*
sphereRadius_SI
/
(
sphereRadius_SI
+
sphereRadius_SI
));
real_t
meff_SI
=
sphereMass_SI
*
sphereMass_SI
/
(
sphereMass_SI
+
sphereMass_SI
);
real_t
damping
=
-
std
::
log
(
en
)
/
std
::
sqrt
((
std
::
log
(
en
)
*
std
::
log
(
en
)
+
math
::
pi
*
math
::
pi
));
real_t
nun_SI
=
2
_r
*
std
::
sqrt
(
kn_SI
*
meff_SI
)
*
damping
;
real_t
kn
=
kn_SI
/
(
densityFluid_SI
*
dx_SI
*
dx_SI
*
dx_SI
/
(
dt_SI
*
dt_SI
));
real_t
nun
=
nun_SI
/
(
densityFluid_SI
*
dx_SI
*
dx_SI
*
dx_SI
/
(
dt_SI
));
real_t
y_n
=
y_n_SI
/
(
densityFluid_SI
*
dx_SI
*
dx_SI
*
dx_SI
*
dx_SI
/
(
dt_SI
*
dt_SI
));
real_t
ksFactors
=
0.5
_r
;
// -
real_t
krFactors
=
0.1
_r
;
// -
real_t
koFactors
=
0.1
_r
;
// -
real_t
nusFactor
=
0
_r
;
// -
real_t
nurFactor
=
0
_r
;
// -
real_t
nuoFactor
=
0
_r
;
// -
real_t
y_s
=
0.5
_r
*
y_n
;
real_t
y_r
=
0.1
_r
*
y_n
/
dx_SI
;
// TODO check -> torsion = N m
real_t
y_o
=
0.1
_r
*
y_n
/
dx_SI
;
// TODO check -> torsion = N m
WALBERLA_LOG_INFO_ON_ROOT
(
"kn = "
<<
kn
<<
", nun = "
<<
nun
<<
", yn = "
<<
y_n
);
WALBERLA_LOG_INFO_ON_ROOT
(
"Estimated maximum surface distance for rupture / radius= "
<<
(
y_n
/
kn
)
/
(
diameter
/
2
));
cohesionKernel
.
setKn
(
0
,
0
,
kn
);
cohesionKernel
.
setKsFactor
(
0
,
0
,
ksFactors
);
cohesionKernel
.
setKrFactor
(
0
,
0
,
krFactors
);
cohesionKernel
.
setKoFactor
(
0
,
0
,
koFactors
);
cohesionKernel
.
setNun
(
0
,
0
,
nun
);
cohesionKernel
.
setNusFactor
(
0
,
0
,
nusFactor
);
cohesionKernel
.
setNurFactor
(
0
,
0
,
nurFactor
);
cohesionKernel
.
setNuoFactor
(
0
,
0
,
nuoFactor
);
cohesionKernel
.
setFrictionCoefficient
(
0
,
0
,
frictionCoefficient
);
cohesionKernel
.
setYn
(
0
,
0
,
y_n
);
cohesionKernel
.
setYs
(
0
,
0
,
y_s
);
cohesionKernel
.
setYr
(
0
,
0
,
y_r
);
cohesionKernel
.
setYo
(
0
,
0
,
y_o
);
mesa_pd
::
SelectSphere
sphereSelector
;
ps
->
forEachParticlePairHalf
(
false
,
sphereSelector
,
*
accessor
,
[
&
](
const
size_t
idx1
,
const
size_t
idx2
)
{
mesa_pd
::
collision_detection
::
AnalyticContactDetection
acd
;
mesa_pd
::
kernel
::
DoubleCast
double_cast
;
mesa_pd
::
mpi
::
ContactFilter
contact_filter
;
if
(
double_cast
(
idx1
,
idx2
,
*
accessor
,
acd
,
*
accessor
))
{
// particles overlap
if
(
contact_filter
(
acd
.
getIdx1
(),
acd
.
getIdx2
(),
*
accessor
,
acd
.
getContactPoint
(),
*
rpdDomain
))
{
cohesionInitKernel
(
acd
.
getIdx1
(),
acd
.
getIdx2
(),
*
accessor
,
acd
.
getPenetrationDepth
());
}
}
});
reduceAndSwapContactHistory
(
*
ps
);
// setup of the LBM communication for synchronizing the pdf field between neighboring blocks
blockforest
::
communication
::
UniformBufferedScheme
<
Stencil_T
>
optimizedPDFCommunicationScheme
(
blocks
);
optimizedPDFCommunicationScheme
.
addPackInfo
(
make_shared
<
lbm
::
PdfFieldPackInfo
<
LatticeModel_T
>
>
(
pdfFieldID
)
);
// optimized sync
...
...
@@ -869,26 +945,34 @@ int main( int argc, char **argv )
// collision response
ps
->
forEachParticlePairHalf
(
useOpenMP
,
ExcludeGlobalGlobal
(),
*
accessor
,
[
&
collisionResponse
,
&
rpdDomain
,
timeStepSizeRPD
,
coefficientOfRestitution
,
particleCollisionTime
,
kappa
,
particleVolume
,
particleDensityRatio
]
(
const
size_t
idx1
,
const
size_t
idx2
,
auto
&
ac
)
ps
->
forEachParticlePairHalf
(
false
,
ExcludeGlobalGlobal
(),
*
accessor
,
[
&
](
size_t
idx1
,
size_t
idx2
)
{
mesa_pd
::
collision_detection
::
AnalyticContactDetection
acd
;
mesa_pd
::
kernel
::
DoubleCast
double_cast
;
mesa_pd
::
mpi
::
ContactFilter
contact_filter
;
bool
contactExists
=
double_cast
(
idx1
,
idx2
,
*
accessor
,
acd
,
*
accessor
);
Vector3
<
real_t
>
filteringPoint
;
if
(
contactExists
)
{
filteringPoint
=
acd
.
getContactPoint
();}
else
{
filteringPoint
=
(
accessor
->
getPosition
(
idx1
)
+
accessor
->
getPosition
(
idx2
))
/
real_t
(
2
);
}
if
(
contact_filter
(
idx1
,
idx2
,
*
accessor
,
filteringPoint
,
*
rpdDomain
))
{
mesa_pd
::
collision_detection
::
AnalyticContactDetection
acd
;
mesa_pd
::
kernel
::
DoubleCast
double_cast
;
mesa_pd
::
mpi
::
ContactFilter
contact_filter
;
if
(
double_cast
(
idx1
,
idx2
,
ac
,
acd
,
ac
))
bool
contactTreatedByCohesionKernel
=
false
;
if
(
sphereSelector
(
idx1
,
idx2
,
*
accessor
))
{
if
(
co
ntact_filter
(
acd
.
getIdx1
(),
acd
.
getI
dx2
()
,
ac
,
acd
.
getContactPoint
(),
*
rpdDomain
))
if
(
co
hesionKernel
.
isCohesiveBondActive
(
idx1
,
i
dx2
,
*
ac
cessor
))
{
auto
meff_sphere_wall
=
particleVolume
*
particleDensityRatio
;
auto
meff_sphere_sphere
=
real_t
(
1
)
/
(
ac
.
getInvMass
(
idx1
)
+
ac
.
getInvMass
(
idx2
));
collisionResponse
.
setStiffnessAndDamping
(
0
,
1
,
coefficientOfRestitution
,
particleCollisionTime
,
kappa
,
meff_sphere_wall
);
collisionResponse
.
setStiffnessAndDamping
(
1
,
1
,
coefficientOfRestitution
,
particleCollisionTime
,
kappa
,
meff_sphere_sphere
);
collisionResponse
(
acd
.
getIdx1
(),
acd
.
getIdx2
(),
ac
,
acd
.
getContactPoint
(),
acd
.
getContactNormal
(),
acd
.
getPenetrationDepth
(),
timeStepSizeRPD
);
contactTreatedByCohesionKernel
=
cohesionKernel
(
idx1
,
idx2
,
*
accessor
,
timeStepSizeRPD
);
}
}
},
*
accessor
);
if
(
contactExists
&&
!
contactTreatedByCohesionKernel
)
{
cohesionKernel
.
nonCohesiveInteraction
(
acd
.
getIdx1
(),
acd
.
getIdx2
(),
*
accessor
,
acd
.
getContactPoint
(),
acd
.
getContactNormal
(),
acd
.
getPenetrationDepth
(),
timeStepSizeRPD
);
}
}
});
reduceAndSwapContactHistory
(
*
ps
);
...
...
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