Impose boundary conditions to FlowEngine when using a predicate as surface

Asked by nora

I have created a .gts surface and filled with spheres. I want to incorporate the flow engine now.
This is the code I have created:

from yade import pack
import gts, os.path, locale
from yade import qt

locale.setlocale(locale.LC_ALL, 'en_US.UTF-8') #gts is locale-dependend. If, for example, german locale is used, gts.read()-function does not import floats normally

surf=gts.read(open('../mesh/sphere.gts'))

idTissue=O.materials.append(FrictMat(young=500.0,poisson=.35,frictionAngle=.6,label="concrete"))
pred=pack.inGtsSurface(surf)
aabb=pred.aabb()

dim0=aabb[1][0]-aabb[0][0];
# brain radius
dim0 = dim0/2.0
# small
radius=dim0/20. # get some characteristic dimension, use it for radius
O.bodies.append(pack.regularHexa(pred, radius=radius, gap=0.0, material=idTissue))

O.bodies.append(pack.gtsSurface2Facets(surf,wire=True))

O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()],label='collider'),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
  [Ip2_FrictMat_FrictMat_FrictPhys()],
  [Law2_ScGeom_FrictPhys_CundallStrack()],
 ),
 NewtonIntegrator(damping=0.1,gravity=[0,0,0]),
 FlowEngine(label="flow"),#introduced as a dead engine for the moment, see 2nd section

]

O.dt=0.1*PWaveTimeStep()
O.saveTmp()
O.timingEnabled=True
O.trackEnergy=True

a = qt.View()

In this way the I get infinite K1! error. I guess it is due to the fact that I have not imposed any boundary condition.
I do not have the standard 6 walls because my domain is a sphere and it has curved walls. Is there any way to modify the function

bndCondIsPressure(=vector<bool>(6, false))

for example?

Thanks!

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#1

Hello,
I have plans to make the meshing of arbitrary contours possible but for the moment it is not the case.
The only thing you could do as it is now is to immerse the spherical domain in a cubic fluid domain (by really introducing 6 bounding bodies or by using the engine's min/max method for defining bounding planes). If there is no macroscopic pressure gradient it is nearly equivalent to applying the external fluid pressure directly at the surface of the sphere. If there is an external pressure gradient however this will generate some fluxes around the granular domain.
If this is the case you could go find by yourself which fluid cells are incident to the surface of the sphere and impose pressure there. I'm afraid it would be a painful exercise though.
Cheers
Bruno

Revision history for this message
nora (eleonorapiersanti) said :
#3

Thank you very much for your answer. I do not know if it is totally clear to me.
Isn't it possible to make a cycle over the facets of the external surface?
I tried to look into the source code and if I well understood the boundary conditions are applied using a for loop over the walls ids.
But it seems they are limited only to six, that is fine in the case of a cubic domain.

Is there anyway to generalize this?

    Il Mercoledì 26 Luglio 2017 6:08, Bruno Chareyre <email address hidden> ha scritto:

 Your question #653502 on Yade changed:
https://answers.launchpad.net/yade/+question/653502

    Status: Open => Answered

Bruno Chareyre proposed the following answer:
Hello,
I have plans to make the meshing of arbitrary contours possible but for the moment it is not the case.
The only thing you could do as it is now is to immerse the spherical domain in a cubic fluid domain (by really introducing 6 bounding bodies or by using the engine's min/max method for defining bounding planes). If there is no macroscopic pressure gradient it is nearly equivalent to applying the external fluid pressure directly at the surface of the sphere. If there is an external pressure gradient however this will generate some fluxes around the granular domain.
If this is the case you could go find by yourself which fluid cells are incident to the surface of the sphere and impose pressure there. I'm afraid it would be a painful exercise though.
Cheers
Bruno

--
If this answers your question, please go to the following page to let us
know that it is solved:
https://answers.launchpad.net/yade/+question/653502/+confirm?answer_id=0

If you still need help, you can reply to this email or go to the
following page to enter your feedback:
https://answers.launchpad.net/yade/+question/653502

You received this question notification because you asked the question.

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#4

>they are limited only to six, that is fine in the case of a cubic domain. Is there anyway to generalize this?

No. As long as walls are represented by infinite spheres there is a limit to six for geometrical reasons.
B

Revision history for this message
Robert Caulk (rcaulk) said :
#5

Update: we introduced alpha shapes from CGAL to take care of arbitrarily shaped boundary conditions [1].

[1]https://gitlab.com/yade-dev/trunk/blob/master/examples/FluidCouplingPFV/alphaShape.py

Can you help with this problem?

Provide an answer of your own, or ask nora for more information if necessary.

To post a message you must log in.